PHP 8.1.33
Preview: customize-loader.js Size: 7.72 KB
/home/jambtst2015/public_html/www.securiskbrokers.com/wp-includes/js/customize-loader.js

/**
 * @output wp-includes/js/customize-loader.js
 */

/* global _wpCustomizeLoaderSettings */

/**
 * Expose a public API that allows the customizer to be
 * loaded on any page.
 *
 * @namespace wp
 */
window.wp = window.wp || {};

(function( exports, $ ){
	var api = wp.customize,
		Loader;

	$.extend( $.support, {
		history: !! ( window.history && history.pushState ),
		hashchange: ('onhashchange' in window) && (document.documentMode === undefined || document.documentMode > 7)
	});

	/**
	 * Allows the Customizer to be overlaid on any page.
	 *
	 * By default, any element in the body with the load-customize class will open
	 * an iframe overlay with the URL specified.
	 *
	 *     e.g. <a class="load-customize" href="<?php echo wp_customize_url(); ?>">Open Customizer</a>
	 *
	 * @memberOf wp.customize
	 *
	 * @class
	 * @augments wp.customize.Events
	 */
	Loader = $.extend( {}, api.Events,/** @lends wp.customize.Loader.prototype */{
		/**
		 * Setup the Loader; triggered on document#ready.
		 */
		initialize: function() {
			this.body = $( document.body );

			// Ensure the loader is supported.
			// Check for settings, postMessage support, and whether we require CORS support.
			if ( ! Loader.settings || ! $.support.postMessage || ( ! $.support.cors && Loader.settings.isCrossDomain ) ) {
				return;
			}

			this.window  = $( window );
			this.element = $( '<div id="customize-container" />' ).appendTo( this.body );

			// Bind events for opening and closing the overlay.
			this.bind( 'open', this.overlay.show );
			this.bind( 'close', this.overlay.hide );

			// Any element in the body with the `load-customize` class opens
			// the Customizer.
			$('#wpbody').on( 'click', '.load-customize', function( event ) {
				event.preventDefault();

				// Store a reference to the link that opened the Customizer.
				Loader.link = $(this);
				// Load the theme.
				Loader.open( Loader.link.attr('href') );
			});

			// Add navigation listeners.
			if ( $.support.history ) {
				this.window.on( 'popstate', Loader.popstate );
			}

			if ( $.support.hashchange ) {
				this.window.on( 'hashchange', Loader.hashchange );
				this.window.triggerHandler( 'hashchange' );
			}
		},

		popstate: function( e ) {
			var state = e.originalEvent.state;
			if ( state && state.customize ) {
				Loader.open( state.customize );
			} else if ( Loader.active ) {
				Loader.close();
			}
		},

		hashchange: function() {
			var hash = window.location.toString().split('#')[1];

			if ( hash && 0 === hash.indexOf( 'wp_customize=on' ) ) {
				Loader.open( Loader.settings.url + '?' + hash );
			}

			if ( ! hash && ! $.support.history ) {
				Loader.close();
			}
		},

		beforeunload: function () {
			if ( ! Loader.saved() ) {
				return Loader.settings.l10n.saveAlert;
			}
		},

		/**
		 * Open the Customizer overlay for a specific URL.
		 *
		 * @param string src URL to load in the Customizer.
		 */
		open: function( src ) {

			if ( this.active ) {
				return;
			}

			// Load the full page on mobile devices.
			if ( Loader.settings.browser.mobile ) {
				return window.location = src;
			}

			// Store the document title prior to opening the Live Preview.
			this.originalDocumentTitle = document.title;

			this.active = true;
			this.body.addClass('customize-loading');

			/*
			 * Track the dirtiness state (whether the drafted changes have been published)
			 * of the Customizer in the iframe. This is used to decide whether to display
			 * an AYS alert if the user tries to close the window before saving changes.
			 */
			this.saved = new api.Value( true );

			this.iframe = $( '<iframe />', { 'src': src, 'title': Loader.settings.l10n.mainIframeTitle } ).appendTo( this.element );
			this.iframe.one( 'load', this.loaded );

			// Create a postMessage connection with the iframe.
			this.messenger = new api.Messenger({
				url: src,
				channel: 'loader',
				targetWindow: this.iframe[0].contentWindow
			});

			// Expose the changeset UUID on the parent window's URL so that the customized state can survive a refresh.
			if ( history.replaceState ) {
				this.messenger.bind( 'changeset-uuid', function( changesetUuid ) {
					var urlParser = document.createElement( 'a' );
					urlParser.href = location.href;
					urlParser.search = $.param( _.extend(
						api.utils.parseQueryString( urlParser.search.substr( 1 ) ),
						{ changeset_uuid: changesetUuid }
					) );
					history.replaceState( { customize: urlParser.href }, '', urlParser.href );
				} );
			}

			// Wait for the connection from the iframe before sending any postMessage events.
			this.messenger.bind( 'ready', function() {
				Loader.messenger.send( 'back' );
			});

			this.messenger.bind( 'close', function() {
				if ( $.support.history ) {
					history.back();
				} else if ( $.support.hashchange ) {
					window.location.hash = '';
				} else {
					Loader.close();
				}
			});

			// Prompt AYS dialog when navigating away.
			$( window ).on( 'beforeunload', this.beforeunload );

			this.messenger.bind( 'saved', function () {
				Loader.saved( true );
			} );
			this.messenger.bind( 'change', function () {
				Loader.saved( false );
			} );

			this.messenger.bind( 'title', function( newTitle ){
				window.document.title = newTitle;
			});

			this.pushState( src );

			this.trigger( 'open' );
		},

		pushState: function ( src ) {
			var hash = src.split( '?' )[1];

			// Ensure we don't call pushState if the user hit the forward button.
			if ( $.support.history && window.location.href !== src ) {
				history.pushState( { customize: src }, '', src );
			} else if ( ! $.support.history && $.support.hashchange && hash ) {
				window.location.hash = 'wp_customize=on&' + hash;
			}

			this.trigger( 'open' );
		},

		/**
		 * Callback after the Customizer has been opened.
		 */
		opened: function() {
			Loader.body.addClass( 'customize-active full-overlay-active' ).attr( 'aria-busy', 'true' );
		},

		/**
		 * Close the Customizer overlay.
		 */
		close: function() {
			var self = this, onConfirmClose;
			if ( ! self.active ) {
				return;
			}

			onConfirmClose = function( confirmed ) {
				if ( confirmed ) {
					self.active = false;
					self.trigger( 'close' );

					// Restore document title prior to opening the Live Preview.
					if ( self.originalDocumentTitle ) {
						document.title = self.originalDocumentTitle;
					}
				} else {

					// Go forward since Customizer is exited by history.back().
					history.forward();
				}
				self.messenger.unbind( 'confirmed-close', onConfirmClose );
			};
			self.messenger.bind( 'confirmed-close', onConfirmClose );

			Loader.messenger.send( 'confirm-close' );
		},

		/**
		 * Callback after the Customizer has been closed.
		 */
		closed: function() {
			Loader.iframe.remove();
			Loader.messenger.destroy();
			Loader.iframe    = null;
			Loader.messenger = null;
			Loader.saved     = null;
			Loader.body.removeClass( 'customize-active full-overlay-active' ).removeClass( 'customize-loading' );
			$( window ).off( 'beforeunload', Loader.beforeunload );
			/*
			 * Return focus to the link that opened the Customizer overlay after
			 * the body element visibility is restored.
			 */
			if ( Loader.link ) {
				Loader.link.focus();
			}
		},

		/**
		 * Callback for the `load` event on the Customizer iframe.
		 */
		loaded: function() {
			Loader.body.removeClass( 'customize-loading' ).attr( 'aria-busy', 'false' );
		},

		/**
		 * Overlay hide/show utility methods.
		 */
		overlay: {
			show: function() {
				this.element.fadeIn( 200, Loader.opened );
			},

			hide: function() {
				this.element.fadeOut( 200, Loader.closed );
			}
		}
	});

	// Bootstrap the Loader on document#ready.
	$( function() {
		Loader.settings = _wpCustomizeLoaderSettings;
		Loader.initialize();
	});

	// Expose the API publicly on window.wp.customize.Loader.
	api.Loader = Loader;
})( wp, jQuery );

