| Server IP : 43.153.74.48 / Your IP : 216.73.216.175 Web Server : LiteSpeed System : Linux VM-0-13-ubuntu 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 User : www ( 1002) PHP Version : 8.1.29 Disable Function : 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 MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/stainlesstint.com/wp-content/themes/woodmart/inc/admin/assets/js/ |
Upload File : |
/* global jQuery, woodmartConfig, woodmartAdmin */
(function($) {
'use strict';
function cssGenerator () {
// General.
var $form = $('.xts-generator-form');
$form.on('change', '[type=\"checkbox\"]', prepare);
prepare();
// General.
function prepare() {
var fields = {};
var $this = $(this);
var id = $this.attr('id');
var checked = $this.prop('checked');
var $children = $form.find('[data-parent="' + id + '"] [type=\"checkbox\"]');
$children.prop('checked', checked);
var parentChecked = function($this) {
$form.find('[name="' + $this.parent().data('parent') + '"]').each(function() {
$(this).prop('checked', 'checked');
if ('none' !== $(this).parent().data('parent')) {
parentChecked($(this));
}
});
};
if ('none' !== $this.parent().data('parent')) {
parentChecked($(this));
}
var uncheckedEmpty = function($this) {
var id = $this.parent().data('parent');
var $children = $form.find('[data-parent="' + id + '"]');
if ($children.length > 0) {
var checked = false;
$children.each(function() {
if ($(this).find('[type="checkbox"]').prop('checked')) {
checked = true;
}
});
if (!checked) {
$form.find('[name="' + id + '"]').prop('checked', '');
uncheckedEmpty($form.find('[name="' + id + '"]'));
}
}
};
uncheckedEmpty($(this));
$form.find('[type="checkbox"]').each(function() {
fields[this.name] = $(this).prop('checked') ? true : false;
});
var base64 = btoa(JSON.stringify(fields));
$form.find('[name="css-data"]').val(base64);
}
$('.css-update-button').on('click', function(e) {
e.preventDefault();
$form.find('[name="generate-css"]').click();
});
$form.on('click', '[name="generate-css"]', function() {
$form.parents('.xts-box-content').addClass('xts-loading');
});
}
jQuery(document).ready(function() {
cssGenerator();
});
})(jQuery);