Changeset 3444776
- Timestamp:
- 01/22/2026 11:35:20 AM (7 weeks ago)
- Location:
- unlimited-elements-for-elementor/trunk
- Files:
-
- 18 edited
-
assets_libraries/filters/ue_filters.js (modified) (3 diffs)
-
changelog.txt (modified) (1 diff)
-
inc_php/framework/google/sheets/sheet_values.class.php (modified) (1 diff)
-
inc_php/framework/settings_output.class.php (modified) (1 diff)
-
inc_php/framework/zip.class.php (modified) (2 diffs)
-
inc_php/unitecreator_addons.class.php (modified) (2 diffs)
-
inc_php/unitecreator_filters_process.class.php (modified) (1 diff)
-
inc_php/unitecreator_output.class.php (modified) (23 diffs)
-
includes.php (modified) (1 diff)
-
js/settings.js (modified) (33 diffs)
-
js/unitecreator_addon_config.js (modified) (2 diffs)
-
provider/core/unlimited_elements/gutenberg/assets/gutenberg_integrate.js (modified) (5 diffs)
-
provider/provider_params_processor.class.php (modified) (4 diffs)
-
provider/provider_params_processor_multisource.class.php (modified) (1 diff)
-
provider/provider_settings.class.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
release_log.txt (modified) (1 diff)
-
unlimited_elements.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unlimited-elements-for-elementor/trunk/assets_libraries/filters/ue_filters.js
r3442278 r3444776 1860 1860 */ 1861 1861 function getFilterElementData(objElement){ 1862 1862 1863 1863 var id = objElement.data("id"); 1864 1864 var title = objElement.data("title"); 1865 1865 var key = objElement.data("key"); 1866 1866 var type = objElement.data("type"); 1867 1868 if(!id && !key) 1869 return(null); 1870 1867 1871 1868 1872 switch(type){ … … 3636 3640 if(numItems) 3637 3641 urlAjax += "&uccount="+numItems; 3638 3642 3639 3643 if(arrTerms.length){ 3640 3644 … … 3998 4002 3999 4003 var objUrlKeys = getVal(g_filtersData, "urlkeys"); 4004 4000 4005 var taxSap = getVal(objUrlKeys, "tax_sap"); 4001 4006 if(taxSap) -
unlimited-elements-for-elementor/trunk/changelog.txt
r3442278 r3444776 2 2 3 3 == Changelog == 4 5 = 2.0.5 - 2026-01-22 = 6 7 * Fix: made some fix for wpml in main category 8 * Fix: fixed special characters in google sheets 9 * Fix: fixed filters "All" empty posts issue 10 4 11 5 12 = 2.0.4 - 2026-01-19 = -
unlimited-elements-for-elementor/trunk/inc_php/framework/google/sheets/sheet_values.class.php
r3317018 r3444776 65 65 } 66 66 67 $safeText = htmlspecialchars($rawText); 67 // Allow HTML from Sheets while stripping potentially unsafe JS. 68 $safeText = UniteFunctionsUC::sanitizeHTMLRemoveJS($rawText); 68 69 if(!empty($styles)) { 69 70 $styleAttr = htmlspecialchars(implode(";", $styles)); -
unlimited-elements-for-elementor/trunk/inc_php/framework/settings_output.class.php
r3429507 r3444776 138 138 } 139 139 140 uelm_echo(' data- default="' . esc_attr($defaultValue) . '" data-initval="' . esc_attr($value) . '" ');140 uelm_echo(' data-test="' . esc_attr($defaultValue) . '" data-default="' . esc_attr($defaultValue) . '" data-initval="' . esc_attr($value) . '" '); 141 141 142 142 $this->getGroupSelectorAddAttr($setting); -
unlimited-elements-for-elementor/trunk/inc_php/framework/zip.class.php
r3442278 r3444776 98 98 private function addItem($basePath, $path){ 99 99 100 //normalize paths - remove trailing slashes for consistent comparison101 $basePath = rtrim($basePath, "/\\");102 $path = rtrim($path, "/\\");103 104 //calculate relative path105 100 $rel_path = str_replace($basePath . "/", "", $path); 106 $rel_path = str_replace($basePath . "\\", "", $rel_path);107 108 //if still starts with basePath (Windows paths or other edge cases), use basename109 if($rel_path == $path || strpos($rel_path, $basePath) === 0){110 $rel_path = str_replace($basePath, "", $rel_path);111 $rel_path = ltrim($rel_path, "/\\");112 }113 114 //ensure relative path doesn't start with dot or slash (prevent "./file" or "/file")115 $rel_path = ltrim($rel_path, "./\\");116 101 117 102 if(is_dir($path)){ //directory … … 125 110 $files = scandir($path); 126 111 foreach($files as $file){ 127 //skip hidden files and directories (starting with dot) 128 if($file == "." || $file == ".." || $file == ".svn" || (strlen($file) > 0 && $file[0] == ".")) 112 if($file == "." || $file == ".." || $file == ".svn") 129 113 continue; 130 114 $filepath = $path . "/" . $file; -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_addons.class.php
r3442278 r3444776 596 596 597 597 $tmpAddon = $this->initAddonByData($addonData); 598 598 599 if(method_exists($tmpAddon, "getParamsDefaults")){ 600 $defaults = $tmpAddon->getParamsDefaults(); 601 } elseif(method_exists($tmpAddon, "getParamsManager") 602 && method_exists($tmpAddon->getParamsManager(), "getDefaultsAssoc")) { 603 $defaults = $tmpAddon->getParamsManager()->getDefaultsAssoc(); 604 } 605 606 // using test_slot2 for items only: 599 607 $td = $tmpAddon->getTestData(2); 600 $defaults = UniteFunctionsUC::getVal($td, "config", array());601 608 $defaultItems = UniteFunctionsUC::getVal($td, "items"); 602 603 if(empty($defaults)){ 604 if(method_exists($tmpAddon, "getParamsDefaults")){ 605 $defaults = $tmpAddon->getParamsDefaults(); 606 } elseif(method_exists($tmpAddon, "getParamsManager") 607 && method_exists($tmpAddon->getParamsManager(), "getDefaultsAssoc")) { 608 $defaults = $tmpAddon->getParamsManager()->getDefaultsAssoc(); 609 $defaults_tst = UniteFunctionsUC::getVal($td, "config", array()); 610 foreach($defaults_tst as $k => $v) { 611 if(substr($k, 0, 5) == 'post_') { 612 $defaults[$k] = $v; 609 613 } 610 614 } … … 836 840 // 1) try defaults slot #2 (saved via saveAddonDefaultsFromData) 837 841 $td = $objAddon->getTestData(2); // ['config'=>..., 'items'=>...] 838 $defaults = UniteFunctionsUC::getVal($td, "config", array());842 // using test_slot2 for items only: $defaults = UniteFunctionsUC::getVal($td, "config", array()); 839 843 $defaultItems = UniteFunctionsUC::getVal($td, "items"); 840 844 841 // 2) if slot empty take schema defaults845 // 2) if slot empty take schema defaults 842 846 if (empty($defaults)) { 843 847 if (method_exists($objAddon, "getParamsDefaults")) { -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_filters_process.class.php
r3442278 r3444776 595 595 596 596 $strTerms = UniteFunctionsUC::getVal($request, "ucterms"); 597 598 if($strTerms === "undefined:undefined") 599 $strTerms = null; 597 600 598 601 $arrOutput = array(); -
unlimited-elements-for-elementor/trunk/inc_php/unitecreator_output.class.php
r3429507 r3444776 60 60 61 61 private $htmlDebug = ""; 62 63 private $processedItemsData = false; 62 64 63 65 … … 570 572 private function ______CSS_SELECTORS_______(){} 571 573 572 /** 573 * process css selector of number param 574 */ 574 /* 575 575 private function processParamCSSSelector_number($param, $selectors){ 576 576 … … 595 595 return $style; 596 596 } 597 598 /** 599 * process css selector of background param 600 */ 597 */ 598 599 /** 600 * process css selector of number param 601 */ 602 private function processParamCSSSelector_number($param, $selectors){ 603 $value = UniteFunctionsUC::getVal($param, "value"); 604 605 $isOldFormat = is_array($value) && !empty($value); 606 607 if($isOldFormat){ 608 $values = array( 609 "desktop" => $value, 610 "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"), 611 "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"), 612 ); 613 } else { 614 $values = array( 615 "desktop" => UniteFunctionsUC::getVal($param, "value"), 616 "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"), 617 "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"), 618 ); 619 } 620 621 $style = ""; 622 623 foreach($values as $device => $value){ 624 if(empty($value) === true) 625 continue; 626 627 foreach($selectors as $selector => $selectorValue){ 628 $css = $this->prepareCSSSelectorValueCSS($selectorValue, $value); 629 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device); 630 } 631 } 632 633 return $style; 634 } 635 636 /* 601 637 private function processParamCSSSelector_background($param, $selectors){ 602 638 … … 659 695 return $style; 660 696 } 661 662 /** 663 * process css selector of border param 664 */ 697 */ 698 699 /* 700 * process css selector of background param 701 */ 702 private function processParamCSSSelector_background($param, $selectors){ 703 $name = UniteFunctionsUC::getVal($param, "name"); 704 $value = UniteFunctionsUC::getVal($param, "value"); 705 706 $isOldFormat = is_array($value) && !empty($value); 707 708 if($isOldFormat){ 709 $type = UniteFunctionsUC::getVal($value, $name . "_type"); 710 } else { 711 $type = UniteFunctionsUC::getVal($param, "background_type"); 712 $value = $param; 713 } 714 715 $selector = $this->combineCSSSelectors($selectors); 716 717 $style = ''; 718 719 switch($type){ 720 case "solid": 721 $regularFields = array( 722 $name . "_solid_color" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "color"), 723 $name . "_solid_image_attachment" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "attachment"), 724 ); 725 726 $responsiveFields = array( 727 $name . "_solid_image" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "image"), 728 $name . "_solid_image_position" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "position"), 729 $name . "_solid_image_repeat" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "repeat"), 730 $name . "_solid_image_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "size"), 731 ); 732 733 // Нужно преобразовать ключи для нового формата 734 if(!$isOldFormat){ 735 // Для нового формата ключи без префикса name 736 $regularFields = array( 737 "solid_color" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "color"), 738 "solid_image_attachment" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "attachment"), 739 ); 740 741 $responsiveFields = array( 742 "solid_bg_image" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "image"), 743 "solid_bg_image_position" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "position"), 744 "solid_bg_image_repeat" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "repeat"), 745 "solid_bg_image_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "size"), 746 ); 747 } 748 749 $style .= $this->prepareCSSSelectorFieldsStyle($regularFields, $selector, $value); 750 $style .= $this->prepareCSSSelectorResponsiveFieldsStyle($responsiveFields, $selector, $value); 751 break; 752 case "gradient": 753 // Определяем префиксы ключей в зависимости от формата 754 $prefix = $isOldFormat ? $name . "_" : ""; 755 756 $color1 = UniteFunctionsUC::getVal($value, $prefix . "gradient_color1"); 757 $stop1 = UniteFunctionsUC::getVal($value, $prefix . "gradient1_stop"); 758 $color2 = UniteFunctionsUC::getVal($value, $prefix . "gradient_color2"); 759 $stop2 = UniteFunctionsUC::getVal($value, $prefix . "gradient2_stop"); 760 $gradientType = UniteFunctionsUC::getVal($value, $prefix . "gradient_type"); 761 $angle = UniteFunctionsUC::getVal($value, $prefix . "gradient_angle"); 762 $position = UniteFunctionsUC::getVal($value, $prefix . "gradient_position"); 763 764 $stop1 = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $stop1); 765 $stop2 = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $stop2); 766 $angle = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $angle); 767 768 if($color1 !== "" && $stop1 !== "" && $color2 !== "" && $stop2 !== "" && $gradientType !== "" && $angle !== "" && $position !== ""){ 769 $selectorValue = ($gradientType === "radial") 770 ? HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "radial-gradient") 771 : HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "linear-gradient"); 772 773 $css = $this->processCSSSelectorReplaces($selectorValue, array( 774 "{{angle}}" => $angle, 775 "{{position}}" => $position, 776 "{{color1}}" => $color1, 777 "{{stop1}}" => $stop1, 778 "{{color2}}" => $color2, 779 "{{stop2}}" => $stop2, 780 )); 781 782 $style .= $this->prepareCSSSelectorStyle($selector, $css); 783 } 784 break; 785 } 786 787 return $style; 788 } 789 790 /* 665 791 private function processParamCSSSelector_border($param, $selectors){ 666 792 … … 668 794 $type = UniteFunctionsUC::getVal($value, "type", "none"); 669 795 $color = UniteFunctionsUC::getVal($value, "color", "#000000"); 796 797 // echo json_encode($param) . ' ==[2]'; 670 798 671 799 if($type === "none") … … 701 829 return $style; 702 830 } 703 704 /** 705 * process css selector of dimentions param 706 */ 831 */ 832 833 private function processParamCSSSelector_border($param, $selectors){ 834 $value = UniteFunctionsUC::getVal($param, "value"); 835 836 $isOldFormat = is_array($value) && !empty($value); 837 838 if($isOldFormat){ 839 // from block settings 840 $type = UniteFunctionsUC::getVal($value, "type", "none"); 841 $color = UniteFunctionsUC::getVal($value, "color", "#000000"); 842 } else { 843 // from block defaults 844 $type = UniteFunctionsUC::getVal($param, "border_type", "none"); 845 $color = UniteFunctionsUC::getVal($param, "border_color", "#000000"); 846 $value = $param; // для единообразия 847 } 848 849 if($type === "none") 850 return null; 851 852 $style = ""; 853 $selector = $this->combineCSSSelectors($selectors); 854 855 // border-style 856 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BORDER, "style"); 857 $css = $this->prepareCSSSelectorValueCSS($selectorValue, $type); 858 $style .= $this->prepareCSSSelectorStyle($selector, $css); 859 860 // border-color 861 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BORDER, "color"); 862 $css = $this->prepareCSSSelectorValueCSS($selectorValue, $color); 863 $style .= $this->prepareCSSSelectorStyle($selector, $css); 864 865 // border-width (responsive) 866 $widths = array(); 867 868 if($isOldFormat){ 869 $widths = array( 870 "desktop" => UniteFunctionsUC::getVal($value, "width"), 871 "tablet" => UniteFunctionsUC::getVal($value, "width_tablet"), 872 "mobile" => UniteFunctionsUC::getVal($value, "width_mobile"), 873 ); 874 } else { 875 // Новый формат: width_desktop_top, width_tablet_top, width_mobile_top 876 $widths = array( 877 "desktop" => array( 878 "top" => UniteFunctionsUC::getVal($value, "width_desktop_top"), 879 "right" => UniteFunctionsUC::getVal($value, "width_desktop_right"), 880 "bottom" => UniteFunctionsUC::getVal($value, "width_desktop_bottom"), 881 "left" => UniteFunctionsUC::getVal($value, "width_desktop_left"), 882 "unit" => "px" 883 ), 884 "tablet" => array( 885 "top" => UniteFunctionsUC::getVal($value, "width_tablet_top"), 886 "right" => UniteFunctionsUC::getVal($value, "width_tablet_right"), 887 "bottom" => UniteFunctionsUC::getVal($value, "width_tablet_bottom"), 888 "left" => UniteFunctionsUC::getVal($value, "width_tablet_left"), 889 "unit" => "px" 890 ), 891 "mobile" => array( 892 "top" => UniteFunctionsUC::getVal($value, "width_mobile_top"), 893 "right" => UniteFunctionsUC::getVal($value, "width_mobile_right"), 894 "bottom" => UniteFunctionsUC::getVal($value, "width_mobile_bottom"), 895 "left" => UniteFunctionsUC::getVal($value, "width_mobile_left"), 896 "unit" => "px" 897 ), 898 ); 899 } 900 901 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BORDER, "width"); 902 903 foreach($widths as $device => $widthValue){ 904 if(empty($widthValue) === true) 905 continue; 906 907 $css = $this->prepareCSSSelectorDimentionsCSS($selectorValue, $widthValue); 908 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device); 909 } 910 911 return $style; 912 } 913 914 /* 707 915 private function processParamCSSSelector_dimentions($param, $selectors, $type){ 708 916 … … 727 935 return $style; 728 936 } 729 730 /** 731 * process css selector of slider param 732 */ 733 private function processParamCSSSelector_slider($param, $selectors){ 734 735 $values = array( 736 "desktop" => UniteFunctionsUC::getVal($param, "value"), 737 "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"), 738 "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"), 739 ); 740 741 $style = ""; 742 743 foreach($values as $device => $value){ 744 if(empty($value) === true) 745 continue; 746 747 foreach($selectors as $selector => $selectorValue){ 748 $css = $this->prepareCSSSelectorSliderCSS($selectorValue, $value); 749 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device); 750 } 751 } 752 753 return $style; 754 } 755 756 /** 757 * process css selector of typography param 758 */ 937 */ 938 939 /** 940 * process css selector of dimentions param 941 */ 942 private function processParamCSSSelector_dimentions($param, $selectors, $type){ 943 $value = UniteFunctionsUC::getVal($param, "value"); 944 945 $isOldFormat = is_array($value) && !empty($value); 946 947 if($isOldFormat){ 948 $values = array( 949 "desktop" => $value, 950 "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"), 951 "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"), 952 ); 953 } else { 954 $values = array( 955 "desktop" => UniteFunctionsUC::getVal($param, "value"), 956 "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"), 957 "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"), 958 ); 959 } 960 961 $style = ""; 962 $selector = $this->combineCSSSelectors($selectors); 963 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam($type); 964 965 foreach($values as $device => $value){ 966 if(empty($value) === true) 967 continue; 968 969 $css = $this->prepareCSSSelectorDimentionsCSS($selectorValue, $value); 970 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device); 971 } 972 973 return $style; 974 } 975 976 /** 977 * process css selector of slider param 978 */ 979 private function processParamCSSSelector_slider($param, $selectors){ 980 $name = UniteFunctionsUC::getVal($param, "name"); 981 $value = UniteFunctionsUC::getVal($param, "value"); 982 983 $isOldFormat = is_array($value) && isset($value["size"]); 984 985 if($isOldFormat){ 986 $tabletValue = UniteFunctionsUC::getVal($param, "value_tablet"); 987 $mobileValue = UniteFunctionsUC::getVal($param, "value_mobile"); 988 989 $values = array( 990 "desktop" => $value, 991 "tablet" => is_array($tabletValue) && isset($tabletValue["size"]) ? $tabletValue : null, 992 "mobile" => is_array($mobileValue) && isset($mobileValue["size"]) ? $mobileValue : null, 993 ); 994 } else { 995 $defaultValue = UniteFunctionsUC::getVal($param, "default_value"); 996 $defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet"); 997 $defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile"); 998 999 $desktopValue = UniteFunctionsUC::getVal($param, "value"); 1000 if(empty($desktopValue) && $desktopValue !== "0") $desktopValue = $defaultValue; 1001 1002 $tabletValue = UniteFunctionsUC::getVal($param, "value_tablet"); 1003 if(empty($tabletValue) && $tabletValue !== "0") $tabletValue = $defaultValueTablet; 1004 1005 $mobileValue = UniteFunctionsUC::getVal($param, "value_mobile"); 1006 if(empty($mobileValue) && $mobileValue !== "0") $mobileValue = $defaultValueMobile; 1007 1008 $desktopUnit = UniteFunctionsUC::getVal($param, "unit"); 1009 $tabletUnit = UniteFunctionsUC::getVal($param, "unit_tablet"); 1010 $mobileUnit = UniteFunctionsUC::getVal($param, "unit_mobile"); 1011 1012 $defaultUnit = UniteFunctionsUC::getVal($param, "units"); 1013 if(empty($defaultUnit)) $defaultUnit = "px"; 1014 1015 if(strpos($defaultUnit, "_") !== false){ 1016 $unitsArray = explode("_", $defaultUnit); 1017 $defaultUnit = $unitsArray[0]; 1018 } 1019 1020 if(empty($desktopUnit)) $desktopUnit = $defaultUnit; 1021 if(empty($tabletUnit)) $tabletUnit = $desktopUnit; 1022 if(empty($mobileUnit)) $mobileUnit = $desktopUnit; 1023 1024 $values = array( 1025 "desktop" => (!empty($desktopValue) || $desktopValue === "0") ? array("size" => (int)$desktopValue, "unit" => $desktopUnit) : null, 1026 "tablet" => (!empty($tabletValue) || $tabletValue === "0") ? array("size" => (int)$tabletValue, "unit" => $tabletUnit) : null, 1027 "mobile" => (!empty($mobileValue) || $mobileValue === "0") ? array("size" => (int)$mobileValue, "unit" => $mobileUnit) : null, 1028 ); 1029 } 1030 1031 $style = ""; 1032 1033 // $style .= "/* =[12] " . json_encode($param) . " */ "; 1034 1035 foreach($values as $device => $value){ 1036 if($value === null || (is_array($value) && empty($value))) 1037 continue; 1038 1039 if(is_array($value) && (!isset($value["size"]) || $value["size"] === "")) 1040 continue; 1041 1042 foreach($selectors as $selector => $selectorValue){ 1043 $css = $this->prepareCSSSelectorSliderCSS($selectorValue, $value); 1044 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device); 1045 } 1046 } 1047 1048 return $style; 1049 } 1050 1051 /** 1052 * process css selector of typography param 1053 */ 1054 private function processParamCSSSelector_typography($param, $selectors){ 1055 $value = UniteFunctionsUC::getVal($param, "value"); 1056 1057 // Проверяем, является ли $value массивом с данными (старый формат) 1058 $isOldFormat = is_array($value) && !empty($value); 1059 1060 if(!$isOldFormat){ 1061 // Новый формат: значения прямо в $param 1062 $value = $param; 1063 } 1064 1065 $style = ""; 1066 $selector = $this->combineCSSSelectors($selectors); 1067 1068 // import font family 1069 $fontFamily = UniteFunctionsUC::getVal($value, "font_family"); 1070 1071 if(empty($fontFamily) === false){ 1072 $fontData = HelperUC::getFontPanelData(); 1073 $googleFonts = UniteFunctionsUC::getVal($fontData, "arrGoogleFonts"); 1074 1075 if(empty($googleFonts[$fontFamily]) === false){ 1076 $fontUrl = HelperHtmlUC::getGoogleFontUrl($googleFonts[$fontFamily]); 1077 1078 $this->addon->addCssInclude($fontUrl); 1079 } 1080 } 1081 1082 $regularFields = array( 1083 "font_family" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "family"), 1084 "font_style" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "style"), 1085 "font_weight" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "weight"), 1086 "text_decoration" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "decoration"), 1087 "text_transform" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "transform"), 1088 ); 1089 1090 $responsiveFields = array( 1091 "font_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "size"), 1092 "line_height" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "line-height"), 1093 "letter_spacing" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "letter-spacing"), 1094 "word_spacing" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "word-spacing"), 1095 ); 1096 1097 $style .= $this->prepareCSSSelectorFieldsStyle($regularFields, $selector, $value); 1098 $style .= $this->prepareCSSSelectorResponsiveFieldsStyle($responsiveFields, $selector, $value); 1099 1100 return $style; 1101 } 1102 1103 /* 759 1104 private function processParamCSSSelector_typography($param, $selectors){ 760 1105 … … 798 1143 return $style; 799 1144 } 800 801 /** 802 * process css selector of text shadow param 803 */ 1145 */ 1146 1147 /** 1148 * process css selector of text shadow param 1149 */ 1150 private function processParamCSSSelector_textShadow($param, $selectors){ 1151 $value = UniteFunctionsUC::getVal($param, "value"); 1152 1153 // Проверяем, является ли $value массивом с данными (старый формат) 1154 $isOldFormat = is_array($value) && !empty($value); 1155 1156 if(!$isOldFormat){ 1157 // Новый формат: значения прямо в $param 1158 $value = $param; 1159 } 1160 1161 $x = UniteFunctionsUC::getVal($value, "x"); 1162 $y = UniteFunctionsUC::getVal($value, "y"); 1163 $blur = UniteFunctionsUC::getVal($value, "blur"); 1164 $color = UniteFunctionsUC::getVal($value, "color"); 1165 1166 $x = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $x); 1167 $y = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $y); 1168 $blur = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $blur); 1169 1170 $css = ""; 1171 1172 if($x !== "" && $y !== "" && $blur !== "" && $color !== ""){ 1173 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TEXTSHADOW); 1174 1175 $css = $this->processCSSSelectorReplaces($selectorValue, array( 1176 "{{x}}" => $x, 1177 "{{y}}" => $y, 1178 "{{blur}}" => $blur, 1179 "{{color}}" => $color, 1180 )); 1181 } 1182 1183 $selector = $this->combineCSSSelectors($selectors); 1184 $style = $this->prepareCSSSelectorStyle($selector, $css); 1185 1186 return $style; 1187 } 1188 1189 /* 804 1190 private function processParamCSSSelector_textShadow($param, $selectors){ 805 1191 … … 832 1218 return $style; 833 1219 } 834 835 836 1220 */ 1221 1222 private function processParamCSSSelector_textStroke($param, $selectors){ 1223 $value = UniteFunctionsUC::getVal($param, "value"); 1224 1225 // Проверяем, является ли $value массивом с данными (старый формат) 1226 $isOldFormat = is_array($value) && !empty($value); 1227 1228 if(!$isOldFormat){ 1229 // Новый формат: значения прямо в $param 1230 $value = $param; 1231 } 1232 1233 $width = UniteFunctionsUC::getVal($value, "width"); 1234 $color = UniteFunctionsUC::getVal($value, "color"); 1235 1236 // Prepare CSS for stroke width 1237 $width = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $width); 1238 1239 $css = ""; 1240 1241 // If both width and color are available, apply the text stroke 1242 if($width !== "" && $color !== ""){ 1243 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TEXTSTROKE); 1244 1245 $css = $this->processCSSSelectorReplaces($selectorValue, array( 1246 "{{width}}" => $width, 1247 "{{color}}" => $color, 1248 )); 1249 } 1250 1251 // Combine the selectors and prepare the style 1252 $selector = $this->combineCSSSelectors($selectors); 1253 $style = $this->prepareCSSSelectorStyle($selector, $css); 1254 1255 return $style; 1256 } 1257 1258 /* 837 1259 private function processParamCSSSelector_textStroke($param, $selectors){ 838 1260 … … 861 1283 862 1284 return $style; 863 } 864 865 866 867 868 /** 869 * process css selector of box shadow param 870 */ 1285 } 1286 */ 1287 1288 /** 1289 * process css selector of box shadow param 1290 */ 1291 private function processParamCSSSelector_boxShadow($param, $selectors){ 1292 $value = UniteFunctionsUC::getVal($param, "value"); 1293 1294 // Проверяем, является ли $value массивом с данными (старый формат) 1295 $isOldFormat = is_array($value) && !empty($value); 1296 1297 if(!$isOldFormat){ 1298 // Новый формат: значения прямо в $param 1299 $value = $param; 1300 } 1301 1302 $x = UniteFunctionsUC::getVal($value, "x"); 1303 $y = UniteFunctionsUC::getVal($value, "y"); 1304 $blur = UniteFunctionsUC::getVal($value, "blur"); 1305 $spread = UniteFunctionsUC::getVal($value, "spread"); 1306 $color = UniteFunctionsUC::getVal($value, "color"); 1307 $position = UniteFunctionsUC::getVal($value, "position"); 1308 1309 $x = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $x); 1310 $y = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $y); 1311 $blur = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $blur); 1312 $spread = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $spread); 1313 1314 $css = ""; 1315 1316 if($x !== "" && $y !== "" && $blur !== "" && $spread !== "" && $color !== "" && $position !== ""){ 1317 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BOXSHADOW); 1318 1319 $css = $this->processCSSSelectorReplaces($selectorValue, array( 1320 "{{x}}" => $x, 1321 "{{y}}" => $y, 1322 "{{blur}}" => $blur, 1323 "{{spread}}" => $spread, 1324 "{{color}}" => $color, 1325 "{{position}}" => $position, 1326 )); 1327 } 1328 1329 $selector = $this->combineCSSSelectors($selectors); 1330 $style = $this->prepareCSSSelectorStyle($selector, $css); 1331 1332 return $style; 1333 } 1334 1335 /* 871 1336 private function processParamCSSSelector_boxShadow($param, $selectors){ 872 1337 … … 904 1369 return $style; 905 1370 } 906 907 /** 908 * process css selector of css filters param 909 */ 1371 */ 1372 1373 /** 1374 * process css selector of css filters param 1375 */ 1376 private function processParamCSSSelector_cssFilters($param, $selectors){ 1377 $value = UniteFunctionsUC::getVal($param, "value"); 1378 1379 // Проверяем, является ли $value массивом с данными (старый формат) 1380 $isOldFormat = is_array($value) && !empty($value); 1381 1382 if(!$isOldFormat){ 1383 // Новый формат: значения прямо в $param 1384 $value = $param; 1385 } 1386 1387 $blur = UniteFunctionsUC::getVal($value, "blur"); 1388 $brightness = UniteFunctionsUC::getVal($value, "brightness"); 1389 $contrast = UniteFunctionsUC::getVal($value, "contrast"); 1390 $saturation = UniteFunctionsUC::getVal($value, "saturation"); 1391 $hue = UniteFunctionsUC::getVal($value, "hue"); 1392 1393 $blur = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $blur); 1394 $brightness = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $brightness); 1395 $contrast = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $contrast); 1396 $saturation = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $saturation); 1397 $hue = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $hue); 1398 1399 $css = ""; 1400 1401 if($blur !== "" && $brightness !== "" && $contrast !== "" && $saturation !== "" && $hue !== ""){ 1402 $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_CSS_FILTERS); 1403 1404 $css = $this->processCSSSelectorReplaces($selectorValue, array( 1405 "{{blur}}" => $blur, 1406 "{{brightness}}" => $brightness, 1407 "{{contrast}}" => $contrast, 1408 "{{saturate}}" => $saturation, 1409 "{{hue}}" => $hue, 1410 )); 1411 } 1412 1413 $selector = $this->combineCSSSelectors($selectors); 1414 $style = $this->prepareCSSSelectorStyle($selector, $css); 1415 1416 return $style; 1417 } 1418 1419 /* 910 1420 private function processParamCSSSelector_cssFilters($param, $selectors){ 911 1421 … … 942 1452 return $style; 943 1453 } 944 945 /** 946 * process css selector based on value 947 */ 1454 */ 1455 1456 /** 1457 * process css selector based on value 1458 */ 1459 private function processParamCSSSelector_value($param, $selectors){ 1460 $value = UniteFunctionsUC::getVal($param, "value"); 1461 $name = UniteFunctionsUC::getVal($param, "name"); 1462 1463 $isOldFormat = is_array($value) && !empty($value); 1464 1465 if($isOldFormat){ 1466 $values = array( 1467 "desktop" => $value, 1468 "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"), 1469 "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"), 1470 ); 1471 } else { 1472 // Получаем значения или используем default_value 1473 $defaultValue = UniteFunctionsUC::getVal($param, "default_value"); 1474 $defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet"); 1475 $defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile"); 1476 1477 $desktopValue = UniteFunctionsUC::getVal($param, "value"); 1478 if(empty($desktopValue) && $desktopValue !== "0") $desktopValue = $defaultValue; 1479 1480 $tabletValue = UniteFunctionsUC::getVal($param, "value_tablet"); 1481 if(empty($tabletValue) && $tabletValue !== "0") $tabletValue = $defaultValueTablet; 1482 1483 $mobileValue = UniteFunctionsUC::getVal($param, "value_mobile"); 1484 if(empty($mobileValue) && $mobileValue !== "0") $mobileValue = $defaultValueMobile; 1485 1486 $values = array( 1487 "desktop" => $desktopValue, 1488 "tablet" => $tabletValue, 1489 "mobile" => $mobileValue, 1490 ); 1491 } 1492 1493 $options = UniteFunctionsUC::getVal($param, "options"); 1494 1495 if(empty($options) === false){ 1496 $phpFilter = UniteFunctionsUC::getVal($param, "php_filter_name"); 1497 1498 if(empty($phpFilter) === false) 1499 $options = array_flip($options); 1500 1501 foreach($values as $device => $value){ 1502 if(in_array($value, $options) === false) 1503 unset($values[$device]); 1504 } 1505 } 1506 1507 $style = ""; 1508 1509 // $style .= "/* " . json_encode($param) . " */ /* " . $name . ": start */ "; 1510 1511 foreach($values as $device => $value){ 1512 // Улучшенная проверка пустых значений 1513 if($value === null || $value === "") 1514 continue; 1515 1516 foreach($selectors as $selector => $selectorValue){ 1517 $css = $this->prepareCSSSelectorValueCSS($selectorValue, $value); 1518 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device); 1519 } 1520 } 1521 1522 // $style .= "/* " . $name . ": end */ "; 1523 1524 return $style; 1525 } 1526 1527 /* 948 1528 private function processParamCSSSelector_value($param, $selectors){ 949 1529 … … 985 1565 return $style; 986 1566 } 1567 */ 1568 1569 987 1570 988 1571 /** … … 1190 1773 1191 1774 foreach($selectors as $index => $selector){ 1192 $selectors[$index] = ". " . $wrapperId . " " . trim($selector);1775 $selectors[$index] = ".ue-widget-root." . $wrapperId . " " . trim($selector); 1193 1776 } 1194 1777 … … 1259 1842 foreach($params as $param){ 1260 1843 $passed = UEParamsManager::isParamPassesConditions($params, $param); 1261 if($passed === false) 1844 if($passed === false) { 1262 1845 continue; 1846 } 1847 1263 1848 1264 1849 // param's cat disabled … … 1272 1857 1273 1858 $style = $this->processParamCSSSelector($param); 1859 1274 1860 if(empty($style) === false) 1275 1861 $styles .= $style; 1276 1862 } 1277 1863 1278 // -------------------- ADVANCED -------------------- 1864 return $styles; 1865 } 1866 1867 /** 1868 * process advanced tab css selectors 1869 */ 1870 public function getAdvancedTabCssSelectors() { 1871 1872 $styles = ''; 1873 1279 1874 $wrapperId = $this->getWidgetWrapperID(); 1280 1875 $paramsTmp = $this->getAddonParams(); 1876 1877 // Get default values for advanced parameters 1878 $allParams = $this->addon->getParams(); 1879 $advancedDefaults = array(); 1880 1881 foreach($allParams as $param) { 1882 $paramName = UniteFunctionsUC::getVal($param, 'name'); 1883 1884 // Only process advanced_ parameters 1885 if (strpos($paramName, 'advanced_') === 0) { 1886 $defaultValue = UniteFunctionsUC::getVal($param, 'default_value'); 1887 1888 // Check if default value exists and is not empty 1889 if ($defaultValue !== null && $defaultValue !== '' && $defaultValue !== false) { 1890 // Only add if not already set by user 1891 $currentValue = UniteFunctionsUC::getVal($paramsTmp, $paramName); 1892 if ($currentValue === '' || $currentValue === null) { 1893 $advancedDefaults[$paramName] = $defaultValue; 1894 } 1895 } 1896 } 1897 } 1898 1899 // Merge defaults with user-set values (user values take precedence) 1900 if (!empty($advancedDefaults)) { 1901 $paramsTmp = array_merge($advancedDefaults, $paramsTmp); 1902 } 1903 1281 1904 $advanced_styles = ''; 1282 1905 … … 1554 2177 } 1555 2178 } 1556 1557 $styles .= ' /* debug 2 */'; 1558 2179 1559 2180 return $styles; 1560 2181 } … … 1629 2250 $styles .= $this->processItemsSelectors(); 1630 2251 1631 $styles .= ' /* debug 3 */';2252 $styles .= $this->getAdvancedTabCssSelectors(); 1632 2253 1633 2254 if(empty($styles) === true) 1634 2255 return null; 1635 2256 1636 // UniteProviderFunctionsUC::printCustomStyle($styles);1637 1638 2257 return $styles; 1639 2258 } 1640 2259 2260 private function getProcessedItemsData() { 2261 if(empty($this->processedItemsData)) { 2262 $this->processedItemsData = $this->addon->getProcessedItemsData($this->processType); 2263 } 2264 return $this->processedItemsData; 2265 } 2266 1641 2267 /** 1642 2268 * process items selectors … … 1647 2273 1648 2274 $items = $this->addon->getArrItemsNonProcessed(); 2275 $itemsProcessed = $this->getProcessedItemsData(); 1649 2276 $params = $this->addon->getProcessedItemsParams(); 2277 2278 // $styles = '/* =[8] ' . json_encode($items) . ' =[9] */'; 1650 2279 1651 2280 if (empty($items) === true || empty($params) === true) 1652 2281 return $styles; 1653 2282 1654 foreach($items as $item){ 1655 $itemId = UniteFunctionsUC::getVal($item, "_generated_id"); 1656 $itemParams = array(); 2283 foreach($items as $k => $item){ 2284 $itemData = $itemsProcessed[$k]['item']; 2285 $itemId = UniteFunctionsUC::getVal($itemData, "_generated_id"); 2286 $itemParams = array(); 1657 2287 1658 2288 foreach($params as $param){ … … 1664 2294 1665 2295 $itemStyles = $this->processParamsCSSSelector($itemParams); 1666 $itemStyles = $this->processCSSSelectorReplaces($itemStyles, array("{{current_item}}" => ".elementor-repeater-item-" . $itemId)); 2296 2297 $itemStyles = $this->processCSSSelectorReplaces($itemStyles, array("{{current_item}}" => ".elementor-repeater-item-" . $itemId)); 1667 2298 1668 2299 $styles .= $itemStyles; 1669 2300 1670 $styles .= ' /* debug 4 */';1671 2301 } 1672 2302 … … 2831 3461 */ 2832 3462 private function getAddonParams(){ 2833 2834 if(!empty($this->paramsCache)) 3463 if(!empty($this->paramsCache)) { 2835 3464 return($this->paramsCache); 3465 } 2836 3466 2837 3467 $this->paramsCache = $this->addon->getProcessedMainParamsValues($this->processType); 2838 3468 3469 $allParamDefs = $this->addon->getParams(); 3470 2839 3471 return($this->paramsCache); 3472 2840 3473 } 2841 3474 … … 3127 3760 3128 3761 if(is_string($dataValue) && $dataValue === "uc_items"){ 3129 $arrItemData = $this->addon->getProcessedItemsData($this->processType); 3762 // $arrItemData = $this->addon->getProcessedItemsData($this->processType); 3763 $arrItemData = $this->getProcessedItemsData(); 3130 3764 }elseif(is_array($dataValue)){ 3131 3765 $arrItemData = $dataValue; … … 3138 3772 break; 3139 3773 default: 3140 $arrItemData = $this->addon->getProcessedItemsData($this->processType); 3774 // $arrItemData = $this->addon->getProcessedItemsData($this->processType); 3775 $arrItemData = $this->getProcessedItemsData(); 3141 3776 break; 3142 3777 } -
unlimited-elements-for-elementor/trunk/includes.php
r3442278 r3444776 13 13 14 14 if(!defined("UNLIMITED_ELEMENTS_VERSION")) 15 define("UNLIMITED_ELEMENTS_VERSION", "2.0. 4");15 define("UNLIMITED_ELEMENTS_VERSION", "2.0.5"); 16 16 17 17 //disable elementor support for debugging purposes. keep it commented -
unlimited-elements-for-elementor/trunk/js/settings.js
r3429507 r3444776 17 17 18 18 var g_debug_selectors = null; 19 //var g_debug_selectors = "item_border_width"; //enter input name20 19 21 20 var g_vars = { … … 92 91 93 92 this.setCacheValues = function(values){ 94 g_temp.cacheValues = (values && typeof values === "object") ? values : {}; 93 94 if (!this._instanceCache) { 95 // local cache for this settings instance (for each repeater item) 96 this._instanceCache = {}; 97 } 98 if (values && typeof values === "object") { 99 jQuery.extend(true, this._instanceCache, values); 100 } 101 102 if (!g_temp.cacheValues || typeof g_temp.cacheValues !== "object") { 103 g_temp.cacheValues = {}; 104 } 105 if (values && typeof values === "object") { 106 jQuery.extend(true, g_temp.cacheValues, values); 107 } 95 108 }; 96 109 … … 117 130 118 131 119 this.__________OTHER_EXTERNAL__________ = function(){}; 120 132 this.__________OTHER_EXTERNAL__________ = function(){}; 121 133 122 134 /** … … 354 366 const type = getInputType(objInput); 355 367 368 // Instance cache (for repeater items) 369 if (t._instanceCache && Object.prototype.hasOwnProperty.call(t._instanceCache, name)) { 370 return forcePlannedValueByType(type, t._instanceCache[name], objInput, name); 371 } 372 373 // Global cache 356 374 if (g_temp.cacheValues && Object.prototype.hasOwnProperty.call(g_temp.cacheValues, name)) { 357 375 return forcePlannedValueByType(type, g_temp.cacheValues[name], objInput, name); … … 385 403 return(g_vars.NOT_UPDATE_OPTION); 386 404 405 if (!isInputFullyInited(objInput)) { 406 // if not inited get from cache 407 return getPlannedInitValue(objInput); 408 } 409 387 410 var flagUpdate = true; 388 411 … … 512 535 if (isInputFullyInited(objInput)) { 513 536 514 if (objInput.closest(".unite-setting-row").hasClass("unite-setting-hidden") === true) { 515 //console.log('hidden: ' + name); 537 if (objInput.closest(".unite-setting-row").hasClass("unite-setting-hidden") === true) 516 538 return; 517 }518 539 519 540 value = getSettingInputValue(objInput); … … 734 755 break; 735 756 case "repeater": 736 setRepeaterValues(objInput, null, true); 757 var repeaterName = getInputName(objInput); 758 var hasCachedData = false; 759 760 if (t._instanceCache && t._instanceCache.hasOwnProperty(repeaterName)) { 761 var cachedValue = t._instanceCache[repeaterName]; 762 hasCachedData = Array.isArray(cachedValue) && cachedValue.length > 0; 763 } else if (g_temp.cacheValues && g_temp.cacheValues.hasOwnProperty(repeaterName)) { 764 var cachedValue = g_temp.cacheValues[repeaterName]; 765 hasCachedData = Array.isArray(cachedValue) && cachedValue.length > 0; 766 } 767 768 if (!hasCachedData) { 769 setRepeaterValues(objInput, null, true); 770 } 737 771 break; 738 772 case "col_layout": … … 918 952 break; 919 953 case "repeater": 920 setRepeaterValues(objInput, value); 954 955 if (!objInput.data('repeater-inited')) { 956 initRepeater(objInput, t.onSettingChange); 957 } 958 959 setRepeaterValues(objInput, value); 921 960 break; 922 961 case "multiselect": … … 1019 1058 if (objValues.hasOwnProperty(name)) { 1020 1059 var value = objValues[name]; 1021 1022 1060 setInputValue(objInput, value, objValues); 1023 1061 } … … 1295 1333 } 1296 1334 1297 /*1298 * init input once1299 */1300 1335 function initInputOnce(objInput, funcChange){ 1301 1302 1336 if (_initedInputsOnce.has(objInput[0])) return; 1303 1337 1304 1338 if (!funcChange) 1305 1339 funcChange = t.onSettingChange; 1306 1340 1307 1341 var type = getInputType(objInput); 1308 1309 1342 var basicType = getInputBasicType(objInput); 1310 1343 … … 1314 1347 trace(objInput); 1315 1348 } 1316 1349 1317 1350 //no need to init items panel from here 1318 1351 if(type == "items"){ … … 1320 1353 return(false); 1321 1354 } 1322 1323 1355 1324 1356 // init by type … … 1415 1447 break; 1416 1448 } 1417 1418 1449 1419 1450 t.disableTriggerChange(); … … 1422 1453 const name = getInputName(objInput); 1423 1454 1424 if (!g_temp.cacheValues || typeof g_temp.cacheValues !== 'object') { 1425 g_temp.cacheValues = {}; 1455 var cacheToUse = t._instanceCache || g_temp.cacheValues; 1456 1457 if (!cacheToUse || typeof cacheToUse !== 'object') { 1458 if (!t._instanceCache) t._instanceCache = {}; 1459 cacheToUse = t._instanceCache; 1426 1460 } 1427 1461 1428 if (name && !Object.prototype.hasOwnProperty.call( g_temp.cacheValues, name)) {1462 if (name && !Object.prototype.hasOwnProperty.call(cacheToUse, name)) { 1429 1463 const plannedValue = getPlannedInitValue(objInput); 1430 1464 1431 1465 if (plannedValue !== g_vars.NOT_UPDATE_OPTION) { 1432 g_temp.cacheValues[name] = plannedValue;1466 cacheToUse[name] = plannedValue; 1433 1467 } 1434 1468 } … … 1436 1470 clearInput(objInput, "initval", "initchecked", true); 1437 1471 1438 if (name && Object.prototype.hasOwnProperty.call(g_temp.cacheValues, name)) { 1439 setInputValue(objInput, g_temp.cacheValues[name], g_temp.cacheValues); 1472 if (name && Object.prototype.hasOwnProperty.call(cacheToUse, name)) { 1473 var cachedValue = cacheToUse[name]; 1474 var inputType = getInputType(objInput); 1475 1476 if (inputType !== 'repeater' || !Array.isArray(cachedValue) || cachedValue.length !== 0) { 1477 setInputValue(objInput, cachedValue, cacheToUse); 1478 } 1440 1479 } 1441 1480 … … 1471 1510 1472 1511 let type = getInputType($input); 1473 1474 1512 if(type == 'repeater') { 1475 1513 initInputOnce($input, t.onSettingChange); … … 1766 1804 options = options || {}; 1767 1805 1806 if (!this._instanceCache) { 1807 this._instanceCache = {}; 1808 } 1809 1810 // for repeater item 1768 1811 if (options.cacheValues && typeof options.cacheValues === "object") { 1769 g_temp.cacheValues = options.cacheValues; 1770 } else { 1771 g_temp.cacheValues = {} 1812 jQuery.extend(true, this._instanceCache, options.cacheValues); 1813 } 1814 1815 // for parent block 1816 if (!options.isRepeaterItem && options.cacheValues) { 1817 if (!g_temp.cacheValues || typeof g_temp.cacheValues !== "object") { 1818 g_temp.cacheValues = {}; 1819 } 1820 jQuery.extend(true, g_temp.cacheValues, options.cacheValues); 1772 1821 } 1773 1822 … … 1813 1862 initAnimationsSelector(); 1814 1863 initGlobalEvents(); 1815 1816 1864 1817 1865 t.updateEvents(); … … 1909 1957 function getRangeSliderValue(objWrapper) { 1910 1958 var data = {}; 1911 1912 1959 data["size"] = objWrapper.find(".unite-setting-range-input").val(); 1913 1960 data["unit"] = getUnitsPickerValue(objWrapper); … … 3208 3255 3209 3256 var objType = iconPicker_getObjIconsType(type); 3210 // var isAddNew = g_ucAdmin.getVal(objType, "add_new");3211 3257 3212 3258 var htmlDialog = "<div id=\"" + dialogID + "\" class=\"unite-iconpicker-dialog unite-inputs unite-picker-type-" + type + "\" style=\"display:none\">"; … … 4063 4109 */ 4064 4110 function initItemsPanel(){ 4065 4111 4066 4112 var objItemsWrapper = g_objParent.find(".uc-setting-items-panel"); 4067 4113 if(objItemsWrapper.length == 0) … … 4280 4326 * init repeaters 4281 4327 */ 4282 function initRepeaters() {4283 var objRepeaters = g_objWrapper.find(".unite-setting-repeater");4284 4285 if (objRepeaters.length === 0) 4286 return;4287 4288 g_temp.isRepeaterExists = true;4289 }4328 function initRepeaters() { 4329 var objRepeaters = g_objWrapper.find(".unite-setting-repeater"); 4330 4331 if (objRepeaters.length === 0) 4332 return; 4333 4334 g_temp.isRepeaterExists = true; 4335 } 4290 4336 4291 4337 /** 4292 4338 * init repeater 4293 4339 */ 4294 /**4295 * init repeater4296 */4297 4340 function initRepeater(objWrapper, funcChange) { 4341 if (objWrapper.data('repeater-inited')) { 4342 return; 4343 } 4344 objWrapper.data('repeater-inited', true); 4345 4346 var name = getInputName(objWrapper); 4298 4347 4299 4348 if (objWrapper && objWrapper.sortable && typeof objWrapper.sortable === 'function') { … … 4348 4397 var cachedValue = null; 4349 4398 4350 if (g_temp.cacheValues && g_temp.cacheValues.hasOwnProperty(name)) { 4399 if (t._instanceCache && t._instanceCache.hasOwnProperty(name)) { 4400 cachedValue = t._instanceCache[name]; 4401 } else if (g_temp.cacheValues && g_temp.cacheValues.hasOwnProperty(name)) { 4351 4402 cachedValue = g_temp.cacheValues[name]; 4352 4403 } … … 4463 4514 // init item settings 4464 4515 var objSettings = new UniteSettingsUC(); 4465 objSettings.init(objItemSettingsWrapper, { cacheValues: itemValues });4516 objSettings.init(objItemSettingsWrapper, { cacheValues: itemValues, isRepeaterItem: true }); 4466 4517 objSettings.setValues && objSettings.setValues(itemValues); 4467 4468 4518 objItem.data("objsettings", objSettings); 4469 4519 … … 4557 4607 */ 4558 4608 function setRepeaterValues(objWrapper, values, useDefault) { 4609 4559 4610 destroyRepeaterItems(objWrapper); 4560 4611 … … 4600 4651 var checkedValue = objWrapper.data("checkedvalue"); 4601 4652 4602 checkedValue = g_ucAdmin.strToBool(checkedValue);4603 value = g_ucAdmin.strToBool(value);4604 4605 objWrapper.toggleClass("unite-checked", value == =checkedValue);4653 // checkedValue = g_ucAdmin.strToBool(checkedValue); 4654 // value = g_ucAdmin.strToBool(value); 4655 4656 objWrapper.toggleClass("unite-checked", value == checkedValue); 4606 4657 } 4607 4658 … … 4646 4697 */ 4647 4698 function getControlActionMultiple(parent, control, arrParents) { 4648 if (g_temp.cacheValues === null) 4649 g_temp.cacheValues = t.getSettingsValues(true); 4699 if (g_temp.cacheValues === null) { 4700 g_temp.cacheValues = t.getSettingsValues(); 4701 } 4702 4650 4703 4651 4704 var action = null; … … 4818 4871 if (isShow === true && isHidden === true) { 4819 4872 value = objInput.data("previous-value") || value; 4820 4821 4873 setInputValue(objInput, value); 4822 4874 … … 5015 5067 */ 5016 5068 function getUnitsPickerForElement(objElement) { 5017 return objElement.closest(".unite-setting-row ").find(".unite-units-picker");5069 return objElement.closest(".unite-setting-row, .unite-setting-range").find(".unite-units-picker"); 5018 5070 } 5019 5071 … … 5022 5074 */ 5023 5075 function getUnitsPickerValue(objElement) { 5024 return getUnitsPickerForElement(objElement).val() || "px";5076 return getUnitsPickerForElement(objElement).val() || "px"; 5025 5077 } 5026 5078 … … 5095 5147 break; 5096 5148 } 5097 5098 5149 5099 5150 //-- debug selector css … … 5125 5176 if (g_selectorWrapperID) { 5126 5177 let selectorId = jQuery('#' + g_selectorWrapperID + ' .ue-widget-root').attr('id'); 5127 selector = ". " + selectorId + " " + selector;5178 selector = ".ue-widget-root." + selectorId + " " + selector; 5128 5179 } 5129 5180 … … 5474 5525 5475 5526 var replaces = getInputSelectorReplaces(objInput, isDebug); 5476 5527 5477 5528 if(isDebug){ 5478 5529 trace("replacers"); -
unlimited-elements-for-elementor/trunk/js/unitecreator_addon_config.js
r3429507 r3444776 661 661 this.init = function(objWrapper, isPreviewMode){ 662 662 663 664 663 if(g_objWrapper) 665 664 throw new Error("the config is alrady inited, can't init it twice"); … … 688 687 parseInputOptions(objOptions); 689 688 689 690 690 //set settings events 691 692 691 g_objSettings.init(g_objSettingsContainer); 693 692 694 693 initEvens(); 695 694 -
unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/gutenberg/assets/gutenberg_integrate.js
r3429507 r3444776 354 354 } 355 355 356 return mapToCss(oldMap); 356 let ret = mapToCss(oldMap); 357 358 return ret; 357 359 } 358 360 … … 401 403 402 404 const mergedCss = mergeCss(prevCss, css); 403 405 404 406 $style.text(mergedCss); 405 407 lastSelectorsCssRef.current = mergedCss; … … 514 516 } 515 517 516 ucSettings.init($settingsElement); 518 // get values before init 519 var values = getSettings(); 520 521 if (values === null) { 522 try { 523 // get defaults from data-itemvalues 524 var defaultValues = {}; 525 526 $settingsElement.find('.unite-setting-repeater').each(function() { 527 var $repeater = jQuery(this); 528 var repeaterName = $repeater.attr('name') || $repeater.data('name'); 529 var defaultItems = $repeater.data('itemvalues'); 530 531 if (repeaterName && defaultItems && Array.isArray(defaultItems) && defaultItems.length > 0) { 532 defaultValues[repeaterName] = defaultItems; 533 debug('from integrate: loaded default items for', repeaterName); 534 debug(defaultItems); 535 } 536 }); 537 538 // if defaults exists then use it 539 if (Object.keys(defaultValues).length > 0) { 540 values = defaultValues; 541 } 542 543 } catch (e) { 544 console.warn('Failed to get default settings before init', e); 545 values = null; 546 } 547 } 548 549 ucSettings.init($settingsElement, { cacheValues: values }); 517 550 initedSettingsElementRef.current = elem; 518 551 … … 583 616 }); 584 617 585 var values = getSettings();586 618 if (values !== null) { 619 debug('from integrate: setting cache after init'); 620 debug(values); 587 621 ucSettings.setCacheValues(values); 588 } 622 623 // save attrs for the new block 624 if (!props.attributes.data) { 625 props.setAttributes({ data: JSON.stringify(values) }); 626 } 627 } 589 628 590 629 settingsInitedRef.current = true; … … 776 815 777 816 attachSettingsObserver(); 778 // startSettingsWatchdog();779 780 817 loadWidgetContent(); 781 818 -
unlimited-elements-for-elementor/trunk/provider/provider_params_processor.class.php
r3442278 r3444776 587 587 if(empty($mainCategoryID)) 588 588 $mainCategoryID = UniteFunctionsUC::getVal($arrMeta, "rank_math_primary_category"); 589 589 590 if (!empty($mainCategoryID)) { 591 $mainCategoryID = apply_filters('wpml_object_id', $mainCategoryID, 'category', true); 592 } 593 590 594 if(empty($mainCategoryID)){ 591 595 … … 2401 2405 2402 2406 $disableOtherHooks = UniteFunctionsUC::getVal($value, "{$name}_disable_other_hooks"); 2403 2407 2404 2408 //disable by url 2405 2409 if(GlobalsUC::$showQueryDebugByUrl == true && HelperUC::hasPermissionsFromQuery("uctestquery_clear")) 2406 2410 $disableOtherHooks = "yes"; 2407 2411 2408 2409 2412 if($disableOtherHooks === "yes" && GlobalsProviderUC::$isUnderAjax == true){ 2410 2413 … … 2447 2450 } 2448 2451 2449 2450 2452 //clear some hook by url - for debug 2451 2453 … … 2453 2455 2454 2456 $filterToDisable = HelperUC::getQueryVarWithPermission("uctestquery_clearhook"); 2455 2457 2456 2458 if(!empty($filterToDisable)){ 2457 2459 -
unlimited-elements-for-elementor/trunk/provider/provider_params_processor_multisource.class.php
r3429507 r3444776 294 294 $type = UniteFunctionsUC::getVal($params, "type"); 295 295 $data = UniteCreatorAPIIntegrations::getInstance()->getDataForMultisource($type, $params); 296 297 296 298 297 return $data; 299 298 } -
unlimited-elements-for-elementor/trunk/provider/provider_settings.class.php
r3429507 r3444776 80 80 $params["html"] = "<div class='uc-edit-template-button'><a href='javascript:void(0)' class='uc-edit-template-button__link unite-setting-special-select' data-settingtype='template_button' style='display:none' data-selectid='{$name}_templateid' target='_blank'>Edit Template</a></div>"; 81 81 82 83 84 $this->addTextBox($name."_templateid_button", "", $title , $params); 82 if(GlobalsProviderUC::$renderPlatform != GlobalsProviderUC::RENDER_PLATFORM_GUTENBERG) 83 $this->addTextBox($name."_templateid_button", "", $title , $params); 85 84 86 85 } … … 2300 2299 $params["is_multiple"] = true; 2301 2300 $params["elementor_condition"] = $arrConditionIncludeAuthor; 2302 2301 2303 2302 $this->addMultiSelect($name . "_excludeby_authors", $arrAuthors, __("Exclude By Author", "unlimited-elements-for-elementor"), "", $params); 2304 2303 -
unlimited-elements-for-elementor/trunk/readme.txt
r3442278 r3444776 940 940 941 941 == Changelog == 942 943 version 2.0.5: 944 945 946 = 2.0.5 - 2026-01-22 = 947 948 * Fix: made some fix for wpml in main category 949 * Fix: fixed special characters in google sheets 950 * Fix: fixed filters "All" empty posts issue 942 951 943 952 -
unlimited-elements-for-elementor/trunk/release_log.txt
r3442278 r3444776 1 2 3 version 2.0.5: 4 5 * Fix: made some fix for wpml in main category 6 * Fix: fixed special characters in google sheets 7 * Fix: fixed filters "All" empty posts issue 1 8 2 9 -
unlimited-elements-for-elementor/trunk/unlimited_elements.php
r3432094 r3444776 5 5 * Description: Elementor all-in-one addons pack with the best widgets for Elementor, offering 100+ free widgets, templates, and tools to create stunning websites! 6 6 * Author: Unlimited Elements 7 * Version: 2.0. 37 * Version: 2.0.5 8 8 * Author URI: http://unlimited-elements.com 9 9 * Text Domain: unlimited-elements-for-elementor
Note: See TracChangeset
for help on using the changeset viewer.