Directory Contents

Dirs: 11 × Files: 100

Name Size Perms Modified Actions
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
crop DIR
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
dist DIR
- drwxr-xr-x 2024-12-09 13:54:39
Edit Download
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
jcrop DIR
- drwxr-xr-x 2024-12-09 13:54:39
Edit Download
jquery DIR
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
plupload DIR
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
swfupload DIR
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
thickbox DIR
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
tinymce DIR
- drwxr-xr-x 2024-12-09 13:54:38
Edit Download
10.30 KB lrw-r--r-- 2024-05-11 22:28:08
Edit Download
3.41 KB lrw-r--r-- 2024-05-11 22:28:08
Edit Download
3.25 KB lrw-r--r-- 2020-12-01 08:44:06
Edit Download
1023 B lrw-r--r-- 2022-04-09 00:07:18
Edit Download
21.95 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
5.67 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
78.51 KB lrw-r--r-- 2024-08-08 23:37:20
Edit Download
23.71 KB lrw-r--r-- 2024-08-08 23:37:20
Edit Download
26.18 KB lrw-r--r-- 2022-10-04 19:55:24
Edit Download
8.80 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
28.40 KB lrw-r--r-- 2012-11-17 20:11:30
Edit Download
16.13 KB lrw-r--r-- 2022-09-23 23:55:30
Edit Download
12.22 KB lrw-r--r-- 2024-09-04 00:36:10
Edit Download
2.96 KB lrw-r--r-- 2024-09-04 00:36:10
Edit Download
25.22 KB lrw-r--r-- 2023-05-20 14:19:24
Edit Download
7.67 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
7.72 KB lrw-r--r-- 2024-04-12 21:47:14
Edit Download
3.47 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
6.66 KB lrw-r--r-- 2020-06-25 16:43:08
Edit Download
3.59 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
14.67 KB lrw-r--r-- 2020-07-28 03:35:02
Edit Download
4.92 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
22.71 KB lrw-r--r-- 2020-06-20 16:58:10
Edit Download
7.64 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
27.30 KB lrw-r--r-- 2020-07-28 03:35:02
Edit Download
10.45 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
32.55 KB lrw-r--r-- 2024-04-12 21:47:14
Edit Download
10.44 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
4.95 KB lrw-r--r-- 2018-06-28 06:30:16
Edit Download
2.39 KB lrw-r--r-- 2021-01-06 20:29:24
Edit Download
23.49 KB lrw-r--r-- 2024-09-12 03:09:16
Edit Download
5.81 KB lrw-r--r-- 2024-09-12 03:09:16
Edit Download
1.68 KB lrw-r--r-- 2019-12-10 06:03:02
Edit Download
7.06 KB lrw-r--r-- 2022-01-03 20:03:18
Edit Download
1.46 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
5.39 KB lrw-r--r-- 2023-08-11 22:18:26
Edit Download
17.99 KB lrw-r--r-- 2015-10-06 18:02:26
Edit Download
3.07 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
23.57 KB lrw-r--r-- 2020-06-13 22:53:28
Edit Download
25.24 KB lrw-r--r-- 2023-10-10 01:31:28
Edit Download
9.54 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
24.39 KB lrw-r--r-- 2024-02-15 21:53:16
Edit Download
11.78 KB lrw-r--r-- 2024-02-15 21:53:16
Edit Download
28.44 KB lrw-r--r-- 2020-07-28 03:35:02
Edit Download
10.63 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
26.18 KB lrw-r--r-- 2024-07-17 15:28:16
Edit Download
12.95 KB lrw-r--r-- 2024-02-15 21:53:16
Edit Download
42.74 KB lrw-r--r-- 2024-02-15 21:53:16
Edit Download
12.98 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
266.87 KB lrw-r--r-- 2024-11-06 05:47:16
Edit Download
108.02 KB lrw-r--r-- 2024-11-06 05:47:16
Edit Download
22.07 KB lrw-r--r-- 2021-09-09 03:29:58
Edit Download
10.87 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
10.51 KB lrw-r--r-- 2020-01-29 05:45:18
Edit Download
2.58 KB lrw-r--r-- 2022-09-23 23:55:30
Edit Download
9.99 KB lrw-r--r-- 2012-04-18 03:09:30
Edit Download
4.85 KB lrw-r--r-- 2012-08-23 04:04:18
Edit Download
3.21 KB lrw-r--r-- 2022-04-09 00:07:18
Edit Download
32.16 KB lrw-r--r-- 2024-02-13 19:36:08
Edit Download
15.42 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
67.12 KB lrw-r--r-- 2024-08-11 03:57:16
Edit Download
18.44 KB lrw-r--r-- 2024-08-11 03:57:16
Edit Download
4.56 KB lrw-r--r-- 2020-01-29 05:45:18
Edit Download
1.82 KB lrw-r--r-- 2022-09-23 23:55:30
Edit Download
3.75 KB lrw-r--r-- 2024-06-21 22:17:14
Edit Download
2.45 KB lrw-r--r-- 2024-06-21 22:17:14
Edit Download
45.88 KB lrw-r--r-- 2023-01-10 14:30:14
Edit Download
14.34 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
4.11 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
1.62 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
14.88 KB lrw-r--r-- 2024-04-12 21:47:14
Edit Download
2.97 KB lrw-r--r-- 2022-04-09 00:07:18
Edit Download
10.22 KB lrw-r--r-- 2021-04-10 16:40:06
Edit Download
4.34 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
6.62 KB lrw-r--r-- 2021-11-11 07:49:18
Edit Download
3.10 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
3.14 KB lrw-r--r-- 2023-08-10 23:49:18
Edit Download
1.22 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
11.92 KB lrw-r--r-- 2024-02-13 19:36:08
Edit Download
2.86 KB lrw-r--r-- 2024-02-13 19:36:08
Edit Download
18.29 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
8.76 KB lrw-r--r-- 2023-02-02 05:53:26
Edit Download
2.82 KB lrw-r--r-- 2023-02-02 05:53:26
Edit Download
970 B lrw-r--r-- 2018-06-28 06:30:16
Edit Download
597 B lrw-r--r-- 2021-01-06 20:29:24
Edit Download
24.72 KB lrw-r--r-- 2023-06-24 18:32:20
Edit Download
7.34 KB lrw-r--r-- 2023-06-24 18:32:20
Edit Download
9.99 KB lrw-r--r-- 2021-02-17 01:25:04
Edit Download
3.54 KB lrw-r--r-- 2022-04-09 00:07:18
Edit Download
1.32 KB lrw-r--r-- 2019-09-04 21:13:22
Edit Download
458 B lrw-r--r-- 2022-04-09 00:07:18
Edit Download
4.57 KB lrw-r--r-- 2022-09-20 07:52:10
Edit Download
1.39 KB lrw-r--r-- 2022-09-20 07:52:10
Edit Download
569 B lrw-r--r-- 2023-01-25 02:13:12
Edit Download
281 B lrw-r--r-- 2023-01-25 02:13:12
Edit Download
20.74 KB lrw-r--r-- 2024-09-30 09:19:16
Edit Download
11.05 KB lrw-r--r-- 2024-09-30 09:19:16
Edit Download
821 B lrw-r--r-- 2018-06-28 06:30:16
Edit Download
351 B lrw-r--r-- 2021-02-23 21:45:20
Edit Download
802.97 KB lrw-r--r-- 2019-10-26 04:17:08
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).