HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/zaklada/wp-content/plugins/w3-total-cache/PgCache_Page_CookieGroups_View.js
jQuery(function() {


function w3tc_cookiegroups_clear() {
	if (!jQuery('#cookiegroups li').length) {
		jQuery('#cookiegroups_empty').show();
	} else {
		jQuery('#cookiegroups_empty').hide();
	}
}



jQuery('#w3tc_cookiegroup_add').click(function() {
	var group = prompt('Enter group name (only "0-9", "a-z", "_" symbols are allowed).');

	if (group !== null) {
		group = group.toLowerCase();
		group = group.replace(/[^0-9a-z_]+/g, '_');
		group = group.replace(/^_+/, '');
		group = group.replace(/_+$/, '');

		if (group) {
			var exists = false;

			jQuery('.cookiegroup_name').each(function() {
				if (jQuery(this).html() == group) {
					alert('Group already exists!');
					exists = true;
					return false;
				}
			});

			if (!exists) {
				var li = jQuery('<li id="cookiegroup_' + group + '">' +
					'<table class="form-table">' +
					'<tr>' +
					'<th>Group name:</th>' +
					'<td><span class="cookiegroup_number">' + (jQuery('#cookiegroups li').length + 1) + '.</span> ' +
					'<span class="cookiegroup_name">' + group + '</span> ' +
					'<input type="button" class="button cookiegroup_delete" value="Delete group" /></td>' +
					'</tr>' +
					'<tr>' +
					'<th><label for="cookiegroup_' + group + '_enabled">Enabled:</label></th>' +
					'<td>' +
					'<input id="cookiegroup_' + group + '_enabled" type="checkbox" name="cookiegroups[' +
					group + '][enabled]" value="1" checked="checked" /></td>' +
					'</tr>' +
					'<tr>' +
					'<th><label for="cookiegroup_' + group + '_cache">Cache:</label></th>' +
					'<td>' +
					'<input id="cookiegroup_' + group + '_cache" type="checkbox" name="cookiegroups[' +
					group + '][cache]" value="1" checked="checked" /></td></tr>' +
					'<tr>' +
					'<th><label for="cookiegroups_' + group + '_cookies">Cookies:</label></th>' +
					'<td><textarea id="cookiegroups_' + group + '_cookies" name="cookiegroups[' +
					group + '][cookies]" rows="10" cols="50"></textarea>' +
					'<p class="description">Specify the cookies for this group. Values like \'cookie\', \'cookie=value\', and cookie[a-z]+=value[a-z]+are supported. Remember to escape special characters like spaces, dots or dashes with a backslash. Regular expressions are also supported.</p></td></tr>' +
					'</table></li>');
				var select = li.find('select');

				jQuery('#cookiegroups').append(li);
				w3tc_cookiegroups_clear();
				window.location.hash = '#cookiegroup_' + group;
				li.find('textarea').focus();
			}
		} else {
			alert('Empty group name!');
		}
	}
});

	jQuery('.w3tc_cookiegroup_delete').on('click', function () {
	if (confirm('Are you sure want to delete this group?')) {
		jQuery(this).parents('#cookiegroups li').remove();
		w3tc_cookiegroups_clear();
		w3tc_beforeupload_bind();
	}
});

w3tc_cookiegroups_clear();

// add sortable
if (jQuery.ui && jQuery.ui.sortable) {
	jQuery('#cookiegroups').sortable({
		axis: 'y',
		stop: function() {
			jQuery('#cookiegroups').find('.cookiegroup_number').each(function(index) {
				jQuery(this).html((index + 1) + '.');
			});
		}
	});
}


});