Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/1534260/cwd/plugins/jetpack/modules/custom-css/custom-css/js/ |
Upload File : |
// Originally based on https://raw.githubusercontent.com/xwp/wp-custom-scss-demo/master/custom-scss-demo-preview.js /* globals jpCustomizerCssPreview */ (function( api, $ ) { if ( api.settingPreviewHandlers ) { // No-op the custom_css preview handler since now handled by partial. api.settingPreviewHandlers.custom_css = function() {}; } else { parent.console.warn( 'Missing core patch that adds support for settingPreviewHandlers' ); } api.selectiveRefresh.partialConstructor.custom_css = api.selectiveRefresh.Partial.extend( { /** * Refresh custom_css partial, using selective refresh if pre-processor and direct DOM manipulation if otherwise. * * @returns {jQuery.promise} */ refresh: function() { var partial = this, preprocessor = api( 'jetpack_custom_css[preprocessor]' ).get(), deferred, setting; // Sass or Less require Partial -- so ajax call to get it from PHP. // We can explicitly override for specific providers by testing if `'sass' === preprocessor` if ( jpCustomizerCssPreview.preprocessors.hasOwnProperty( preprocessor ) ) { return api.selectiveRefresh.Partial.prototype.refresh.call( partial ); } // No special providers, just write what we got. deferred = new $.Deferred(); setting = api( 'custom_css[' + api.settings.theme.stylesheet + ']' ); _.each( partial.placements(), function( placement ) { placement.container.text( setting.get() ); } ); deferred.resolve(); return deferred.promise(); } } ); }( wp.customize, jQuery ));