https://t.me/AnonymousX5
Server : Apache/2
System : Linux vps.sdns.vn 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64
User : phatdatpq ( 1022)
PHP Version : 7.2.34
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/phatdatpq/public_html/wp-content/themes/flatsome/inc/admin/kirki/modules/css-vars/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/phatdatpq/public_html/wp-content/themes/flatsome/inc/admin/kirki/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 ) );
			} );
		} );
	} );
} );

https://t.me/AnonymousX5 - 2025