var
/
www
/
html
/
servotec-doerpen
/
wp-includes
/
js
| uid:33
customize-loader.js
[X]
/** * @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 );
codemirror/
-
O
R
D
crop/
-
O
R
D
dist/
-
O
R
D
imgareaselect/
-
O
R
D
jcrop/
-
O
R
D
jquery/
-
O
R
D
mediaelement/
-
O
R
D
plupload/
-
O
R
D
swfupload/
-
O
R
D
thickbox/
-
O
R
D
tinymce/
-
O
R
D
admin-bar.js
10.3K
V
E
R
D
admin-bar.min.js
3.4K
V
E
R
D
autosave.js
21.9K
V
E
R
D
autosave.min.js
5.7K
V
E
R
D
backbone.js
78.6K
V
E
R
D
backbone.min.js
23.7K
V
E
R
D
clipboard.js
26.2K
V
E
R
D
clipboard.min.js
8.8K
V
E
R
D
colorpicker.js
28.4K
V
E
R
D
colorpicker.min.js
16.1K
V
E
R
D
comment-reply.js
12.2K
V
E
R
D
comment-reply.min.js
3K
V
E
R
D
customize-base.js
25.2K
V
E
R
D
customize-base.min.js
7.7K
V
E
R
D
customize-loader.js
7.7K
V
E
R
D
customize-loader.min.js
3.5K
V
E
R
D
customize-models.js
6.7K
V
E
R
D
customize-models.min.js
3.6K
V
E
R
D
customize-preview-nav-menus.js
14.7K
V
E
R
D
customize-preview-nav-menus.min.js
4.9K
V
E
R
D
customize-preview-widgets.js
22.7K
V
E
R
D
customize-preview-widgets.min.js
7.6K
V
E
R
D
customize-preview.js
27.9K
V
E
R
D
customize-preview.min.js
10.8K
V
E
R
D
customize-selective-refresh.js
32.6K
V
E
R
D
customize-selective-refresh.min.js
10.4K
V
E
R
D
customize-views.js
5.1K
V
E
R
D
customize-views.min.js
2.5K
V
E
R
D
heartbeat.js
23.5K
V
E
R
D
heartbeat.min.js
5.8K
V
E
R
D
hoverintent-js.min.js
1.7K
V
E
R
D
imagesloaded.min.js
5.4K
V
E
R
D
json2.js
31
V
E
R
D
json2.min.js
35
V
E
R
D
masonry.min.js
23.6K
V
E
R
D
mce-view.js
25.2K
V
E
R
D
mce-view.min.js
9.5K
V
E
R
D
media-audiovideo.js
24.1K
V
E
R
D
media-audiovideo.min.js
11.8K
V
E
R
D
media-editor.js
28.8K
V
E
R
D
media-editor.min.js
10.8K
V
E
R
D
media-grid.js
26.1K
V
E
R
D
media-grid.min.js
13K
V
E
R
D
media-models.js
42.5K
V
E
R
D
media-models.min.js
13K
V
E
R
D
media-views.js
266.5K
V
E
R
D
media-views.min.js
108.1K
V
E
R
D
quicktags.js
22.1K
V
E
R
D
quicktags.min.js
10.9K
V
E
R
D
swfobject.js
0
V
E
R
D
swfobject.min.js
35
V
E
R
D
tw-sack.js
4.9K
V
E
R
D
tw-sack.min.js
3.2K
V
E
R
D
twemoji.js
36.3K
V
E
R
D
twemoji.min.js
19.4K
V
E
R
D
underscore.js
67.3K
V
E
R
D
underscore.min.js
18.6K
V
E
R
D
utils.js
4.6K
V
E
R
D
utils.min.js
1.8K
V
E
R
D
wp-ajax-response.js
3.8K
V
E
R
D
wp-ajax-response.min.js
2.5K
V
E
R
D
wp-api.js
45.9K
V
E
R
D
wp-api.min.js
14.3K
V
E
R
D
wp-auth-check.js
4.3K
V
E
R
D
wp-auth-check.min.js
1.6K
V
E
R
D
wp-backbone.js
14.9K
V
E
R
D
wp-backbone.min.js
3K
V
E
R
D
wp-custom-header.js
10.2K
V
E
R
D
wp-custom-header.min.js
4.3K
V
E
R
D
wp-embed-template.js
6.6K
V
E
R
D
wp-embed-template.min.js
3.1K
V
E
R
D
wp-embed.js
3.1K
V
E
R
D
wp-embed.min.js
1.2K
V
E
R
D
wp-emoji-loader.js
12.9K
V
E
R
D
wp-emoji-loader.min.js
2.8K
V
E
R
D
wp-emoji-release.min.js
22.2K
V
E
R
D
wp-emoji.js
8.6K
V
E
R
D
wp-emoji.min.js
2.8K
V
E
R
D
wp-list-revisions.js
970
V
E
R
D
wp-list-revisions.min.js
597
V
E
R
D
wp-lists.js
24.7K
V
E
R
D
wp-lists.min.js
7.3K
V
E
R
D
wp-sanitize.js
1.6K
V
E
R
D
wp-sanitize.min.js
402
V
E
R
D
wp-util.js
4.6K
V
E
R
D
wp-util.min.js
1.4K
V
E
R
D
wpdialog.js
569
V
E
R
D
wpdialog.min.js
281
V
E
R
D
wplink.js
20.7K
V
E
R
D
wplink.min.js
11.1K
V
E
R
D
zxcvbn-async.js
821
V
E
R
D
zxcvbn-async.min.js
351
V
E
R
D
zxcvbn.min.js
803K
V
E
R
D