HEX
Server: nginx/1.26.3
System: Linux debian 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64
User: root (0)
PHP: 5.6.40
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/gxdaosen.net/wp-content/plugins/futurio-extra/include/modules/css-vars/script.js
/* global kirkiCssVarFields */
var kirkiCssVars = {

	/**
	 * Get styles.
	 *
	 * @since 3.0.28
	 * @returns {Object}
	 */
	getStyles: function() {
		var style     = jQuery( '#kirki-css-vars' ),
			styles    = style.html().replace( ':root{', '' ).replace( '}', '' ).split( ';' ),
			stylesObj = {};

		// Format styles as a object we can then tweak.
		_.each( styles, function( style ) {
			style = style.split( ':' );
			if ( style[0] && style[1] ) {
				stylesObj[ style[0] ] = style[1];
			}
		} );
		return stylesObj;
	},

	/**
	 * Builds the styles from an object.
	 *
	 * @since 3.0.28
	 * @param {Object} vars - The vars.
	 * @returns {string}
	 */
	buildStyle: function( vars ) {
		var style = '';

		_.each( vars, function( val, name ) {
			style += name + ':' + val + ';';
		} );
		return ':root{' + style + '}';
	}
};

jQuery( document ).ready( function() {
	_.each( kirkiCssVarFields, function( field ) {
		wp.customize( field.settings, function( value ) {
			value.bind( function( newVal ) {
				var styles = kirkiCssVars.getStyles();

				_.each( field.css_vars, function( cssVar ) {
					if ( 'object' === typeof newVal ) {
						if ( cssVar[2] && newVal[ cssVar[2] ] ) {
							styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal[ cssVar[2] ] );
						}
					} else {
						styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal );
					}
				} );
				jQuery( '#kirki-css-vars' ).html( kirkiCssVars.buildStyle( styles ) );
			} );
		} );
	} );
} );

wp.customize.bind( 'preview-ready', function() {
	wp.customize.preview.bind( 'active', function() {
		_.each( kirkiCssVarFields, function( field ) {
			wp.customize( field.settings, function( value ) {
				var styles = kirkiCssVars.getStyles(),
					newVal = window.parent.wp.customize( value.id ).get();
				_.each( field.css_vars, function( cssVar ) {
					if ( 'object' === typeof newVal ) {
						if ( cssVar[2] && newVal[ cssVar[2] ] ) {
							styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal[ cssVar[2] ] );
						}
					} else {
						styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal );
					}
				} );
				jQuery( '#kirki-css-vars' ).html( kirkiCssVars.buildStyle( styles ) );
			} );
		} );
	} );
} );