PHP 8.0.30
Preview: unitecreator_variables.js Size: 2.23 KB
/home/certprox/test.certproxywizard.com/wp-content/plugins/unlimited-elements-for-elementor/js/unitecreator_variables.js

"use strict";

function UniteCreatorVariables(){

	var t = this;

	var g_arrVarsMain = [], g_arrVarsItem = [], g_arrVarsItem2 = [];
	
	this.types = {
			MAIN:"main",
			ITEM:"item"
	};
	
	if(!g_ucAdmin)
		var g_ucAdmin = new UniteAdminUC();

	/**
	 * validate type
	 */
	function validateType(type){
		switch(type){
			case t.types.MAIN:
			case t.types.ITEM:
			break;
			default:
				throw new Error("Wrong variables type: " + type);
			break;
		}
	}
	
	
	/**
	 * validate that the index exists in array
	 */
	function validateIndex(arrItems, index){
		
		if(index >= arrItems.length)
			throw new Error("The var: "+index+" don't exists in the collection");
		
	}
	
	
	/**
	 * get array by type
	 */
	function getArrByType(type){
		validateType(type);
		
		switch(type){
			case t.types.MAIN:
				return(g_arrVarsMain);
			break;
			case t.types.ITEM:
				return(g_arrVarsItem);
			break;
		}
		
	}
	
	
	/**
	 * add variable into collection
	 */
	this.add = function(type, objVar){
				
		var arrVars = getArrByType(type);
		
		arrVars.push(objVar);
	}
	
	
	/**
	 * update variable
	 */
	this.update = function(type, index, objVar){
		
		var arrVars = getArrByType(type);
		
		validateIndex(arrVars, index);
		
		arrVars[index] = objVar;
				
	}
	
	
	
	/**
	 * delete variable by name from some collection
	 */
	this.deleteVar = function(type, index){
		
		var arrItems = getArrByType(type);
		
		validateIndex(arrItems, index);
		
		arrItems.splice(index, 1);
	}
	
	
	/**
	 * get variable
	 */
	this.getVariable = function(type, index){
		
		validateType(type);
		
		var arrItems = getArrByType(type);
		validateIndex(arrItems, index);
		
		var objVar = arrItems[index];
		return(objVar);
	}
	
	
	/**
	 * add variables from array
	 */
	this.addFromArray = function(type, arrVars){
		validateType(type);
		if(typeof arrVars != "object")
			return(false);
		
		jQuery.each(arrVars, function(index, objVar){
			t.add(type, objVar);
		});
		
	}
	
	
	/**
	 * get variables array by type
	 */
	this.getArrVars = function(type){
		
		var objVars = getArrByType(type);
		
		var arrVars = g_ucAdmin.objToArray(objVars);
		
		return(arrVars);
	}
	
	
}

Directory Contents

Dirs: 9 × Files: 27

Name Size Perms Modified Actions
- drwxr-xr-x 2026-03-06 14:07:48
Edit Download
- drwxr-xr-x 2026-03-06 14:07:48
Edit Download
dropzone DIR
- drwxr-xr-x 2026-03-06 14:07:48
Edit Download
- drwxr-xr-x 2026-03-06 14:07:48
Edit Download
flatpickr DIR
- drwxr-xr-x 2026-03-06 14:07:48
Edit Download
- drwxr-xr-x 2026-03-06 14:07:49
Edit Download
manager DIR
- drwxr-xr-x 2026-03-06 14:07:49
Edit Download
select2 DIR
- drwxr-xr-x 2026-03-06 14:07:49
Edit Download
spectrum DIR
- drwxr-xr-x 2026-03-06 14:07:50
Edit Download
55.34 KB lrw-r--r-- 2026-03-06 14:07:47
Edit Download
0 B lrw-r--r-- 2026-03-06 14:07:49
Edit Download
8.11 KB lrw-r--r-- 2026-03-06 14:07:49
Edit Download
19.41 KB lrw-r--r-- 2026-03-06 14:07:49
Edit Download
137.18 KB lrw-r--r-- 2026-03-06 14:07:49
Edit Download
118.14 KB lrw-r--r-- 2026-03-06 14:07:49
Edit Download
3.94 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
801 B lrw-r--r-- 2026-03-06 14:07:50
Edit Download
13.79 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
3.92 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
50.29 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
3.61 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
16.19 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
15.27 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
1.21 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
35.92 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
17.73 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
5.04 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
17.84 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
26.82 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
53.04 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
41.07 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
21.93 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
2.57 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
2.97 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
2.10 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download
2.23 KB lrw-r--r-- 2026-03-06 14:07:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).