Changeset 2956716
- Timestamp:
- 08/22/2023 10:51:33 AM (2 years ago)
- Location:
- unlimited-elements-for-elementor/trunk
- Files:
-
- 12 edited
-
assets_libraries/filters/ue_filters.js (modified) (2 diffs)
-
assets_libraries/form/uc_form.js (modified) (23 diffs)
-
assets_libraries/remote/ue-remote-controls.js (modified) (1 diff)
-
inc_php/unitecreator_filters_process.class.php (modified) (11 diffs)
-
inc_php/unitecreator_globals.class.php (modified) (1 diff)
-
inc_php/unitecreator_settings.class.php (modified) (1 diff)
-
inc_php/unitecreator_template_engine.class.php (modified) (1 diff)
-
includes.php (modified) (1 diff)
-
provider/core/plugins/unlimited_elements/helper_provider_core.class.php (modified) (1 diff)
-
provider/woocommerce_integrate.class.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
release_log.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unlimited-elements-for-elementor/trunk/assets_libraries/filters/ue_filters.js
r2954426 r2956716 3206 3206 bindFilterToGrid(objGrid, objFilter); 3207 3207 3208 //set data var 3209 if(g_showDebug == true) 3210 objFilter.attr("data-showdebug", true); 3211 3212 3208 3213 switch(type){ 3209 3214 case g_types.TERMS_LIST: … … 3759 3764 if(!queryData) 3760 3765 return(null); 3761 3766 3762 3767 var objData = jQuery.parseJSON(queryData); 3763 3768 3769 if(g_showDebug == true){ 3770 console.log("getQueryData (filter, grid, querydata): ",objFilter, objGrid, queryData); 3771 } 3772 3764 3773 return(objData); 3765 3774 } -
unlimited-elements-for-elementor/trunk/assets_libraries/form/uc_form.js
r2954426 r2956716 1 1 "use strict"; 2 2 3 //version: 1. 33 //version: 1.4 4 4 5 5 function UnlimitedElementsForm(){ … … 31 31 32 32 objError.show(); 33 33 34 34 var objErrorParent = objError.parents(".debug-wrapper"); 35 35 36 36 if(!objErrorParent.length) 37 37 throw new Error(consoleErrorText); 38 38 39 39 objErrorParent.addClass("ue_error_true"); 40 40 41 41 throw new Error(consoleErrorText); 42 42 … … 46 46 * get formula names 47 47 */ 48 function getFormulaNames(expr, objError){ 48 function getFormulaNames(expr, objError){ 49 49 50 50 var regex = /\[(.*?)\]/g; … … 56 56 names = matches.map(match => match.substring(1, match.length - 1)); 57 57 58 if(names == undefined) 59 return(false); 60 61 //check for space inside name 62 names.forEach(function(name, index){ 63 64 for (var i = 0; i < name.length; i++) { 65 66 var currentChar = name[i]; 67 68 if(currentChar === " "){ 69 70 var errorText = 'Unlimited Elements Form Error: Name option must not contain spaces inside. Found in name: '+name; 71 var consoleErrorText = "Space character in name found"; 72 73 showCustomError(objError, errorText, consoleErrorText); 74 75 } 76 77 } 78 79 }); 80 81 //remove spacing in case they were not removed before 82 expr = expr.replace(/\s+/g, ""); 83 58 84 var unmatches = expr.replace(regex, "").split(/[\[\]]/); 59 85 … … 81 107 var names = getFormulaNames(expr, objError); 82 108 109 if(names == undefined || names == false) 110 return(expr); 111 83 112 names.forEach(function(name, index){ 84 113 … … 103 132 } 104 133 134 //check if uppercase characters are in name 135 for (var i = 0; i < name.length; i++) { 136 137 var currentChar = name[i]; 138 139 if (currentChar === currentChar.toUpperCase() && currentChar !== currentChar.toLowerCase()){ 140 141 var errorText = 'Unlimited Elements Form Error: Name option must not contain Uppercase characters. Found in name: '+name; 142 var consoleErrorText = "Uppercase in name found"; 143 144 showCustomError(objError, errorText, consoleErrorText); 145 146 } 147 148 if(currentChar === " "){ 149 150 var errorText = 'Unlimited Elements Form Error: Name option must not contain spaces inside. Found in name: '+name; 151 var consoleErrorText = "Space character in name found"; 152 153 showCustomError(objError, errorText, consoleErrorText); 154 155 } 156 157 } 158 105 159 var inputValue = objInpput.val(); 106 160 107 161 //add parentheses if valus is less then 0 108 162 if(inputValue < 0) 109 inputValue = "("+inputValue+")" 163 inputValue = "("+inputValue+")"; 164 165 //if input is empty then count it as 0 166 if(inputValue.length == 0) 167 inputValue = 0; 110 168 111 169 expr = expr.replace(name, inputValue); … … 122 180 * validate the expression 123 181 */ 124 function validateExpression(expr){ 182 function validateExpression(expr){ 125 183 126 184 //allow Math.something (math js operation), numbers, float numbers, math operators, dots, comas … … 143 201 function getResult(expr, objError) { 144 202 145 //if space just erase it 203 //if space just erase it 146 204 expr = expr.replace(/\s+/g, ""); 147 205 … … 214 272 if(dataFormula == "" || dataFormula == undefined) 215 273 return(false); 216 274 217 275 //get result with numbers instead of fields name 218 276 var result = getResult(dataFormula, objError); 219 277 220 278 //format result 221 279 result = formatResultNumber(result, objCalcInput); … … 224 282 objCalcInput.val(result); 225 283 226 //set readonly attr 284 //set readonly attr if needed 285 var dataRemoveReadonlyCalcMode = objCalcInput.data("remove-readonly-for-calc-mode"); 286 287 if(dataRemoveReadonlyCalcMode == false) 227 288 objCalcInput.attr('readonly', ''); 228 289 … … 249 310 var names = getFormulaNames(expr, objError); 250 311 312 if(names == undefined || names == false) 313 return(false); 314 251 315 names.forEach(function(name, index){ 252 316 253 317 var objInpput = jQuery(ueInputFieldSelector+'[name="'+name+'"]'); 254 255 objInpput.attr("data-parent-formula-input", parentIdAttribute); 318 var dataParentFormulaInputArray = objInpput.data("parent-formula-input"); 319 320 //if attr not exist create it 321 if(dataParentFormulaInputArray === undefined) 322 objInpput.attr("data-parent-formula-input", parentIdAttribute); 323 324 //if attr exist, add new parent id to it 325 if(dataParentFormulaInputArray !== undefined){ 326 327 dataParentFormulaInputArray = dataParentFormulaInputArray.split(","); 328 329 dataParentFormulaInputArray.push(parentIdAttribute); 330 331 objInpput.attr("data-parent-formula-input", dataParentFormulaInputArray); 332 333 } 256 334 257 335 }); … … 264 342 function getParentCalcInput(objInput){ 265 343 266 var parentAttr = objInput.data("parent-formula-input"); 267 268 if(!parentAttr) 269 return(null); 270 271 var objParentCalkInput = jQuery("#"+parentAttr).find("[data-calc-mode='true']"); 272 273 return(objParentCalkInput); 344 var parentsArray = objInput.attr("data-parent-formula-input"); 345 346 var objParentsArray = []; 347 348 //make sure attr is an array 349 if(parentsArray != undefined){ 350 351 parentsArray = parentsArray.split(","); 352 353 parentsArray.forEach(function(id, index){ 354 355 var parentId = id; 356 var objParentCalcInput = jQuery("#"+parentId).find("[data-calc-mode='true']"); 357 358 objParentsArray.push(objParentCalcInput); 359 360 }); 361 362 return(objParentsArray); 363 364 } 274 365 275 366 } … … 279 370 */ 280 371 function showField(objFieldWidget, classHidden){ 281 372 282 373 objFieldWidget.removeClass(classHidden); 283 374 … … 288 379 */ 289 380 function hideField(objFieldWidget, classHidden){ 290 381 291 382 objFieldWidget.addClass(classHidden); 292 383 … … 297 388 */ 298 389 function getConditions(visibilityCondition, condition, objFieldValue, fieldValue){ 299 390 300 391 switch (condition) { 301 392 case "=": … … 307 398 308 399 visibilityCondition = objFieldValue > fieldValue; 309 400 310 401 break; 311 402 case ">=": … … 381 472 382 473 var isNamesEqual = arrNames.indexOf(inputName) != -1; 383 474 384 475 if(isNamesEqual == true){ 385 476 … … 427 518 var names = getFormulaNames(formula, objError); 428 519 520 if(names == undefined || names == false) 521 return(false); 522 429 523 names.forEach(function(name, index){ 430 524 … … 455 549 var classHidden = "ucform-has-conditions"; 456 550 var classError = "ue-error"; 457 551 458 552 var conditions = conditionArray.visibility_conditions; 459 553 var conditionsNum = conditions.length; … … 478 572 var objField = jQuery(ueInputFieldSelector+'[name="'+fieldName+'"]'); 479 573 var objFieldValue = parseInt(objField.val()); 480 574 481 575 //sets the condition: "==", ">", "<" ... 482 576 var visibilityCondition = getConditions(visibilityCondition, condition, objFieldValue, fieldValue); … … 495 589 arrNames = getNames(arrNames, fieldName); 496 590 497 var objInputField = objFieldWidget.find(ueInputFieldSelector);498 591 var objInputField = objFieldWidget.find(ueInputFieldSelector); 592 499 593 equalConditionInputNameError(objInputField, arrNames, classError); 500 594 … … 544 638 setResult(objCalcInput, objError); 545 639 546 //init events547 var objAllInputFields = jQuery(ueInputFieldSelector);548 549 //on input change trigger only parent calc number field, not all of them550 objAllInputFields.on('input', function(){551 552 var objInput = jQuery(this); //triggered input553 var objParentCalkInput = getParentCalcInput(objInput); //parent calc input with formula attr554 555 if(objParentCalkInput == null)556 return(false);557 558 onInputChange(objParentCalkInput);559 560 });561 562 640 //set result on custom shange event 563 641 objCalcInput.on('input_calc', function(){ 564 642 565 643 var objInput = jQuery(this); //triggered input 566 644 567 645 setResult(objInput, objError); 568 646 … … 571 649 }); 572 650 573 574 651 //init events 652 var objAllInputFields = jQuery(ueInputFieldSelector); 653 654 //on input change trigger only parent calc number field, not all of them 655 objAllInputFields.on('input', function(){ 656 657 var objInput = jQuery(this); //triggered input 658 var objParentCalkInputs = getParentCalcInput(objInput); //parent calc input with formula attr 659 660 if(objParentCalkInputs == undefined) 661 return(true); 662 663 objParentCalkInputs.forEach(function(parent, index){ 664 665 onInputChange(parent); 666 667 }); 668 669 }); 575 670 576 671 } -
unlimited-elements-for-elementor/trunk/assets_libraries/remote/ue-remote-controls.js
r2937493 r2956716 155 155 156 156 if(num < 0) 157 num = 0; 158 159 if(!num) 160 num = 0; 161 162 if(typeof num == "undefined") 157 163 num = 0; 158 164 -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_filters_process.class.php
r2954426 r2956716 1948 1948 private function modifyOutputTerms_addFirstItem($arrTerms, $data, $filterType){ 1949 1949 1950 //don't add first item if no terms, if no terms, no "all" as well 1951 1950 1952 if(empty($arrTerms)) 1951 $arrTerms = array();1953 return(array()); 1952 1954 1953 1955 $addFirst = UniteFunctionsUC::getVal($data, "add_first"); … … 1957 1959 return($arrTerms); 1958 1960 1961 1959 1962 $text = UniteFunctionsUC::getVal($data, "first_item_text", __("All","unlimited-elements-for-elementor")); 1960 1963 … … 2063 2066 2064 2067 /** 2065 * modify the terms for init after 2068 * modify the terms for init after 2066 2069 */ 2067 2070 private function modifyOutputTerms_setNumPosts($arrTerms){ … … 2073 2076 2074 2077 $arrPostNums = GlobalsProviderUC::$arrTestTermIDs; 2075 2078 2076 2079 foreach($arrTerms as $key => $term){ 2077 2080 … … 2104 2107 if($isHidden == true){ 2105 2108 $htmlAttributes = "hidden='hidden' style='display:none'"; 2109 $htmlAttributesNew = "hidden='hidden' "; //no style 2106 2110 2107 2111 $addClass = UniteFunctionsUC::getVal($term, "addclass"); … … 2113 2117 $term["hidden"] = $isHidden; 2114 2118 $term["html_attributes"] = $htmlAttributes; 2119 $term["html_attributes2"] = $htmlAttributesNew; 2115 2120 2116 2121 $arrTerms[$key] = $term; … … 2341 2346 $isFirstLoad = true; //not in ajax, or with init after (also first load) 2342 2347 2348 2343 2349 $isInsideEditor = GlobalsProviderUC::$isInsideEditor; 2344 2350 … … 2384 2390 2385 2391 $arrTerms = UniteFunctionsUC::getVal($data, "taxonomy"); 2392 2393 //modify the hidden as well 2386 2394 2387 2395 $arrTerms = $this->modifyOutputTerms_setNumPosts($arrTerms, $isInitAfter, $isFirstLoad); … … 2394 2402 2395 2403 $arrTerms = $this->modifyOutputTerms_modifySelectedByRequest($arrTerms); 2404 2396 2405 2397 2406 $isFilterHidden = false; … … 2403 2412 if($isInitAfter == true && !empty($limitGrayedItems) && $isUnderAjax == false) 2404 2413 $arrTerms = $this->modifyOutputTerms_tabs_modifyLimitGrayed($arrTerms, $limitGrayedItems); 2405 2414 2406 2415 $isFilterHidden = $this->modifyOutputTerms_isFilterHidden($data, $arrTerms, $isUnderAjax); 2407 2408 2416 2409 2417 break; … … 2418 2426 2419 2427 $arrTerms = $this->modifyOutputTerms_setSelectedClass($arrTerms, $filterType); 2420 2428 2421 2429 $arrTerms = $this->modifyOutputTerms_getDataAttributes($arrTerms, $filterType); 2422 2430 -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_globals.class.php
r2954426 r2956716 172 172 173 173 public static $enableAPIIntegration = false; 174 174 175 public static $enableNewDashboard = false; 175 176 -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_settings.class.php
r2933731 r2956716 724 724 break; 725 725 default: 726 UniteFunctionsUC::throwError("Add special param error: wrong attribute type: $attributeType ");726 UniteFunctionsUC::throwError("Add special param error: wrong attribute type: $attributeType, please check that the plugin version is up to date"); 727 727 break; 728 728 } -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_template_engine.class.php
r2951403 r2956716 1451 1451 1452 1452 break; 1453 case "get_breakpoints": 1454 1455 $arrBreakpoints = HelperProviderCoreUC_EL::getBreakpoints(); 1456 1457 dmp("breakpoints"); 1458 dmp($arrBreakpoints); 1459 1460 break; 1453 1461 default: 1454 1462 -
unlimited-elements-for-elementor/trunk/includes.php
r2954426 r2956716 13 13 14 14 if(!defined("UNLIMITED_ELEMENTS_VERSION")) 15 define("UNLIMITED_ELEMENTS_VERSION", "1.5.8 2");15 define("UNLIMITED_ELEMENTS_VERSION", "1.5.83"); 16 16 17 17 $currentFile = __FILE__; -
unlimited-elements-for-elementor/trunk/provider/core/plugins/unlimited_elements/helper_provider_core.class.php
r2951403 r2956716 653 653 654 654 return($condition); 655 } 656 657 /* 658 * get elementor breakpoints 659 */ 660 public static function getBreakPoints($onlyCustom = true){ 661 662 $arrBreakpoints = Elementor\Plugin::$instance->breakpoints->get_breakpoints(); 663 664 if(empty($arrBreakpoints)) 665 return(array()); 666 667 $output = array(); 668 669 foreach($arrBreakpoints as $objBreakpoint){ 670 671 //$arrBreakpoint = (array)$objBreakpoint; 672 673 $name = $objBreakpoint->get_name(); 674 675 $isEnabled = $objBreakpoint->is_enabled(); 676 677 if($isEnabled == false) 678 continue; 679 680 switch($name){ 681 case "mobile": 682 case "tablet": 683 continue(2); 684 break; 685 } 686 687 $value = $objBreakpoint->get_value(); 688 689 $output = array(); 690 $output[$name] = $value; 691 } 692 693 694 return($output); 655 695 } 656 696 -
unlimited-elements-for-elementor/trunk/provider/woocommerce_integrate.class.php
r2954426 r2956716 1202 1202 if(!empty($urlImage)) 1203 1203 $imageHTML = "<img class=\"ue-mini-cart-item-image\" src=\"{$urlImage}\" >"; 1204 1205 1206 $htmlItem = "<div class=\"ue-mini-cart-item\" data-key=\"{$cart_item_key}\"> 1207 1208 <div class=\"ue-mini-cart-item-content\"> 1209 1210 <div class=\"ue-mini-cart-content-wrapper\"> 1211 <div class=\"ue-mini-cart-item-title-text\">{$item_name}</div> 1212 1213 {$imageHTML} 1214 1215 <div> 1216 <span class=\"ue_mini_qty\"> 1217 {$quantity} 1218 </span> 1219 <span class=\"ue_mini_price\"> 1220 {$priceHtml} 1221 </span> 1204 1205 $htmlItem = " 1206 <div class=\"ue-mini-cart-item\" data-key=\"{$cart_item_key}\"> 1207 {$imageHTML} 1208 <div class=\"ue-mini-cart-item-content\"> 1209 <div class=\"ue-mini-cart-content-wrapper\"> 1210 <div class=\"ue-mini-cart-item-title-text\">{$item_name}</div> 1211 <div> 1212 <span class=\"ue_mini_qty\">{$quantity} x</span> 1213 <span class=\"ue_mini_price\">{$priceHtml}</span> 1214 </div> 1215 <div class=\"ue_mini_quantity_input\"> 1216 <span class=\"ue_mini_minus\">-</span> 1217 <input class=\"ue_mini_input\" type=\"number\" value=\"{$quantity}\"/> 1218 <span class=\"ue_mini_plus\">+</span> 1219 </div> 1222 1220 </div> 1223 1224 <div class=\"ue_mini_quantity_input\"> 1225 <span class=\"ue_mini_minus\">-</span> 1226 <input class=\"ue_mini_input\" type=\"number\" value=\"{$quantity}\"/> 1227 <span class=\"ue_mini_plus\">+</span> 1228 </div> 1229 1230 </div> 1231 1232 <div class=\"ue-mini-cart-item-delete\">X</div> 1233 1234 </div> 1221 <div class=\"ue-mini-cart-item-delete\"><i class=\"far fa-trash-alt\"></i></div> 1222 </div> 1223 </div> 1224 1225 "; 1226 1235 1227 1236 </div>";1237 1238 1228 $html .= $htmlItem; 1239 1229 } -
unlimited-elements-for-elementor/trunk/readme.txt
r2954426 r2956716 1241 1241 1242 1242 1243 version 1.5.82: 1243 version 1.5.83: 2023-08-22 1244 1245 * Fix: don't show first item in filter when no terms available 1246 * Change: updated calculators javascript code base 1247 1248 1249 version 1.5.82: 2023-08-16 1244 1250 1245 1251 * Feature: added option for group filtering widgets -
unlimited-elements-for-elementor/trunk/release_log.txt
r2954426 r2956716 1 1 2 version 1.5.83: 3 4 -bug fix: don't show first item in filter when no terms available 5 -change: updated calculators javascript code base 2 6 3 7
Note: See TracChangeset
for help on using the changeset viewer.