Plugin Directory

Changeset 2956716


Ignore:
Timestamp:
08/22/2023 10:51:33 AM (2 years ago)
Author:
valiano
Message:

updated to 1.5.83 version.

Location:
unlimited-elements-for-elementor/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • unlimited-elements-for-elementor/trunk/assets_libraries/filters/ue_filters.js

    r2954426 r2956716  
    32063206        bindFilterToGrid(objGrid, objFilter);
    32073207       
     3208        //set data var
     3209        if(g_showDebug == true)
     3210            objFilter.attr("data-showdebug", true);
     3211       
     3212       
    32083213        switch(type){
    32093214            case g_types.TERMS_LIST:
     
    37593764          if(!queryData)
    37603765            return(null);
    3761      
     3766         
    37623767         var objData = jQuery.parseJSON(queryData);
    37633768       
     3769         if(g_showDebug == true){
     3770             console.log("getQueryData (filter, grid, querydata): ",objFilter, objGrid, queryData);
     3771         }
     3772         
    37643773        return(objData);
    37653774    }
  • unlimited-elements-for-elementor/trunk/assets_libraries/form/uc_form.js

    r2954426 r2956716  
    11"use strict";
    22
    3 //version: 1.3
     3//version: 1.4
    44
    55function UnlimitedElementsForm(){
     
    3131   
    3232    objError.show();
    33 
     33   
    3434    var objErrorParent = objError.parents(".debug-wrapper");
    3535   
    3636    if(!objErrorParent.length)
    3737    throw new Error(consoleErrorText);   
    38 
     38   
    3939    objErrorParent.addClass("ue_error_true");
    40 
     40   
    4141    throw new Error(consoleErrorText);
    4242   
     
    4646  * get formula names
    4747  */
    48   function getFormulaNames(expr, objError){
     48  function getFormulaNames(expr, objError){ 
    4949   
    5050    var regex = /\[(.*?)\]/g;
     
    5656    names = matches.map(match => match.substring(1, match.length - 1));     
    5757   
     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   
    5884    var unmatches = expr.replace(regex, "").split(/[\[\]]/);
    5985   
     
    81107    var names = getFormulaNames(expr, objError);
    82108   
     109    if(names == undefined || names == false)
     110    return(expr);
     111   
    83112    names.forEach(function(name, index){
    84113     
     
    103132      }
    104133     
     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     
    105159      var inputValue = objInpput.val();
    106160     
    107161      //add parentheses if valus is less then 0
    108162      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;
    110168     
    111169      expr = expr.replace(name, inputValue);
     
    122180  * validate the expression
    123181  */
    124   function validateExpression(expr){     
     182  function validateExpression(expr){ 
    125183   
    126184    //allow Math.something (math js operation), numbers, float numbers, math operators, dots, comas   
     
    143201  function getResult(expr, objError) {
    144202   
    145     //if space just erase it
     203    //if space just erase it   
    146204    expr = expr.replace(/\s+/g, "");
    147205   
     
    214272    if(dataFormula == "" || dataFormula == undefined)
    215273    return(false);
    216 
     274   
    217275    //get result with numbers instead of fields name
    218276    var result = getResult(dataFormula, objError);
    219 
     277   
    220278    //format result
    221279    result = formatResultNumber(result, objCalcInput);
     
    224282    objCalcInput.val(result);
    225283   
    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)
    227288    objCalcInput.attr('readonly', '');
    228289   
     
    249310    var names = getFormulaNames(expr, objError);
    250311   
     312    if(names == undefined || names == false)
     313    return(false);
     314   
    251315    names.forEach(function(name, index){
    252316     
    253317      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      }
    256334     
    257335    });
     
    264342  function getParentCalcInput(objInput){
    265343   
    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    }
    274365   
    275366  }
     
    279370  */
    280371  function showField(objFieldWidget, classHidden){
    281    
     372    
    282373    objFieldWidget.removeClass(classHidden);
    283374   
     
    288379  */
    289380  function hideField(objFieldWidget, classHidden){
    290  
     381   
    291382    objFieldWidget.addClass(classHidden);
    292383   
     
    297388  */
    298389  function getConditions(visibilityCondition, condition, objFieldValue, fieldValue){
    299      
     390   
    300391    switch (condition) {
    301392      case "=":
     
    307398     
    308399      visibilityCondition = objFieldValue > fieldValue;
    309            
     400     
    310401      break;
    311402      case ">=":
     
    381472   
    382473    var isNamesEqual = arrNames.indexOf(inputName) != -1;
    383    
     474    
    384475    if(isNamesEqual == true){
    385476     
     
    427518      var names = getFormulaNames(formula, objError);
    428519     
     520      if(names == undefined || names == false)
     521      return(false);
     522     
    429523      names.forEach(function(name, index){
    430524       
     
    455549    var classHidden = "ucform-has-conditions";
    456550    var classError = "ue-error";
    457      
     551   
    458552    var conditions = conditionArray.visibility_conditions;
    459553    var conditionsNum = conditions.length;
     
    478572      var objField = jQuery(ueInputFieldSelector+'[name="'+fieldName+'"]');
    479573      var objFieldValue = parseInt(objField.val());
    480    
     574     
    481575      //sets the condition: "==", ">", "<" ...
    482576      var visibilityCondition = getConditions(visibilityCondition, condition, objFieldValue, fieldValue);
     
    495589      arrNames = getNames(arrNames, fieldName);
    496590     
    497       var objInputField = objFieldWidget.find(ueInputFieldSelector);
    498        
     591      var objInputField = objFieldWidget.find(ueInputFieldSelector);
     592     
    499593      equalConditionInputNameError(objInputField, arrNames, classError);
    500594     
     
    544638      setResult(objCalcInput, objError);   
    545639     
    546       //init events
    547       var objAllInputFields = jQuery(ueInputFieldSelector);
    548      
    549       //on input change trigger only parent calc number field, not all of them
    550       objAllInputFields.on('input', function(){
    551        
    552         var objInput = jQuery(this); //triggered input
    553         var objParentCalkInput = getParentCalcInput(objInput); //parent calc input with formula attr
    554        
    555         if(objParentCalkInput == null)
    556         return(false);
    557        
    558         onInputChange(objParentCalkInput);
    559        
    560       });
    561      
    562640      //set result on custom shange event
    563641      objCalcInput.on('input_calc', function(){
    564642       
    565643        var objInput = jQuery(this); //triggered input
    566  
     644       
    567645        setResult(objInput, objError);
    568646       
     
    571649    });
    572650   
    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    });
    575670   
    576671  }
  • unlimited-elements-for-elementor/trunk/assets_libraries/remote/ue-remote-controls.js

    r2937493 r2956716  
    155155       
    156156        if(num < 0)
     157            num = 0;
     158       
     159        if(!num)
     160            num = 0;
     161       
     162        if(typeof num == "undefined")
    157163            num = 0;
    158164       
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_filters_process.class.php

    r2954426 r2956716  
    19481948    private function modifyOutputTerms_addFirstItem($arrTerms, $data, $filterType){
    19491949       
     1950        //don't add first item if no terms, if no terms, no "all" as well
     1951       
    19501952        if(empty($arrTerms))
    1951             $arrTerms = array();
     1953            return(array());
    19521954       
    19531955        $addFirst = UniteFunctionsUC::getVal($data, "add_first");
     
    19571959            return($arrTerms);
    19581960       
     1961           
    19591962        $text = UniteFunctionsUC::getVal($data, "first_item_text", __("All","unlimited-elements-for-elementor"));
    19601963                   
     
    20632066   
    20642067    /**
    2065      * modify the terms for init after
     2068     * modify the terms for init after 
    20662069     */
    20672070    private function modifyOutputTerms_setNumPosts($arrTerms){
     
    20732076       
    20742077        $arrPostNums = GlobalsProviderUC::$arrTestTermIDs;
    2075            
     2078       
    20762079        foreach($arrTerms as $key => $term){
    20772080           
     
    21042107            if($isHidden == true){
    21052108                $htmlAttributes = "hidden='hidden' style='display:none'";
     2109                $htmlAttributesNew = "hidden='hidden' ";    //no style
    21062110               
    21072111                $addClass = UniteFunctionsUC::getVal($term, "addclass");
     
    21132117            $term["hidden"] = $isHidden;
    21142118            $term["html_attributes"] = $htmlAttributes;
     2119            $term["html_attributes2"] = $htmlAttributesNew;
    21152120           
    21162121            $arrTerms[$key] = $term;           
     
    23412346        $isFirstLoad = true;        //not in ajax, or with init after (also first load)
    23422347       
     2348       
    23432349        $isInsideEditor = GlobalsProviderUC::$isInsideEditor;
    23442350       
     
    23842390       
    23852391        $arrTerms = UniteFunctionsUC::getVal($data, "taxonomy");
     2392               
     2393        //modify the hidden as well
    23862394       
    23872395        $arrTerms = $this->modifyOutputTerms_setNumPosts($arrTerms, $isInitAfter, $isFirstLoad);
     
    23942402       
    23952403        $arrTerms = $this->modifyOutputTerms_modifySelectedByRequest($arrTerms);
     2404       
    23962405       
    23972406        $isFilterHidden = false;
     
    24032412                if($isInitAfter == true && !empty($limitGrayedItems) && $isUnderAjax == false)
    24042413                    $arrTerms = $this->modifyOutputTerms_tabs_modifyLimitGrayed($arrTerms, $limitGrayedItems);
    2405                    
     2414               
    24062415                $isFilterHidden = $this->modifyOutputTerms_isFilterHidden($data, $arrTerms, $isUnderAjax);
    2407                                
    24082416               
    24092417            break;
     
    24182426       
    24192427        $arrTerms = $this->modifyOutputTerms_setSelectedClass($arrTerms, $filterType);
    2420 
     2428       
    24212429        $arrTerms = $this->modifyOutputTerms_getDataAttributes($arrTerms, $filterType);
    24222430       
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_globals.class.php

    r2954426 r2956716  
    172172       
    173173        public static $enableAPIIntegration = false;
     174       
    174175        public static $enableNewDashboard = false;
    175176       
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_settings.class.php

    r2933731 r2956716  
    724724            break;
    725725            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");
    727727            break;
    728728        }
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_template_engine.class.php

    r2951403 r2956716  
    14511451               
    14521452            break;
     1453            case "get_breakpoints":
     1454               
     1455                $arrBreakpoints = HelperProviderCoreUC_EL::getBreakpoints();
     1456               
     1457                dmp("breakpoints");
     1458                dmp($arrBreakpoints);
     1459               
     1460            break;
    14531461            default:
    14541462               
  • unlimited-elements-for-elementor/trunk/includes.php

    r2954426 r2956716  
    1313
    1414if(!defined("UNLIMITED_ELEMENTS_VERSION"))
    15     define("UNLIMITED_ELEMENTS_VERSION", "1.5.82");
     15    define("UNLIMITED_ELEMENTS_VERSION", "1.5.83");
    1616
    1717$currentFile = __FILE__;
  • unlimited-elements-for-elementor/trunk/provider/core/plugins/unlimited_elements/helper_provider_core.class.php

    r2951403 r2956716  
    653653       
    654654        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);
    655695    }
    656696   
  • unlimited-elements-for-elementor/trunk/provider/woocommerce_integrate.class.php

    r2954426 r2956716  
    12021202            if(!empty($urlImage))
    12031203                $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>
    12221220      </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
    12351227 
    1236 </div>";
    1237 
    12381228            $html .= $htmlItem;
    12391229        }
  • unlimited-elements-for-elementor/trunk/readme.txt

    r2954426 r2956716  
    12411241
    12421242
    1243 version 1.5.82:
     1243version 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
     1249version 1.5.82: 2023-08-16
    12441250
    12451251* Feature: added option for group filtering widgets
  • unlimited-elements-for-elementor/trunk/release_log.txt

    r2954426 r2956716  
    11
     2version 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
    26
    37
Note: See TracChangeset for help on using the changeset viewer.