Unlimited Elements For Elementor (Free Widgets, Addons, Templates) - Version 1.4.85

Version Description

Download this release

Release Info

Developer unitecms
Plugin Icon 128x128 Unlimited Elements For Elementor (Free Widgets, Addons, Templates)
Version 1.4.85
Comparing to
See all releases

Code changes from version 1.4.80 to 1.4.85

Files changed (73) hide show
  1. assets_libraries/filters/ue_filters.js +703 -145
  2. assets_libraries/owl-carousel-new/assets/owl.carousel.css +186 -0
  3. assets_libraries/owl-carousel-new/owl.carousel.js +3448 -0
  4. assets_libraries/owl-carousel-new/owl.carousel.min.js +7 -0
  5. assets_libraries/remote/ue-remote-controls.js +1164 -0
  6. css/admin.css +2 -0
  7. css/unitecreator_styles.css +38 -4
  8. images/icon-tab.svg +7 -0
  9. inc_php/framework/font_manager.class.php +42 -5
  10. inc_php/framework/functions.class.php +102 -6
  11. inc_php/framework/helper_base.class.php +1 -0
  12. inc_php/framework/instagram/instagram_api_official.class.php +1 -0
  13. inc_php/framework/instagram/obj_item.class.php +7 -3
  14. inc_php/framework/settings.class.php +6 -1
  15. inc_php/framework/zip.class.php +2 -4
  16. inc_php/unitecreator_addon.class.php +103 -20
  17. inc_php/unitecreator_addon_config.class.php +1 -1
  18. inc_php/unitecreator_addons.class.php +2 -0
  19. inc_php/unitecreator_dialog_param.class.php +119 -73
  20. inc_php/unitecreator_filters_process.class.php +301 -47
  21. inc_php/unitecreator_helper.class.php +62 -0
  22. inc_php/unitecreator_helperhtml.class.php +174 -1
  23. inc_php/unitecreator_output.class.php +37 -6
  24. inc_php/unitecreator_params_editor.class.php +10 -1
  25. inc_php/unitecreator_params_processor.class.php +127 -28
  26. inc_php/unitecreator_settings.class.php +11 -4
  27. inc_php/unitecreator_template_engine.class.php +65 -50
  28. inc_php/unitecreator_unitegallery.class.php +24 -0
  29. includes.php +2 -1
  30. js/admin.js +2 -2
  31. js/manager/unitecreator_manager_actions_inline.js +8 -4
  32. js/manager/unitecreator_manager_cats.js +6 -1
  33. js/settings.js +15 -0
  34. js/unitecreator_params_dialog.js +62 -17
  35. js/unitecreator_params_editor.js +70 -15
  36. js/unitecreator_params_panel.js +11 -1
  37. provider/core/plugins/unlimited_elements/copy_paste.class.php +1 -6
  38. provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php +3 -0
  39. provider/core/plugins/unlimited_elements/elementor/assets/template_library_admin.js +11 -2
  40. provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.css +25 -17
  41. provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js +97 -6
  42. provider/core/plugins/unlimited_elements/elementor/assets/uc_front_admin.js +94 -2
  43. provider/core/plugins/unlimited_elements/elementor/elementor_background_widget.class.php +12 -3
  44. provider/core/plugins/unlimited_elements/elementor/elementor_content.class.php +0 -9
  45. provider/core/plugins/unlimited_elements/elementor/elementor_controls.class.php +244 -0
  46. provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php +41 -55
  47. provider/core/plugins/unlimited_elements/elementor/elementor_layout_exporter.class.php +1 -2
  48. provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +294 -80
  49. provider/core/plugins/unlimited_elements/elementor/images/widget-icon.svg +28 -0
  50. provider/core/plugins/unlimited_elements/elementor/pagination.class.php +126 -11
  51. provider/core/plugins/unlimited_elements/helper_provider_core.class.php +4 -2
  52. provider/core/plugins/unlimited_elements/plugin.php +1 -1
  53. provider/core/plugins/unlimited_elements/settings/general_settings_el.xml +13 -19
  54. provider/core/plugins/unlimited_elements/template.php +169 -0
  55. provider/functions_wordpress.class.php +15 -5
  56. provider/provider_admin.class.php +6 -5
  57. provider/provider_front.class.php +29 -0
  58. provider/provider_functions.class.php +6 -4
  59. provider/provider_helper.class.php +44 -0
  60. provider/provider_library.class.php +5 -1
  61. provider/provider_params_processor.class.php +511 -89
  62. provider/provider_settings.class.php +179 -10
  63. provider/woocommerce_integrate.class.php +270 -2
  64. readme.txt +94 -41
  65. release_log.txt +63 -0
  66. settings/addon_fields.xml +1 -0
  67. settings/library.xml +11 -3
  68. unitecreator_admin.php +7 -1
  69. unlimited_elements.php +3 -3
  70. views/addondefaults.php +2 -0
  71. views/objects/addon_view.class.php +4 -0
  72. views/objects/addon_view_childparams.class.php +52 -1
  73. views/test_settings.php +5 -3
assets_libraries/filters/ue_filters.js CHANGED
@@ -2,20 +2,26 @@
2
  function UEDynamicFilters(){
3
 
4
  var g_objFilters, g_objGrid, g_filtersData, g_urlBase;
5
- var g_urlAjax;
6
 
7
  var g_types = {
8
- CHECKBOX:"checkbox"
 
 
9
  };
10
 
11
  var g_vars = {
12
- CLASS_DIV_DEBUG:"uc-div-ajax-debug"
 
 
 
 
13
  };
14
 
15
  var g_options = {
16
- has_grid: false,
17
- ajax_reload: false,
18
- widget_name: null
19
  };
20
 
21
 
@@ -28,6 +34,26 @@ function UEDynamicFilters(){
28
 
29
  function ________GENERAL_______________(){}
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  /**
33
  * get object property
@@ -87,16 +113,49 @@ function UEDynamicFilters(){
87
  */
88
  function getClosestGrid(objSource){
89
 
90
- if(!g_objGrid)
91
- return(null);
 
92
 
93
- if(g_objGrid.length == 0)
 
 
 
94
  return(null);
95
 
 
 
 
 
96
 
97
- return(g_objGrid);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
 
 
100
  /**
101
  * add filter object to grid
102
  */
@@ -113,6 +172,67 @@ function UEDynamicFilters(){
113
 
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
 
118
  function ________FILTERS_______________(){}
@@ -123,9 +243,18 @@ function UEDynamicFilters(){
123
  */
124
  function getFilterType(objFilter){
125
 
 
 
 
126
  if(objFilter.is(":checkbox"))
127
  return(g_types.CHECKBOX);
128
 
 
 
 
 
 
 
129
  return(null);
130
  }
131
 
@@ -244,18 +373,9 @@ function UEDynamicFilters(){
244
  return(objSelected);
245
  }
246
 
 
247
  function ________PAGINATION_FILTER______(){}
248
 
249
- /**
250
- * check if the filter is pagination
251
- */
252
- function isPaginationFilter(objFilter){
253
-
254
- if(objFilter.hasClass("uc-filter-pagination"))
255
- return(true);
256
-
257
- return(false);
258
- }
259
 
260
  /**
261
  * get pagination selected url or null if is current
@@ -275,6 +395,104 @@ function UEDynamicFilters(){
275
  return(url);
276
  }
277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  function ________DATA_______________(){}
279
 
280
 
@@ -430,7 +648,242 @@ function UEDynamicFilters(){
430
 
431
  return(url);
432
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  function ________AJAX_______________(){}
435
 
436
  /**
@@ -446,15 +899,20 @@ function UEDynamicFilters(){
446
  * get the debug object
447
  */
448
  function getDebugObject(){
449
-
450
- var objDebug = g_objGrid.find("."+g_vars.CLASS_DIV_DEBUG);
 
 
 
 
 
451
 
452
  if(objDebug.length)
453
  return(objDebug);
454
 
455
  //insert if not exists
456
 
457
- g_objGrid.after("<div class='"+g_vars.CLASS_DIV_DEBUG+"' style='padding:10px;display:none;background-color:lightgray'></div>");
458
 
459
  var objDebug = jQuery("body").find("."+g_vars.CLASS_DIV_DEBUG);
460
 
@@ -467,9 +925,23 @@ function UEDynamicFilters(){
467
  */
468
  function showAjaxDebug(str){
469
 
 
 
 
 
 
 
 
 
 
 
 
470
  var objDebug = getDebugObject();
471
 
472
- if(objDebug.length == 0){
 
 
 
473
  throw new Error("debug not found");
474
  }
475
 
@@ -483,13 +955,26 @@ function UEDynamicFilters(){
483
  * small ajax request
484
  */
485
  function ajaxRequest(ajaxUrl, action, objData, onSuccess){
486
-
487
  if(!objData)
488
  var objData = {};
489
 
490
  if(typeof objData != "object")
491
  throw new Error("wrong ajax param");
492
-
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  var ajaxData = {};
494
  ajaxData["action"] = "unlimitedelements_ajax_action";
495
  ajaxData["client_action"] = action;
@@ -500,7 +985,7 @@ function UEDynamicFilters(){
500
  ajaxData["data"] = objData;
501
  ajaxtype = "post";
502
  }
503
-
504
  var ajaxOptions = {
505
  type:ajaxtype,
506
  url:ajaxUrl,
@@ -547,8 +1032,12 @@ function UEDynamicFilters(){
547
  return(false);
548
  }
549
 
550
- if(typeof onSuccess == "function")
 
 
 
551
  onSuccess(response);
 
552
 
553
  },
554
  error:function(jqXHR, textStatus, errorThrown){
@@ -576,52 +1065,68 @@ function UEDynamicFilters(){
576
  }
577
 
578
 
 
579
  /**
580
- * on ajax pagination click
581
  */
582
- function onAjaxPaginationLinkClick(event){
583
 
584
- var objLink = jQuery(this);
 
585
 
586
- var objNav = objLink.parents("nav");
587
-
588
- var objLinkCurrent = objNav.find(".current");
589
-
590
- objLinkCurrent.removeClass("current");
591
-
592
- objLink.addClass("current");
593
-
594
- var objPagination = objLink.parents(".uc-filter-pagination");
595
 
596
- var objGrid = objPagination.data("grid");
 
597
 
598
- if(!objGrid || objGrid.length == 0)
599
- throw new Error("Grid not found!");
600
-
601
- //run the ajax, prevent default
 
 
 
 
602
 
603
- refreshAjaxGrid(objGrid);
 
 
 
 
 
 
604
 
605
- event.preventDefault();
606
- return(false);
607
  }
608
 
 
609
  /**
610
- * operate the response
611
  */
612
- function operateAjaxRefreshResponse(response){
613
 
614
- alert("ajax response success!!!");
 
615
 
616
- trace(response);
 
 
 
 
 
 
 
 
 
617
 
618
  }
619
 
 
620
  /**
621
  * refresh ajax grid
622
  */
623
  function refreshAjaxGrid(objGrid){
624
-
625
  //get all grid filters
626
  var objFilters = objGrid.data("filters");
627
 
@@ -631,14 +1136,38 @@ function UEDynamicFilters(){
631
  if(objFilters.length == 0)
632
  return(false);
633
 
634
- var objAjaxOptions = getGridAjaxOptions(objFilters);
635
 
636
  if(!objAjaxOptions)
637
  return(false);
638
 
639
  var ajaxUrl = objAjaxOptions["ajax_url"];
640
 
641
- ajaxRequest(ajaxUrl,null,null, operateAjaxRefreshResponse);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
642
  }
643
 
644
 
@@ -660,73 +1189,74 @@ function UEDynamicFilters(){
660
  }
661
 
662
 
663
-
664
- /**
665
- * get element layout data
666
- */
667
- function getElementLayoutData(objElement){
668
-
669
- if(!objElement || objElement.length == 0)
670
- throw new Error("Element not found");
671
-
672
- //get widget id
673
-
674
- var objWidget = objElement.parents(".elementor-widget");
675
-
676
- if(objWidget.langth == 0)
677
- throw new Error("Element parent not found");
678
-
679
- var widgetID = objWidget.data("id");
680
-
681
- if(!widgetID)
682
- throw new Error("widget id not found");
683
-
684
- //get layout id
685
- var objLayout = objWidget.parents(".elementor");
686
-
687
- if(objLayout.length == 0)
688
- throw new Error("layout not found");
689
-
690
- var layoutID = objLayout.data("elementor-id");
691
-
692
- var output = {};
693
-
694
- output["widgetid"] = widgetID;
695
- output["layoutid"] = layoutID;
696
-
697
- return(output);
698
- }
699
-
700
-
701
  /**
702
  * get grid ajax options
703
  */
704
- function getGridAjaxOptions(objFilters){
705
 
706
  if(!objFilters)
707
  return(false);
708
 
709
  var urlAjax = g_urlBase;
710
 
 
 
 
 
 
711
  //get ajax options
712
  jQuery.each(objFilters, function(index, objFilter){
713
 
714
- var isPagination = isPaginationFilter(objFilter);
715
 
716
- if(isPagination == true){
717
- var urlPagination = getPaginationSelectedUrl(objFilter);
718
- if(urlPagination)
719
- urlAjax = urlPagination;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  }
 
 
 
 
721
 
 
 
 
 
722
  });
723
 
724
- var dataLayout = getElementLayoutData(g_objGrid);
 
 
 
725
 
726
  var widgetID = dataLayout["widgetid"];
727
  var layoutID = dataLayout["layoutid"];
728
 
729
- urlAjax += "?ucfrontajaxaction=getfiltersdata&layoutid="+layoutID+"&elid="+widgetID;
 
 
 
 
 
 
 
 
 
730
 
731
  var output = {};
732
  output["ajax_url"] = urlAjax;
@@ -751,47 +1281,27 @@ function UEDynamicFilters(){
751
 
752
  }
753
 
 
754
  /**
755
  * init listing object
756
  */
757
  function initGridObject(){
758
-
759
  //init the listing
760
- g_objGrid = jQuery(".uc-filterable-grid");
761
 
762
  if(g_objGrid.length == 0){
763
  g_objGrid = null;
764
  return(false);
765
  }
766
 
767
- //set the options
768
-
769
- //get first grid
770
  if(g_objGrid.length > 1){
771
- g_objGrid = jQuery(g_objListing[0]);
772
  }
773
-
774
- g_options.has_grid = true;
775
-
776
- //init options
777
- //var isAjax = g_objGrid.data("ajax");
778
-
779
  }
780
 
781
-
782
- /**
783
- * init grid filters
784
- */
785
- function initGridFilters(){
786
-
787
- //init the filters objects
788
- g_objFilters = jQuery(".uc-grid-filter");
789
-
790
- if(g_objFilters.length == 0){
791
- return(false);
792
- }
793
-
794
- }
795
 
796
 
797
  /**
@@ -828,16 +1338,11 @@ function UEDynamicFilters(){
828
 
829
 
830
  /**
831
- * init pagination filter
832
  */
833
- function initPaginationFilter(){
834
 
835
- var objPagination = jQuery(".uc-filter-pagination");
836
-
837
- if(objPagination.length == 0)
838
- return(false);
839
-
840
- var objGrid = getClosestGrid(objPagination);
841
 
842
  if(!objGrid)
843
  return(null);
@@ -847,21 +1352,74 @@ function UEDynamicFilters(){
847
  if(isAjax == false)
848
  return(false);
849
 
850
- //init the ajax pagination
851
-
852
  //bind grid to pagination
853
- objPagination.data("grid", objGrid);
854
 
855
  //bind pagination to grid
856
- bindFilterToGrid(objGrid, objPagination);
857
 
858
- var objLinks = objPagination.find("a");
859
- objLinks.on("click", onAjaxPaginationLinkClick);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
860
 
861
  }
862
 
863
 
864
 
 
 
865
  /**
866
  * init
867
  */
@@ -874,10 +1432,10 @@ function UEDynamicFilters(){
874
 
875
  //init the grid object
876
  initGridObject();
 
 
877
 
878
- //initGridFilters();
879
-
880
- initPaginationFilter();
881
 
882
  //clearFilters(true);
883
  //initEvents();
@@ -894,7 +1452,7 @@ function UEDynamicFilters(){
894
  trace("Filters not loaded, jQuery not loaded");
895
  return(false);
896
  }
897
-
898
  jQuery("document").ready(init);
899
 
900
  }
2
  function UEDynamicFilters(){
3
 
4
  var g_objFilters, g_objGrid, g_filtersData, g_urlBase;
5
+ var g_urlAjax, g_lastGridAjaxCall, g_cache = {};
6
 
7
  var g_types = {
8
+ CHECKBOX:"checkbox",
9
+ PAGINATION:"pagination",
10
+ LOADMORE:"loadmore"
11
  };
12
 
13
  var g_vars = {
14
+ CLASS_DIV_DEBUG:"uc-div-ajax-debug",
15
+ CLASS_GRID:"uc-filterable-grid",
16
+ DEBUG_AJAX_OPTIONS: false,
17
+ handleTrashold:null,
18
+ next_ajax_loadmore:false
19
  };
20
 
21
  var g_options = {
22
+ is_cache_enabled:true,
23
+ ajax_reload: false,
24
+ widget_name: null
25
  };
26
 
27
 
34
 
35
  function ________GENERAL_______________(){}
36
 
37
+
38
+
39
+ /**
40
+ * add url param
41
+ */
42
+ function addUrlParam(url, param, value){
43
+
44
+ if(url.indexOf("?") == -1)
45
+ url += "?";
46
+ else
47
+ url += "&";
48
+
49
+ if(typeof value == "undefined")
50
+ url += param;
51
+ else
52
+ url += param + "=" + value;
53
+
54
+ return(url);
55
+ }
56
+
57
 
58
  /**
59
  * get object property
113
  */
114
  function getClosestGrid(objSource){
115
 
116
+ //in case there is only one grid - return it
117
+ if(g_objGrid)
118
+ return(g_objGrid);
119
 
120
+ //in case there are nothing:
121
+ var objGrids = jQuery("."+ g_vars.CLASS_GRID);
122
+
123
+ if(objGrids.length == 0)
124
  return(null);
125
 
126
+ //get from current section
127
+ var objSection = objSource.parents("section");
128
+
129
+ var objGrid = objSection.find("."+ g_vars.CLASS_GRID);
130
 
131
+ if(objGrid.length == 1)
132
+ return(objGrid);
133
+
134
+ var objPrevSection = objSection;
135
+ var objNextSection = objSection;
136
+
137
+ //get from previous section
138
+ do{
139
+ objPrevSection = objPrevSection.prev();
140
+ objNextSection = objNextSection.next();
141
+
142
+ objGrid = objPrevSection.find("."+ g_vars.CLASS_GRID);
143
+ if(objGrid.length == 1)
144
+ return(objGrid);
145
+
146
+ objGrid = objNextSection.find("."+ g_vars.CLASS_GRID);
147
+ if(objGrid.length == 1)
148
+ return(objGrid);
149
+
150
+ }while(objNextSection.length != 0 && objNextSection != 0);
151
+
152
+ //return first grid in the list
153
+
154
+ var objFirstGrid = jQuery(objGrids[0]);
155
+ return(objFirstGrid);
156
  }
157
 
158
+
159
  /**
160
  * add filter object to grid
161
  */
172
 
173
  }
174
 
175
+ /**
176
+ *
177
+ * get element widget id from parent wrapper
178
+ */
179
+ function getElementWidgetID(objElement){
180
+
181
+ if(!objElement || objElement.length == 0)
182
+ throw new Error("Element not found");
183
+
184
+ //get widget id
185
+
186
+ var objWidget = objElement.parents(".elementor-widget");
187
+
188
+ if(objWidget.langth == 0)
189
+ throw new Error("Element parent not found");
190
+
191
+ var widgetID = objWidget.data("id");
192
+
193
+ if(!widgetID)
194
+ throw new Error("widget id not found");
195
+
196
+ return(widgetID);
197
+ }
198
+
199
+
200
+ /**
201
+ * get element layout data
202
+ */
203
+ function getElementLayoutData(objElement){
204
+
205
+ if(!objElement || objElement.length == 0)
206
+ throw new Error("Element not found");
207
+
208
+ //get widget id
209
+
210
+ var objWidget = objElement.parents(".elementor-widget");
211
+
212
+ if(objWidget.langth == 0)
213
+ throw new Error("Element parent not found");
214
+
215
+ var widgetID = objWidget.data("id");
216
+
217
+ if(!widgetID)
218
+ throw new Error("widget id not found");
219
+
220
+ //get layout id
221
+ var objLayout = objWidget.parents(".elementor");
222
+
223
+ if(objLayout.length == 0)
224
+ throw new Error("layout not found");
225
+
226
+ var layoutID = objLayout.data("elementor-id");
227
+
228
+ var output = {};
229
+
230
+ output["widgetid"] = widgetID;
231
+ output["layoutid"] = layoutID;
232
+
233
+ return(output);
234
+ }
235
+
236
 
237
 
238
  function ________FILTERS_______________(){}
243
  */
244
  function getFilterType(objFilter){
245
 
246
+ if(objFilter.hasClass("uc-filter-pagination"))
247
+ return(g_types.PAGINATION);
248
+
249
  if(objFilter.is(":checkbox"))
250
  return(g_types.CHECKBOX);
251
 
252
+ if(objFilter.hasClass("uc-filter-load-more"))
253
+ return(g_types.LOADMORE);
254
+
255
+ trace(objFilter);
256
+ throw new Error("wrong filter type");
257
+
258
  return(null);
259
  }
260
 
373
  return(objSelected);
374
  }
375
 
376
+
377
  function ________PAGINATION_FILTER______(){}
378
 
 
 
 
 
 
 
 
 
 
 
379
 
380
  /**
381
  * get pagination selected url or null if is current
395
  return(url);
396
  }
397
 
398
+
399
+
400
+ /**
401
+ * on ajax pagination click
402
+ */
403
+ function onAjaxPaginationLinkClick(event){
404
+
405
+ var objLink = jQuery(this);
406
+
407
+ var objPagination = objLink.parents(".uc-filter-pagination");
408
+
409
+ var objLinkCurrent = objPagination.find(".current");
410
+
411
+ objLinkCurrent.removeClass("current");
412
+
413
+ objLink.addClass("current");
414
+
415
+ var objGrid = objPagination.data("grid");
416
+
417
+ if(!objGrid || objGrid.length == 0)
418
+ throw new Error("Grid not found!");
419
+
420
+ //run the ajax, prevent default
421
+
422
+ g_vars.next_ajax_loadmore = false;
423
+
424
+ refreshAjaxGrid(objGrid);
425
+
426
+ event.preventDefault();
427
+ return(false);
428
+ }
429
+
430
+ function ________LOAD_MORE_______________(){}
431
+
432
+
433
+ /**
434
+ * get current load more page
435
+ */
436
+ function getLoadMorePage(objFilter){
437
+
438
+ var objData = objFilter.find(".uc-filter-load-more__data");
439
+
440
+ var nextPage = objData.data("nextpage");
441
+ if(!nextPage)
442
+ return(null);
443
+
444
+ return(nextPage);
445
+ }
446
+
447
+
448
+ /**
449
+ * init load more filter
450
+ */
451
+ function initLoadMoreFilter(objLoadMore){
452
+
453
+ var objData = objFilter.find(".uc-filter-load-more__data");
454
+
455
+ var isMore = objData.data("more");
456
+ if(isMore !== true)
457
+ return(false);
458
+
459
+ //check if nessesary
460
+ objLoadMore.addClass("uc-loadmore-active");
461
+ }
462
+
463
+
464
+ /**
465
+ * do the load more operation
466
+ */
467
+ function onLoadMoreClick(){
468
+
469
+ var objLink = jQuery(this);
470
+
471
+ var objLoadMore = objLink.parents(".uc-filter-load-more");
472
+
473
+ var objData = objLoadMore.find(".uc-filter-load-more__data");
474
+
475
+ var isMore = objData.data("more");
476
+
477
+ if(isMore == false)
478
+ return(false);
479
+
480
+ var objGrid = objLoadMore.data("grid");
481
+
482
+ if(!objGrid || objGrid.length == 0)
483
+ throw new Error("Grid not found!");
484
+
485
+ //run the ajax, prevent default
486
+
487
+ g_vars.next_ajax_loadmore = true;
488
+
489
+ refreshAjaxGrid(objGrid);
490
+
491
+ }
492
+
493
+
494
+
495
+
496
  function ________DATA_______________(){}
497
 
498
 
648
 
649
  return(url);
650
  }
651
+
652
+ function ________AJAX_CACHE_________(){}
653
+
654
+ /**
655
+ * get ajax url
656
+ */
657
+ function getAjaxCacheKeyFromUrl(ajaxUrl){
658
+
659
+ var key = ajaxUrl;
660
+
661
+ key = key.replace(g_urlAjax, "");
662
+ key = key.replace(g_urlBase, "");
663
+
664
+ //replace special signs
665
+ key = replaceAll(key, "/","");
666
+ key = replaceAll(key, "?","_");
667
+ key = replaceAll(key, "&","_");
668
+ key = replaceAll(key, "=","_");
669
+
670
+ return(key);
671
+ }
672
+
673
+ /**
674
+ * get ajax cache key
675
+ */
676
+ function getAjaxCacheKey(ajaxUrl, action, objData){
677
+
678
+ if(g_options.is_cache_enabled == false)
679
+ return(false);
680
+
681
+ //cache only by url meanwhile
682
+
683
+ if(jQuery.isEmptyObject(objData) == false)
684
+ return(false);
685
+
686
+ if(action)
687
+ return(false);
688
+
689
+ var cacheKey = getAjaxCacheKeyFromUrl(ajaxUrl);
690
+
691
+ if(!cacheKey)
692
+ return(false);
693
+
694
+ return(cacheKey);
695
+ }
696
+
697
+
698
+ /**
699
+ * cache ajax response
700
+ */
701
+ function cacheAjaxResponse(ajaxUrl, action, objData, response){
702
+
703
+ var cacheKey = getAjaxCacheKey(ajaxUrl, action, objData);
704
+
705
+ if(!cacheKey)
706
+ return(false);
707
+
708
+ //some precoutions for overload
709
+ if(g_cache.length > 100)
710
+ return(false);
711
+
712
+ g_cache[cacheKey] = response;
713
+
714
+ }
715
+
716
+
717
+ function ________AJAX_RESPONSE_______________(){}
718
 
719
+ /**
720
+ * replace the grid debug
721
+ */
722
+ function operateAjax_setHtmlDebug(response, objGrid){
723
+
724
+ //replace the debug
725
+ var htmlDebug = getVal(response, "html_debug");
726
+
727
+ if(!htmlDebug)
728
+ return(false);
729
+
730
+ var gridParent = objGrid.parent();
731
+
732
+ var objDebug = objGrid.siblings(".uc-debug-query-wrapper");
733
+
734
+ if(objDebug.length == 0)
735
+ return(false);
736
+
737
+ objDebug.replaceWith(htmlDebug);
738
+ }
739
+
740
+
741
+ /**
742
+ * set html grid from ajax response
743
+ */
744
+ function operateAjax_setHtmlGrid(response, objGrid){
745
+
746
+ if(objGrid.length == 0)
747
+ return(false);
748
+
749
+ objItemsWrapper = getGridItemsWrapper(objGrid);
750
+
751
+ var htmlItems = getVal(response, "html_items");
752
+
753
+ if(g_vars.next_ajax_loadmore === true){
754
+
755
+ objItemsWrapper.append(htmlItems);
756
+
757
+ }else{
758
+ objItemsWrapper.html(htmlItems);
759
+ }
760
+
761
+ operateAjax_setHtmlDebug(response, objGrid);
762
+
763
+ }
764
+
765
+
766
+ /**
767
+ * replace filters html
768
+ */
769
+ function operateAjax_setHtmlWidgets(response, objFilters){
770
+
771
+ if(!objFilters)
772
+ return(false);
773
+
774
+ if(objFilters.length == 0)
775
+ return(false);
776
+
777
+ var objHtmlWidgets = getVal(response, "html_widgets");
778
+
779
+ if(!objHtmlWidgets)
780
+ return(false);
781
+
782
+ if(objHtmlWidgets.length == 0)
783
+ return(false);
784
+
785
+ jQuery.each(objFilters, function(index, objFilter){
786
+
787
+ var widgetID = getElementWidgetID(objFilter);
788
+
789
+ if(!widgetID)
790
+ return(true);
791
+
792
+ var html = getVal(objHtmlWidgets, widgetID);
793
+
794
+ var objHtml = jQuery(html);
795
+
796
+ var htmlInner = objHtml.html();
797
+
798
+ objFilter.html(htmlInner);
799
+
800
+ objFilter.trigger("uc_ajax_reloaded");
801
+
802
+ });
803
+
804
+ }
805
+
806
+ /**
807
+ * scroll to grid top
808
+ */
809
+ function scrollToGridTop(objGrid){
810
+
811
+ var gapTop = 150;
812
+
813
+ var gridOffset = objGrid.offset().top;
814
+
815
+ var gridTop = gridOffset - gapTop;
816
+
817
+ if(gridTop < 0)
818
+ gridTop = 0;
819
+
820
+ //check if the grid top is visible
821
+
822
+ var currentPos = jQuery(window).scrollTop();
823
+
824
+ if(currentPos <= gridOffset)
825
+ return(false);
826
+
827
+ window.scrollTo({ top: gridTop, behavior: 'smooth' });
828
+
829
+ }
830
+
831
+
832
+ /**
833
+ * operate the response
834
+ */
835
+ function operateAjaxRefreshResponse(response, objGrid, objFilters){
836
+
837
+ operateAjax_setHtmlGrid(response, objGrid);
838
+
839
+ operateAjax_setHtmlWidgets(response, objFilters);
840
+
841
+ objGrid.trigger("uc_ajax_refreshed");
842
+
843
+ //scroll to top
844
+ if(g_vars.next_ajax_loadmore == false){
845
+
846
+ setTimeout(function(){
847
+
848
+ scrollToGridTop(objGrid);
849
+
850
+ },200);
851
+
852
+ }
853
+
854
+ //reset the load more setting
855
+ g_vars.next_ajax_loadmore = false;
856
+
857
+ }
858
+
859
+
860
+ /**
861
+ * replace all occurances
862
+ */
863
+ function replaceAll(text, from, to){
864
+
865
+ return text.split(from).join(to);
866
+ };
867
+
868
+
869
+
870
+
871
+ /**
872
+ * get response from ajax cache
873
+ */
874
+ function getResponseFromAjaxCache(ajaxUrl, action, objData){
875
+
876
+ var cacheKey = getAjaxCacheKey(ajaxUrl, action, objData);
877
+
878
+ if(!cacheKey)
879
+ return(false);
880
+
881
+ var response = getVal(g_cache, cacheKey);
882
+
883
+ return(response);
884
+ }
885
+
886
+
887
  function ________AJAX_______________(){}
888
 
889
  /**
899
  * get the debug object
900
  */
901
  function getDebugObject(){
902
+
903
+ var objGrid = g_lastGridAjaxCall;
904
+
905
+ if(!objGrid)
906
+ return(null);
907
+
908
+ var objDebug = objGrid.find("."+g_vars.CLASS_DIV_DEBUG);
909
 
910
  if(objDebug.length)
911
  return(objDebug);
912
 
913
  //insert if not exists
914
 
915
+ objGrid.after("<div class='"+g_vars.CLASS_DIV_DEBUG+"' style='padding:10px;display:none;background-color:#D8FCC6'></div>");
916
 
917
  var objDebug = jQuery("body").find("."+g_vars.CLASS_DIV_DEBUG);
918
 
925
  */
926
  function showAjaxDebug(str){
927
 
928
+ str = jQuery.trim(str);
929
+
930
+ if(!str || str.length == 0)
931
+ return(false);
932
+
933
+ var objStr = jQuery(str);
934
+
935
+ if(objStr.find("header").length || objStr.find("body").length){
936
+ str = "Wrong ajax response!";
937
+ }
938
+
939
  var objDebug = getDebugObject();
940
 
941
+ if(!objDebug || objDebug.length == 0){
942
+
943
+ alert(str);
944
+
945
  throw new Error("debug not found");
946
  }
947
 
955
  * small ajax request
956
  */
957
  function ajaxRequest(ajaxUrl, action, objData, onSuccess){
958
+
959
  if(!objData)
960
  var objData = {};
961
 
962
  if(typeof objData != "object")
963
  throw new Error("wrong ajax param");
964
+
965
+ //check response from cache
966
+ var responseFromCache = getResponseFromAjaxCache(ajaxUrl, action, objData);
967
+
968
+ if(responseFromCache){
969
+
970
+ //simulate ajax request
971
+ setTimeout(function(){
972
+ onSuccess(responseFromCache);
973
+ }, 300);
974
+
975
+ return(false);
976
+ }
977
+
978
  var ajaxData = {};
979
  ajaxData["action"] = "unlimitedelements_ajax_action";
980
  ajaxData["client_action"] = action;
985
  ajaxData["data"] = objData;
986
  ajaxtype = "post";
987
  }
988
+
989
  var ajaxOptions = {
990
  type:ajaxtype,
991
  url:ajaxUrl,
1032
  return(false);
1033
  }
1034
 
1035
+ cacheAjaxResponse(ajaxUrl, action, objData, response);
1036
+
1037
+ if(typeof onSuccess == "function"){
1038
+
1039
  onSuccess(response);
1040
+ }
1041
 
1042
  },
1043
  error:function(jqXHR, textStatus, errorThrown){
1065
  }
1066
 
1067
 
1068
+
1069
  /**
1070
+ * get grid items wrapper
1071
  */
1072
+ function getGridItemsWrapper(objGrid){
1073
 
1074
+ if(objGrid.hasClass("uc-items-wrapper"))
1075
+ return(objGrid);
1076
 
1077
+ var objItemsWrapper = objGrid.find(".uc-items-wrapper");
 
 
 
 
 
 
 
 
1078
 
1079
+ if(objItemsWrapper.length == 0)
1080
+ throw new Error("Missing items wrapper - with class: uc-items-wrapper");
1081
 
1082
+ return(objItemsWrapper);
1083
+ }
1084
+
1085
+
1086
+ /**
1087
+ * set ajax loader
1088
+ */
1089
+ function showAjaxLoader(objElement){
1090
 
1091
+ objElement.addClass("uc-ajax-loading");
1092
+ }
1093
+
1094
+ /**
1095
+ * hide ajax loader
1096
+ */
1097
+ function hideAjaxLoader(objElement){
1098
 
1099
+ objElement.removeClass("uc-ajax-loading");
 
1100
  }
1101
 
1102
+
1103
  /**
1104
+ * show multiple ajax loader
1105
  */
1106
+ function showMultipleAjaxLoaders(objElements, isShow){
1107
 
1108
+ if(!objElements)
1109
+ return(false);
1110
 
1111
+ if(objElements.length == 0)
1112
+ return(false);
1113
+
1114
+ jQuery.each(objElements,function(index, objElement){
1115
+
1116
+ if(isShow == true)
1117
+ showAjaxLoader(objElement);
1118
+ else
1119
+ hideAjaxLoader(objElement);
1120
+ });
1121
 
1122
  }
1123
 
1124
+
1125
  /**
1126
  * refresh ajax grid
1127
  */
1128
  function refreshAjaxGrid(objGrid){
1129
+
1130
  //get all grid filters
1131
  var objFilters = objGrid.data("filters");
1132
 
1136
  if(objFilters.length == 0)
1137
  return(false);
1138
 
1139
+ var objAjaxOptions = getGridAjaxOptions(objFilters, objGrid);
1140
 
1141
  if(!objAjaxOptions)
1142
  return(false);
1143
 
1144
  var ajaxUrl = objAjaxOptions["ajax_url"];
1145
 
1146
+ if(g_vars.DEBUG_AJAX_OPTIONS == true){
1147
+
1148
+ trace("DEBUG AJAX OPTIONS");
1149
+ trace(objAjaxOptions);
1150
+ return(false);
1151
+ }
1152
+
1153
+ //do the ajax call
1154
+ if(g_vars.next_ajax_loadmore == false)
1155
+ showAjaxLoader(objGrid);
1156
+
1157
+ showMultipleAjaxLoaders(objFilters, true);
1158
+
1159
+ g_lastGridAjaxCall = objGrid;
1160
+
1161
+ ajaxRequest(ajaxUrl,null,null, function(response){
1162
+
1163
+ if(g_vars.next_ajax_loadmore == false)
1164
+ hideAjaxLoader(objGrid);
1165
+
1166
+ showMultipleAjaxLoaders(objFilters, false);
1167
+
1168
+ operateAjaxRefreshResponse(response, objGrid, objFilters);
1169
+
1170
+ });
1171
  }
1172
 
1173
 
1189
  }
1190
 
1191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1192
  /**
1193
  * get grid ajax options
1194
  */
1195
+ function getGridAjaxOptions(objFilters, objGrid){
1196
 
1197
  if(!objFilters)
1198
  return(false);
1199
 
1200
  var urlAjax = g_urlBase;
1201
 
1202
+ var strRefreshIDs = "";
1203
+
1204
+ var urlFiltersAddition = "";
1205
+ var page = null;
1206
+
1207
  //get ajax options
1208
  jQuery.each(objFilters, function(index, objFilter){
1209
 
1210
+ var type = getFilterType(objFilter);
1211
 
1212
+ switch(type){
1213
+ case g_types.PAGINATION:
1214
+
1215
+ var urlPagination = getPaginationSelectedUrl(objFilter);
1216
+
1217
+ if(urlPagination)
1218
+ urlAjax = urlPagination;
1219
+ break;
1220
+ case g_types.LOADMORE:
1221
+
1222
+ page = getLoadMorePage(objFilter);
1223
+
1224
+ if(!page)
1225
+ urlAjax = null;
1226
+ break;
1227
+ default:
1228
+ throw new Error("Unknown filter type: "+type);
1229
+ break;
1230
  }
1231
+
1232
+ //add widget id of the filter to refresh
1233
+
1234
+ var filterWidgetID = getElementWidgetID(objFilter);
1235
 
1236
+ if(strRefreshIDs)
1237
+ strRefreshIDs += ",";
1238
+
1239
+ strRefreshIDs += filterWidgetID;
1240
  });
1241
 
1242
+ if(urlAjax == null)
1243
+ return(null);
1244
+
1245
+ var dataLayout = getElementLayoutData(objGrid);
1246
 
1247
  var widgetID = dataLayout["widgetid"];
1248
  var layoutID = dataLayout["layoutid"];
1249
 
1250
+ var urlAddition = "ucfrontajaxaction=getfiltersdata&layoutid="+layoutID+"&elid="+widgetID;
1251
+
1252
+ urlAjax = addUrlParam(urlAjax, urlAddition);
1253
+
1254
+ if(page)
1255
+ urlAjax += "&ucpage="+page;
1256
+
1257
+ //add refresh ids
1258
+ if(strRefreshIDs)
1259
+ urlAjax += "&addelids="+strRefreshIDs;
1260
 
1261
  var output = {};
1262
  output["ajax_url"] = urlAjax;
1281
 
1282
  }
1283
 
1284
+
1285
  /**
1286
  * init listing object
1287
  */
1288
  function initGridObject(){
1289
+
1290
  //init the listing
1291
+ g_objGrid = jQuery("."+ g_vars.CLASS_GRID);
1292
 
1293
  if(g_objGrid.length == 0){
1294
  g_objGrid = null;
1295
  return(false);
1296
  }
1297
 
1298
+ //set only available grid
 
 
1299
  if(g_objGrid.length > 1){
1300
+ g_objGrid = null;
1301
  }
1302
+
 
 
 
 
 
1303
  }
1304
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1305
 
1306
 
1307
  /**
1338
 
1339
 
1340
  /**
1341
+ * init filter and bing to grid
1342
  */
1343
+ function initFilter(objFilter){
1344
 
1345
+ var objGrid = getClosestGrid(objFilter);
 
 
 
 
 
1346
 
1347
  if(!objGrid)
1348
  return(null);
1352
  if(isAjax == false)
1353
  return(false);
1354
 
 
 
1355
  //bind grid to pagination
1356
+ objFilter.data("grid", objGrid);
1357
 
1358
  //bind pagination to grid
1359
+ bindFilterToGrid(objGrid, objFilter);
1360
 
1361
+ }
1362
+
1363
+ /**
1364
+ * init filter events by types
1365
+ */
1366
+ function initFilterEventsByTypes(arrTypes, objFilters){
1367
+
1368
+ if(!arrTypes || arrTypes.length == 0)
1369
+ return(false);
1370
+
1371
+ //init the events
1372
+ var objParent = objFilters.parents(".elementor");
1373
+
1374
+ for(var index in arrTypes){
1375
+ var type = arrTypes[index];
1376
+
1377
+ switch(type){
1378
+ case g_types.PAGINATION:
1379
+ objParent.on("click",".uc-filter-pagination a", onAjaxPaginationLinkClick);
1380
+ break;
1381
+ case g_types.LOADMORE:
1382
+
1383
+ //load more
1384
+ objParent.on("click",".uc-filter-load-more__link", onLoadMoreClick);
1385
+ break;
1386
+ }
1387
+ }
1388
+
1389
+ }
1390
+
1391
+
1392
+ /**
1393
+ * init pagination filter
1394
+ */
1395
+ function initFilters(){
1396
+
1397
+ var objFilters = jQuery(".uc-grid-filter,.uc-filter-pagination");
1398
+
1399
+ if(objFilters.length == 0)
1400
+ return(false);
1401
+
1402
+ var arrTypes = [];
1403
+
1404
+ jQuery.each(objFilters, function(index, filter){
1405
+
1406
+ var objFilter = jQuery(filter);
1407
+
1408
+ initFilter(objFilter);
1409
+
1410
+ var type = getFilterType(objFilter);
1411
+ arrTypes.push(type);
1412
+
1413
+ });
1414
+
1415
+ initFilterEventsByTypes(arrTypes, objFilters);
1416
 
1417
  }
1418
 
1419
 
1420
 
1421
+
1422
+
1423
  /**
1424
  * init
1425
  */
1432
 
1433
  //init the grid object
1434
  initGridObject();
1435
+
1436
+ initFilters();
1437
 
1438
+ //initLoadmoreFilters();
 
 
1439
 
1440
  //clearFilters(true);
1441
  //initEvents();
1452
  trace("Filters not loaded, jQuery not loaded");
1453
  return(false);
1454
  }
1455
+
1456
  jQuery("document").ready(init);
1457
 
1458
  }
assets_libraries/owl-carousel-new/assets/owl.carousel.css ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Owl Carousel v2.3.4
3
+ * Copyright 2013-2018 David Deutsch
4
+ * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
+ */
6
+ /*
7
+ * Owl Carousel - Core
8
+ */
9
+ .owl-carousel {
10
+ display: none;
11
+ width: 100%;
12
+ -webkit-tap-highlight-color: transparent;
13
+ /* position relative and z-index fix webkit rendering fonts issue */
14
+ position: relative;
15
+ z-index: 1; }
16
+ .owl-carousel .owl-stage {
17
+ position: relative;
18
+ -ms-touch-action: pan-Y;
19
+ touch-action: manipulation;
20
+ -moz-backface-visibility: hidden;
21
+ /* fix firefox animation glitch */ }
22
+ .owl-carousel .owl-stage:after {
23
+ content: ".";
24
+ display: block;
25
+ clear: both;
26
+ visibility: hidden;
27
+ line-height: 0;
28
+ height: 0; }
29
+ .owl-carousel .owl-stage-outer {
30
+ position: relative;
31
+ overflow: hidden;
32
+ /* fix for flashing background */
33
+ -webkit-transform: translate3d(0px, 0px, 0px); }
34
+ .owl-carousel .owl-wrapper,
35
+ .owl-carousel .owl-item {
36
+ -webkit-backface-visibility: hidden;
37
+ -moz-backface-visibility: hidden;
38
+ -ms-backface-visibility: hidden;
39
+ -webkit-transform: translate3d(0, 0, 0);
40
+ -moz-transform: translate3d(0, 0, 0);
41
+ -ms-transform: translate3d(0, 0, 0); }
42
+ .owl-carousel .owl-item {
43
+ position: relative;
44
+ min-height: 1px;
45
+ float: left;
46
+ -webkit-backface-visibility: hidden;
47
+ -webkit-tap-highlight-color: transparent;
48
+ -webkit-touch-callout: none; }
49
+ .owl-carousel .owl-item img {
50
+ display: block;
51
+ width: 100%; }
52
+ .owl-carousel .owl-nav.disabled,
53
+ .owl-carousel .owl-dots.disabled {
54
+ display: none; }
55
+ .owl-carousel .owl-nav .owl-prev,
56
+ .owl-carousel .owl-nav .owl-next,
57
+ .owl-carousel .owl-dot {
58
+ cursor: pointer;
59
+ -webkit-user-select: none;
60
+ -khtml-user-select: none;
61
+ -moz-user-select: none;
62
+ -ms-user-select: none;
63
+ user-select: none; }
64
+ .owl-carousel .owl-nav button.owl-prev,
65
+ .owl-carousel .owl-nav button.owl-next,
66
+ .owl-carousel button.owl-dot {
67
+ background: none;
68
+ color: inherit;
69
+ border: none;
70
+ padding: 0 !important;
71
+ font: inherit; }
72
+ .owl-carousel.owl-loaded {
73
+ display: block; }
74
+ .owl-carousel.owl-loading {
75
+ opacity: 0;
76
+ display: block; }
77
+ .owl-carousel.owl-hidden {
78
+ opacity: 0; }
79
+ .owl-carousel.owl-refresh .owl-item {
80
+ visibility: hidden; }
81
+ .owl-carousel.owl-drag .owl-item {
82
+ -ms-touch-action: pan-y;
83
+ touch-action: pan-y;
84
+ -webkit-user-select: none;
85
+ -moz-user-select: none;
86
+ -ms-user-select: none;
87
+ user-select: none; }
88
+ .owl-carousel.owl-grab {
89
+ cursor: move;
90
+ cursor: grab; }
91
+ .owl-carousel.owl-rtl {
92
+ direction: rtl; }
93
+ .owl-carousel.owl-rtl .owl-item {
94
+ float: right; }
95
+
96
+ /* No Js */
97
+ .no-js .owl-carousel {
98
+ display: block; }
99
+
100
+ /*
101
+ * Owl Carousel - Animate Plugin
102
+ */
103
+ .owl-carousel .animated {
104
+ animation-duration: 1000ms;
105
+ animation-fill-mode: both; }
106
+
107
+ .owl-carousel .owl-animated-in {
108
+ z-index: 0; }
109
+
110
+ .owl-carousel .owl-animated-out {
111
+ z-index: 1; }
112
+
113
+ .owl-carousel .fadeOut {
114
+ animation-name: fadeOut; }
115
+
116
+ @keyframes fadeOut {
117
+ 0% {
118
+ opacity: 1; }
119
+ 100% {
120
+ opacity: 0; } }
121
+
122
+ /*
123
+ * Owl Carousel - Auto Height Plugin
124
+ */
125
+ .owl-height {
126
+ transition: height 500ms ease-in-out; }
127
+
128
+ /*
129
+ * Owl Carousel - Lazy Load Plugin
130
+ */
131
+ .owl-carousel .owl-item {
132
+ /**
133
+ This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
134
+ calculation of the height of the owl-item that breaks page layouts
135
+ */ }
136
+ .owl-carousel .owl-item .owl-lazy {
137
+ opacity: 0;
138
+ transition: opacity 400ms ease; }
139
+ .owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
140
+ max-height: 0; }
141
+ .owl-carousel .owl-item img.owl-lazy {
142
+ transform-style: preserve-3d; }
143
+
144
+ /*
145
+ * Owl Carousel - Video Plugin
146
+ */
147
+ .owl-carousel .owl-video-wrapper {
148
+ position: relative;
149
+ height: 100%;
150
+ background: #000; }
151
+
152
+ .owl-carousel .owl-video-play-icon {
153
+ position: absolute;
154
+ height: 80px;
155
+ width: 80px;
156
+ left: 50%;
157
+ top: 50%;
158
+ margin-left: -40px;
159
+ margin-top: -40px;
160
+ background: url("owl.video.play.png") no-repeat;
161
+ cursor: pointer;
162
+ z-index: 1;
163
+ -webkit-backface-visibility: hidden;
164
+ transition: transform 100ms ease; }
165
+
166
+ .owl-carousel .owl-video-play-icon:hover {
167
+ -ms-transform: scale(1.3, 1.3);
168
+ transform: scale(1.3, 1.3); }
169
+
170
+ .owl-carousel .owl-video-playing .owl-video-tn,
171
+ .owl-carousel .owl-video-playing .owl-video-play-icon {
172
+ display: none; }
173
+
174
+ .owl-carousel .owl-video-tn {
175
+ opacity: 0;
176
+ height: 100%;
177
+ background-position: center center;
178
+ background-repeat: no-repeat;
179
+ background-size: contain;
180
+ transition: opacity 400ms ease; }
181
+
182
+ .owl-carousel .owl-video-frame {
183
+ position: relative;
184
+ z-index: 1;
185
+ height: 100%;
186
+ width: 100%; }
assets_libraries/owl-carousel-new/owl.carousel.js ADDED
@@ -0,0 +1,3448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Owl Carousel v2.3.4
3
+ * Copyright 2013-2018 David Deutsch
4
+ * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
+ */
6
+ /**
7
+ * Owl carousel
8
+ * @version 2.3.4
9
+ * @author Bartosz Wojciechowski
10
+ * @author David Deutsch
11
+ * @license The MIT License (MIT)
12
+ * @todo Lazy Load Icon
13
+ * @todo prevent animationend bubling
14
+ * @todo itemsScaleUp
15
+ * @todo Test Zepto
16
+ * @todo stagePadding calculate wrong active classes
17
+ */
18
+ ;(function($, window, document, undefined) {
19
+
20
+ /**
21
+ * Creates a carousel.
22
+ * @class The Owl Carousel.
23
+ * @public
24
+ * @param {HTMLElement|jQuery} element - The element to create the carousel for.
25
+ * @param {Object} [options] - The options
26
+ */
27
+ function Owl(element, options) {
28
+
29
+ /**
30
+ * Current settings for the carousel.
31
+ * @public
32
+ */
33
+ this.settings = null;
34
+
35
+ /**
36
+ * Current options set by the caller including defaults.
37
+ * @public
38
+ */
39
+ this.options = $.extend({}, Owl.Defaults, options);
40
+
41
+ /**
42
+ * Plugin element.
43
+ * @public
44
+ */
45
+ this.$element = $(element);
46
+
47
+ /**
48
+ * Proxied event handlers.
49
+ * @protected
50
+ */
51
+ this._handlers = {};
52
+
53
+ /**
54
+ * References to the running plugins of this carousel.
55
+ * @protected
56
+ */
57
+ this._plugins = {};
58
+
59
+ /**
60
+ * Currently suppressed events to prevent them from being retriggered.
61
+ * @protected
62
+ */
63
+ this._supress = {};
64
+
65
+ /**
66
+ * Absolute current position.
67
+ * @protected
68
+ */
69
+ this._current = null;
70
+
71
+ /**
72
+ * Animation speed in milliseconds.
73
+ * @protected
74
+ */
75
+ this._speed = null;
76
+
77
+ /**
78
+ * Coordinates of all items in pixel.
79
+ * @todo The name of this member is missleading.
80
+ * @protected
81
+ */
82
+ this._coordinates = [];
83
+
84
+ /**
85
+ * Current breakpoint.
86
+ * @todo Real media queries would be nice.
87
+ * @protected
88
+ */
89
+ this._breakpoint = null;
90
+
91
+ /**
92
+ * Current width of the plugin element.
93
+ */
94
+ this._width = null;
95
+
96
+ /**
97
+ * All real items.
98
+ * @protected
99
+ */
100
+ this._items = [];
101
+
102
+ /**
103
+ * All cloned items.
104
+ * @protected
105
+ */
106
+ this._clones = [];
107
+
108
+ /**
109
+ * Merge values of all items.
110
+ * @todo Maybe this could be part of a plugin.
111
+ * @protected
112
+ */
113
+ this._mergers = [];
114
+
115
+ /**
116
+ * Widths of all items.
117
+ */
118
+ this._widths = [];
119
+
120
+ /**
121
+ * Invalidated parts within the update process.
122
+ * @protected
123
+ */
124
+ this._invalidated = {};
125
+
126
+ /**
127
+ * Ordered list of workers for the update process.
128
+ * @protected
129
+ */
130
+ this._pipe = [];
131
+
132
+ /**
133
+ * Current state information for the drag operation.
134
+ * @todo #261
135
+ * @protected
136
+ */
137
+ this._drag = {
138
+ time: null,
139
+ target: null,
140
+ pointer: null,
141
+ stage: {
142
+ start: null,
143
+ current: null
144
+ },
145
+ direction: null
146
+ };
147
+
148
+ /**
149
+ * Current state information and their tags.
150
+ * @type {Object}
151
+ * @protected
152
+ */
153
+ this._states = {
154
+ current: {},
155
+ tags: {
156
+ 'initializing': [ 'busy' ],
157
+ 'animating': [ 'busy' ],
158
+ 'dragging': [ 'interacting' ]
159
+ }
160
+ };
161
+
162
+ $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
163
+ this._handlers[handler] = $.proxy(this[handler], this);
164
+ }, this));
165
+
166
+ $.each(Owl.Plugins, $.proxy(function(key, plugin) {
167
+ this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
168
+ = new plugin(this);
169
+ }, this));
170
+
171
+ $.each(Owl.Workers, $.proxy(function(priority, worker) {
172
+ this._pipe.push({
173
+ 'filter': worker.filter,
174
+ 'run': $.proxy(worker.run, this)
175
+ });
176
+ }, this));
177
+
178
+ this.setup();
179
+ this.initialize();
180
+ }
181
+
182
+ /**
183
+ * Default options for the carousel.
184
+ * @public
185
+ */
186
+ Owl.Defaults = {
187
+ items: 3,
188
+ loop: false,
189
+ center: false,
190
+ rewind: false,
191
+ checkVisibility: true,
192
+
193
+ mouseDrag: true,
194
+ touchDrag: true,
195
+ pullDrag: true,
196
+ freeDrag: false,
197
+
198
+ margin: 0,
199
+ stagePadding: 0,
200
+
201
+ merge: false,
202
+ mergeFit: true,
203
+ autoWidth: false,
204
+
205
+ startPosition: 0,
206
+ rtl: false,
207
+
208
+ smartSpeed: 250,
209
+ fluidSpeed: false,
210
+ dragEndSpeed: false,
211
+
212
+ responsive: {},
213
+ responsiveRefreshRate: 200,
214
+ responsiveBaseElement: window,
215
+
216
+ fallbackEasing: 'swing',
217
+ slideTransition: '',
218
+
219
+ info: false,
220
+
221
+ nestedItemSelector: false,
222
+ itemElement: 'div',
223
+ stageElement: 'div',
224
+
225
+ refreshClass: 'owl-refresh',
226
+ loadedClass: 'owl-loaded',
227
+ loadingClass: 'owl-loading',
228
+ rtlClass: 'owl-rtl',
229
+ responsiveClass: 'owl-responsive',
230
+ dragClass: 'owl-drag',
231
+ itemClass: 'owl-item',
232
+ stageClass: 'owl-stage',
233
+ stageOuterClass: 'owl-stage-outer',
234
+ grabClass: 'owl-grab'
235
+ };
236
+
237
+ /**
238
+ * Enumeration for width.
239
+ * @public
240
+ * @readonly
241
+ * @enum {String}
242
+ */
243
+ Owl.Width = {
244
+ Default: 'default',
245
+ Inner: 'inner',
246
+ Outer: 'outer'
247
+ };
248
+
249
+ /**
250
+ * Enumeration for types.
251
+ * @public
252
+ * @readonly
253
+ * @enum {String}
254
+ */
255
+ Owl.Type = {
256
+ Event: 'event',
257
+ State: 'state'
258
+ };
259
+
260
+ /**
261
+ * Contains all registered plugins.
262
+ * @public
263
+ */
264
+ Owl.Plugins = {};
265
+
266
+ /**
267
+ * List of workers involved in the update process.
268
+ */
269
+ Owl.Workers = [ {
270
+ filter: [ 'width', 'settings' ],
271
+ run: function() {
272
+ this._width = this.$element.width();
273
+ }
274
+ }, {
275
+ filter: [ 'width', 'items', 'settings' ],
276
+ run: function(cache) {
277
+ cache.current = this._items && this._items[this.relative(this._current)];
278
+ }
279
+ }, {
280
+ filter: [ 'items', 'settings' ],
281
+ run: function() {
282
+ this.$stage.children('.cloned').remove();
283
+ }
284
+ }, {
285
+ filter: [ 'width', 'items', 'settings' ],
286
+ run: function(cache) {
287
+ var margin = this.settings.margin || '',
288
+ grid = !this.settings.autoWidth,
289
+ rtl = this.settings.rtl,
290
+ css = {
291
+ 'width': 'auto',
292
+ 'margin-left': rtl ? margin : '',
293
+ 'margin-right': rtl ? '' : margin
294
+ };
295
+
296
+ !grid && this.$stage.children().css(css);
297
+
298
+ cache.css = css;
299
+ }
300
+ }, {
301
+ filter: [ 'width', 'items', 'settings' ],
302
+ run: function(cache) {
303
+ var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
304
+ merge = null,
305
+ iterator = this._items.length,
306
+ grid = !this.settings.autoWidth,
307
+ widths = [];
308
+
309
+ cache.items = {
310
+ merge: false,
311
+ width: width
312
+ };
313
+
314
+ while (iterator--) {
315
+ merge = this._mergers[iterator];
316
+ merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
317
+
318
+ cache.items.merge = merge > 1 || cache.items.merge;
319
+
320
+ widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
321
+ }
322
+
323
+ this._widths = widths;
324
+ }
325
+ }, {
326
+ filter: [ 'items', 'settings' ],
327
+ run: function() {
328
+ var clones = [],
329
+ items = this._items,
330
+ settings = this.settings,
331
+ // TODO: Should be computed from number of min width items in stage
332
+ view = Math.max(settings.items * 2, 4),
333
+ size = Math.ceil(items.length / 2) * 2,
334
+ repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
335
+ append = '',
336
+ prepend = '';
337
+
338
+ repeat /= 2;
339
+
340
+ while (repeat > 0) {
341
+ // Switch to only using appended clones
342
+ clones.push(this.normalize(clones.length / 2, true));
343
+ append = append + items[clones[clones.length - 1]][0].outerHTML;
344
+ clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
345
+ prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
346
+ repeat -= 1;
347
+ }
348
+
349
+ this._clones = clones;
350
+
351
+ $(append).addClass('cloned').appendTo(this.$stage);
352
+ $(prepend).addClass('cloned').prependTo(this.$stage);
353
+ }
354
+ }, {
355
+ filter: [ 'width', 'items', 'settings' ],
356
+ run: function() {
357
+ var rtl = this.settings.rtl ? 1 : -1,
358
+ size = this._clones.length + this._items.length,
359
+ iterator = -1,
360
+ previous = 0,
361
+ current = 0,
362
+ coordinates = [];
363
+
364
+ while (++iterator < size) {
365
+ previous = coordinates[iterator - 1] || 0;
366
+ current = this._widths[this.relative(iterator)] + this.settings.margin;
367
+ coordinates.push(previous + current * rtl);
368
+ }
369
+
370
+ this._coordinates = coordinates;
371
+ }
372
+ }, {
373
+ filter: [ 'width', 'items', 'settings' ],
374
+ run: function() {
375
+ var padding = this.settings.stagePadding,
376
+ coordinates = this._coordinates,
377
+ css = {
378
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
379
+ 'padding-left': padding || '',
380
+ 'padding-right': padding || ''
381
+ };
382
+
383
+ this.$stage.css(css);
384
+ }
385
+ }, {
386
+ filter: [ 'width', 'items', 'settings' ],
387
+ run: function(cache) {
388
+ var iterator = this._coordinates.length,
389
+ grid = !this.settings.autoWidth,
390
+ items = this.$stage.children();
391
+
392
+ if (grid && cache.items.merge) {
393
+ while (iterator--) {
394
+ cache.css.width = this._widths[this.relative(iterator)];
395
+ items.eq(iterator).css(cache.css);
396
+ }
397
+ } else if (grid) {
398
+ cache.css.width = cache.items.width;
399
+ items.css(cache.css);
400
+ }
401
+ }
402
+ }, {
403
+ filter: [ 'items' ],
404
+ run: function() {
405
+ this._coordinates.length < 1 && this.$stage.removeAttr('style');
406
+ }
407
+ }, {
408
+ filter: [ 'width', 'items', 'settings' ],
409
+ run: function(cache) {
410
+ cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
411
+ cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
412
+ this.reset(cache.current);
413
+ }
414
+ }, {
415
+ filter: [ 'position' ],
416
+ run: function() {
417
+ this.animate(this.coordinates(this._current));
418
+ }
419
+ }, {
420
+ filter: [ 'width', 'position', 'items', 'settings' ],
421
+ run: function() {
422
+ var rtl = this.settings.rtl ? 1 : -1,
423
+ padding = this.settings.stagePadding * 2,
424
+ begin = this.coordinates(this.current()) + padding,
425
+ end = begin + this.width() * rtl,
426
+ inner, outer, matches = [], i, n;
427
+
428
+ for (i = 0, n = this._coordinates.length; i < n; i++) {
429
+ inner = this._coordinates[i - 1] || 0;
430
+ outer = Math.abs(this._coordinates[i]) + padding * rtl;
431
+
432
+ if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
433
+ || (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
434
+ matches.push(i);
435
+ }
436
+ }
437
+
438
+ this.$stage.children('.active').removeClass('active');
439
+ this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
440
+
441
+ this.$stage.children('.center').removeClass('center');
442
+ if (this.settings.center) {
443
+ this.$stage.children().eq(this.current()).addClass('center');
444
+ }
445
+ }
446
+ } ];
447
+
448
+ /**
449
+ * Create the stage DOM element
450
+ */
451
+ Owl.prototype.initializeStage = function() {
452
+ this.$stage = this.$element.find('.' + this.settings.stageClass);
453
+
454
+ // if the stage is already in the DOM, grab it and skip stage initialization
455
+ if (this.$stage.length) {
456
+ return;
457
+ }
458
+
459
+ this.$element.addClass(this.options.loadingClass);
460
+
461
+ // create stage
462
+ this.$stage = $('<' + this.settings.stageElement + '>', {
463
+ "class": this.settings.stageClass
464
+ }).wrap( $( '<div/>', {
465
+ "class": this.settings.stageOuterClass
466
+ }));
467
+
468
+ // append stage
469
+ this.$element.append(this.$stage.parent());
470
+ };
471
+
472
+ /**
473
+ * Create item DOM elements
474
+ */
475
+ Owl.prototype.initializeItems = function() {
476
+ var $items = this.$element.find('.owl-item');
477
+
478
+ // if the items are already in the DOM, grab them and skip item initialization
479
+ if ($items.length) {
480
+ this._items = $items.get().map(function(item) {
481
+ return $(item);
482
+ });
483
+
484
+ this._mergers = this._items.map(function() {
485
+ return 1;
486
+ });
487
+
488
+ this.refresh();
489
+
490
+ return;
491
+ }
492
+
493
+ // append content
494
+ this.replace(this.$element.children().not(this.$stage.parent()));
495
+
496
+ // check visibility
497
+ if (this.isVisible()) {
498
+ // update view
499
+ this.refresh();
500
+ } else {
501
+ // invalidate width
502
+ this.invalidate('width');
503
+ }
504
+
505
+ this.$element
506
+ .removeClass(this.options.loadingClass)
507
+ .addClass(this.options.loadedClass);
508
+ };
509
+
510
+ /**
511
+ * Initializes the carousel.
512
+ * @protected
513
+ */
514
+ Owl.prototype.initialize = function() {
515
+ this.enter('initializing');
516
+ this.trigger('initialize');
517
+
518
+ this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
519
+
520
+ if (this.settings.autoWidth && !this.is('pre-loading')) {
521
+ var imgs, nestedSelector, width;
522
+ imgs = this.$element.find('img');
523
+ nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
524
+ width = this.$element.children(nestedSelector).width();
525
+
526
+ if (imgs.length && width <= 0) {
527
+ this.preloadAutoWidthImages(imgs);
528
+ }
529
+ }
530
+
531
+ this.initializeStage();
532
+ this.initializeItems();
533
+
534
+ // register event handlers
535
+ this.registerEventHandlers();
536
+
537
+ this.leave('initializing');
538
+ this.trigger('initialized');
539
+ };
540
+
541
+ /**
542
+ * @returns {Boolean} visibility of $element
543
+ * if you know the carousel will always be visible you can set `checkVisibility` to `false` to
544
+ * prevent the expensive browser layout forced reflow the $element.is(':visible') does
545
+ */
546
+ Owl.prototype.isVisible = function() {
547
+ return this.settings.checkVisibility
548
+ ? this.$element.is(':visible')
549
+ : true;
550
+ };
551
+
552
+ /**
553
+ * Setups the current settings.
554
+ * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
555
+ * @todo Support for media queries by using `matchMedia` would be nice.
556
+ * @public
557
+ */
558
+ Owl.prototype.setup = function() {
559
+ var viewport = this.viewport(),
560
+ overwrites = this.options.responsive,
561
+ match = -1,
562
+ settings = null;
563
+
564
+ if (!overwrites) {
565
+ settings = $.extend({}, this.options);
566
+ } else {
567
+ $.each(overwrites, function(breakpoint) {
568
+ if (breakpoint <= viewport && breakpoint > match) {
569
+ match = Number(breakpoint);
570
+ }
571
+ });
572
+
573
+ settings = $.extend({}, this.options, overwrites[match]);
574
+ if (typeof settings.stagePadding === 'function') {
575
+ settings.stagePadding = settings.stagePadding();
576
+ }
577
+ delete settings.responsive;
578
+
579
+ // responsive class
580
+ if (settings.responsiveClass) {
581
+ this.$element.attr('class',
582
+ this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
583
+ );
584
+ }
585
+ }
586
+
587
+ this.trigger('change', { property: { name: 'settings', value: settings } });
588
+ this._breakpoint = match;
589
+ this.settings = settings;
590
+ this.invalidate('settings');
591
+ this.trigger('changed', { property: { name: 'settings', value: this.settings } });
592
+ };
593
+
594
+ /**
595
+ * Updates option logic if necessery.
596
+ * @protected
597
+ */
598
+ Owl.prototype.optionsLogic = function() {
599
+ if (this.settings.autoWidth) {
600
+ this.settings.stagePadding = false;
601
+ this.settings.merge = false;
602
+ }
603
+ };
604
+
605
+ /**
606
+ * Prepares an item before add.
607
+ * @todo Rename event parameter `content` to `item`.
608
+ * @protected
609
+ * @returns {jQuery|HTMLElement} - The item container.
610
+ */
611
+ Owl.prototype.prepare = function(item) {
612
+ var event = this.trigger('prepare', { content: item });
613
+
614
+ if (!event.data) {
615
+ event.data = $('<' + this.settings.itemElement + '/>')
616
+ .addClass(this.options.itemClass).append(item)
617
+ }
618
+
619
+ this.trigger('prepared', { content: event.data });
620
+
621
+ return event.data;
622
+ };
623
+
624
+ /**
625
+ * Updates the view.
626
+ * @public
627
+ */
628
+ Owl.prototype.update = function() {
629
+ var i = 0,
630
+ n = this._pipe.length,
631
+ filter = $.proxy(function(p) { return this[p] }, this._invalidated),
632
+ cache = {};
633
+
634
+ while (i < n) {
635
+ if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
636
+ this._pipe[i].run(cache);
637
+ }
638
+ i++;
639
+ }
640
+
641
+ this._invalidated = {};
642
+
643
+ !this.is('valid') && this.enter('valid');
644
+ };
645
+
646
+ /**
647
+ * Gets the width of the view.
648
+ * @public
649
+ * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
650
+ * @returns {Number} - The width of the view in pixel.
651
+ */
652
+ Owl.prototype.width = function(dimension) {
653
+ dimension = dimension || Owl.Width.Default;
654
+ switch (dimension) {
655
+ case Owl.Width.Inner:
656
+ case Owl.Width.Outer:
657
+ return this._width;
658
+ default:
659
+ return this._width - this.settings.stagePadding * 2 + this.settings.margin;
660
+ }
661
+ };
662
+
663
+ /**
664
+ * Refreshes the carousel primarily for adaptive purposes.
665
+ * @public
666
+ */
667
+ Owl.prototype.refresh = function() {
668
+ this.enter('refreshing');
669
+ this.trigger('refresh');
670
+
671
+ this.setup();
672
+
673
+ this.optionsLogic();
674
+
675
+ this.$element.addClass(this.options.refreshClass);
676
+
677
+ this.update();
678
+
679
+ this.$element.removeClass(this.options.refreshClass);
680
+
681
+ this.leave('refreshing');
682
+ this.trigger('refreshed');
683
+ };
684
+
685
+ /**
686
+ * Checks window `resize` event.
687
+ * @protected
688
+ */
689
+ Owl.prototype.onThrottledResize = function() {
690
+ window.clearTimeout(this.resizeTimer);
691
+ this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
692
+ };
693
+
694
+ /**
695
+ * Checks window `resize` event.
696
+ * @protected
697
+ */
698
+ Owl.prototype.onResize = function() {
699
+ if (!this._items.length) {
700
+ return false;
701
+ }
702
+
703
+ if (this._width === this.$element.width()) {
704
+ return false;
705
+ }
706
+
707
+ if (!this.isVisible()) {
708
+ return false;
709
+ }
710
+
711
+ this.enter('resizing');
712
+
713
+ if (this.trigger('resize').isDefaultPrevented()) {
714
+ this.leave('resizing');
715
+ return false;
716
+ }
717
+
718
+ this.invalidate('width');
719
+
720
+ this.refresh();
721
+
722
+ this.leave('resizing');
723
+ this.trigger('resized');
724
+ };
725
+
726
+ /**
727
+ * Registers event handlers.
728
+ * @todo Check `msPointerEnabled`
729
+ * @todo #261
730
+ * @protected
731
+ */
732
+ Owl.prototype.registerEventHandlers = function() {
733
+ if ($.support.transition) {
734
+ this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
735
+ }
736
+
737
+ if (this.settings.responsive !== false) {
738
+ this.on(window, 'resize', this._handlers.onThrottledResize);
739
+ }
740
+
741
+ if (this.settings.mouseDrag) {
742
+ this.$element.addClass(this.options.dragClass);
743
+ this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
744
+ this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
745
+ }
746
+
747
+ if (this.settings.touchDrag){
748
+ this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
749
+ this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
750
+ }
751
+ };
752
+
753
+ /**
754
+ * Handles `touchstart` and `mousedown` events.
755
+ * @todo Horizontal swipe threshold as option
756
+ * @todo #261
757
+ * @protected
758
+ * @param {Event} event - The event arguments.
759
+ */
760
+ Owl.prototype.onDragStart = function(event) {
761
+ var stage = null;
762
+
763
+ if (event.which === 3) {
764
+ return;
765
+ }
766
+
767
+ if ($.support.transform) {
768
+ stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
769
+ stage = {
770
+ x: stage[stage.length === 16 ? 12 : 4],
771
+ y: stage[stage.length === 16 ? 13 : 5]
772
+ };
773
+ } else {
774
+ stage = this.$stage.position();
775
+ stage = {
776
+ x: this.settings.rtl ?
777
+ stage.left + this.$stage.width() - this.width() + this.settings.margin :
778
+ stage.left,
779
+ y: stage.top
780
+ };
781
+ }
782
+
783
+ if (this.is('animating')) {
784
+ $.support.transform ? this.animate(stage.x) : this.$stage.stop()
785
+ this.invalidate('position');
786
+ }
787
+
788
+ this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
789
+
790
+ this.speed(0);
791
+
792
+ this._drag.time = new Date().getTime();
793
+ this._drag.target = $(event.target);
794
+ this._drag.stage.start = stage;
795
+ this._drag.stage.current = stage;
796
+ this._drag.pointer = this.pointer(event);
797
+
798
+ $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
799
+
800
+ $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
801
+ var delta = this.difference(this._drag.pointer, this.pointer(event));
802
+
803
+ $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
804
+
805
+ if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
806
+ return;
807
+ }
808
+
809
+ event.preventDefault();
810
+
811
+ this.enter('dragging');
812
+ this.trigger('drag');
813
+ }, this));
814
+ };
815
+
816
+ /**
817
+ * Handles the `touchmove` and `mousemove` events.
818
+ * @todo #261
819
+ * @protected
820
+ * @param {Event} event - The event arguments.
821
+ */
822
+ Owl.prototype.onDragMove = function(event) {
823
+ var minimum = null,
824
+ maximum = null,
825
+ pull = null,
826
+ delta = this.difference(this._drag.pointer, this.pointer(event)),
827
+ stage = this.difference(this._drag.stage.start, delta);
828
+
829
+ if (!this.is('dragging')) {
830
+ return;
831
+ }
832
+
833
+ event.preventDefault();
834
+
835
+ if (this.settings.loop) {
836
+ minimum = this.coordinates(this.minimum());
837
+ maximum = this.coordinates(this.maximum() + 1) - minimum;
838
+ stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
839
+ } else {
840
+ minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
841
+ maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
842
+ pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
843
+ stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
844
+ }
845
+
846
+ this._drag.stage.current = stage;
847
+
848
+ this.animate(stage.x);
849
+ };
850
+
851
+ /**
852
+ * Handles the `touchend` and `mouseup` events.
853
+ * @todo #261
854
+ * @todo Threshold for click event
855
+ * @protected
856
+ * @param {Event} event - The event arguments.
857
+ */
858
+ Owl.prototype.onDragEnd = function(event) {
859
+ var delta = this.difference(this._drag.pointer, this.pointer(event)),
860
+ stage = this._drag.stage.current,
861
+ direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
862
+
863
+ $(document).off('.owl.core');
864
+
865
+ this.$element.removeClass(this.options.grabClass);
866
+
867
+ if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
868
+ this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
869
+ this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
870
+ this.invalidate('position');
871
+ this.update();
872
+
873
+ this._drag.direction = direction;
874
+
875
+ if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
876
+ this._drag.target.one('click.owl.core', function() { return false; });
877
+ }
878
+ }
879
+
880
+ if (!this.is('dragging')) {
881
+ return;
882
+ }
883
+
884
+ this.leave('dragging');
885
+ this.trigger('dragged');
886
+ };
887
+
888
+ /**
889
+ * Gets absolute position of the closest item for a coordinate.
890
+ * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
891
+ * @protected
892
+ * @param {Number} coordinate - The coordinate in pixel.
893
+ * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
894
+ * @return {Number} - The absolute position of the closest item.
895
+ */
896
+ Owl.prototype.closest = function(coordinate, direction) {
897
+ var position = -1,
898
+ pull = 30,
899
+ width = this.width(),
900
+ coordinates = this.coordinates();
901
+
902
+ if (!this.settings.freeDrag) {
903
+ // check closest item
904
+ $.each(coordinates, $.proxy(function(index, value) {
905
+ // on a left pull, check on current index
906
+ if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
907
+ position = index;
908
+ // on a right pull, check on previous index
909
+ // to do so, subtract width from value and set position = index + 1
910
+ } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
911
+ position = index + 1;
912
+ } else if (this.op(coordinate, '<', value)
913
+ && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
914
+ position = direction === 'left' ? index + 1 : index;
915
+ }
916
+ return position === -1;
917
+ }, this));
918
+ }
919
+
920
+ if (!this.settings.loop) {
921
+ // non loop boundries
922
+ if (this.op(coordinate, '>', coordinates[this.minimum()])) {
923
+ position = coordinate = this.minimum();
924
+ } else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
925
+ position = coordinate = this.maximum();
926
+ }
927
+ }
928
+
929
+ return position;
930
+ };
931
+
932
+ /**
933
+ * Animates the stage.
934
+ * @todo #270
935
+ * @public
936
+ * @param {Number} coordinate - The coordinate in pixels.
937
+ */
938
+ Owl.prototype.animate = function(coordinate) {
939
+ var animate = this.speed() > 0;
940
+
941
+ this.is('animating') && this.onTransitionEnd();
942
+
943
+ if (animate) {
944
+ this.enter('animating');
945
+ this.trigger('translate');
946
+ }
947
+
948
+ if ($.support.transform3d && $.support.transition) {
949
+ this.$stage.css({
950
+ transform: 'translate3d(' + coordinate + 'px,0px,0px)',
951
+ transition: (this.speed() / 1000) + 's' + (
952
+ this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
953
+ )
954
+ });
955
+ } else if (animate) {
956
+ this.$stage.animate({
957
+ left: coordinate + 'px'
958
+ }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
959
+ } else {
960
+ this.$stage.css({
961
+ left: coordinate + 'px'
962
+ });
963
+ }
964
+ };
965
+
966
+ /**
967
+ * Checks whether the carousel is in a specific state or not.
968
+ * @param {String} state - The state to check.
969
+ * @returns {Boolean} - The flag which indicates if the carousel is busy.
970
+ */
971
+ Owl.prototype.is = function(state) {
972
+ return this._states.current[state] && this._states.current[state] > 0;
973
+ };
974
+
975
+ /**
976
+ * Sets the absolute position of the current item.
977
+ * @public
978
+ * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
979
+ * @returns {Number} - The absolute position of the current item.
980
+ */
981
+ Owl.prototype.current = function(position) {
982
+ if (position === undefined) {
983
+ return this._current;
984
+ }
985
+
986
+ if (this._items.length === 0) {
987
+ return undefined;
988
+ }
989
+
990
+ position = this.normalize(position);
991
+
992
+ if (this._current !== position) {
993
+ var event = this.trigger('change', { property: { name: 'position', value: position } });
994
+
995
+ if (event.data !== undefined) {
996
+ position = this.normalize(event.data);
997
+ }
998
+
999
+ this._current = position;
1000
+
1001
+ this.invalidate('position');
1002
+
1003
+ this.trigger('changed', { property: { name: 'position', value: this._current } });
1004
+ }
1005
+
1006
+ return this._current;
1007
+ };
1008
+
1009
+ /**
1010
+ * Invalidates the given part of the update routine.
1011
+ * @param {String} [part] - The part to invalidate.
1012
+ * @returns {Array.<String>} - The invalidated parts.
1013
+ */
1014
+ Owl.prototype.invalidate = function(part) {
1015
+ if ($.type(part) === 'string') {
1016
+ this._invalidated[part] = true;
1017
+ this.is('valid') && this.leave('valid');
1018
+ }
1019
+ return $.map(this._invalidated, function(v, i) { return i });
1020
+ };
1021
+
1022
+ /**
1023
+ * Resets the absolute position of the current item.
1024
+ * @public
1025
+ * @param {Number} position - The absolute position of the new item.
1026
+ */
1027
+ Owl.prototype.reset = function(position) {
1028
+ position = this.normalize(position);
1029
+
1030
+ if (position === undefined) {
1031
+ return;
1032
+ }
1033
+
1034
+ this._speed = 0;
1035
+ this._current = position;
1036
+
1037
+ this.suppress([ 'translate', 'translated' ]);
1038
+
1039
+ this.animate(this.coordinates(position));
1040
+
1041
+ this.release([ 'translate', 'translated' ]);
1042
+ };
1043
+
1044
+ /**
1045
+ * Normalizes an absolute or a relative position of an item.
1046
+ * @public
1047
+ * @param {Number} position - The absolute or relative position to normalize.
1048
+ * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1049
+ * @returns {Number} - The normalized position.
1050
+ */
1051
+ Owl.prototype.normalize = function(position, relative) {
1052
+ var n = this._items.length,
1053
+ m = relative ? 0 : this._clones.length;
1054
+
1055
+ if (!this.isNumeric(position) || n < 1) {
1056
+ position = undefined;
1057
+ } else if (position < 0 || position >= n + m) {
1058
+ position = ((position - m / 2) % n + n) % n + m / 2;
1059
+ }
1060
+
1061
+ return position;
1062
+ };
1063
+
1064
+ /**
1065
+ * Converts an absolute position of an item into a relative one.
1066
+ * @public
1067
+ * @param {Number} position - The absolute position to convert.
1068
+ * @returns {Number} - The converted position.
1069
+ */
1070
+ Owl.prototype.relative = function(position) {
1071
+ position -= this._clones.length / 2;
1072
+ return this.normalize(position, true);
1073
+ };
1074
+
1075
+ /**
1076
+ * Gets the maximum position for the current item.
1077
+ * @public
1078
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1079
+ * @returns {Number}
1080
+ */
1081
+ Owl.prototype.maximum = function(relative) {
1082
+ var settings = this.settings,
1083
+ maximum = this._coordinates.length,
1084
+ iterator,
1085
+ reciprocalItemsWidth,
1086
+ elementWidth;
1087
+
1088
+ if (settings.loop) {
1089
+ maximum = this._clones.length / 2 + this._items.length - 1;
1090
+ } else if (settings.autoWidth || settings.merge) {
1091
+ iterator = this._items.length;
1092
+ if (iterator) {
1093
+ reciprocalItemsWidth = this._items[--iterator].width();
1094
+ elementWidth = this.$element.width();
1095
+ while (iterator--) {
1096
+ reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
1097
+ if (reciprocalItemsWidth > elementWidth) {
1098
+ break;
1099
+ }
1100
+ }
1101
+ }
1102
+ maximum = iterator + 1;
1103
+ } else if (settings.center) {
1104
+ maximum = this._items.length - 1;
1105
+ } else {
1106
+ maximum = this._items.length - settings.items;
1107
+ }
1108
+
1109
+ if (relative) {
1110
+ maximum -= this._clones.length / 2;
1111
+ }
1112
+
1113
+ return Math.max(maximum, 0);
1114
+ };
1115
+
1116
+ /**
1117
+ * Gets the minimum position for the current item.
1118
+ * @public
1119
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1120
+ * @returns {Number}
1121
+ */
1122
+ Owl.prototype.minimum = function(relative) {
1123
+ return relative ? 0 : this._clones.length / 2;
1124
+ };
1125
+
1126
+ /**
1127
+ * Gets an item at the specified relative position.
1128
+ * @public
1129
+ * @param {Number} [position] - The relative position of the item.
1130
+ * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1131
+ */
1132
+ Owl.prototype.items = function(position) {
1133
+ if (position === undefined) {
1134
+ return this._items.slice();
1135
+ }
1136
+
1137
+ position = this.normalize(position, true);
1138
+ return this._items[position];
1139
+ };
1140
+
1141
+ /**
1142
+ * Gets an item at the specified relative position.
1143
+ * @public
1144
+ * @param {Number} [position] - The relative position of the item.
1145
+ * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1146
+ */
1147
+ Owl.prototype.mergers = function(position) {
1148
+ if (position === undefined) {
1149
+ return this._mergers.slice();
1150
+ }
1151
+
1152
+ position = this.normalize(position, true);
1153
+ return this._mergers[position];
1154
+ };
1155
+
1156
+ /**
1157
+ * Gets the absolute positions of clones for an item.
1158
+ * @public
1159
+ * @param {Number} [position] - The relative position of the item.
1160
+ * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1161
+ */
1162
+ Owl.prototype.clones = function(position) {
1163
+ var odd = this._clones.length / 2,
1164
+ even = odd + this._items.length,
1165
+ map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
1166
+
1167
+ if (position === undefined) {
1168
+ return $.map(this._clones, function(v, i) { return map(i) });
1169
+ }
1170
+
1171
+ return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1172
+ };
1173
+
1174
+ /**
1175
+ * Sets the current animation speed.
1176
+ * @public
1177
+ * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1178
+ * @returns {Number} - The current animation speed in milliseconds.
1179
+ */
1180
+ Owl.prototype.speed = function(speed) {
1181
+ if (speed !== undefined) {
1182
+ this._speed = speed;
1183
+ }
1184
+
1185
+ return this._speed;
1186
+ };
1187
+
1188
+ /**
1189
+ * Gets the coordinate of an item.
1190
+ * @todo The name of this method is missleanding.
1191
+ * @public
1192
+ * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1193
+ * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1194
+ */
1195
+ Owl.prototype.coordinates = function(position) {
1196
+ var multiplier = 1,
1197
+ newPosition = position - 1,
1198
+ coordinate;
1199
+
1200
+ if (position === undefined) {
1201
+ return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1202
+ return this.coordinates(index);
1203
+ }, this));
1204
+ }
1205
+
1206
+ if (this.settings.center) {
1207
+ if (this.settings.rtl) {
1208
+ multiplier = -1;
1209
+ newPosition = position + 1;
1210
+ }
1211
+
1212
+ coordinate = this._coordinates[position];
1213
+ coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
1214
+ } else {
1215
+ coordinate = this._coordinates[newPosition] || 0;
1216
+ }
1217
+
1218
+ coordinate = Math.ceil(coordinate);
1219
+
1220
+ return coordinate;
1221
+ };
1222
+
1223
+ /**
1224
+ * Calculates the speed for a translation.
1225
+ * @protected
1226
+ * @param {Number} from - The absolute position of the start item.
1227
+ * @param {Number} to - The absolute position of the target item.
1228
+ * @param {Number} [factor=undefined] - The time factor in milliseconds.
1229
+ * @returns {Number} - The time in milliseconds for the translation.
1230
+ */
1231
+ Owl.prototype.duration = function(from, to, factor) {
1232
+ if (factor === 0) {
1233
+ return 0;
1234
+ }
1235
+
1236
+ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1237
+ };
1238
+
1239
+ /**
1240
+ * Slides to the specified item.
1241
+ * @public
1242
+ * @param {Number} position - The position of the item.
1243
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1244
+ */
1245
+ Owl.prototype.to = function(position, speed) {
1246
+ var current = this.current(),
1247
+ revert = null,
1248
+ distance = position - this.relative(current),
1249
+ direction = (distance > 0) - (distance < 0),
1250
+ items = this._items.length,
1251
+ minimum = this.minimum(),
1252
+ maximum = this.maximum();
1253
+
1254
+ if (this.settings.loop) {
1255
+ if (!this.settings.rewind && Math.abs(distance) > items / 2) {
1256
+ distance += direction * -1 * items;
1257
+ }
1258
+
1259
+ position = current + distance;
1260
+ revert = ((position - minimum) % items + items) % items + minimum;
1261
+
1262
+ if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
1263
+ current = revert - distance;
1264
+ position = revert;
1265
+ this.reset(current);
1266
+ }
1267
+ } else if (this.settings.rewind) {
1268
+ maximum += 1;
1269
+ position = (position % maximum + maximum) % maximum;
1270
+ } else {
1271
+ position = Math.max(minimum, Math.min(maximum, position));
1272
+ }
1273
+
1274
+ this.speed(this.duration(current, position, speed));
1275
+ this.current(position);
1276
+
1277
+ if (this.isVisible()) {
1278
+ this.update();
1279
+ }
1280
+ };
1281
+
1282
+ /**
1283
+ * Slides to the next item.
1284
+ * @public
1285
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1286
+ */
1287
+ Owl.prototype.next = function(speed) {
1288
+ speed = speed || false;
1289
+ this.to(this.relative(this.current()) + 1, speed);
1290
+ };
1291
+
1292
+ /**
1293
+ * Slides to the previous item.
1294
+ * @public
1295
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1296
+ */
1297
+ Owl.prototype.prev = function(speed) {
1298
+ speed = speed || false;
1299
+ this.to(this.relative(this.current()) - 1, speed);
1300
+ };
1301
+
1302
+ /**
1303
+ * Handles the end of an animation.
1304
+ * @protected
1305
+ * @param {Event} event - The event arguments.
1306
+ */
1307
+ Owl.prototype.onTransitionEnd = function(event) {
1308
+
1309
+ // if css2 animation then event object is undefined
1310
+ if (event !== undefined) {
1311
+ event.stopPropagation();
1312
+
1313
+ // Catch only owl-stage transitionEnd event
1314
+ if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1315
+ return false;
1316
+ }
1317
+ }
1318
+
1319
+ this.leave('animating');
1320
+ this.trigger('translated');
1321
+ };
1322
+
1323
+ /**
1324
+ * Gets viewport width.
1325
+ * @protected
1326
+ * @return {Number} - The width in pixel.
1327
+ */
1328
+ Owl.prototype.viewport = function() {
1329
+ var width;
1330
+ if (this.options.responsiveBaseElement !== window) {
1331
+ width = $(this.options.responsiveBaseElement).width();
1332
+ } else if (window.innerWidth) {
1333
+ width = window.innerWidth;
1334
+ } else if (document.documentElement && document.documentElement.clientWidth) {
1335
+ width = document.documentElement.clientWidth;
1336
+ } else {
1337
+ console.warn('Can not detect viewport width.');
1338
+ }
1339
+ return width;
1340
+ };
1341
+
1342
+ /**
1343
+ * Replaces the current content.
1344
+ * @public
1345
+ * @param {HTMLElement|jQuery|String} content - The new content.
1346
+ */
1347
+ Owl.prototype.replace = function(content) {
1348
+ this.$stage.empty();
1349
+ this._items = [];
1350
+
1351
+ if (content) {
1352
+ content = (content instanceof jQuery) ? content : $(content);
1353
+ }
1354
+
1355
+ if (this.settings.nestedItemSelector) {
1356
+ content = content.find('.' + this.settings.nestedItemSelector);
1357
+ }
1358
+
1359
+ content.filter(function() {
1360
+ return this.nodeType === 1;
1361
+ }).each($.proxy(function(index, item) {
1362
+ item = this.prepare(item);
1363
+ this.$stage.append(item);
1364
+ this._items.push(item);
1365
+ this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1366
+ }, this));
1367
+
1368
+ this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1369
+
1370
+ this.invalidate('items');
1371
+ };
1372
+
1373
+ /**
1374
+ * Adds an item.
1375
+ * @todo Use `item` instead of `content` for the event arguments.
1376
+ * @public
1377
+ * @param {HTMLElement|jQuery|String} content - The item content to add.
1378
+ * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1379
+ */
1380
+ Owl.prototype.add = function(content, position) {
1381
+ var current = this.relative(this._current);
1382
+
1383
+ position = position === undefined ? this._items.length : this.normalize(position, true);
1384
+ content = content instanceof jQuery ? content : $(content);
1385
+
1386
+ this.trigger('add', { content: content, position: position });
1387
+
1388
+ content = this.prepare(content);
1389
+
1390
+ if (this._items.length === 0 || position === this._items.length) {
1391
+ this._items.length === 0 && this.$stage.append(content);
1392
+ this._items.length !== 0 && this._items[position - 1].after(content);
1393
+ this._items.push(content);
1394
+ this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1395
+ } else {
1396
+ this._items[position].before(content);
1397
+ this._items.splice(position, 0, content);
1398
+ this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1399
+ }
1400
+
1401
+ this._items[current] && this.reset(this._items[current].index());
1402
+
1403
+ this.invalidate('items');
1404
+
1405
+ this.trigger('added', { content: content, position: position });
1406
+ };
1407
+
1408
+ /**
1409
+ * Removes an item by its position.
1410
+ * @todo Use `item` instead of `content` for the event arguments.
1411
+ * @public
1412
+ * @param {Number} position - The relative position of the item to remove.
1413
+ */
1414
+ Owl.prototype.remove = function(position) {
1415
+ position = this.normalize(position, true);
1416
+
1417
+ if (position === undefined) {
1418
+ return;
1419
+ }
1420
+
1421
+ this.trigger('remove', { content: this._items[position], position: position });
1422
+
1423
+ this._items[position].remove();
1424
+ this._items.splice(position, 1);
1425
+ this._mergers.splice(position, 1);
1426
+
1427
+ this.invalidate('items');
1428
+
1429
+ this.trigger('removed', { content: null, position: position });
1430
+ };
1431
+
1432
+ /**
1433
+ * Preloads images with auto width.
1434
+ * @todo Replace by a more generic approach
1435
+ * @protected
1436
+ */
1437
+ Owl.prototype.preloadAutoWidthImages = function(images) {
1438
+ images.each($.proxy(function(i, element) {
1439
+ this.enter('pre-loading');
1440
+ element = $(element);
1441
+ $(new Image()).one('load', $.proxy(function(e) {
1442
+ element.attr('src', e.target.src);
1443
+ element.css('opacity', 1);
1444
+ this.leave('pre-loading');
1445
+ !this.is('pre-loading') && !this.is('initializing') && this.refresh();
1446
+ }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
1447
+ }, this));
1448
+ };
1449
+
1450
+ /**
1451
+ * Destroys the carousel.
1452
+ * @public
1453
+ */
1454
+ Owl.prototype.destroy = function() {
1455
+
1456
+ this.$element.off('.owl.core');
1457
+ this.$stage.off('.owl.core');
1458
+ $(document).off('.owl.core');
1459
+
1460
+ if (this.settings.responsive !== false) {
1461
+ window.clearTimeout(this.resizeTimer);
1462
+ this.off(window, 'resize', this._handlers.onThrottledResize);
1463
+ }
1464
+
1465
+ for (var i in this._plugins) {
1466
+ this._plugins[i].destroy();
1467
+ }
1468
+
1469
+ this.$stage.children('.cloned').remove();
1470
+
1471
+ this.$stage.unwrap();
1472
+ this.$stage.children().contents().unwrap();
1473
+ this.$stage.children().unwrap();
1474
+ this.$stage.remove();
1475
+ this.$element
1476
+ .removeClass(this.options.refreshClass)
1477
+ .removeClass(this.options.loadingClass)
1478
+ .removeClass(this.options.loadedClass)
1479
+ .removeClass(this.options.rtlClass)
1480
+ .removeClass(this.options.dragClass)
1481
+ .removeClass(this.options.grabClass)
1482
+ .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
1483
+ .removeData('owl.carousel');
1484
+ };
1485
+
1486
+ /**
1487
+ * Operators to calculate right-to-left and left-to-right.
1488
+ * @protected
1489
+ * @param {Number} [a] - The left side operand.
1490
+ * @param {String} [o] - The operator.
1491
+ * @param {Number} [b] - The right side operand.
1492
+ */
1493
+ Owl.prototype.op = function(a, o, b) {
1494
+ var rtl = this.settings.rtl;
1495
+ switch (o) {
1496
+ case '<':
1497
+ return rtl ? a > b : a < b;
1498
+ case '>':
1499
+ return rtl ? a < b : a > b;
1500
+ case '>=':
1501
+ return rtl ? a <= b : a >= b;
1502
+ case '<=':
1503
+ return rtl ? a >= b : a <= b;
1504
+ default:
1505
+ break;
1506
+ }
1507
+ };
1508
+
1509
+ /**
1510
+ * Attaches to an internal event.
1511
+ * @protected
1512
+ * @param {HTMLElement} element - The event source.
1513
+ * @param {String} event - The event name.
1514
+ * @param {Function} listener - The event handler to attach.
1515
+ * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
1516
+ */
1517
+ Owl.prototype.on = function(element, event, listener, capture) {
1518
+ if (element.addEventListener) {
1519
+ element.addEventListener(event, listener, capture);
1520
+ } else if (element.attachEvent) {
1521
+ element.attachEvent('on' + event, listener);
1522
+ }
1523
+ };
1524
+
1525
+ /**
1526
+ * Detaches from an internal event.
1527
+ * @protected
1528
+ * @param {HTMLElement} element - The event source.
1529
+ * @param {String} event - The event name.
1530
+ * @param {Function} listener - The attached event handler to detach.
1531
+ * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1532
+ */
1533
+ Owl.prototype.off = function(element, event, listener, capture) {
1534
+ if (element.removeEventListener) {
1535
+ element.removeEventListener(event, listener, capture);
1536
+ } else if (element.detachEvent) {
1537
+ element.detachEvent('on' + event, listener);
1538
+ }
1539
+ };
1540
+
1541
+ /**
1542
+ * Triggers a public event.
1543
+ * @todo Remove `status`, `relatedTarget` should be used instead.
1544
+ * @protected
1545
+ * @param {String} name - The event name.
1546
+ * @param {*} [data=null] - The event data.
1547
+ * @param {String} [namespace=carousel] - The event namespace.
1548
+ * @param {String} [state] - The state which is associated with the event.
1549
+ * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
1550
+ * @returns {Event} - The event arguments.
1551
+ */
1552
+ Owl.prototype.trigger = function(name, data, namespace, state, enter) {
1553
+ var status = {
1554
+ item: { count: this._items.length, index: this.current() }
1555
+ }, handler = $.camelCase(
1556
+ $.grep([ 'on', name, namespace ], function(v) { return v })
1557
+ .join('-').toLowerCase()
1558
+ ), event = $.Event(
1559
+ [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1560
+ $.extend({ relatedTarget: this }, status, data)
1561
+ );
1562
+
1563
+ if (!this._supress[name]) {
1564
+ $.each(this._plugins, function(name, plugin) {
1565
+ if (plugin.onTrigger) {
1566
+ plugin.onTrigger(event);
1567
+ }
1568
+ });
1569
+
1570
+ this.register({ type: Owl.Type.Event, name: name });
1571
+ this.$element.trigger(event);
1572
+
1573
+ if (this.settings && typeof this.settings[handler] === 'function') {
1574
+ this.settings[handler].call(this, event);
1575
+ }
1576
+ }
1577
+
1578
+ return event;
1579
+ };
1580
+
1581
+ /**
1582
+ * Enters a state.
1583
+ * @param name - The state name.
1584
+ */
1585
+ Owl.prototype.enter = function(name) {
1586
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1587
+ if (this._states.current[name] === undefined) {
1588
+ this._states.current[name] = 0;
1589
+ }
1590
+
1591
+ this._states.current[name]++;
1592
+ }, this));
1593
+ };
1594
+
1595
+ /**
1596
+ * Leaves a state.
1597
+ * @param name - The state name.
1598
+ */
1599
+ Owl.prototype.leave = function(name) {
1600
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1601
+ this._states.current[name]--;
1602
+ }, this));
1603
+ };
1604
+
1605
+ /**
1606
+ * Registers an event or state.
1607
+ * @public
1608
+ * @param {Object} object - The event or state to register.
1609
+ */
1610
+ Owl.prototype.register = function(object) {
1611
+ if (object.type === Owl.Type.Event) {
1612
+ if (!$.event.special[object.name]) {
1613
+ $.event.special[object.name] = {};
1614
+ }
1615
+
1616
+ if (!$.event.special[object.name].owl) {
1617
+ var _default = $.event.special[object.name]._default;
1618
+ $.event.special[object.name]._default = function(e) {
1619
+ if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
1620
+ return _default.apply(this, arguments);
1621
+ }
1622
+ return e.namespace && e.namespace.indexOf('owl') > -1;
1623
+ };
1624
+ $.event.special[object.name].owl = true;
1625
+ }
1626
+ } else if (object.type === Owl.Type.State) {
1627
+ if (!this._states.tags[object.name]) {
1628
+ this._states.tags[object.name] = object.tags;
1629
+ } else {
1630
+ this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
1631
+ }
1632
+
1633
+ this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
1634
+ return $.inArray(tag, this._states.tags[object.name]) === i;
1635
+ }, this));
1636
+ }
1637
+ };
1638
+
1639
+ /**
1640
+ * Suppresses events.
1641
+ * @protected
1642
+ * @param {Array.<String>} events - The events to suppress.
1643
+ */
1644
+ Owl.prototype.suppress = function(events) {
1645
+ $.each(events, $.proxy(function(index, event) {
1646
+ this._supress[event] = true;
1647
+ }, this));
1648
+ };
1649
+
1650
+ /**
1651
+ * Releases suppressed events.
1652
+ * @protected
1653
+ * @param {Array.<String>} events - The events to release.
1654
+ */
1655
+ Owl.prototype.release = function(events) {
1656
+ $.each(events, $.proxy(function(index, event) {
1657
+ delete this._supress[event];
1658
+ }, this));
1659
+ };
1660
+
1661
+ /**
1662
+ * Gets unified pointer coordinates from event.
1663
+ * @todo #261
1664
+ * @protected
1665
+ * @param {Event} - The `mousedown` or `touchstart` event.
1666
+ * @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
1667
+ */
1668
+ Owl.prototype.pointer = function(event) {
1669
+ var result = { x: null, y: null };
1670
+
1671
+ event = event.originalEvent || event || window.event;
1672
+
1673
+ event = event.touches && event.touches.length ?
1674
+ event.touches[0] : event.changedTouches && event.changedTouches.length ?
1675
+ event.changedTouches[0] : event;
1676
+
1677
+ if (event.pageX) {
1678
+ result.x = event.pageX;
1679
+ result.y = event.pageY;
1680
+ } else {
1681
+ result.x = event.clientX;
1682
+ result.y = event.clientY;
1683
+ }
1684
+
1685
+ return result;
1686
+ };
1687
+
1688
+ /**
1689
+ * Determines if the input is a Number or something that can be coerced to a Number
1690
+ * @protected
1691
+ * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
1692
+ * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
1693
+ */
1694
+ Owl.prototype.isNumeric = function(number) {
1695
+ return !isNaN(parseFloat(number));
1696
+ };
1697
+
1698
+ /**
1699
+ * Gets the difference of two vectors.
1700
+ * @todo #261
1701
+ * @protected
1702
+ * @param {Object} - The first vector.
1703
+ * @param {Object} - The second vector.
1704
+ * @returns {Object} - The difference.
1705
+ */
1706
+ Owl.prototype.difference = function(first, second) {
1707
+ return {
1708
+ x: first.x - second.x,
1709
+ y: first.y - second.y
1710
+ };
1711
+ };
1712
+
1713
+ /**
1714
+ * The jQuery Plugin for the Owl Carousel
1715
+ * @todo Navigation plugin `next` and `prev`
1716
+ * @public
1717
+ */
1718
+ $.fn.owlCarousel = function(option) {
1719
+ var args = Array.prototype.slice.call(arguments, 1);
1720
+
1721
+ return this.each(function() {
1722
+ var $this = $(this),
1723
+ data = $this.data('owl.carousel');
1724
+
1725
+ if (!data) {
1726
+ data = new Owl(this, typeof option == 'object' && option);
1727
+ $this.data('owl.carousel', data);
1728
+
1729
+ $.each([
1730
+ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
1731
+ ], function(i, event) {
1732
+ data.register({ type: Owl.Type.Event, name: event });
1733
+ data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
1734
+ if (e.namespace && e.relatedTarget !== this) {
1735
+ this.suppress([ event ]);
1736
+ data[event].apply(this, [].slice.call(arguments, 1));
1737
+ this.release([ event ]);
1738
+ }
1739
+ }, data));
1740
+ });
1741
+ }
1742
+
1743
+ if (typeof option == 'string' && option.charAt(0) !== '_') {
1744
+ data[option].apply(data, args);
1745
+ }
1746
+ });
1747
+ };
1748
+
1749
+ /**
1750
+ * The constructor for the jQuery Plugin
1751
+ * @public
1752
+ */
1753
+ $.fn.owlCarousel.Constructor = Owl;
1754
+
1755
+ })(window.Zepto || window.jQuery, window, document);
1756
+
1757
+ /**
1758
+ * AutoRefresh Plugin
1759
+ * @version 2.3.4
1760
+ * @author Artus Kolanowski
1761
+ * @author David Deutsch
1762
+ * @license The MIT License (MIT)
1763
+ */
1764
+ ;(function($, window, document, undefined) {
1765
+
1766
+ /**
1767
+ * Creates the auto refresh plugin.
1768
+ * @class The Auto Refresh Plugin
1769
+ * @param {Owl} carousel - The Owl Carousel
1770
+ */
1771
+ var AutoRefresh = function(carousel) {
1772
+ /**
1773
+ * Reference to the core.
1774
+ * @protected
1775
+ * @type {Owl}
1776
+ */
1777
+ this._core = carousel;
1778
+
1779
+ /**
1780
+ * Refresh interval.
1781
+ * @protected
1782
+ * @type {number}
1783
+ */
1784
+ this._interval = null;
1785
+
1786
+ /**
1787
+ * Whether the element is currently visible or not.
1788
+ * @protected
1789
+ * @type {Boolean}
1790
+ */
1791
+ this._visible = null;
1792
+
1793
+ /**
1794
+ * All event handlers.
1795
+ * @protected
1796
+ * @type {Object}
1797
+ */
1798
+ this._handlers = {
1799
+ 'initialized.owl.carousel': $.proxy(function(e) {
1800
+ if (e.namespace && this._core.settings.autoRefresh) {
1801
+ this.watch();
1802
+ }
1803
+ }, this)
1804
+ };
1805
+
1806
+ // set default options
1807
+ this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
1808
+
1809
+ // register event handlers
1810
+ this._core.$element.on(this._handlers);
1811
+ };
1812
+
1813
+ /**
1814
+ * Default options.
1815
+ * @public
1816
+ */
1817
+ AutoRefresh.Defaults = {
1818
+ autoRefresh: true,
1819
+ autoRefreshInterval: 500
1820
+ };
1821
+
1822
+ /**
1823
+ * Watches the element.
1824
+ */
1825
+ AutoRefresh.prototype.watch = function() {
1826
+ if (this._interval) {
1827
+ return;
1828
+ }
1829
+
1830
+ this._visible = this._core.isVisible();
1831
+ this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
1832
+ };
1833
+
1834
+ /**
1835
+ * Refreshes the element.
1836
+ */
1837
+ AutoRefresh.prototype.refresh = function() {
1838
+ if (this._core.isVisible() === this._visible) {
1839
+ return;
1840
+ }
1841
+
1842
+ this._visible = !this._visible;
1843
+
1844
+ this._core.$element.toggleClass('owl-hidden', !this._visible);
1845
+
1846
+ this._visible && (this._core.invalidate('width') && this._core.refresh());
1847
+ };
1848
+
1849
+ /**
1850
+ * Destroys the plugin.
1851
+ */
1852
+ AutoRefresh.prototype.destroy = function() {
1853
+ var handler, property;
1854
+
1855
+ window.clearInterval(this._interval);
1856
+
1857
+ for (handler in this._handlers) {
1858
+ this._core.$element.off(handler, this._handlers[handler]);
1859
+ }
1860
+ for (property in Object.getOwnPropertyNames(this)) {
1861
+ typeof this[property] != 'function' && (this[property] = null);
1862
+ }
1863
+ };
1864
+
1865
+ $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
1866
+
1867
+ })(window.Zepto || window.jQuery, window, document);
1868
+
1869
+ /**
1870
+ * Lazy Plugin
1871
+ * @version 2.3.4
1872
+ * @author Bartosz Wojciechowski
1873
+ * @author David Deutsch
1874
+ * @license The MIT License (MIT)
1875
+ */
1876
+ ;(function($, window, document, undefined) {
1877
+
1878
+ /**
1879
+ * Creates the lazy plugin.
1880
+ * @class The Lazy Plugin
1881
+ * @param {Owl} carousel - The Owl Carousel
1882
+ */
1883
+ var Lazy = function(carousel) {
1884
+
1885
+ /**
1886
+ * Reference to the core.
1887
+ * @protected
1888
+ * @type {Owl}
1889
+ */
1890
+ this._core = carousel;
1891
+
1892
+ /**
1893
+ * Already loaded items.
1894
+ * @protected
1895
+ * @type {Array.<jQuery>}
1896
+ */
1897
+ this._loaded = [];
1898
+
1899
+ /**
1900
+ * Event handlers.
1901
+ * @protected
1902
+ * @type {Object}
1903
+ */
1904
+ this._handlers = {
1905
+ 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
1906
+ if (!e.namespace) {
1907
+ return;
1908
+ }
1909
+
1910
+ if (!this._core.settings || !this._core.settings.lazyLoad) {
1911
+ return;
1912
+ }
1913
+
1914
+ if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1915
+ var settings = this._core.settings,
1916
+ n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
1917
+ i = ((settings.center && n * -1) || 0),
1918
+ position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
1919
+ clones = this._core.clones().length,
1920
+ load = $.proxy(function(i, v) { this.load(v) }, this);
1921
+ //TODO: Need documentation for this new option
1922
+ if (settings.lazyLoadEager > 0) {
1923
+ n += settings.lazyLoadEager;
1924
+ // If the carousel is looping also preload images that are to the "left"
1925
+ if (settings.loop) {
1926
+ position -= settings.lazyLoadEager;
1927
+ n++;
1928
+ }
1929
+ }
1930
+
1931
+ while (i++ < n) {
1932
+ this.load(clones / 2 + this._core.relative(position));
1933
+ clones && $.each(this._core.clones(this._core.relative(position)), load);
1934
+ position++;
1935
+ }
1936
+ }
1937
+ }, this)
1938
+ };
1939
+
1940
+ // set the default options
1941
+ this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
1942
+
1943
+ // register event handler
1944
+ this._core.$element.on(this._handlers);
1945
+ };
1946
+
1947
+ /**
1948
+ * Default options.
1949
+ * @public
1950
+ */
1951
+ Lazy.Defaults = {
1952
+ lazyLoad: false,
1953
+ lazyLoadEager: 0
1954
+ };
1955
+
1956
+ /**
1957
+ * Loads all resources of an item at the specified position.
1958
+ * @param {Number} position - The absolute position of the item.
1959
+ * @protected
1960
+ */
1961
+ Lazy.prototype.load = function(position) {
1962
+ var $item = this._core.$stage.children().eq(position),
1963
+ $elements = $item && $item.find('.owl-lazy');
1964
+
1965
+ if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
1966
+ return;
1967
+ }
1968
+
1969
+ $elements.each($.proxy(function(index, element) {
1970
+ var $element = $(element), image,
1971
+ url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
1972
+
1973
+ this._core.trigger('load', { element: $element, url: url }, 'lazy');
1974
+
1975
+ if ($element.is('img')) {
1976
+ $element.one('load.owl.lazy', $.proxy(function() {
1977
+ $element.css('opacity', 1);
1978
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1979
+ }, this)).attr('src', url);
1980
+ } else if ($element.is('source')) {
1981
+ $element.one('load.owl.lazy', $.proxy(function() {
1982
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1983
+ }, this)).attr('srcset', url);
1984
+ } else {
1985
+ image = new Image();
1986
+ image.onload = $.proxy(function() {
1987
+ $element.css({
1988
+ 'background-image': 'url("' + url + '")',
1989
+ 'opacity': '1'
1990
+ });
1991
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1992
+ }, this);
1993
+ image.src = url;
1994
+ }
1995
+ }, this));
1996
+
1997
+ this._loaded.push($item.get(0));
1998
+ };
1999
+
2000
+ /**
2001
+ * Destroys the plugin.
2002
+ * @public
2003
+ */
2004
+ Lazy.prototype.destroy = function() {
2005
+ var handler, property;
2006
+
2007
+ for (handler in this.handlers) {
2008
+ this._core.$element.off(handler, this.handlers[handler]);
2009
+ }
2010
+ for (property in Object.getOwnPropertyNames(this)) {
2011
+ typeof this[property] != 'function' && (this[property] = null);
2012
+ }
2013
+ };
2014
+
2015
+ $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
2016
+
2017
+ })(window.Zepto || window.jQuery, window, document);
2018
+
2019
+ /**
2020
+ * AutoHeight Plugin
2021
+ * @version 2.3.4
2022
+ * @author Bartosz Wojciechowski
2023
+ * @author David Deutsch
2024
+ * @license The MIT License (MIT)
2025
+ */
2026
+ ;(function($, window, document, undefined) {
2027
+
2028
+ /**
2029
+ * Creates the auto height plugin.
2030
+ * @class The Auto Height Plugin
2031
+ * @param {Owl} carousel - The Owl Carousel
2032
+ */
2033
+ var AutoHeight = function(carousel) {
2034
+ /**
2035
+ * Reference to the core.
2036
+ * @protected
2037
+ * @type {Owl}
2038
+ */
2039
+ this._core = carousel;
2040
+
2041
+ this._previousHeight = null;
2042
+
2043
+ /**
2044
+ * All event handlers.
2045
+ * @protected
2046
+ * @type {Object}
2047
+ */
2048
+ this._handlers = {
2049
+ 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
2050
+ if (e.namespace && this._core.settings.autoHeight) {
2051
+ this.update();
2052
+ }
2053
+ }, this),
2054
+ 'changed.owl.carousel': $.proxy(function(e) {
2055
+ if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
2056
+ this.update();
2057
+ }
2058
+ }, this),
2059
+ 'loaded.owl.lazy': $.proxy(function(e) {
2060
+ if (e.namespace && this._core.settings.autoHeight
2061
+ && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
2062
+ this.update();
2063
+ }
2064
+ }, this)
2065
+ };
2066
+
2067
+ // set default options
2068
+ this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2069
+
2070
+ // register event handlers
2071
+ this._core.$element.on(this._handlers);
2072
+ this._intervalId = null;
2073
+ var refThis = this;
2074
+
2075
+ // These changes have been taken from a PR by gavrochelegnou proposed in #1575
2076
+ // and have been made compatible with the latest jQuery version
2077
+ $(window).on('load', function() {
2078
+ if (refThis._core.settings.autoHeight) {
2079
+ refThis.update();
2080
+ }
2081
+ });
2082
+
2083
+ // Autoresize the height of the carousel when window is resized
2084
+ // When carousel has images, the height is dependent on the width
2085
+ // and should also change on resize
2086
+ $(window).resize(function() {
2087
+ if (refThis._core.settings.autoHeight) {
2088
+ if (refThis._intervalId != null) {
2089
+ clearTimeout(refThis._intervalId);
2090
+ }
2091
+
2092
+ refThis._intervalId = setTimeout(function() {
2093
+ refThis.update();
2094
+ }, 250);
2095
+ }
2096
+ });
2097
+
2098
+ };
2099
+
2100
+ /**
2101
+ * Default options.
2102
+ * @public
2103
+ */
2104
+ AutoHeight.Defaults = {
2105
+ autoHeight: false,
2106
+ autoHeightClass: 'owl-height'
2107
+ };
2108
+
2109
+ /**
2110
+ * Updates the view.
2111
+ */
2112
+ AutoHeight.prototype.update = function() {
2113
+ var start = this._core._current,
2114
+ end = start + this._core.settings.items,
2115
+ lazyLoadEnabled = this._core.settings.lazyLoad,
2116
+ visible = this._core.$stage.children().toArray().slice(start, end),
2117
+ heights = [],
2118
+ maxheight = 0;
2119
+
2120
+ $.each(visible, function(index, item) {
2121
+ heights.push($(item).height());
2122
+ });
2123
+
2124
+ maxheight = Math.max.apply(null, heights);
2125
+
2126
+ if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
2127
+ maxheight = this._previousHeight;
2128
+ }
2129
+
2130
+ this._previousHeight = maxheight;
2131
+
2132
+ this._core.$stage.parent()
2133
+ .height(maxheight)
2134
+ .addClass(this._core.settings.autoHeightClass);
2135
+ };
2136
+
2137
+ AutoHeight.prototype.destroy = function() {
2138
+ var handler, property;
2139
+
2140
+ for (handler in this._handlers) {
2141
+ this._core.$element.off(handler, this._handlers[handler]);
2142
+ }
2143
+ for (property in Object.getOwnPropertyNames(this)) {
2144
+ typeof this[property] !== 'function' && (this[property] = null);
2145
+ }
2146
+ };
2147
+
2148
+ $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2149
+
2150
+ })(window.Zepto || window.jQuery, window, document);
2151
+
2152
+ /**
2153
+ * Video Plugin
2154
+ * @version 2.3.4
2155
+ * @author Bartosz Wojciechowski
2156
+ * @author David Deutsch
2157
+ * @license The MIT License (MIT)
2158
+ */
2159
+ ;(function($, window, document, undefined) {
2160
+
2161
+ /**
2162
+ * Creates the video plugin.
2163
+ * @class The Video Plugin
2164
+ * @param {Owl} carousel - The Owl Carousel
2165
+ */
2166
+ var Video = function(carousel) {
2167
+ /**
2168
+ * Reference to the core.
2169
+ * @protected
2170
+ * @type {Owl}
2171
+ */
2172
+ this._core = carousel;
2173
+
2174
+ /**
2175
+ * Cache all video URLs.
2176
+ * @protected
2177
+ * @type {Object}
2178
+ */
2179
+ this._videos = {};
2180
+
2181
+ /**
2182
+ * Current playing item.
2183
+ * @protected
2184
+ * @type {jQuery}
2185
+ */
2186
+ this._playing = null;
2187
+
2188
+ /**
2189
+ * All event handlers.
2190
+ * @todo The cloned content removale is too late
2191
+ * @protected
2192
+ * @type {Object}
2193
+ */
2194
+ this._handlers = {
2195
+ 'initialized.owl.carousel': $.proxy(function(e) {
2196
+ if (e.namespace) {
2197
+ this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
2198
+ }
2199
+ }, this),
2200
+ 'resize.owl.carousel': $.proxy(function(e) {
2201
+ if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
2202
+ e.preventDefault();
2203
+ }
2204
+ }, this),
2205
+ 'refreshed.owl.carousel': $.proxy(function(e) {
2206
+ if (e.namespace && this._core.is('resizing')) {
2207
+ this._core.$stage.find('.cloned .owl-video-frame').remove();
2208
+ }
2209
+ }, this),
2210
+ 'changed.owl.carousel': $.proxy(function(e) {
2211
+ if (e.namespace && e.property.name === 'position' && this._playing) {
2212
+ this.stop();
2213
+ }
2214
+ }, this),
2215
+ 'prepared.owl.carousel': $.proxy(function(e) {
2216
+ if (!e.namespace) {
2217
+ return;
2218
+ }
2219
+
2220
+ var $element = $(e.content).find('.owl-video');
2221
+
2222
+ if ($element.length) {
2223
+ $element.css('display', 'none');
2224
+ this.fetch($element, $(e.content));
2225
+ }
2226
+ }, this)
2227
+ };
2228
+
2229
+ // set default options
2230
+ this._core.options = $.extend({}, Video.Defaults, this._core.options);
2231
+
2232
+ // register event handlers
2233
+ this._core.$element.on(this._handlers);
2234
+
2235
+ this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2236
+ this.play(e);
2237
+ }, this));
2238
+ };
2239
+
2240
+ /**
2241
+ * Default options.
2242
+ * @public
2243
+ */
2244
+ Video.Defaults = {
2245
+ video: false,
2246
+ videoHeight: false,
2247
+ videoWidth: false
2248
+ };
2249
+
2250
+ /**
2251
+ * Gets the video ID and the type (YouTube/Vimeo/vzaar only).
2252
+ * @protected
2253
+ * @param {jQuery} target - The target containing the video data.
2254
+ * @param {jQuery} item - The item containing the video.
2255
+ */
2256
+ Video.prototype.fetch = function(target, item) {
2257
+ var type = (function() {
2258
+ if (target.attr('data-vimeo-id')) {
2259
+ return 'vimeo';
2260
+ } else if (target.attr('data-vzaar-id')) {
2261
+ return 'vzaar'
2262
+ } else {
2263
+ return 'youtube';
2264
+ }
2265
+ })(),
2266
+ id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
2267
+ width = target.attr('data-width') || this._core.settings.videoWidth,
2268
+ height = target.attr('data-height') || this._core.settings.videoHeight,
2269
+ url = target.attr('href');
2270
+
2271
+ if (url) {
2272
+
2273
+ /*
2274
+ Parses the id's out of the following urls (and probably more):
2275
+ https://www.youtube.com/watch?v=:id
2276
+ https://youtu.be/:id
2277
+ https://vimeo.com/:id
2278
+ https://vimeo.com/channels/:channel/:id
2279
+ https://vimeo.com/groups/:group/videos/:id
2280
+ https://app.vzaar.com/videos/:id
2281
+
2282
+ Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
2283
+ */
2284
+
2285
+ id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2286
+
2287
+ if (id[3].indexOf('youtu') > -1) {
2288
+ type = 'youtube';
2289
+ } else if (id[3].indexOf('vimeo') > -1) {
2290
+ type = 'vimeo';
2291
+ } else if (id[3].indexOf('vzaar') > -1) {
2292
+ type = 'vzaar';
2293
+ } else {
2294
+ throw new Error('Video URL not supported.');
2295
+ }
2296
+ id = id[6];
2297
+ } else {
2298
+ throw new Error('Missing video URL.');
2299
+ }
2300
+
2301
+ this._videos[url] = {
2302
+ type: type,
2303
+ id: id,
2304
+ width: width,
2305
+ height: height
2306
+ };
2307
+
2308
+ item.attr('data-video', url);
2309
+
2310
+ this.thumbnail(target, this._videos[url]);
2311
+ };
2312
+
2313
+ /**
2314
+ * Creates video thumbnail.
2315
+ * @protected
2316
+ * @param {jQuery} target - The target containing the video data.
2317
+ * @param {Object} info - The video info object.
2318
+ * @see `fetch`
2319
+ */
2320
+ Video.prototype.thumbnail = function(target, video) {
2321
+ var tnLink,
2322
+ icon,
2323
+ path,
2324
+ dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
2325
+ customTn = target.find('img'),
2326
+ srcType = 'src',
2327
+ lazyClass = '',
2328
+ settings = this._core.settings,
2329
+ create = function(path) {
2330
+ icon = '<div class="owl-video-play-icon"></div>';
2331
+
2332
+ if (settings.lazyLoad) {
2333
+ tnLink = $('<div/>',{
2334
+ "class": 'owl-video-tn ' + lazyClass,
2335
+ "srcType": path
2336
+ });
2337
+ } else {
2338
+ tnLink = $( '<div/>', {
2339
+ "class": "owl-video-tn",
2340
+ "style": 'opacity:1;background-image:url(' + path + ')'
2341
+ });
2342
+ }
2343
+ target.after(tnLink);
2344
+ target.after(icon);
2345
+ };
2346
+
2347
+ // wrap video content into owl-video-wrapper div
2348
+ target.wrap( $( '<div/>', {
2349
+ "class": "owl-video-wrapper",
2350
+ "style": dimensions
2351
+ }));
2352
+
2353
+ if (this._core.settings.lazyLoad) {
2354
+ srcType = 'data-src';
2355
+ lazyClass = 'owl-lazy';
2356
+ }
2357
+
2358
+ // custom thumbnail
2359
+ if (customTn.length) {
2360
+ create(customTn.attr(srcType));
2361
+ customTn.remove();
2362
+ return false;
2363
+ }
2364
+
2365
+ if (video.type === 'youtube') {
2366
+ path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2367
+ create(path);
2368
+ } else if (video.type === 'vimeo') {
2369
+ $.ajax({
2370
+ type: 'GET',
2371
+ url: '//vimeo.com/api/v2/video/' + video.id + '.json',
2372
+ jsonp: 'callback',
2373
+ dataType: 'jsonp',
2374
+ success: function(data) {
2375
+ path = data[0].thumbnail_large;
2376
+ create(path);
2377
+ }
2378
+ });
2379
+ } else if (video.type === 'vzaar') {
2380
+ $.ajax({
2381
+ type: 'GET',
2382
+ url: '//vzaar.com/api/videos/' + video.id + '.json',
2383
+ jsonp: 'callback',
2384
+ dataType: 'jsonp',
2385
+ success: function(data) {
2386
+ path = data.framegrab_url;
2387
+ create(path);
2388
+ }
2389
+ });
2390
+ }
2391
+ };
2392
+
2393
+ /**
2394
+ * Stops the current video.
2395
+ * @public
2396
+ */
2397
+ Video.prototype.stop = function() {
2398
+ this._core.trigger('stop', null, 'video');
2399
+ this._playing.find('.owl-video-frame').remove();
2400
+ this._playing.removeClass('owl-video-playing');
2401
+ this._playing = null;
2402
+ this._core.leave('playing');
2403
+ this._core.trigger('stopped', null, 'video');
2404
+ };
2405
+
2406
+ /**
2407
+ * Starts the current video.
2408
+ * @public
2409
+ * @param {Event} event - The event arguments.
2410
+ */
2411
+ Video.prototype.play = function(event) {
2412
+ var target = $(event.target),
2413
+ item = target.closest('.' + this._core.settings.itemClass),
2414
+ video = this._videos[item.attr('data-video')],
2415
+ width = video.width || '100%',
2416
+ height = video.height || this._core.$stage.height(),
2417
+ html,
2418
+ iframe;
2419
+
2420
+ if (this._playing) {
2421
+ return;
2422
+ }
2423
+
2424
+ this._core.enter('playing');
2425
+ this._core.trigger('play', null, 'video');
2426
+
2427
+ item = this._core.items(this._core.relative(item.index()));
2428
+
2429
+ this._core.reset(item.index());
2430
+
2431
+ html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
2432
+ html.attr( 'height', height );
2433
+ html.attr( 'width', width );
2434
+ if (video.type === 'youtube') {
2435
+ html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
2436
+ } else if (video.type === 'vimeo') {
2437
+ html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
2438
+ } else if (video.type === 'vzaar') {
2439
+ html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
2440
+ }
2441
+
2442
+ iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
2443
+
2444
+ this._playing = item.addClass('owl-video-playing');
2445
+ };
2446
+
2447
+ /**
2448
+ * Checks whether an video is currently in full screen mode or not.
2449
+ * @todo Bad style because looks like a readonly method but changes members.
2450
+ * @protected
2451
+ * @returns {Boolean}
2452
+ */
2453
+ Video.prototype.isInFullScreen = function() {
2454
+ var element = document.fullscreenElement || document.mozFullScreenElement ||
2455
+ document.webkitFullscreenElement;
2456
+
2457
+ return element && $(element).parent().hasClass('owl-video-frame');
2458
+ };
2459
+
2460
+ /**
2461
+ * Destroys the plugin.
2462
+ */
2463
+ Video.prototype.destroy = function() {
2464
+ var handler, property;
2465
+
2466
+ this._core.$element.off('click.owl.video');
2467
+
2468
+ for (handler in this._handlers) {
2469
+ this._core.$element.off(handler, this._handlers[handler]);
2470
+ }
2471
+ for (property in Object.getOwnPropertyNames(this)) {
2472
+ typeof this[property] != 'function' && (this[property] = null);
2473
+ }
2474
+ };
2475
+
2476
+ $.fn.owlCarousel.Constructor.Plugins.Video = Video;
2477
+
2478
+ })(window.Zepto || window.jQuery, window, document);
2479
+
2480
+ /**
2481
+ * Animate Plugin
2482
+ * @version 2.3.4
2483
+ * @author Bartosz Wojciechowski
2484
+ * @author David Deutsch
2485
+ * @license The MIT License (MIT)
2486
+ */
2487
+ ;(function($, window, document, undefined) {
2488
+
2489
+ /**
2490
+ * Creates the animate plugin.
2491
+ * @class The Navigation Plugin
2492
+ * @param {Owl} scope - The Owl Carousel
2493
+ */
2494
+ var Animate = function(scope) {
2495
+ this.core = scope;
2496
+ this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2497
+ this.swapping = true;
2498
+ this.previous = undefined;
2499
+ this.next = undefined;
2500
+
2501
+ this.handlers = {
2502
+ 'change.owl.carousel': $.proxy(function(e) {
2503
+ if (e.namespace && e.property.name == 'position') {
2504
+ this.previous = this.core.current();
2505
+ this.next = e.property.value;
2506
+ }
2507
+ }, this),
2508
+ 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2509
+ if (e.namespace) {
2510
+ this.swapping = e.type == 'translated';
2511
+ }
2512
+ }, this),
2513
+ 'translate.owl.carousel': $.proxy(function(e) {
2514
+ if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2515
+ this.swap();
2516
+ }
2517
+ }, this)
2518
+ };
2519
+
2520
+ this.core.$element.on(this.handlers);
2521
+ };
2522
+
2523
+ /**
2524
+ * Default options.
2525
+ * @public
2526
+ */
2527
+ Animate.Defaults = {
2528
+ animateOut: false,
2529
+ animateIn: false
2530
+ };
2531
+
2532
+ /**
2533
+ * Toggles the animation classes whenever an translations starts.
2534
+ * @protected
2535
+ * @returns {Boolean|undefined}
2536
+ */
2537
+ Animate.prototype.swap = function() {
2538
+
2539
+ if (this.core.settings.items !== 1) {
2540
+ return;
2541
+ }
2542
+
2543
+ if (!$.support.animation || !$.support.transition) {
2544
+ return;
2545
+ }
2546
+
2547
+ this.core.speed(0);
2548
+
2549
+ var left,
2550
+ clear = $.proxy(this.clear, this),
2551
+ previous = this.core.$stage.children().eq(this.previous),
2552
+ next = this.core.$stage.children().eq(this.next),
2553
+ incoming = this.core.settings.animateIn,
2554
+ outgoing = this.core.settings.animateOut;
2555
+
2556
+ if (this.core.current() === this.previous) {
2557
+ return;
2558
+ }
2559
+
2560
+ if (outgoing) {
2561
+ left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2562
+ previous.one($.support.animation.end, clear)
2563
+ .css( { 'left': left + 'px' } )
2564
+ .addClass('animated owl-animated-out')
2565
+ .addClass(outgoing);
2566
+ }
2567
+
2568
+ if (incoming) {
2569
+ next.one($.support.animation.end, clear)
2570
+ .addClass('animated owl-animated-in')
2571
+ .addClass(incoming);
2572
+ }
2573
+ };
2574
+
2575
+ Animate.prototype.clear = function(e) {
2576
+ $(e.target).css( { 'left': '' } )
2577
+ .removeClass('animated owl-animated-out owl-animated-in')
2578
+ .removeClass(this.core.settings.animateIn)
2579
+ .removeClass(this.core.settings.animateOut);
2580
+ this.core.onTransitionEnd();
2581
+ };
2582
+
2583
+ /**
2584
+ * Destroys the plugin.
2585
+ * @public
2586
+ */
2587
+ Animate.prototype.destroy = function() {
2588
+ var handler, property;
2589
+
2590
+ for (handler in this.handlers) {
2591
+ this.core.$element.off(handler, this.handlers[handler]);
2592
+ }
2593
+ for (property in Object.getOwnPropertyNames(this)) {
2594
+ typeof this[property] != 'function' && (this[property] = null);
2595
+ }
2596
+ };
2597
+
2598
+ $.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2599
+
2600
+ })(window.Zepto || window.jQuery, window, document);
2601
+
2602
+ /**
2603
+ * Autoplay Plugin
2604
+ * @version 2.3.4
2605
+ * @author Bartosz Wojciechowski
2606
+ * @author Artus Kolanowski
2607
+ * @author David Deutsch
2608
+ * @author Tom De Caluwé
2609
+ * @license The MIT License (MIT)
2610
+ */
2611
+ ;(function($, window, document, undefined) {
2612
+
2613
+ /**
2614
+ * Creates the autoplay plugin.
2615
+ * @class The Autoplay Plugin
2616
+ * @param {Owl} scope - The Owl Carousel
2617
+ */
2618
+ var Autoplay = function(carousel) {
2619
+ /**
2620
+ * Reference to the core.
2621
+ * @protected
2622
+ * @type {Owl}
2623
+ */
2624
+ this._core = carousel;
2625
+
2626
+ /**
2627
+ * The autoplay timeout id.
2628
+ * @type {Number}
2629
+ */
2630
+ this._call = null;
2631
+
2632
+ /**
2633
+ * Depending on the state of the plugin, this variable contains either
2634
+ * the start time of the timer or the current timer value if it's
2635
+ * paused. Since we start in a paused state we initialize the timer
2636
+ * value.
2637
+ * @type {Number}
2638
+ */
2639
+ this._time = 0;
2640
+
2641
+ /**
2642
+ * Stores the timeout currently used.
2643
+ * @type {Number}
2644
+ */
2645
+ this._timeout = 0;
2646
+
2647
+ /**
2648
+ * Indicates whenever the autoplay is paused.
2649
+ * @type {Boolean}
2650
+ */
2651
+ this._paused = true;
2652
+
2653
+ /**
2654
+ * All event handlers.
2655
+ * @protected
2656
+ * @type {Object}
2657
+ */
2658
+ this._handlers = {
2659
+ 'changed.owl.carousel': $.proxy(function(e) {
2660
+ if (e.namespace && e.property.name === 'settings') {
2661
+ if (this._core.settings.autoplay) {
2662
+ this.play();
2663
+ } else {
2664
+ this.stop();
2665
+ }
2666
+ } else if (e.namespace && e.property.name === 'position' && this._paused) {
2667
+ // Reset the timer. This code is triggered when the position
2668
+ // of the carousel was changed through user interaction.
2669
+ this._time = 0;
2670
+ }
2671
+ }, this),
2672
+ 'initialized.owl.carousel': $.proxy(function(e) {
2673
+ if (e.namespace && this._core.settings.autoplay) {
2674
+ this.play();
2675
+ }
2676
+ }, this),
2677
+ 'play.owl.autoplay': $.proxy(function(e, t, s) {
2678
+ if (e.namespace) {
2679
+ this.play(t, s);
2680
+ }
2681
+ }, this),
2682
+ 'stop.owl.autoplay': $.proxy(function(e) {
2683
+ if (e.namespace) {
2684
+ this.stop();
2685
+ }
2686
+ }, this),
2687
+ 'mouseover.owl.autoplay': $.proxy(function() {
2688
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2689
+ this.pause();
2690
+ }
2691
+ }, this),
2692
+ 'mouseleave.owl.autoplay': $.proxy(function() {
2693
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2694
+ this.play();
2695
+ }
2696
+ }, this),
2697
+ 'touchstart.owl.core': $.proxy(function() {
2698
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2699
+ this.pause();
2700
+ }
2701
+ }, this),
2702
+ 'touchend.owl.core': $.proxy(function() {
2703
+ if (this._core.settings.autoplayHoverPause) {
2704
+ this.play();
2705
+ }
2706
+ }, this)
2707
+ };
2708
+
2709
+ // register event handlers
2710
+ this._core.$element.on(this._handlers);
2711
+
2712
+ // set default options
2713
+ this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
2714
+ };
2715
+
2716
+ /**
2717
+ * Default options.
2718
+ * @public
2719
+ */
2720
+ Autoplay.Defaults = {
2721
+ autoplay: false,
2722
+ autoplayTimeout: 5000,
2723
+ autoplayHoverPause: false,
2724
+ autoplaySpeed: false
2725
+ };
2726
+
2727
+ /**
2728
+ * Transition to the next slide and set a timeout for the next transition.
2729
+ * @private
2730
+ * @param {Number} [speed] - The animation speed for the animations.
2731
+ */
2732
+ Autoplay.prototype._next = function(speed) {
2733
+ this._call = window.setTimeout(
2734
+ $.proxy(this._next, this, speed),
2735
+ this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
2736
+ );
2737
+
2738
+ if (this._core.is('interacting') || document.hidden) {
2739
+ return;
2740
+ }
2741
+ this._core.next(speed || this._core.settings.autoplaySpeed);
2742
+ }
2743
+
2744
+ /**
2745
+ * Reads the current timer value when the timer is playing.
2746
+ * @public
2747
+ */
2748
+ Autoplay.prototype.read = function() {
2749
+ return new Date().getTime() - this._time;
2750
+ };
2751
+
2752
+ /**
2753
+ * Starts the autoplay.
2754
+ * @public
2755
+ * @param {Number} [timeout] - The interval before the next animation starts.
2756
+ * @param {Number} [speed] - The animation speed for the animations.
2757
+ */
2758
+ Autoplay.prototype.play = function(timeout, speed) {
2759
+ var elapsed;
2760
+
2761
+ if (!this._core.is('rotating')) {
2762
+ this._core.enter('rotating');
2763
+ }
2764
+
2765
+ timeout = timeout || this._core.settings.autoplayTimeout;
2766
+
2767
+ // Calculate the elapsed time since the last transition. If the carousel
2768
+ // wasn't playing this calculation will yield zero.
2769
+ elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
2770
+
2771
+ if (this._paused) {
2772
+ // Start the clock.
2773
+ this._time = this.read();
2774
+ this._paused = false;
2775
+ } else {
2776
+ // Clear the active timeout to allow replacement.
2777
+ window.clearTimeout(this._call);
2778
+ }
2779
+
2780
+ // Adjust the origin of the timer to match the new timeout value.
2781
+ this._time += this.read() % timeout - elapsed;
2782
+
2783
+ this._timeout = timeout;
2784
+ this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
2785
+ };
2786
+
2787
+ /**
2788
+ * Stops the autoplay.
2789
+ * @public
2790
+ */
2791
+ Autoplay.prototype.stop = function() {
2792
+ if (this._core.is('rotating')) {
2793
+ // Reset the clock.
2794
+ this._time = 0;
2795
+ this._paused = true;
2796
+
2797
+ window.clearTimeout(this._call);
2798
+ this._core.leave('rotating');
2799
+ }
2800
+ };
2801
+
2802
+ /**
2803
+ * Pauses the autoplay.
2804
+ * @public
2805
+ */
2806
+ Autoplay.prototype.pause = function() {
2807
+ if (this._core.is('rotating') && !this._paused) {
2808
+ // Pause the clock.
2809
+ this._time = this.read();
2810
+ this._paused = true;
2811
+
2812
+ window.clearTimeout(this._call);
2813
+ }
2814
+ };
2815
+
2816
+ /**
2817
+ * Destroys the plugin.
2818
+ */
2819
+ Autoplay.prototype.destroy = function() {
2820
+ var handler, property;
2821
+
2822
+ this.stop();
2823
+
2824
+ for (handler in this._handlers) {
2825
+ this._core.$element.off(handler, this._handlers[handler]);
2826
+ }
2827
+ for (property in Object.getOwnPropertyNames(this)) {
2828
+ typeof this[property] != 'function' && (this[property] = null);
2829
+ }
2830
+ };
2831
+
2832
+ $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2833
+
2834
+ })(window.Zepto || window.jQuery, window, document);
2835
+
2836
+ /**
2837
+ * Navigation Plugin
2838
+ * @version 2.3.4
2839
+ * @author Artus Kolanowski
2840
+ * @author David Deutsch
2841
+ * @license The MIT License (MIT)
2842
+ */
2843
+ ;(function($, window, document, undefined) {
2844
+ 'use strict';
2845
+
2846
+ /**
2847
+ * Creates the navigation plugin.
2848
+ * @class The Navigation Plugin
2849
+ * @param {Owl} carousel - The Owl Carousel.
2850
+ */
2851
+ var Navigation = function(carousel) {
2852
+ /**
2853
+ * Reference to the core.
2854
+ * @protected
2855
+ * @type {Owl}
2856
+ */
2857
+ this._core = carousel;
2858
+
2859
+ /**
2860
+ * Indicates whether the plugin is initialized or not.
2861
+ * @protected
2862
+ * @type {Boolean}
2863
+ */
2864
+ this._initialized = false;
2865
+
2866
+ /**
2867
+ * The current paging indexes.
2868
+ * @protected
2869
+ * @type {Array}
2870
+ */
2871
+ this._pages = [];
2872
+
2873
+ /**
2874
+ * All DOM elements of the user interface.
2875
+ * @protected
2876
+ * @type {Object}
2877
+ */
2878
+ this._controls = {};
2879
+
2880
+ /**
2881
+ * Markup for an indicator.
2882
+ * @protected
2883
+ * @type {Array.<String>}
2884
+ */
2885
+ this._templates = [];
2886
+
2887
+ /**
2888
+ * The carousel element.
2889
+ * @type {jQuery}
2890
+ */
2891
+ this.$element = this._core.$element;
2892
+
2893
+ /**
2894
+ * Overridden methods of the carousel.
2895
+ * @protected
2896
+ * @type {Object}
2897
+ */
2898
+ this._overrides = {
2899
+ next: this._core.next,
2900
+ prev: this._core.prev,
2901
+ to: this._core.to
2902
+ };
2903
+
2904
+ /**
2905
+ * All event handlers.
2906
+ * @protected
2907
+ * @type {Object}
2908
+ */
2909
+ this._handlers = {
2910
+ 'prepared.owl.carousel': $.proxy(function(e) {
2911
+ if (e.namespace && this._core.settings.dotsData) {
2912
+ this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
2913
+ $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
2914
+ }
2915
+ }, this),
2916
+ 'added.owl.carousel': $.proxy(function(e) {
2917
+ if (e.namespace && this._core.settings.dotsData) {
2918
+ this._templates.splice(e.position, 0, this._templates.pop());
2919
+ }
2920
+ }, this),
2921
+ 'remove.owl.carousel': $.proxy(function(e) {
2922
+ if (e.namespace && this._core.settings.dotsData) {
2923
+ this._templates.splice(e.position, 1);
2924
+ }
2925
+ }, this),
2926
+ 'changed.owl.carousel': $.proxy(function(e) {
2927
+ if (e.namespace && e.property.name == 'position') {
2928
+ this.draw();
2929
+ }
2930
+ }, this),
2931
+ 'initialized.owl.carousel': $.proxy(function(e) {
2932
+ if (e.namespace && !this._initialized) {
2933
+ this._core.trigger('initialize', null, 'navigation');
2934
+ this.initialize();
2935
+ this.update();
2936
+ this.draw();
2937
+ this._initialized = true;
2938
+ this._core.trigger('initialized', null, 'navigation');
2939
+ }
2940
+ }, this),
2941
+ 'refreshed.owl.carousel': $.proxy(function(e) {
2942
+ if (e.namespace && this._initialized) {
2943
+ this._core.trigger('refresh', null, 'navigation');
2944
+ this.update();
2945
+ this.draw();
2946
+ this._core.trigger('refreshed', null, 'navigation');
2947
+ }
2948
+ }, this)
2949
+ };
2950
+
2951
+ // set default options
2952
+ this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
2953
+
2954
+ // register event handlers
2955
+ this.$element.on(this._handlers);
2956
+ };
2957
+
2958
+ /**
2959
+ * Default options.
2960
+ * @public
2961
+ * @todo Rename `slideBy` to `navBy`
2962
+ */
2963
+ Navigation.Defaults = {
2964
+ nav: false,
2965
+ navText: [
2966
+ '<span aria-label="' + 'Previous' + '">&#x2039;</span>',
2967
+ '<span aria-label="' + 'Next' + '">&#x203a;</span>'
2968
+ ],
2969
+ navSpeed: false,
2970
+ navElement: 'button type="button" role="presentation"',
2971
+ navContainer: false,
2972
+ navContainerClass: 'owl-nav',
2973
+ navClass: [
2974
+ 'owl-prev',
2975
+ 'owl-next'
2976
+ ],
2977
+ slideBy: 1,
2978
+ dotClass: 'owl-dot',
2979
+ dotsClass: 'owl-dots',
2980
+ dots: true,
2981
+ dotsEach: false,
2982
+ dotsData: false,
2983
+ dotsSpeed: false,
2984
+ dotsContainer: false
2985
+ };
2986
+
2987
+ /**
2988
+ * Initializes the layout of the plugin and extends the carousel.
2989
+ * @protected
2990
+ */
2991
+ Navigation.prototype.initialize = function() {
2992
+ var override,
2993
+ settings = this._core.settings;
2994
+
2995
+ // create DOM structure for relative navigation
2996
+ this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
2997
+ : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
2998
+
2999
+ this._controls.$previous = $('<' + settings.navElement + '>')
3000
+ .addClass(settings.navClass[0])
3001
+ .html(settings.navText[0])
3002
+ .prependTo(this._controls.$relative)
3003
+ .on('click', $.proxy(function(e) {
3004
+ this.prev(settings.navSpeed);
3005
+ }, this));
3006
+ this._controls.$next = $('<' + settings.navElement + '>')
3007
+ .addClass(settings.navClass[1])
3008
+ .html(settings.navText[1])
3009
+ .appendTo(this._controls.$relative)
3010
+ .on('click', $.proxy(function(e) {
3011
+ this.next(settings.navSpeed);
3012
+ }, this));
3013
+
3014
+ // create DOM structure for absolute navigation
3015
+ if (!settings.dotsData) {
3016
+ this._templates = [ $('<button role="button">')
3017
+ .addClass(settings.dotClass)
3018
+ .append($('<span>'))
3019
+ .prop('outerHTML') ];
3020
+ }
3021
+
3022
+ this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
3023
+ : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
3024
+
3025
+ this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
3026
+ var index = $(e.target).parent().is(this._controls.$absolute)
3027
+ ? $(e.target).index() : $(e.target).parent().index();
3028
+
3029
+ e.preventDefault();
3030
+
3031
+ this.to(index, settings.dotsSpeed);
3032
+ }, this));
3033
+
3034
+ /*$el.on('focusin', function() {
3035
+ $(document).off(".carousel");
3036
+
3037
+ $(document).on('keydown.carousel', function(e) {
3038
+ if(e.keyCode == 37) {
3039
+ $el.trigger('prev.owl')
3040
+ }
3041
+ if(e.keyCode == 39) {
3042
+ $el.trigger('next.owl')
3043
+ }
3044
+ });
3045
+ });*/
3046
+
3047
+ // override public methods of the carousel
3048
+ for (override in this._overrides) {
3049
+ this._core[override] = $.proxy(this[override], this);
3050
+ }
3051
+ };
3052
+
3053
+ /**
3054
+ * Destroys the plugin.
3055
+ * @protected
3056
+ */
3057
+ Navigation.prototype.destroy = function() {
3058
+ var handler, control, property, override, settings;
3059
+ settings = this._core.settings;
3060
+
3061
+ for (handler in this._handlers) {
3062
+ this.$element.off(handler, this._handlers[handler]);
3063
+ }
3064
+ for (control in this._controls) {
3065
+ if (control === '$relative' && settings.navContainer) {
3066
+ this._controls[control].html('');
3067
+ } else {
3068
+ this._controls[control].remove();
3069
+ }
3070
+ }
3071
+ for (override in this.overides) {
3072
+ this._core[override] = this._overrides[override];
3073
+ }
3074
+ for (property in Object.getOwnPropertyNames(this)) {
3075
+ typeof this[property] != 'function' && (this[property] = null);
3076
+ }
3077
+ };
3078
+
3079
+ /**
3080
+ * Updates the internal state.
3081
+ * @protected
3082
+ */
3083
+ Navigation.prototype.update = function() {
3084
+ var i, j, k,
3085
+ lower = this._core.clones().length / 2,
3086
+ upper = lower + this._core.items().length,
3087
+ maximum = this._core.maximum(true),
3088
+ settings = this._core.settings,
3089
+ size = settings.center || settings.autoWidth || settings.dotsData
3090
+ ? 1 : settings.dotsEach || settings.items;
3091
+
3092
+ if (settings.slideBy !== 'page') {
3093
+ settings.slideBy = Math.min(settings.slideBy, settings.items);
3094
+ }
3095
+
3096
+ if (settings.dots || settings.slideBy == 'page') {
3097
+ this._pages = [];
3098
+
3099
+ for (i = lower, j = 0, k = 0; i < upper; i++) {
3100
+ if (j >= size || j === 0) {
3101
+ this._pages.push({
3102
+ start: Math.min(maximum, i - lower),
3103
+ end: i - lower + size - 1
3104
+ });
3105
+ if (Math.min(maximum, i - lower) === maximum) {
3106
+ break;
3107
+ }
3108
+ j = 0, ++k;
3109
+ }
3110
+ j += this._core.mergers(this._core.relative(i));
3111
+ }
3112
+ }
3113
+ };
3114
+
3115
+ /**
3116
+ * Draws the user interface.
3117
+ * @todo The option `dotsData` wont work.
3118
+ * @protected
3119
+ */
3120
+ Navigation.prototype.draw = function() {
3121
+ var difference,
3122
+ settings = this._core.settings,
3123
+ disabled = this._core.items().length <= settings.items,
3124
+ index = this._core.relative(this._core.current()),
3125
+ loop = settings.loop || settings.rewind;
3126
+
3127
+ this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
3128
+
3129
+ if (settings.nav) {
3130
+ this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
3131
+ this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
3132
+ }
3133
+
3134
+ this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
3135
+
3136
+ if (settings.dots) {
3137
+ difference = this._pages.length - this._controls.$absolute.children().length;
3138
+
3139
+ if (settings.dotsData && difference !== 0) {
3140
+ this._controls.$absolute.html(this._templates.join(''));
3141
+ } else if (difference > 0) {
3142
+ this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
3143
+ } else if (difference < 0) {
3144
+ this._controls.$absolute.children().slice(difference).remove();
3145
+ }
3146
+
3147
+ this._controls.$absolute.find('.active').removeClass('active');
3148
+ this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
3149
+ }
3150
+ };
3151
+
3152
+ /**
3153
+ * Extends event data.
3154
+ * @protected
3155
+ * @param {Event} event - The event object which gets thrown.
3156
+ */
3157
+ Navigation.prototype.onTrigger = function(event) {
3158
+ var settings = this._core.settings;
3159
+
3160
+ event.page = {
3161
+ index: $.inArray(this.current(), this._pages),
3162
+ count: this._pages.length,
3163
+ size: settings && (settings.center || settings.autoWidth || settings.dotsData
3164
+ ? 1 : settings.dotsEach || settings.items)
3165
+ };
3166
+ };
3167
+
3168
+ /**
3169
+ * Gets the current page position of the carousel.
3170
+ * @protected
3171
+ * @returns {Number}
3172
+ */
3173
+ Navigation.prototype.current = function() {
3174
+ var current = this._core.relative(this._core.current());
3175
+ return $.grep(this._pages, $.proxy(function(page, index) {
3176
+ return page.start <= current && page.end >= current;
3177
+ }, this)).pop();
3178
+ };
3179
+
3180
+ /**
3181
+ * Gets the current succesor/predecessor position.
3182
+ * @protected
3183
+ * @returns {Number}
3184
+ */
3185
+ Navigation.prototype.getPosition = function(successor) {
3186
+ var position, length,
3187
+ settings = this._core.settings;
3188
+
3189
+ if (settings.slideBy == 'page') {
3190
+ position = $.inArray(this.current(), this._pages);
3191
+ length = this._pages.length;
3192
+ successor ? ++position : --position;
3193
+ position = this._pages[((position % length) + length) % length].start;
3194
+ } else {
3195
+ position = this._core.relative(this._core.current());
3196
+ length = this._core.items().length;
3197
+ successor ? position += settings.slideBy : position -= settings.slideBy;
3198
+ }
3199
+
3200
+ return position;
3201
+ };
3202
+
3203
+ /**
3204
+ * Slides to the next item or page.
3205
+ * @public
3206
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3207
+ */
3208
+ Navigation.prototype.next = function(speed) {
3209
+ $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3210
+ };
3211
+
3212
+ /**
3213
+ * Slides to the previous item or page.
3214
+ * @public
3215
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3216
+ */
3217
+ Navigation.prototype.prev = function(speed) {
3218
+ $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3219
+ };
3220
+
3221
+ /**
3222
+ * Slides to the specified item or page.
3223
+ * @public
3224
+ * @param {Number} position - The position of the item or page.
3225
+ * @param {Number} [speed] - The time in milliseconds for the transition.
3226
+ * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3227
+ */
3228
+ Navigation.prototype.to = function(position, speed, standard) {
3229
+ var length;
3230
+
3231
+ if (!standard && this._pages.length) {
3232
+ length = this._pages.length;
3233
+ $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3234
+ } else {
3235
+ $.proxy(this._overrides.to, this._core)(position, speed);
3236
+ }
3237
+ };
3238
+
3239
+ $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3240
+
3241
+ })(window.Zepto || window.jQuery, window, document);
3242
+
3243
+ /**
3244
+ * Hash Plugin
3245
+ * @version 2.3.4
3246
+ * @author Artus Kolanowski
3247
+ * @author David Deutsch
3248
+ * @license The MIT License (MIT)
3249
+ */
3250
+ ;(function($, window, document, undefined) {
3251
+ 'use strict';
3252
+
3253
+ /**
3254
+ * Creates the hash plugin.
3255
+ * @class The Hash Plugin
3256
+ * @param {Owl} carousel - The Owl Carousel
3257
+ */
3258
+ var Hash = function(carousel) {
3259
+ /**
3260
+ * Reference to the core.
3261
+ * @protected
3262
+ * @type {Owl}
3263
+ */
3264
+ this._core = carousel;
3265
+
3266
+ /**
3267
+ * Hash index for the items.
3268
+ * @protected
3269
+ * @type {Object}
3270
+ */
3271
+ this._hashes = {};
3272
+
3273
+ /**
3274
+ * The carousel element.
3275
+ * @type {jQuery}
3276
+ */
3277
+ this.$element = this._core.$element;
3278
+
3279
+ /**
3280
+ * All event handlers.
3281
+ * @protected
3282
+ * @type {Object}
3283
+ */
3284
+ this._handlers = {
3285
+ 'initialized.owl.carousel': $.proxy(function(e) {
3286
+ if (e.namespace && this._core.settings.startPosition === 'URLHash') {
3287
+ $(window).trigger('hashchange.owl.navigation');
3288
+ }
3289
+ }, this),
3290
+ 'prepared.owl.carousel': $.proxy(function(e) {
3291
+ if (e.namespace) {
3292
+ var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
3293
+
3294
+ if (!hash) {
3295
+ return;
3296
+ }
3297
+
3298
+ this._hashes[hash] = e.content;
3299
+ }
3300
+ }, this),
3301
+ 'changed.owl.carousel': $.proxy(function(e) {
3302
+ if (e.namespace && e.property.name === 'position') {
3303
+ var current = this._core.items(this._core.relative(this._core.current())),
3304
+ hash = $.map(this._hashes, function(item, hash) {
3305
+ return item === current ? hash : null;
3306
+ }).join();
3307
+
3308
+ if (!hash || window.location.hash.slice(1) === hash) {
3309
+ return;
3310
+ }
3311
+
3312
+ window.location.hash = hash;
3313
+ }
3314
+ }, this)
3315
+ };
3316
+
3317
+ // set default options
3318
+ this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3319
+
3320
+ // register the event handlers
3321
+ this.$element.on(this._handlers);
3322
+
3323
+ // register event listener for hash navigation
3324
+ $(window).on('hashchange.owl.navigation', $.proxy(function(e) {
3325
+ var hash = window.location.hash.substring(1),
3326
+ items = this._core.$stage.children(),
3327
+ position = this._hashes[hash] && items.index(this._hashes[hash]);
3328
+
3329
+ if (position === undefined || position === this._core.current()) {
3330
+ return;
3331
+ }
3332
+
3333
+ this._core.to(this._core.relative(position), false, true);
3334
+ }, this));
3335
+ };
3336
+
3337
+ /**
3338
+ * Default options.
3339
+ * @public
3340
+ */
3341
+ Hash.Defaults = {
3342
+ URLhashListener: false
3343
+ };
3344
+
3345
+ /**
3346
+ * Destroys the plugin.
3347
+ * @public
3348
+ */
3349
+ Hash.prototype.destroy = function() {
3350
+ var handler, property;
3351
+
3352
+ $(window).off('hashchange.owl.navigation');
3353
+
3354
+ for (handler in this._handlers) {
3355
+ this._core.$element.off(handler, this._handlers[handler]);
3356
+ }
3357
+ for (property in Object.getOwnPropertyNames(this)) {
3358
+ typeof this[property] != 'function' && (this[property] = null);
3359
+ }
3360
+ };
3361
+
3362
+ $.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3363
+
3364
+ })(window.Zepto || window.jQuery, window, document);
3365
+
3366
+ /**
3367
+ * Support Plugin
3368
+ *
3369
+ * @version 2.3.4
3370
+ * @author Vivid Planet Software GmbH
3371
+ * @author Artus Kolanowski
3372
+ * @author David Deutsch
3373
+ * @license The MIT License (MIT)
3374
+ */
3375
+ ;(function($, window, document, undefined) {
3376
+
3377
+ var style = $('<support>').get(0).style,
3378
+ prefixes = 'Webkit Moz O ms'.split(' '),
3379
+ events = {
3380
+ transition: {
3381
+ end: {
3382
+ WebkitTransition: 'webkitTransitionEnd',
3383
+ MozTransition: 'transitionend',
3384
+ OTransition: 'oTransitionEnd',
3385
+ transition: 'transitionend'
3386
+ }
3387
+ },
3388
+ animation: {
3389
+ end: {
3390
+ WebkitAnimation: 'webkitAnimationEnd',
3391
+ MozAnimation: 'animationend',
3392
+ OAnimation: 'oAnimationEnd',
3393
+ animation: 'animationend'
3394
+ }
3395
+ }
3396
+ },
3397
+ tests = {
3398
+ csstransforms: function() {
3399
+ return !!test('transform');
3400
+ },
3401
+ csstransforms3d: function() {
3402
+ return !!test('perspective');
3403
+ },
3404
+ csstransitions: function() {
3405
+ return !!test('transition');
3406
+ },
3407
+ cssanimations: function() {
3408
+ return !!test('animation');
3409
+ }
3410
+ };
3411
+
3412
+ function test(property, prefixed) {
3413
+ var result = false,
3414
+ upper = property.charAt(0).toUpperCase() + property.slice(1);
3415
+
3416
+ $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
3417
+ if (style[property] !== undefined) {
3418
+ result = prefixed ? property : true;
3419
+ return false;
3420
+ }
3421
+ });
3422
+
3423
+ return result;
3424
+ }
3425
+
3426
+ function prefixed(property) {
3427
+ return test(property, true);
3428
+ }
3429
+
3430
+ if (tests.csstransitions()) {
3431
+ /* jshint -W053 */
3432
+ $.support.transition = new String(prefixed('transition'))
3433
+ $.support.transition.end = events.transition.end[ $.support.transition ];
3434
+ }
3435
+
3436
+ if (tests.cssanimations()) {
3437
+ /* jshint -W053 */
3438
+ $.support.animation = new String(prefixed('animation'))
3439
+ $.support.animation.end = events.animation.end[ $.support.animation ];
3440
+ }
3441
+
3442
+ if (tests.csstransforms()) {
3443
+ /* jshint -W053 */
3444
+ $.support.transform = new String(prefixed('transform'));
3445
+ $.support.transform3d = tests.csstransforms3d();
3446
+ }
3447
+
3448
+ })(window.Zepto || window.jQuery, window, document);
assets_libraries/owl-carousel-new/owl.carousel.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /**
2
+ * Owl Carousel v2.3.4
3
+ * Copyright 2013-2018 David Deutsch
4
+ * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
+ */
6
+ !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?a("<div/>",{class:"owl-video-tn "+j,srcType:c}):a("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("<div/>",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,
7
+ animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
assets_libraries/remote/ue-remote-controls.js ADDED
@@ -0,0 +1,1164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * remote gallery api class
3
+ */
4
+ function UERemoteGalleryAPI(){
5
+
6
+ var g_api, g_isInited;
7
+ var t = this;
8
+
9
+ /**
10
+ * console log some string
11
+ */
12
+ function trace(str){
13
+ console.log(str);
14
+ }
15
+
16
+ /**
17
+ * validate that the object is inited
18
+ */
19
+ function validateInited(){
20
+
21
+ if(g_isInited == false)
22
+ throw new Error("The owl carousel API is not inited");
23
+ }
24
+
25
+ /**
26
+ do some action
27
+ */
28
+ this.doAction = function(action){
29
+
30
+ validateInited();
31
+
32
+ switch(action){
33
+ case "next":
34
+ g_api.nextItem();
35
+ break;
36
+ case "prev":
37
+ g_api.prevItem();
38
+ break;
39
+ default:
40
+ throw new Error("GALLERY API: Wrong action: "+action);
41
+ break;
42
+ }
43
+
44
+ }
45
+
46
+ /**
47
+ * init the api
48
+ */
49
+ this.init = function(objParent){
50
+
51
+ g_api = objParent.data("unitegallery-api");
52
+ if(!g_api)
53
+ return(false);
54
+
55
+ g_isInited = true;
56
+
57
+ return(true);
58
+ }
59
+
60
+
61
+
62
+ }
63
+
64
+
65
+ /**
66
+ * remote tabs api class
67
+ */
68
+ function UERemoteTabsAPI(){
69
+
70
+ var g_objTabs, g_isInited;
71
+ var t = this;
72
+
73
+ /**
74
+ * console log some string
75
+ */
76
+ function trace(str){
77
+ console.log(str);
78
+ }
79
+
80
+ /**
81
+ * validate that the object is inited
82
+ */
83
+ function validateInited(){
84
+
85
+ if(g_isInited == false)
86
+ throw new Error("The owl carousel API is not inited");
87
+ }
88
+
89
+ /**
90
+ do some action
91
+ */
92
+ this.doAction = function(action, arg){
93
+
94
+ validateInited();
95
+
96
+ switch(action){
97
+ case "next":
98
+
99
+ g_objTabs.trigger("next-tab");
100
+
101
+ break;
102
+ case "prev":
103
+
104
+ g_objTabs.trigger("prev-tab");
105
+
106
+ break;
107
+ default:
108
+ throw new Error("TABS API: Wrong action: "+action);
109
+ break;
110
+ }
111
+
112
+ }
113
+
114
+ /**
115
+ * init the api
116
+ */
117
+ this.init = function(objParent){
118
+
119
+ var tabsLoaded = objParent.data("tabs-loaded");
120
+ if(!tabsLoaded)
121
+ return(false);
122
+
123
+ g_objTabs = objParent;
124
+
125
+ g_isInited = true;
126
+
127
+ return(true);
128
+ }
129
+
130
+
131
+
132
+ }
133
+
134
+
135
+ /**
136
+ * remote carousel api class
137
+ */
138
+ function UERemoteCarouselAPI(){
139
+
140
+ var g_owlCarousel, g_owl, g_isInited;
141
+ var t = this;
142
+
143
+ /**
144
+ * console log some string
145
+ */
146
+ function trace(str){
147
+ console.log(str);
148
+ }
149
+
150
+ /**
151
+ * validate that the object is inited
152
+ */
153
+ function validateInited(){
154
+
155
+ if(g_isInited == false)
156
+ throw new Error("The owl carousel API is not inited");
157
+ }
158
+
159
+ /**
160
+ do some action
161
+ */
162
+ this.doAction = function(action, arg1, arg2){
163
+
164
+ validateInited();
165
+
166
+ switch(action){
167
+ case "next":
168
+
169
+ g_owlCarousel.trigger('next.owl.carousel');
170
+
171
+ break;
172
+ case "prev":
173
+
174
+ g_owlCarousel.trigger('prev.owl.carousel');
175
+
176
+ break;
177
+ case "play":
178
+
179
+ g_owlCarousel.trigger('play.owl.autoplay');
180
+ g_owlCarousel.trigger('next.owl.carousel');
181
+
182
+ break;
183
+ case "pause":
184
+
185
+ g_owlCarousel.trigger('stop.owl.autoplay');
186
+ g_owl.settings.autoplay = false;
187
+
188
+ break;
189
+ case "is_playing":
190
+
191
+ if (g_owl.settings.autoplay == true)
192
+ return(true)
193
+ else
194
+ return(false);
195
+
196
+ break;
197
+ case "change_item":
198
+
199
+ g_owlCarousel.trigger('to.owl.carousel', [arg1, null, true]);
200
+
201
+ break;
202
+ case "get_total_items":
203
+
204
+ var owlTotalItems = g_owlCarousel.find(".owl-item:not(.cloned)").length;
205
+ return(owlTotalItems);
206
+
207
+ break;
208
+ case "get_progress_time":
209
+
210
+ var progressTime = g_owl.settings.autoplayTimeout / 1000;
211
+ return(progressTime);
212
+
213
+ break;
214
+ case "get_modified_progress_time":
215
+
216
+ var progressTime = (g_owl.settings.autoplayTimeout - g_owl.settings.smartSpeed) / 1000;
217
+ return(progressTime);
218
+
219
+ break;
220
+ case 'get_num_current':
221
+
222
+ var currentItem = g_owl.relative(g_owl.current());
223
+
224
+ return(currentItem);
225
+ break;
226
+ case "get_total_text":
227
+
228
+ var owlTotalItems = g_owlCarousel.find(".owl-item:not(.cloned)").length;
229
+ if(owlTotalItems.toString().length < 2){
230
+ owlTotalItems = "0" + owlTotalItems;
231
+ }
232
+ return(owlTotalItems);
233
+
234
+ break;
235
+ case "get_current_text":
236
+
237
+ var owlCurrentItem = g_owl.relative(g_owl.current()) + 1;
238
+ if(owlCurrentItem.toString().length < 2){
239
+ owlCurrentItem = "0" + owlCurrentItem;
240
+ }
241
+ return(owlCurrentItem);
242
+
243
+ break;
244
+ case 'set_slide':
245
+
246
+ var owlTotalItems = g_owlCarousel.find(".owl-item:not(.cloned)").length;
247
+
248
+ if (arg1 >= owlTotalItems){
249
+ g_owlCarousel.trigger('to.owl.carousel', [owlTotalItems - 1, 500, true]);
250
+ } else if (arg1 < 0){
251
+ g_owlCarousel.trigger('to.owl.carousel', [0, 500, true]);
252
+ } else {
253
+ g_owlCarousel.trigger('to.owl.carousel', [arg1, 500, true]);
254
+ }
255
+
256
+ break;
257
+ default:
258
+ throw new Error("Carousel API: Wrong action: "+action);
259
+ break;
260
+ }
261
+
262
+ }
263
+
264
+ /*
265
+ events
266
+ */
267
+ this.onEvent = function(name, func){
268
+
269
+ validateInited();
270
+
271
+ switch(name){
272
+ case "play":
273
+
274
+ g_owlCarousel.on("play.owl.autoplay", func);
275
+
276
+ break;
277
+ case "pause":
278
+
279
+ g_owlCarousel.on("stop.owl.autoplay", func);
280
+
281
+ break;
282
+ case "change":
283
+
284
+ g_owlCarousel.on("changed.owl.carousel", func);
285
+
286
+ break;
287
+ case "translate":
288
+
289
+ g_owlCarousel.on("translate.owl.carousel", func);
290
+
291
+ break;
292
+ case "translated":
293
+
294
+ g_owlCarousel.on("translated.owl.carousel", func);
295
+
296
+ break;
297
+ case "refreshed":
298
+
299
+ g_owlCarousel.on("refreshed.owl.carousel", func);
300
+
301
+ break;
302
+ default:
303
+ throw new Error("Carousel API: Wrong event: "+event);
304
+ break;
305
+
306
+ }
307
+ }
308
+
309
+ /**
310
+ * init the api
311
+ */
312
+ this.init = function(objParent){
313
+
314
+ if(objParent.hasClass("owl-carousel") == false)
315
+ throw new Error("owl-carousel class not found");
316
+
317
+ g_owlCarousel = objParent;
318
+
319
+
320
+ g_owl = g_owlCarousel.data("owl.carousel");
321
+
322
+ if(!g_owl)
323
+ return(false);
324
+
325
+ g_isInited = true;
326
+
327
+ return(true);
328
+
329
+ }
330
+
331
+ }
332
+
333
+ /**
334
+ * ---------------------------------------------------
335
+ * remote carousel api class
336
+ */
337
+ function UERemoteWidgets(){
338
+
339
+ var g_objParent, g_objWidget, g_parentID;
340
+ var g_api;
341
+ var t = this;
342
+
343
+ var g_vars = {
344
+ is_inited:false,
345
+ funcOnInit:null,
346
+ is_editor:null,
347
+ widget_id:null,
348
+ init_options:null
349
+ };
350
+
351
+ var g_types = {
352
+ CAROUSEL:"carousel",
353
+ TABS:"tabs",
354
+ GALLERY:"gallery"
355
+ };
356
+
357
+
358
+ /**
359
+ * console log some string
360
+ */
361
+ function trace(str){
362
+ console.log(str);
363
+ }
364
+
365
+ /**
366
+ * get object property
367
+ */
368
+ function getVal(obj, name, defaultValue){
369
+
370
+ if(!defaultValue)
371
+ var defaultValue = "";
372
+
373
+ var val = "";
374
+
375
+ if(!obj || typeof obj != "object")
376
+ val = defaultValue;
377
+ else if(obj.hasOwnProperty(name) == false){
378
+ val = defaultValue;
379
+ }else{
380
+ val = obj[name];
381
+ }
382
+
383
+ return(val);
384
+ }
385
+
386
+
387
+ function _______INIT_________(){}
388
+
389
+ /**
390
+ * init widget
391
+ */
392
+ function initWidget(widgetID){
393
+
394
+ g_objWidget = jQuery("#"+widgetID);
395
+ if(g_objWidget.length == 0)
396
+ throw new Error("Widget not found by id: "+widgetID);
397
+
398
+ g_vars.widget_id = widgetID;
399
+
400
+ g_parentID = g_objWidget.data("parentid");
401
+
402
+ if(!g_parentID)
403
+ throw new Error("Parent controlled ID not set");
404
+
405
+ }
406
+
407
+ /**
408
+ * get controlled parent type
409
+ */
410
+ function getParentType(){
411
+
412
+ if(!g_objParent || g_objParent.length == 0)
413
+ throw new Error("getParentType: no parent found");
414
+
415
+ if(g_objParent.hasClass("owl-carousel"))
416
+ return(g_types.CAROUSEL);
417
+
418
+ var remoteType = g_objParent.data("remote-type");
419
+
420
+ if(!remoteType)
421
+ return(null);
422
+
423
+ //check if the type valid
424
+
425
+ switch(remoteType){
426
+ case g_types.CAROUSEL:
427
+ case g_types.TABS:
428
+ case g_types.GALLERY:
429
+
430
+ return(remoteType);
431
+ break;
432
+ default:
433
+ throw new Error("Wrong parent remote type: "+remoteType);
434
+ break;
435
+ }
436
+
437
+ return(null);
438
+ }
439
+
440
+ /**
441
+ * get offsets distance
442
+ */
443
+ function getOffsetsDistance(offset1, offset2){
444
+
445
+ var dx = offset2.left-offset1.left;
446
+ var dy = offset2.top-offset1.top;
447
+
448
+ return Math.sqrt(dx*dx+dy*dy);
449
+ }
450
+
451
+
452
+ /**
453
+ * get closest object by offset
454
+ */
455
+ function getClosestByOffset(objParents, objElement){
456
+
457
+ var objClosest = null;
458
+ var minDiff = 1000000;
459
+
460
+ var elementOffset = objElement.offset();
461
+
462
+ jQuery.each(objParents, function(index, parent){
463
+
464
+ var objParent = jQuery(parent);
465
+ var parentOffset = objParent.offset();
466
+
467
+ var distance = getOffsetsDistance(parentOffset, elementOffset);
468
+
469
+ if(distance < minDiff){
470
+ minDiff = distance;
471
+ objClosest = objParent;
472
+ }
473
+
474
+ });
475
+
476
+ return(objClosest);
477
+ }
478
+
479
+
480
+ /**
481
+ * detect closest parent
482
+ */
483
+ function detectClosestParent(){
484
+
485
+ var objParents = jQuery(".uc-remote-parent").not(g_objWidget);
486
+
487
+ var numParents = objParents.length;
488
+
489
+ if(numParents == 0)
490
+ return(null);
491
+
492
+ if(numParents == 1)
493
+ return(objParents);
494
+
495
+ //filter by auto
496
+
497
+ var objParentsFiltered = objParents.filter("[data-remoteid='"+g_parentID+"']");
498
+
499
+ if(objParentsFiltered.lenght == 1)
500
+ return(objParentsFiltered);
501
+
502
+ //find by offset
503
+ var objClosest = getClosestByOffset(objParentsFiltered, g_objWidget);
504
+
505
+ if(objClosest)
506
+ return(objClosest);
507
+
508
+ var firstParent = jQuery(objParentsFiltered[0]);
509
+
510
+
511
+ return(firstParent);
512
+ }
513
+
514
+ /**
515
+ * set parent object
516
+ */
517
+ function setParentObject(){
518
+
519
+ var objForceParent = getVal(g_vars.init_options, "force_parent_obj");
520
+
521
+ if(objForceParent){
522
+ g_objParent = objForceParent;
523
+ return(false);
524
+ }
525
+
526
+ if(!g_parentID)
527
+ throw new Error("Parent controller ID not found");
528
+
529
+ if(!g_objParent || g_objParent.length == 0){
530
+
531
+ if(g_parentID == "auto"){
532
+
533
+ g_objParent = detectClosestParent();
534
+
535
+ if(!g_objParent)
536
+ throw new Error("Can't detect remote parent");
537
+
538
+ }
539
+ else{
540
+ g_objParent = jQuery(".uc-remote-parent[data-remoteid='"+g_parentID+"']").not(g_objWidget);
541
+
542
+ if(g_objParent.length == 0)
543
+ throw new Error("Parent widget with remote name:'"+g_parentID+"' not found");
544
+ }
545
+
546
+ }
547
+
548
+ }
549
+
550
+ /**
551
+ * init parent
552
+ */
553
+ function initParent(){
554
+
555
+ setParentObject();
556
+
557
+ //set type and related objects
558
+ if(!g_api){
559
+
560
+ var parentType = getParentType();
561
+
562
+ if(!parentType){
563
+ trace(g_objParent);
564
+ throw new Error("No parent type found");
565
+ }
566
+
567
+ //init the api
568
+ switch(parentType){
569
+ case g_types.CAROUSEL:
570
+ g_api = new UERemoteCarouselAPI();
571
+ break;
572
+ case g_types.TABS:
573
+
574
+ g_api = new UERemoteTabsAPI();
575
+
576
+ break;
577
+ case g_types.GALLERY:
578
+
579
+ g_api = new UERemoteGalleryAPI();
580
+
581
+ break;
582
+ default:
583
+ throw new Error("Wrong parent type: "+parentType);
584
+ break;
585
+ }
586
+
587
+ }
588
+
589
+ var isInited = g_api.init(g_objParent);
590
+
591
+ return(isInited);
592
+ }
593
+
594
+
595
+ /**
596
+ init global helper function
597
+ */
598
+ function initGlobal(widgetID, func){
599
+
600
+ if(!g_objWidget)
601
+ initWidget(widgetID);
602
+
603
+ g_vars.is_inited = initParent();
604
+
605
+ if(g_vars.is_inited == false)
606
+ g_objParent.on("uc-object-ready", func);
607
+
608
+ }
609
+
610
+
611
+ /**
612
+ * set action, bind to some object
613
+ * objElement can be jQuery object or selector
614
+ */
615
+ this.setAction = function(action, objElement){
616
+
617
+ if(g_vars.is_inited == false)
618
+ throw new Error("Widget not inited");
619
+
620
+ if(typeof objElement == "string")
621
+ objElement = g_objWidget.find(objElement);
622
+
623
+ if(!objElement || objElement.length == 0)
624
+ throw new Error("Element not inited");
625
+
626
+ if(!g_api)
627
+ throw new Error("API not inited!");
628
+
629
+ //avoid double action
630
+ var linkedAction = objElement.data("uc-action");
631
+ if(linkedAction)
632
+ throw new Error("No double actions allowed! existing: "+linkedAction+" new: "+action);
633
+
634
+ objElement.data("uc-action", action);
635
+
636
+ objElement.on("click",function(){
637
+
638
+ g_api.doAction(action);
639
+
640
+ });
641
+
642
+ }
643
+
644
+
645
+ /**
646
+ * run this function after the widget is ready to use
647
+ */
648
+ function onWidgetReady(){
649
+
650
+ checkWidgetDebug();
651
+
652
+ var isEditorMode = isInsideEditor();
653
+
654
+ //in editor mode check debug every second
655
+
656
+ if(isEditorMode == true){
657
+
658
+ hideErrorOnWidget();
659
+
660
+ setInterval(checkWidgetInsideEditor, 700);
661
+ }
662
+
663
+
664
+ }
665
+
666
+
667
+ function _______ERROR_________(){}
668
+
669
+
670
+ /**
671
+ * hide error on widget
672
+ */
673
+ function hideErrorOnWidget(){
674
+
675
+ if(!g_objWidget || g_objWidget.length == 0)
676
+ return(false);
677
+
678
+ //don't hide if no message
679
+
680
+ var hasError = g_objWidget.data("uc-has-error");
681
+
682
+ if(hasError !== true)
683
+ return(false);
684
+
685
+ var objError = g_objWidget.find('.uc-remote-error');
686
+
687
+ objError.hide();
688
+
689
+ g_objWidget.css({
690
+ "border" : "none"
691
+ });
692
+
693
+ g_objWidget.data("uc-has-error", false);
694
+
695
+ }
696
+
697
+
698
+
699
+ /**
700
+ * add error message div on the widget div
701
+ *
702
+ */
703
+ function addErrorMessageDiv(objWidget){
704
+
705
+ var divError = "<div class='uc-remote-error'></div>";
706
+ g_objWidget.append(divError);
707
+
708
+ var objError = objWidget.find('.uc-remote-error');
709
+
710
+ objError.css({
711
+ "position":"absolute",
712
+ "color":"red",
713
+ "top":"-30px",
714
+ "left":"0px"
715
+ });
716
+
717
+ var objError = objWidget.find('.uc-remote-error');
718
+
719
+ return(objError);
720
+ }
721
+
722
+ /**
723
+ * display some error on widget interface
724
+ */
725
+ function displayErrorOnWidget(objWidget, message){
726
+
727
+ var objError = objWidget.find('.uc-remote-error');
728
+
729
+ //add error div if missing. pause error in editor
730
+ //second time the div will be not empty and it will show the message
731
+ if(objError.length == 0){
732
+ objError = addErrorMessageDiv(objWidget);
733
+
734
+ var isInEditor = isInsideEditor();
735
+ if(isInEditor == true){
736
+
737
+ setTimeout(function(){
738
+ displayErrorOnWidget(objWidget, message);
739
+ },2000);
740
+
741
+ return(false);
742
+ }
743
+
744
+ }
745
+
746
+ //add the error
747
+
748
+ g_objWidget.data("uc-has-error",true);
749
+
750
+ g_objWidget.css({
751
+ "border" : "2px solid red",
752
+ "position" : "relative"
753
+ });
754
+
755
+ objError.show();
756
+
757
+ objError.html(message);
758
+
759
+ }
760
+
761
+
762
+ /**
763
+ * display error message
764
+ */
765
+ function displayErrorMessage(message){
766
+
767
+ if(g_objWidget && g_objWidget.length)
768
+ displayErrorOnWidget(g_objWidget, message);
769
+
770
+ trace(g_objWidget);
771
+
772
+ console.log("UE Remote Error: "+message);
773
+ console.log(message);
774
+
775
+ }
776
+
777
+ function _______DEBUG_________(){}
778
+
779
+
780
+ /**
781
+ * return if the debug is active
782
+ */
783
+ function isDebugActive(){
784
+
785
+ var isActive = g_objWidget.data("debug_active");
786
+
787
+ if(isActive === true)
788
+ return(true);
789
+
790
+ return(false);
791
+ }
792
+
793
+
794
+ /**
795
+ * remove debug visual from the widget
796
+ */
797
+ function removeDebugVisual(){
798
+
799
+ g_objWidget.data("debug_active", false);
800
+
801
+ g_objWidget.css("border","none");
802
+ }
803
+
804
+ /**
805
+ * set debug visual
806
+ */
807
+ function setDebugVisual(color){
808
+
809
+ g_objWidget.data("debug_active", true);
810
+
811
+ g_objWidget.css("border","3px solid "+color);
812
+
813
+ }
814
+
815
+ /**
816
+ * check widget debug
817
+ */
818
+ function checkWidgetDebug(){
819
+
820
+ //get debug color
821
+
822
+ if(!g_objParent || g_vars.is_inited == false){
823
+ removeDebugVisual();
824
+ return(false);
825
+ }
826
+
827
+ var dataDebug = g_objParent.data("debug");
828
+ var isDebug = (dataDebug === true);
829
+
830
+ var isActive = isDebugActive();
831
+
832
+ //trace("check! "+isActive+" "+isDebug);
833
+ //trace(g_objParent);
834
+
835
+ //remove debug if active but no need
836
+
837
+ if(isDebug == false){
838
+
839
+ if(isActive == true)
840
+ removeDebugVisual();
841
+
842
+ return(false);
843
+ }
844
+
845
+ //add debug is not in debug mode
846
+
847
+ if(isActive == false){
848
+
849
+ //get parent color
850
+ var color = addParentDebug();
851
+
852
+ setDebugVisual(color);
853
+
854
+ }
855
+
856
+
857
+ }
858
+
859
+
860
+ this.onEvent = function(name, func){
861
+ g_api.onEvent(name,func)
862
+ }
863
+
864
+ this.doAction = function(action, arg1, arg2){
865
+ return(g_api.doAction(action, arg1, arg2));
866
+ }
867
+
868
+ /**
869
+ * add the parent some debug color
870
+ */
871
+ function addParentDebug(){
872
+
873
+ var color = g_objParent.data("uc-debug-color");
874
+ if(color)
875
+ return(color);
876
+
877
+ var objBody = jQuery("body");
878
+ var dataColors = "uc-remote-debug-colors";
879
+
880
+ var objColors = objBody.data(dataColors);
881
+
882
+ if(!objColors){
883
+ objColors = ["#ffeb00","blue","#808000","#d1e231","#01796f","#8e4585","#ff33cc","#436b95","#eaa221","#b86d29"];
884
+ }
885
+
886
+ var color = objColors.pop();
887
+
888
+ g_objParent.data("uc-debug-color", color);
889
+ objBody.data(dataColors, objColors);
890
+
891
+ g_objParent.css("border","3px solid "+color);
892
+
893
+ return(color);
894
+ }
895
+
896
+
897
+ function _______EDITOR_RELATED_________(){}
898
+
899
+
900
+ /**
901
+ * check if nside editor
902
+ */
903
+ function isInsideEditor(){
904
+
905
+ if(g_vars.is_editor !== null)
906
+ return(g_vars.is_editor);
907
+
908
+ if(typeof window.parent == "undefined"){
909
+
910
+ g_vars.is_editor = false;
911
+
912
+ return(false);
913
+ }
914
+
915
+ if(typeof window.parent.elementor != "undefined"){
916
+
917
+ g_vars.is_editor = true;
918
+
919
+ return(true);
920
+ }
921
+
922
+ g_vars.is_editor = false;
923
+
924
+ return(false);
925
+ }
926
+
927
+ /**
928
+ * reset the settings
929
+ */
930
+ function resetSettingsInsideEditor(){
931
+
932
+ g_objParent = null;
933
+ g_api = null;
934
+ g_vars.is_inited = false
935
+ g_vars.funcOnInit = null;
936
+ }
937
+
938
+
939
+ /**
940
+ * check widget inside editor
941
+ */
942
+ function checkWidgetInsideEditor(){
943
+
944
+ //check for disconnect
945
+ try{
946
+
947
+ hideErrorOnWidget();
948
+
949
+ if(g_vars.is_inited == true){
950
+
951
+ if(g_objParent.is(":hidden")){
952
+
953
+ //disconnect
954
+ resetSettingsInsideEditor();
955
+ }
956
+
957
+ }else{
958
+
959
+ //check for connect
960
+ g_vars.is_inited = initParent();
961
+
962
+ if(g_vars.is_inited == false)
963
+ g_objParent.on("uc-object-ready", g_vars.funcOnInit);
964
+ }
965
+
966
+ checkWidgetDebug();
967
+
968
+ }catch(message){
969
+
970
+ displayErrorMessage(message);
971
+
972
+ return(false);
973
+ }
974
+
975
+
976
+ }
977
+
978
+
979
+
980
+ /**
981
+ * on widget init
982
+ */
983
+ this.onWidgetInit = function(widgetID, func, options){
984
+
985
+ try{
986
+
987
+ if(!g_vars.funcOnInit){
988
+
989
+ if(typeof func != "function")
990
+ throw new Error("onWidgetInit error: the second parameter should be a function");
991
+
992
+ g_vars.funcOnInit = func;
993
+ }
994
+
995
+ g_vars.init_options = options;
996
+
997
+ initGlobal(widgetID, t.onWidgetInit);
998
+
999
+ if(g_vars.is_inited == false)
1000
+ return(false);
1001
+
1002
+ //widget is inited
1003
+
1004
+ onWidgetReady();
1005
+
1006
+ g_vars.funcOnInit(g_objWidget);
1007
+
1008
+ }catch(message){
1009
+
1010
+ displayErrorMessage(message);
1011
+
1012
+ var isEditorMode = isInsideEditor();
1013
+
1014
+ //in editor mode check debug every second
1015
+
1016
+ if(isEditorMode == true)
1017
+ setInterval(checkWidgetInsideEditor, 700);
1018
+
1019
+ return(false);
1020
+ }
1021
+
1022
+ }
1023
+
1024
+ /**
1025
+ * set sync events between 2 apis
1026
+ */
1027
+ function setSyncEvents(objLocalAPI, objRemoteAPI){
1028
+
1029
+ var totalItemsLocal = objLocalAPI.doAction("get_total_items");
1030
+ var totalItemsRemote = objRemoteAPI.doAction("get_total_items");
1031
+
1032
+ if(totalItemsLocal !== totalItemsRemote)
1033
+ throw new Error("Sync failed, number of items should be the same. Now it's "+totalItemsLocal+" and "+totalItemsRemote);
1034
+
1035
+
1036
+ //sync on local change
1037
+
1038
+ objLocalAPI.onEvent("change",function(){
1039
+
1040
+ var currentNumCurrent = objLocalAPI.doAction("get_num_current");
1041
+ var currentNumRemote = objRemoteAPI.doAction("get_num_current");
1042
+
1043
+ if(currentNumCurrent != currentNumRemote)
1044
+ objRemoteAPI.doAction("change_item", currentNumCurrent);
1045
+ });
1046
+
1047
+
1048
+ //sync on remote change
1049
+
1050
+ objRemoteAPI.onEvent("change",function(){
1051
+
1052
+ var currentNumCurrent = objLocalAPI.doAction("get_num_current");
1053
+ var currentNumRemote = objRemoteAPI.doAction("get_num_current");
1054
+
1055
+ if(currentNumCurrent != currentNumRemote)
1056
+ objLocalAPI.doAction("change_item", currentNumRemote);
1057
+ });
1058
+
1059
+
1060
+ }
1061
+
1062
+
1063
+ /**
1064
+ * start parent sync
1065
+ */
1066
+ function startParentSync(){
1067
+
1068
+ var currentID = g_objParent.attr("id");
1069
+
1070
+ var classSync = "uc-is-sync";
1071
+
1072
+ if(g_objParent.hasClass(classSync))
1073
+ return(false);
1074
+
1075
+ var objRemoteAPI = new UERemoteWidgets();
1076
+ var objLocalAPI = new UERemoteWidgets();
1077
+
1078
+ objRemoteAPI.onWidgetInit(currentID, function(objWidget){
1079
+
1080
+ var objConnectedParent = objRemoteAPI.getParent();
1081
+
1082
+ //check classes
1083
+ if(objConnectedParent.hasClass(classSync))
1084
+ return(false);
1085
+
1086
+ if(objWidget.hasClass(classSync))
1087
+ return(false);
1088
+
1089
+ //add classs
1090
+
1091
+ objConnectedParent.addClass(classSync)
1092
+ objWidget.addClass(classSync);
1093
+
1094
+ //create second api
1095
+ objLocalAPI.onWidgetInit(currentID, function(objWidget){
1096
+
1097
+ setSyncEvents(objLocalAPI, objRemoteAPI);
1098
+
1099
+ },{force_parent_obj:objWidget});
1100
+
1101
+ });
1102
+
1103
+
1104
+ }
1105
+
1106
+
1107
+ /**
1108
+ * parent init, init the debug
1109
+ */
1110
+ this.onParentInit = function(objParent){
1111
+
1112
+ g_objParent = objParent;
1113
+
1114
+ if(!g_objParent)
1115
+ return(false);
1116
+
1117
+ if(g_objParent.length == 0)
1118
+ return(false);
1119
+
1120
+ var isDebug = g_objParent.data("debug");
1121
+
1122
+ if(isDebug === true)
1123
+ addParentDebug(objParent);
1124
+
1125
+ var isSync = objParent.data("sync");
1126
+
1127
+ if(isSync == true)
1128
+ startParentSync();
1129
+
1130
+ }
1131
+
1132
+ /**
1133
+ * show the info
1134
+ */
1135
+ this.showInfo = function(){
1136
+
1137
+ trace("parent");
1138
+ trace(g_objParent);
1139
+
1140
+ trace("current widget");
1141
+ trace(g_objWidget);
1142
+
1143
+
1144
+ }
1145
+
1146
+ /**
1147
+ * get the connected parent
1148
+ */
1149
+ this.getParent = function(){
1150
+
1151
+ return(g_objParent);
1152
+ }
1153
+
1154
+ }
1155
+
1156
+ jQuery("body").on("uc-remote-parent-init",function(event, objParent){
1157
+
1158
+ var objRemote = new UERemoteWidgets();
1159
+
1160
+ objRemote.onParentInit(objParent);
1161
+
1162
+ });
1163
+
1164
+
css/admin.css CHANGED
@@ -880,7 +880,9 @@ ul.unite-context-menu li a:focus {
880
  display: inline-block;
881
  width: 92px;
882
  vertical-align: top;
 
883
  }
 
884
  .unite-inputs-label-inline-free {
885
  display: inline-block;
886
  vertical-align: top;
880
  display: inline-block;
881
  width: 92px;
882
  vertical-align: top;
883
+ line-height:24px;
884
  }
885
+
886
  .unite-inputs-label-inline-free {
887
  display: inline-block;
888
  vertical-align: top;
css/unitecreator_styles.css CHANGED
@@ -744,7 +744,17 @@
744
  xpadding-top:4px;
745
  position:relative;
746
  top:7px;
747
-
 
 
 
 
 
 
 
 
 
 
748
  }
749
 
750
 
@@ -935,6 +945,30 @@
935
  }
936
 
937
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
938
  @media ( max-width:1024px ){
939
 
940
  .ui-dialog.unite-dialog-responsive{
@@ -995,11 +1029,11 @@
995
 
996
 
997
  .uc-dialog-param .uc-no-attribute-selected .uc-dialog-condition-operator,
998
- .uc-dialog-param .uc-no-attribute-selected .uc-dialog-condition-value{
999
- display:none;
 
1000
  }
1001
 
1002
-
1003
  .----------------THIRD_PARTY------------- {}
1004
 
1005
  .select2-dropdown{
744
  xpadding-top:4px;
745
  position:relative;
746
  top:7px;
747
+ }
748
+
749
+ .uc-table-params .uc-text-tab{
750
+ background-image:url('../images/icon-tab.svg');
751
+ background-repeat:no-repeat;
752
+ padding-left:18px;
753
+ background-position:left 4px;
754
+ background-size:17px;
755
+ color:#195D24;
756
+ position:relative;
757
+ top:7px;
758
  }
759
 
760
 
945
  }
946
 
947
 
948
+ .uc-dialog-link-addcondition{
949
+ text-decoration:none;
950
+ font-size:22px;
951
+ display:inline-block;
952
+ margin-left:10px;
953
+ }
954
+
955
+ .uc-dialog-condition-value-wrapper{
956
+ display:flex;
957
+ align-items:center;
958
+ }
959
+
960
+ .uc-dialog-link-addcondition:hover{
961
+ text-decoration:underline;
962
+ }
963
+
964
+ .uc-dialog-label-inline {
965
+ display: inline-block !important;
966
+ vertical-align: top;
967
+ line-height:30px;
968
+ padding-right:5px;
969
+ }
970
+
971
+
972
  @media ( max-width:1024px ){
973
 
974
  .ui-dialog.unite-dialog-responsive{
1029
 
1030
 
1031
  .uc-dialog-param .uc-no-attribute-selected .uc-dialog-condition-operator,
1032
+ .uc-dialog-param .uc-no-attribute-selected .uc-dialog-condition-value,
1033
+ .uc-dialog-param .uc-no-attribute-selected .uc-dialog-link-addcondition{
1034
+ display:none !important;
1035
  }
1036
 
 
1037
  .----------------THIRD_PARTY------------- {}
1038
 
1039
  .select2-dropdown{
images/icon-tab.svg ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
2
+ <svg height="50px" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"
3
+ width="50px" xml:space="preserve"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ xmlns:xlink="http://www.w3.org/1999/xlink">
6
+ <path stroke="#195D24" fill="#195D24" d="M390.5,144c0,0-154.7,0-167,0c-4.7,0-10.7-9.9-18.5-19c-7.1-8.3-14.7-13-20.5-13c-7.5,0-60.3,0-60.3,0 c-15.5,0-28.2,8.9-28.2,24.3v234.6c0,15.5,12.7,29.1,28.2,29.1h266.3c15.5,0,25.5-13.6,25.5-29.1V168.8C416,153.3,406,144,390.5,144 z M124.2,128H168c0,0,7.4,0,11.3,0c3.9,0,8.6,1.6,14.3,8.3c12.1,14.3,15.5,23.7,29.9,23.7h167c6.6,0,9.5,2.2,9.5,8.8V192H112v-55.7 C112,127.3,122.3,128,124.2,128z M390.5,384H124.2c-6.5,0-12.2-6.2-12.2-13.1V208h288v162.9C400,376.9,397.4,384,390.5,384z"/>
7
+ </svg>
inc_php/framework/font_manager.class.php CHANGED
@@ -28,7 +28,7 @@ class UniteFontManagerUC{
28
  $filename = "fontawesome-all.css";
29
 
30
  $pathCssFile = GlobalsUC::$pathLibrary."font-awesome5/css/{$filename}";
31
-
32
  UniteFunctionsUC::validateFilepath($pathCssFile,"css file");
33
  $content = file_get_contents($pathCssFile);
34
 
@@ -56,6 +56,8 @@ class UniteFontManagerUC{
56
  */
57
  private function fetchIconsFromCss_getArrIconsFromSvg($type){
58
 
 
 
59
  switch($type){
60
 
61
  case "brand":
@@ -67,16 +69,23 @@ class UniteFontManagerUC{
67
  case "solid":
68
  $filename = "fa-solid-900.svg";
69
  break;
 
 
 
 
70
  default:
71
  UniteFunctionsUC::throwError("Wrong icons type: $type");
72
  break;
73
  }
74
 
 
 
75
 
76
- $pathCssFile = GlobalsUC::$pathLibrary."font-awesome5/css/{$filename}";
77
  UniteFunctionsUC::validateFilepath($pathCssFile,"css file");
78
  $content = file_get_contents($pathCssFile);
79
 
 
80
  $arrLines = explode("\n", $content);
81
  $arrIcons = array();
82
 
@@ -102,7 +111,6 @@ class UniteFontManagerUC{
102
  $arrIcons[$icon] = true;
103
  }
104
 
105
-
106
  return($arrIcons);
107
  }
108
 
@@ -139,7 +147,7 @@ class UniteFontManagerUC{
139
  private function fetchIconsFromCss(){
140
 
141
  $arrIcons = $this->fetchIconsFromCss_getArrIcons();
142
-
143
  $arrBrandIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("brand");
144
  $arrRegularIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("regular");
145
  $arrSolidIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("solid");
@@ -179,6 +187,21 @@ class UniteFontManagerUC{
179
  $this->printIcons($arrAllIcons);
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  /**
184
  * fetch font awsome icons array from site
@@ -257,6 +280,18 @@ class UniteFontManagerUC{
257
  return($jsonIconsFA5);
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
  /**
262
  * get brand icons
@@ -424,7 +459,9 @@ class UniteFontManagerUC{
424
  */
425
  public function fetchIcons(){
426
 
427
- $this->fetchIconsFromCss();
 
 
428
 
429
  }
430
 
28
  $filename = "fontawesome-all.css";
29
 
30
  $pathCssFile = GlobalsUC::$pathLibrary."font-awesome5/css/{$filename}";
31
+
32
  UniteFunctionsUC::validateFilepath($pathCssFile,"css file");
33
  $content = file_get_contents($pathCssFile);
34
 
56
  */
57
  private function fetchIconsFromCss_getArrIconsFromSvg($type){
58
 
59
+ $pathCssFile = null;
60
+
61
  switch($type){
62
 
63
  case "brand":
69
  case "solid":
70
  $filename = "fa-solid-900.svg";
71
  break;
72
+ case "eicons":
73
+
74
+ $pathCssFile = GlobalsUC::$path_base."wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.svg";
75
+ break;
76
  default:
77
  UniteFunctionsUC::throwError("Wrong icons type: $type");
78
  break;
79
  }
80
 
81
+ if(empty($pathCssFile))
82
+ $pathCssFile = GlobalsUC::$pathLibrary."font-awesome5/css/{$filename}";
83
 
84
+
85
  UniteFunctionsUC::validateFilepath($pathCssFile,"css file");
86
  $content = file_get_contents($pathCssFile);
87
 
88
+
89
  $arrLines = explode("\n", $content);
90
  $arrIcons = array();
91
 
111
  $arrIcons[$icon] = true;
112
  }
113
 
 
114
  return($arrIcons);
115
  }
116
 
147
  private function fetchIconsFromCss(){
148
 
149
  $arrIcons = $this->fetchIconsFromCss_getArrIcons();
150
+
151
  $arrBrandIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("brand");
152
  $arrRegularIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("regular");
153
  $arrSolidIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("solid");
187
  $this->printIcons($arrAllIcons);
188
  }
189
 
190
+ /**
191
+ * print elementor icons
192
+ */
193
+ private function printElementorIcons(){
194
+
195
+ $arrIcons = $this->fetchIconsFromCss_getArrIconsFromSvg("eicons");
196
+
197
+ $output = array();
198
+
199
+ foreach($arrIcons as $key=>$stam)
200
+ $output[] = "eicon-".$key;
201
+
202
+ $this->printIcons($output);
203
+
204
+ }
205
 
206
  /**
207
  * fetch font awsome icons array from site
280
  return($jsonIconsFA5);
281
  }
282
 
283
+ /**
284
+ * get elementor icons
285
+ */
286
+ public static function elementor_getJsonIcons(){
287
+
288
+ if(!defined("ELEMENTOR_VERSION"))
289
+ return('[]');
290
+
291
+ $jsonIconsElementor = '["eicon-editor-link","eicon-editor-unlink","eicon-editor-external-link","eicon-editor-close","eicon-editor-list-ol","eicon-editor-list-ul","eicon-editor-bold","eicon-editor-italic","eicon-editor-underline","eicon-editor-paragraph","eicon-editor-h1","eicon-editor-h2","eicon-editor-h3","eicon-editor-h4","eicon-editor-h5","eicon-editor-h6","eicon-editor-quote","eicon-editor-code","eicon-elementor","eicon-elementor-circle","eicon-pojome","eicon-plus","eicon-menu-bar","eicon-apps","eicon-accordion","eicon-alert","eicon-animation-text","eicon-animation","eicon-banner","eicon-blockquote","eicon-button","eicon-call-to-action","eicon-captcha","eicon-carousel","eicon-checkbox","eicon-columns","eicon-countdown","eicon-counter","eicon-date","eicon-divider-shape","eicon-divider","eicon-download-button","eicon-dual-button","eicon-email-field","eicon-facebook-comments","eicon-facebook-like-box","eicon-form-horizontal","eicon-form-vertical","eicon-gallery-grid","eicon-gallery-group","eicon-gallery-justified","eicon-gallery-masonry","eicon-icon-box","eicon-image-before-after","eicon-image-box","eicon-image-hotspot","eicon-image-rollover","eicon-info-box","eicon-inner-section","eicon-mailchimp","eicon-menu-card","eicon-navigation-horizontal","eicon-nav-menu","eicon-navigation-vertical","eicon-number-field","eicon-parallax","eicon-php7","eicon-post-list","eicon-post-slider","eicon-post","eicon-posts-carousel","eicon-posts-grid","eicon-posts-group","eicon-posts-justified","eicon-posts-masonry","eicon-posts-ticker","eicon-price-list","eicon-price-table","eicon-radio","eicon-rtl","eicon-scroll","eicon-search","eicon-select","eicon-share","eicon-sidebar","eicon-skill-bar","eicon-slider-3d","eicon-slider-album","eicon-slider-device","eicon-slider-full-screen","eicon-slider-push","eicon-slider-vertical","eicon-slider-video","eicon-slides","eicon-social-icons","eicon-spacer","eicon-table","eicon-tabs","eicon-tel-field","eicon-text-area","eicon-text-field","eicon-thumbnails-down","eicon-thumbnails-half","eicon-thumbnails-right","eicon-time-line","eicon-toggle","eicon-url","eicon-t-letter","eicon-wordpress","eicon-text","eicon-anchor","eicon-bullet-list","eicon-code","eicon-favorite","eicon-google-maps","eicon-image","eicon-photo-library","eicon-woocommerce","eicon-youtube","eicon-flip-box","eicon-settings","eicon-headphones","eicon-testimonial","eicon-counter-circle","eicon-person","eicon-chevron-right","eicon-chevron-left","eicon-close","eicon-file-download","eicon-save","eicon-zoom-in","eicon-shortcode","eicon-nerd","eicon-device-desktop","eicon-device-tablet","eicon-device-mobile","eicon-document-file","eicon-folder-o","eicon-hypster","eicon-h-align-left","eicon-h-align-right","eicon-h-align-center","eicon-h-align-stretch","eicon-v-align-top","eicon-v-align-bottom","eicon-v-align-middle","eicon-v-align-stretch","eicon-pro-icon","eicon-mail","eicon-lock-user","eicon-testimonial-carousel","eicon-media-carousel","eicon-section","eicon-column","eicon-edit","eicon-clone","eicon-trash","eicon-play","eicon-angle-right","eicon-angle-left","eicon-animated-headline","eicon-menu-toggle","eicon-fb-embed","eicon-fb-feed","eicon-twitter-embed","eicon-twitter-feed","eicon-sync","eicon-import-export","eicon-check-circle","eicon-library-save","eicon-library-download","eicon-insert","eicon-preview-medium","eicon-sort-down","eicon-sort-up","eicon-heading","eicon-logo","eicon-meta-data","eicon-post-content","eicon-post-excerpt","eicon-post-navigation","eicon-yoast","eicon-nerd-chuckle","eicon-nerd-wink","eicon-comments","eicon-download-circle-o","eicon-library-upload","eicon-save-o","eicon-upload-circle-o","eicon-ellipsis-h","eicon-ellipsis-v","eicon-arrow-left","eicon-arrow-right","eicon-arrow-up","eicon-arrow-down","eicon-play-o","eicon-archive-posts","eicon-archive-title","eicon-featured-image","eicon-post-info","eicon-post-title","eicon-site-logo","eicon-site-search","eicon-site-title","eicon-plus-square","eicon-minus-square","eicon-cloud-check","eicon-drag-n-drop","eicon-welcome","eicon-handle","eicon-cart","eicon-product-add-to-cart","eicon-product-breadcrumbs","eicon-product-categories","eicon-product-description","eicon-product-images","eicon-product-info","eicon-product-meta","eicon-product-pages","eicon-product-price","eicon-product-rating","eicon-product-related","eicon-product-stock","eicon-product-tabs","eicon-product-title","eicon-product-upsell","eicon-products","eicon-bag-light","eicon-bag-medium","eicon-bag-solid","eicon-basket-light","eicon-basket-medium","eicon-basket-solid","eicon-cart-light","eicon-cart-medium","eicon-cart-solid","eicon-exchange","eicon-preview-thin","eicon-device-laptop","eicon-collapse","eicon-expand","eicon-navigator","eicon-plug","eicon-dashboard","eicon-typography","eicon-info-circle-o","eicon-integration","eicon-plus-circle-o","eicon-rating","eicon-review","eicon-tools","eicon-loading","eicon-sitemap","eicon-click","eicon-clock","eicon-library-open","eicon-warning","eicon-flow","eicon-cursor-move","eicon-arrow-circle-left","eicon-flash","eicon-redo","eicon-ban","eicon-barcode","eicon-calendar","eicon-caret-left","eicon-caret-right","eicon-caret-up","eicon-chain-broken","eicon-check-circle-o","eicon-check","eicon-chevron-double-left","eicon-chevron-double-right","eicon-undo","eicon-filter","eicon-circle-o","eicon-circle","eicon-clock-o","eicon-cog","eicon-cogs","eicon-commenting-o","eicon-copy","eicon-database","eicon-dot-circle-o","eicon-envelope","eicon-external-link-square","eicon-eyedropper","eicon-folder","eicon-font","eicon-adjust","eicon-lightbox","eicon-heart-o","eicon-history","eicon-image-bold","eicon-info-circle","eicon-link","eicon-long-arrow-left","eicon-long-arrow-right","eicon-caret-down","eicon-paint-brush","eicon-pencil","eicon-plus-circle","eicon-zoom-in-bold","eicon-sort-amount-desc","eicon-sign-out","eicon-spinner","eicon-square","eicon-star-o","eicon-star","eicon-text-align-justify","eicon-text-align-center","eicon-tags","eicon-text-align-left","eicon-text-align-right","eicon-close-circle","eicon-trash-o","eicon-font-awesome","eicon-user-circle-o","eicon-video-camera","eicon-heart","eicon-wrench","eicon-help","eicon-help-o","eicon-zoom-out-bold","eicon-plus-square-o","eicon-minus-square-o","eicon-minus-circle","eicon-minus-circle-o","eicon-code-bold","eicon-cloud-upload","eicon-search-bold","eicon-map-pin","eicon-meetup","eicon-slideshow","eicon-t-letter-bold","eicon-preferences","eicon-table-of-contents","eicon-tv","eicon-upload","eicon-instagram-comments","eicon-instagram-nested-gallery","eicon-instagram-post","eicon-instagram-video","eicon-instagram-gallery","eicon-instagram-likes","eicon-facebook","eicon-twitter","eicon-pinterest","eicon-frame-expand","eicon-frame-minimize","eicon-archive","eicon-colors-typography","eicon-custom","eicon-footer","eicon-header","eicon-layout-settings","eicon-lightbox-expand","eicon-error-404","eicon-theme-style","eicon-search-results","eicon-single-post","eicon-site-identity","eicon-theme-builder","eicon-download-bold","eicon-share-arrow","eicon-global-settings","eicon-user-preferences","eicon-lock","eicon-export-kit","eicon-import-kit","eicon-lottie","eicon-products-archive","eicon-single-product","eicon-disable-trash-o","eicon-single-page","eicon-wordpress-light","eicon-cogs-check","eicon-custom-css","eicon-global-colors","eicon-globe","eicon-typography-1","eicon-background","eicon-device-responsive","eicon-device-wide","eicon-code-highlight","eicon-video-playlist","eicon-download-kit","eicon-kit-details","eicon-kit-parts","eicon-kit-upload","eicon-kit-plugins","eicon-kit-upload-alt","eicon-hotspot","eicon-paypal-button","eicon-shape","eicon-wordart","eicon-checkout","eicon-container","eicon-flip","eicon-info","eicon-my-account","eicon-purchase-summary","eicon-page-transition","eicon-spotify","eicon-stripe-button","eicon-woo-settings","eicon-woo-cart"]';
292
+
293
+ return($jsonIconsElementor);
294
+ }
295
 
296
  /**
297
  * get brand icons
459
  */
460
  public function fetchIcons(){
461
 
462
+ $this->printElementorIcons();
463
+
464
+ //$this->fetchIconsFromCss();
465
 
466
  }
467
 
inc_php/framework/functions.class.php CHANGED
@@ -597,10 +597,16 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
597
  */
598
  public static function getArrayDuplicateValues($arrAssoc){
599
 
 
 
 
600
  $arrDuplicate = array_diff_assoc($arrAssoc, array_unique($arrAssoc));
601
 
602
  $arrDuplicate = array_flip($arrDuplicate);
603
 
 
 
 
604
  return($arrDuplicate);
605
  }
606
 
@@ -810,15 +816,28 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
810
 
811
  if (mb_strlen($value, $charset) > $length) {
812
  if ($preserve) {
813
- // If breakpoint is on the last word, return the value without separator.
814
- if (false === ($breakpoint = mb_strpos($value, ' ', $length, $charset))) {
815
- return $value;
816
- }
 
 
 
 
 
 
 
 
 
817
 
818
  $length = $breakpoint;
819
  }
820
-
821
- return rtrim(mb_substr($value, 0, $length, $charset)).$separator;
 
 
 
 
822
  }
823
 
824
  return $value;
@@ -1492,6 +1511,38 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1492
  return($url);
1493
  }
1494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1495
 
1496
  public static function z___________VALIDATIONS_________(){}
1497
 
@@ -2333,7 +2384,52 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
2333
 
2334
  public static function z___________OTHERS__________(){}
2335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2337
 
2338
  /**
2339
  * encode svg to bg image url
597
  */
598
  public static function getArrayDuplicateValues($arrAssoc){
599
 
600
+ if(empty($arrAssoc))
601
+ return(array());
602
+
603
  $arrDuplicate = array_diff_assoc($arrAssoc, array_unique($arrAssoc));
604
 
605
  $arrDuplicate = array_flip($arrDuplicate);
606
 
607
+ if(empty($arrDuplicate))
608
+ $arrDuplicate = array();
609
+
610
  return($arrDuplicate);
611
  }
612
 
816
 
817
  if (mb_strlen($value, $charset) > $length) {
818
  if ($preserve) {
819
+
820
+ if(function_exists("mb_strpos")){
821
+ // If breakpoint is on the last word, return the value without separator.
822
+ if (false === ($breakpoint = mb_strpos($value, ' ', $length, $charset))) {
823
+ return $value;
824
+ }
825
+ }else{
826
+
827
+ if (false === ($breakpoint = strpos($value, ' ', $length))) {
828
+ return $value;
829
+ }
830
+
831
+ }
832
 
833
  $length = $breakpoint;
834
  }
835
+
836
+ if(function_exists("mb_substr"))
837
+ return rtrim(mb_substr($value, 0, $length, $charset)).$separator;
838
+ else
839
+ return rtrim(substr($value, 0, $length, $charset)).$separator;
840
+
841
  }
842
 
843
  return $value;
1511
  return($url);
1512
  }
1513
 
1514
+ /**
1515
+ * get links from some content
1516
+ */
1517
+ public static function parseHTMLGetLinks($html){
1518
+
1519
+ $htmlDom = new DOMDocument;
1520
+
1521
+ @$htmlDom->loadHTML($html);
1522
+
1523
+ $links = $htmlDom->getElementsByTagName('a');
1524
+
1525
+ if(empty($links))
1526
+ return(array());
1527
+
1528
+ if($links->length == 0)
1529
+ return(array());
1530
+
1531
+ $arrLinks = array();
1532
+ foreach($links as $link){
1533
+
1534
+ $linkHref = $link->getAttribute('href');
1535
+ if(strlen(trim($linkHref)) == 0)
1536
+ continue;
1537
+ if($linkHref[0] == '#')
1538
+ continue;
1539
+
1540
+ $arrLinks[] = $linkHref;
1541
+ }
1542
+
1543
+ return($arrLinks);
1544
+ }
1545
+
1546
 
1547
  public static function z___________VALIDATIONS_________(){}
1548
 
2384
 
2385
  public static function z___________OTHERS__________(){}
2386
 
2387
+ /**
2388
+ * get youtube video id from url, or ID
2389
+ */
2390
+ public static function getYoutubeVideoID($url){
2391
+
2392
+ preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $url, $matches);
2393
+
2394
+ if(empty($matches))
2395
+ return($url);
2396
+
2397
+ if(count($matches) < 1)
2398
+ return("");
2399
+
2400
+ $videoID = $matches[1];
2401
+
2402
+ return($videoID);
2403
+ }
2404
 
2405
+ /**
2406
+ * get vimeo id from url
2407
+ */
2408
+ public static function getVimeoIDFromUrl($url){
2409
+
2410
+
2411
+ if(is_numeric($url))
2412
+ return($url);
2413
+
2414
+ if(strpos($url, "https://") === false)
2415
+ $url = "https://".$url;
2416
+
2417
+ preg_match('%^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$%im', $url, $matches);
2418
+
2419
+ if(empty($matches))
2420
+ return($url);
2421
+
2422
+ if(count($matches) < 4)
2423
+ return($url);
2424
+
2425
+ $videoID = $matches[3];
2426
+
2427
+ if(is_numeric($videoID) == false)
2428
+ return($url);
2429
+
2430
+
2431
+ return($videoID);
2432
+ }
2433
 
2434
  /**
2435
  * encode svg to bg image url
inc_php/framework/helper_base.class.php CHANGED
@@ -40,6 +40,7 @@ class UniteHelperBaseUC extends HtmlOutputBaseUC{
40
  * echo json ajax response, without message, only data
41
  */
42
  public static function ajaxResponseData($arrData){
 
43
  if(gettype($arrData) == "string")
44
  $arrData = array("data"=>$arrData);
45
 
40
  * echo json ajax response, without message, only data
41
  */
42
  public static function ajaxResponseData($arrData){
43
+
44
  if(gettype($arrData) == "string")
45
  $arrData = array("data"=>$arrData);
46
 
inc_php/framework/instagram/instagram_api_official.class.php CHANGED
@@ -124,6 +124,7 @@ class InstagramAPIOfficialUC{
124
 
125
  }
126
 
 
127
  return($response);
128
  }
129
 
124
 
125
  }
126
 
127
+
128
  return($response);
129
  }
130
 
inc_php/framework/instagram/obj_item.class.php CHANGED
@@ -28,6 +28,7 @@ class InstaObjItemUC{
28
  public $locationName;
29
  public $arrImages;
30
  public $arrVideos;
 
31
  public $videoViews;
32
  public $canViewComments = false;
33
  public $numComments;
@@ -287,6 +288,7 @@ class InstaObjItemUC{
287
  $arr["isvideo"] = $isVideo;
288
  $arr["video_class"] = $class;
289
  $arr["num_video_views"] = $this->getNumVideoViewsText();
 
290
 
291
  return($arr);
292
  }
@@ -608,7 +610,7 @@ class InstaObjItemUC{
608
  * init item by official API
609
  */
610
  public function initOfficialAPI($item){
611
-
612
  $mediaType = UniteFunctionsUC::getVal($item, "media_type");
613
 
614
  switch($mediaType){
@@ -631,16 +633,18 @@ class InstaObjItemUC{
631
  $url = $this->arrVideos[self::VIDEO_STANDART]["url"] = $urlImage;
632
 
633
  $urlImage = UniteFunctionsUC::getVal($item, "thumbnail_url");
 
 
634
  }
635
 
636
  $this->arrImages[self::IMAGE_LOW]["url"] = $urlImage;
637
  $this->arrImages[self::IMAGE_STANDARD]["url"] = $urlImage;
638
 
 
639
  $this->captionText = UniteFunctionsUC::getVal($item, "caption");
640
 
641
  $this->id = UniteFunctionsUC::getVal($item, "id");
642
-
643
-
644
  $this->link = UniteFunctionsUC::getVal($item, "permalink");
645
 
646
  $this->isInited = true;
28
  public $locationName;
29
  public $arrImages;
30
  public $arrVideos;
31
+ public $urlVideo;
32
  public $videoViews;
33
  public $canViewComments = false;
34
  public $numComments;
288
  $arr["isvideo"] = $isVideo;
289
  $arr["video_class"] = $class;
290
  $arr["num_video_views"] = $this->getNumVideoViewsText();
291
+ $arr["url_video"] = $this->urlVideo;
292
 
293
  return($arr);
294
  }
610
  * init item by official API
611
  */
612
  public function initOfficialAPI($item){
613
+
614
  $mediaType = UniteFunctionsUC::getVal($item, "media_type");
615
 
616
  switch($mediaType){
633
  $url = $this->arrVideos[self::VIDEO_STANDART]["url"] = $urlImage;
634
 
635
  $urlImage = UniteFunctionsUC::getVal($item, "thumbnail_url");
636
+
637
+ $this->urlVideo = UniteFunctionsUC::getVal($item, "media_url");
638
  }
639
 
640
  $this->arrImages[self::IMAGE_LOW]["url"] = $urlImage;
641
  $this->arrImages[self::IMAGE_STANDARD]["url"] = $urlImage;
642
 
643
+ $this->hasCaption = true;
644
  $this->captionText = UniteFunctionsUC::getVal($item, "caption");
645
 
646
  $this->id = UniteFunctionsUC::getVal($item, "id");
647
+
 
648
  $this->link = UniteFunctionsUC::getVal($item, "permalink");
649
 
650
  $this->isInited = true;
inc_php/framework/settings.class.php CHANGED
@@ -897,6 +897,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
897
  $setting = $this->modifyBeforeAdd($setting, $modifyType);
898
  }
899
 
 
900
  $this->addSettingByArray($setting);
901
  }
902
 
@@ -1170,8 +1171,12 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1170
  $visibility = (string)UniteFunctionsUC::getVal($attribs, "visibility");
1171
 
1172
  $isForceShow = false;
1173
- if($sapName == "copy_paste_mode" && defined("UC_ENABLE_COPYPASTE"))
 
 
 
1174
  $isForceShow = true;
 
1175
 
1176
  if($visibility == "dev" && GlobalsUC::$inDev == false && $isForceShow == false)
1177
  continue;
897
  $setting = $this->modifyBeforeAdd($setting, $modifyType);
898
  }
899
 
900
+
901
  $this->addSettingByArray($setting);
902
  }
903
 
1171
  $visibility = (string)UniteFunctionsUC::getVal($attribs, "visibility");
1172
 
1173
  $isForceShow = false;
1174
+
1175
+ /*
1176
+ * //demo for show setting
1177
+ if($sapName == "my_setting" && defined("UC_ENABLE_COPYPASTE"))
1178
  $isForceShow = true;
1179
+ */
1180
 
1181
  if($visibility == "dev" && GlobalsUC::$inDev == false && $isForceShow == false)
1182
  continue;
inc_php/framework/zip.class.php CHANGED
@@ -637,9 +637,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
637
  * Extract zip archive
638
  */
639
  public function extract($src, $dest){
640
-
641
- $content = file_get_contents($src);
642
-
643
  if($this->isZipArchiveExists() == true){ //zipArchive
644
  $success = $this->extract_zipArchive($src, $dest);
645
  if($success == true)
@@ -656,7 +654,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
656
  if($success == true)
657
  return(true);
658
  }
659
-
660
  $success = $this->extract_custom($src, $dest);
661
 
662
  return($success);
637
  * Extract zip archive
638
  */
639
  public function extract($src, $dest){
640
+
 
 
641
  if($this->isZipArchiveExists() == true){ //zipArchive
642
  $success = $this->extract_zipArchive($src, $dest);
643
  if($success == true)
654
  if($success == true)
655
  return(true);
656
  }
657
+
658
  $success = $this->extract_custom($src, $dest);
659
 
660
  return($success);
inc_php/unitecreator_addon.class.php CHANGED
@@ -19,6 +19,11 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
19
  const FILENAME_PREVIEW = "preview_addon"; //jpg,png,gif
20
  const FILENAME_ICON_SVG = "preview_icon.svg";
21
 
 
 
 
 
 
22
  private $id = null;
23
  private $isInited = false;
24
  private $title,$type,$html,$htmlItem,$htmlItem2,$css,$cssItem,$js,$updateHash;
@@ -34,6 +39,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
34
  private $isInsideGrid = false, $objAddonType;
35
  private $pathAssetsBase, $urlAssetsBase;
36
  private $arrStoredData = array();
 
 
37
 
38
  private static $arrCacheRecords = array();
39
  private static $arrCacheCats = null;
@@ -200,6 +207,14 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
200
  UniteFunctionsUC::throwError("The widget with name: $name already exists");
201
  }
202
 
 
 
 
 
 
 
 
 
203
 
204
  /**
205
  * init item by ID
@@ -212,7 +227,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
212
 
213
  try{
214
  $record = $this->db->fetchSingle(GlobalsUC::$table_addons,"id={$id}");
215
-
216
  }catch(Exception $e){
217
  UniteFunctionsUC::throwError("Widget with ID: {$id} not found");
218
  }
@@ -418,13 +433,14 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
418
  * get the items type on init
419
  */
420
  private function initItemsType(){
421
-
422
  foreach($this->paramsItems as $param){
423
  $type = UniteFunctionsUC::getVal($param, "type");
424
  if($type == "uc_imagebase")
425
  return(self::ITEMS_TYPE_IMAGE);
426
  }
427
 
 
428
  return(self::ITEMS_TYPE_DEFAULT);
429
  }
430
 
@@ -474,6 +490,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
474
  protected function getItemsSpecialType(){
475
 
476
  foreach($this->params as $param){
 
477
  $type = UniteFunctionsUC::getVal($param, "type");
478
  switch($type){
479
  case UniteCreatorDialogParam::PARAM_POSTS_LIST:
@@ -488,7 +505,18 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
488
  case UniteCreatorDialogParam::PARAM_DATASET:
489
  return self::ITEMS_TYPE_DATASET;
490
  break;
 
 
 
 
 
 
 
 
 
 
491
  }
 
492
  }
493
 
494
  return(null);
@@ -502,20 +530,41 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
502
 
503
  //set spacial items type if exists
504
  $specialType = $this->getItemsSpecialType();
505
-
 
 
506
  if(!empty($specialType)){
507
 
508
  $this->itemsType = $specialType;
509
 
510
- if($specialType == self::ITEMS_TYPE_FORM || $specialType == self::ITEMS_TYPE_DATASET){
 
511
  $this->hasItems = true;
512
- return(false);
513
  }else{
514
  $this->hasItems = false;
515
  $this->options["enable_items"] = false;
516
  }
517
 
518
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
 
520
  }
521
 
@@ -525,7 +574,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
525
  * init item by db record
526
  */
527
  public function initByDBRecord($record){
528
-
529
  //cache db record
530
  $addonName = UniteFunctionsUC::getVal($record, "name");
531
  self::$arrCacheRecords[$addonName] = $record;
@@ -616,8 +665,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
616
  if(!empty($jsonIncludes))
617
  $arrIncludes = json_decode($jsonIncludes);
618
  }
619
-
620
  $this->options = $this->initAddonOptions($this->options);
 
621
 
622
  //check params for doubles
623
  $this->params = $this->initParamsFindDoubles($this->params);
@@ -625,7 +675,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
625
 
626
  //process params items
627
  $this->paramsItems = $this->operations->checkAddParamTitle($this->paramsItems);
628
-
629
  //set assets path
630
  $objAddonType = $this->getObjAddonType();
631
  $this->pathAssetsBase = HelperUC::getAssetsPath($objAddonType);
@@ -639,12 +689,10 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
639
  //init if has items
640
  $enableItems = $this->getOption("enable_items");
641
  $this->hasItems = UniteFunctionsUC::strToBool($enableItems);
642
-
643
-
644
  if($this->hasItems)
645
  $this->itemsType = $this->initItemsType();
646
 
647
-
648
  //parse includes
649
  if(!empty($arrIncludes)){
650
 
@@ -663,7 +711,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
663
  $this->includesJSLib = $this->normalizeIncludeArray($this->includesJSLib);
664
 
665
  $this->modifyAfterInit();
666
-
667
  //set default data
668
  $this->setValuesFromDefaultData();
669
 
@@ -1022,12 +1070,20 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1022
  return($this->hasItems);
1023
  }
1024
 
 
 
 
 
 
 
 
1025
 
1026
  /**
1027
  * get items type like image / default
1028
  */
1029
  public function getItemsType(){
1030
 
 
1031
  return($this->itemsType);
1032
  }
1033
 
@@ -1634,6 +1690,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1634
  $arrJsIncludes = array_merge($arrJsIncludes, $arrJs);
1635
  $arrCssIncludes = array_merge($arrCssIncludes, $arrCss);
1636
  }
 
1637
 
1638
  $output = array();
1639
  $output["js"] = $arrJsIncludes;
@@ -1670,6 +1727,29 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1670
 
1671
  private function a______GET_HTML______(){}
1672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1673
  /**
1674
  * get addon config html
1675
  * for vc make another function - get config only
@@ -1682,7 +1762,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1682
  $this->arrHtmlConfigOptions = $options;
1683
 
1684
  $arrParams = $this->objProcessor->processParamsForOutput($this->params);
1685
-
1686
  //add config
1687
  $objSettings = new UniteCreatorSettings();
1688
 
@@ -1692,17 +1772,17 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1692
  $objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
1693
  }
1694
 
 
 
1695
  if(!empty($this->params) || $this->hasItems){
1696
 
1697
  $objSettings->addSap(esc_html__("General","unlimited-elements-for-elementor"),"config",true);
1698
 
1699
  if($this->hasItems == true){
1700
-
1701
  //$this->itemsType == self::ITEMS_TYPE_IMAGE
1702
-
1703
  $objSettings->addItemsPanel($this, $source);
1704
  $objSettings->addHr("after_items_hr");
1705
-
1706
  }
1707
 
1708
  $objSettings->initByCreatorParams($arrParams);
@@ -1829,6 +1909,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1829
  $this->getHtmlConfig(true, $isOutputSidebar, $params);
1830
  }
1831
 
 
1832
  /**
1833
  * get object settings items for config (repeater)
1834
  */
@@ -1852,8 +1933,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1852
  $objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
1853
  }
1854
 
 
1855
  $objSettings->initByCreatorParams($this->paramsItems);
1856
-
1857
  return($objSettings);
1858
  }
1859
 
@@ -2038,7 +2120,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
2038
  public function getArrItemsForConfig(){
2039
 
2040
  $arrItems = $this->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_CONFIG, false);
2041
-
2042
  return($arrItems);
2043
  }
2044
 
@@ -2211,7 +2293,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
2211
 
2212
  $this->validateInited();
2213
 
2214
- if($this->hasItems == false)
2215
  return(false);
2216
 
2217
  if($arrItems === GlobalsUC::VALUE_EMPTY_ARRAY)
@@ -2227,6 +2309,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
2227
  dmp("Error: ".$errorMessage);
2228
  UniteFunctionsUC::throwError($errorMessage);
2229
  }
 
2230
  $this->arrItems = $arrItems;
2231
  }
2232
 
@@ -3133,7 +3216,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
3133
  public function setValuesFromTestData($slotNum){
3134
 
3135
  $arrData = $this->getTestData($slotNum);
3136
-
3137
  if(empty($arrData))
3138
  return(false);
3139
 
19
  const FILENAME_PREVIEW = "preview_addon"; //jpg,png,gif
20
  const FILENAME_ICON_SVG = "preview_icon.svg";
21
 
22
+ const OPERATION_RENDER = "render";
23
+ const OPERATION_CONFIG = "config";
24
+ const OPERATION_EDIT = "edit";
25
+ const OPERATION_WIDGET = "widget";
26
+
27
  private $id = null;
28
  private $isInited = false;
29
  private $title,$type,$html,$htmlItem,$htmlItem2,$css,$cssItem,$js,$updateHash;
39
  private $isInsideGrid = false, $objAddonType;
40
  private $pathAssetsBase, $urlAssetsBase;
41
  private $arrStoredData = array();
42
+ private $operationType = null, $specialType;
43
+
44
 
45
  private static $arrCacheRecords = array();
46
  private static $arrCacheCats = null;
207
  UniteFunctionsUC::throwError("The widget with name: $name already exists");
208
  }
209
 
210
+ /**
211
+ * set loacation
212
+ */
213
+ public function setOperationType($operation){
214
+
215
+ $this->operationType = $operation;
216
+
217
+ }
218
 
219
  /**
220
  * init item by ID
227
 
228
  try{
229
  $record = $this->db->fetchSingle(GlobalsUC::$table_addons,"id={$id}");
230
+
231
  }catch(Exception $e){
232
  UniteFunctionsUC::throwError("Widget with ID: {$id} not found");
233
  }
433
  * get the items type on init
434
  */
435
  private function initItemsType(){
436
+
437
  foreach($this->paramsItems as $param){
438
  $type = UniteFunctionsUC::getVal($param, "type");
439
  if($type == "uc_imagebase")
440
  return(self::ITEMS_TYPE_IMAGE);
441
  }
442
 
443
+
444
  return(self::ITEMS_TYPE_DEFAULT);
445
  }
446
 
490
  protected function getItemsSpecialType(){
491
 
492
  foreach($this->params as $param){
493
+
494
  $type = UniteFunctionsUC::getVal($param, "type");
495
  switch($type){
496
  case UniteCreatorDialogParam::PARAM_POSTS_LIST:
505
  case UniteCreatorDialogParam::PARAM_DATASET:
506
  return self::ITEMS_TYPE_DATASET;
507
  break;
508
+ case UniteCreatorDialogParam::PARAM_LISTING:
509
+
510
+ if($this->operationType != self::OPERATION_EDIT){
511
+
512
+ $useFor = UniteFunctionsUC::getVal($param, "use_for");
513
+ if($useFor == "gallery")
514
+ return(self::ITEMS_TYPE_IMAGE);
515
+ }
516
+
517
+ break;
518
  }
519
+
520
  }
521
 
522
  return(null);
530
 
531
  //set spacial items type if exists
532
  $specialType = $this->getItemsSpecialType();
533
+
534
+ $this->specialType = $specialType;
535
+
536
  if(!empty($specialType)){
537
 
538
  $this->itemsType = $specialType;
539
 
540
+ if($specialType == self::ITEMS_TYPE_FORM || $specialType == self::ITEMS_TYPE_DATASET || $specialType == self::ITEMS_TYPE_IMAGE){
541
+
542
  $this->hasItems = true;
543
+
544
  }else{
545
  $this->hasItems = false;
546
  $this->options["enable_items"] = false;
547
  }
548
 
549
  }
550
+
551
+ //add image fields
552
+ if($specialType == self::ITEMS_TYPE_IMAGE){
553
+
554
+ if($this->operationType == self::OPERATION_WIDGET){
555
+ $this->hasItems = false;
556
+ $this->options["enable_items"] = false;
557
+ }
558
+
559
+
560
+ $paramImageBase = array();
561
+ $paramImageBase["type"] = "uc_imagebase";
562
+ $paramImageBase["name"] = "imagebase_fields";
563
+ $paramImageBase["title"] = "Image Base Fields";
564
+
565
+ $this->paramsItems[] = $paramImageBase;
566
+ }
567
+
568
 
569
  }
570
 
574
  * init item by db record
575
  */
576
  public function initByDBRecord($record){
577
+
578
  //cache db record
579
  $addonName = UniteFunctionsUC::getVal($record, "name");
580
  self::$arrCacheRecords[$addonName] = $record;
665
  if(!empty($jsonIncludes))
666
  $arrIncludes = json_decode($jsonIncludes);
667
  }
668
+
669
  $this->options = $this->initAddonOptions($this->options);
670
+
671
 
672
  //check params for doubles
673
  $this->params = $this->initParamsFindDoubles($this->params);
675
 
676
  //process params items
677
  $this->paramsItems = $this->operations->checkAddParamTitle($this->paramsItems);
678
+
679
  //set assets path
680
  $objAddonType = $this->getObjAddonType();
681
  $this->pathAssetsBase = HelperUC::getAssetsPath($objAddonType);
689
  //init if has items
690
  $enableItems = $this->getOption("enable_items");
691
  $this->hasItems = UniteFunctionsUC::strToBool($enableItems);
692
+
 
693
  if($this->hasItems)
694
  $this->itemsType = $this->initItemsType();
695
 
 
696
  //parse includes
697
  if(!empty($arrIncludes)){
698
 
711
  $this->includesJSLib = $this->normalizeIncludeArray($this->includesJSLib);
712
 
713
  $this->modifyAfterInit();
714
+
715
  //set default data
716
  $this->setValuesFromDefaultData();
717
 
1070
  return($this->hasItems);
1071
  }
1072
 
1073
+ /**
1074
+ * get special type
1075
+ */
1076
+ public function getSpecialType(){
1077
+
1078
+ return($this->specialType);
1079
+ }
1080
 
1081
  /**
1082
  * get items type like image / default
1083
  */
1084
  public function getItemsType(){
1085
 
1086
+
1087
  return($this->itemsType);
1088
  }
1089
 
1690
  $arrJsIncludes = array_merge($arrJsIncludes, $arrJs);
1691
  $arrCssIncludes = array_merge($arrCssIncludes, $arrCss);
1692
  }
1693
+
1694
 
1695
  $output = array();
1696
  $output["js"] = $arrJsIncludes;
1727
 
1728
  private function a______GET_HTML______(){}
1729
 
1730
+ /**
1731
+ * return true if it has dynamic param with gallery
1732
+ */
1733
+ private function hasDynamicGallery(){
1734
+
1735
+ $paramDynamic = $this->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
1736
+
1737
+ if(empty($paramDynamic))
1738
+ return(false);
1739
+
1740
+ $useFor = UniteFunctionsUC::getVal($paramDynamic, "use_for");
1741
+
1742
+ switch($useFor){
1743
+ case "gallery":
1744
+ return(true);
1745
+ break;
1746
+ }
1747
+
1748
+ return(false);
1749
+ }
1750
+
1751
+
1752
+
1753
  /**
1754
  * get addon config html
1755
  * for vc make another function - get config only
1762
  $this->arrHtmlConfigOptions = $options;
1763
 
1764
  $arrParams = $this->objProcessor->processParamsForOutput($this->params);
1765
+
1766
  //add config
1767
  $objSettings = new UniteCreatorSettings();
1768
 
1772
  $objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
1773
  }
1774
 
1775
+ //choose if add items chooser
1776
+
1777
  if(!empty($this->params) || $this->hasItems){
1778
 
1779
  $objSettings->addSap(esc_html__("General","unlimited-elements-for-elementor"),"config",true);
1780
 
1781
  if($this->hasItems == true){
1782
+
1783
  //$this->itemsType == self::ITEMS_TYPE_IMAGE
 
1784
  $objSettings->addItemsPanel($this, $source);
1785
  $objSettings->addHr("after_items_hr");
 
1786
  }
1787
 
1788
  $objSettings->initByCreatorParams($arrParams);
1909
  $this->getHtmlConfig(true, $isOutputSidebar, $params);
1910
  }
1911
 
1912
+
1913
  /**
1914
  * get object settings items for config (repeater)
1915
  */
1933
  $objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
1934
  }
1935
 
1936
+
1937
  $objSettings->initByCreatorParams($this->paramsItems);
1938
+
1939
  return($objSettings);
1940
  }
1941
 
2120
  public function getArrItemsForConfig(){
2121
 
2122
  $arrItems = $this->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_CONFIG, false);
2123
+
2124
  return($arrItems);
2125
  }
2126
 
2293
 
2294
  $this->validateInited();
2295
 
2296
+ if($this->hasItems == false && $this->operationType != self::OPERATION_WIDGET)
2297
  return(false);
2298
 
2299
  if($arrItems === GlobalsUC::VALUE_EMPTY_ARRAY)
2309
  dmp("Error: ".$errorMessage);
2310
  UniteFunctionsUC::throwError($errorMessage);
2311
  }
2312
+
2313
  $this->arrItems = $arrItems;
2314
  }
2315
 
3216
  public function setValuesFromTestData($slotNum){
3217
 
3218
  $arrData = $this->getTestData($slotNum);
3219
+
3220
  if(empty($arrData))
3221
  return(false);
3222
 
inc_php/unitecreator_addon_config.class.php CHANGED
@@ -64,7 +64,7 @@ class UniteCreatorAddonConfig extends HtmlOutputBaseUC{
64
  * get item settings html
65
  */
66
  private function getHtmlSettings($putMode = false){
67
-
68
  $html = "";
69
 
70
  $html .= self::TAB3."<div class='uc-addon-config-settings unite-settings'>".self::BR;
64
  * get item settings html
65
  */
66
  private function getHtmlSettings($putMode = false){
67
+
68
  $html = "";
69
 
70
  $html .= self::TAB3."<div class='uc-addon-config-settings unite-settings'>".self::BR;
inc_php/unitecreator_addons.class.php CHANGED
@@ -1320,6 +1320,7 @@ class UniteCreatorAddons extends UniteElementsBaseUC{
1320
  * save addon defaults from data
1321
  */
1322
  public function saveAddonDefaultsFromData($data){
 
1323
  $this->saveTestAddonData($data, 2);
1324
  }
1325
 
@@ -1329,6 +1330,7 @@ class UniteCreatorAddons extends UniteElementsBaseUC{
1329
  * @param $data
1330
  */
1331
  public function getTestAddonData($data){
 
1332
  $objAddon = $this->initAddonByData($data);
1333
  $slotNum = UniteFunctionsUC::getVal($data, "slotnum");
1334
 
1320
  * save addon defaults from data
1321
  */
1322
  public function saveAddonDefaultsFromData($data){
1323
+
1324
  $this->saveTestAddonData($data, 2);
1325
  }
1326
 
1330
  * @param $data
1331
  */
1332
  public function getTestAddonData($data){
1333
+
1334
  $objAddon = $this->initAddonByData($data);
1335
  $slotNum = UniteFunctionsUC::getVal($data, "slotnum");
1336
 
inc_php/unitecreator_dialog_param.class.php CHANGED
@@ -22,6 +22,7 @@ class UniteCreatorDialogParamWork{
22
  const PARAM_DROPDOWN = "uc_dropdown";
23
  const PARAM_MULTIPLE_SELECT = "uc_multiple_select";
24
  const PARAM_HR = "uc_hr";
 
25
  const PARAM_CONTENT = "uc_content";
26
  const PARAM_POST = "uc_post";
27
  const PARAM_DATASET = "uc_dataset";
@@ -175,8 +176,9 @@ class UniteCreatorDialogParamWork{
175
  $this->addParam(self::PARAM_MULTIPLE_SELECT, esc_html__("Multiple Select", "unlimited-elements-for-elementor"));
176
  $this->addParam(self::PARAM_COLORPICKER, esc_html__("Color Picker", "unlimited-elements-for-elementor"));
177
  $this->addParam(self::PARAM_LINK, esc_html__("Link", "unlimited-elements-for-elementor"));
178
- $this->addParam(self::PARAM_IMAGE, esc_html__("Image", "unlimited-elements-for-elementor"));
179
  $this->addParam(self::PARAM_HR, esc_html__("HR Line", "unlimited-elements-for-elementor"));
 
180
  $this->addParam(self::PARAM_FONT_OVERRIDE, esc_html__("Font Override", "unlimited-elements-for-elementor"));
181
  $this->addParam(self::PARAM_ADDONPICKER, esc_html__("Addon Picker", "unlimited-elements-for-elementor"));
182
 
@@ -373,7 +375,7 @@ class UniteCreatorDialogParamWork{
373
  /**
374
  * put default value param in params dialog
375
  */
376
- protected function putDefaultValueParam($isTextarea = false, $class="", $addStyleChekbox = false){
377
 
378
  //disable in form item mode
379
  $putTextareaText = true;
@@ -382,14 +384,21 @@ class UniteCreatorDialogParamWork{
382
  $addStyleChekbox = false;
383
  $putTextareaText = false;
384
  }
385
-
 
 
 
 
 
 
 
386
  $strClass = "";
387
  if(!empty($class))
388
  $strClass = "class='{$class}'";
389
-
390
  ?>
391
  <div class="unite-inputs-label">
392
- <?php esc_html_e("Default Value", "unlimited-elements-for-elementor")?>:
393
  </div>
394
 
395
  <?php if($isTextarea == false):?>
@@ -557,20 +566,54 @@ class UniteCreatorDialogParamWork{
557
  <?php
558
  }
559
 
 
560
  /**
561
  * put image param settings
562
  */
563
  private function putImageParam(){
564
 
 
 
 
 
 
 
565
  ?>
 
 
566
  <div class="unite-inputs-sap"></div>
567
-
568
- <?php $this->putImageSelectInput("default_value",esc_html__("Default Image","unlimited-elements-for-elementor")); ?>
569
 
570
  <div class="unite-inputs-sap-double"></div>
571
 
572
- <?php $this->putCheckbox("add_image_sizes", __("Add Image Size Select","unlimited-elements-for-elementor"))?>
573
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
574
  <?php
575
  }
576
 
@@ -770,10 +813,19 @@ class UniteCreatorDialogParamWork{
770
 
771
  $arrItems = array(
772
  "template"=>__("Template Loop","unlimited-elements-for-elementor"),
773
- "gallery"=>__("Gallery","unlimited-elements-for-elementor")
 
774
  );
775
 
776
- $htmlSelect = HelperHtmlUC::getHTMLSelect($arrItems,"template","name='use_for' class='unite-inputs-select uc-control' data-controlled-selector='.uc-listing-template-options'", true);
 
 
 
 
 
 
 
 
777
 
778
  ?>
779
 
@@ -783,13 +835,37 @@ class UniteCreatorDialogParamWork{
783
 
784
  <div class="unite-inputs-sap-double"></div>
785
 
786
- <div class="uc-listing-template-options" data-control="template">
 
 
787
  <?php
788
 
789
- $this->putCheckbox("enable_pagination", __("Enable Pagination", "unlimited-elements-for-elementor"));
 
 
 
 
 
 
 
 
 
 
790
 
791
  ?>
792
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
793
  <?php
794
 
795
  }
@@ -849,6 +925,12 @@ class UniteCreatorDialogParamWork{
849
  $this->putCheckbox("is_filterable", __("Enable Filterable Options", "unlimited-elements-for-elementor"));
850
  ?>
851
  <?php endif?>
 
 
 
 
 
 
852
 
853
  <div class="vert_sap10"></div>
854
 
@@ -1330,6 +1412,9 @@ class UniteCreatorDialogParamWork{
1330
  case self::PARAM_HR:
1331
  $this->putNoDefaultValueText();
1332
  break;
 
 
 
1333
  case self::PARAM_FONT_OVERRIDE:
1334
  $text = esc_html__("Use this font override in css tab using special function", "unlimited-elements-for-elementor");
1335
  $this->putNoDefaultValueText($text);
@@ -1481,67 +1566,8 @@ class UniteCreatorDialogParamWork{
1481
  */
1482
  private function putHtmlConditionLeft(){
1483
 
1484
- $checkboxID = "uc_dialog_left_condition_".$this->type;
1485
- $tableID = "uc_dialog_left_condition_table".$this->type;
1486
-
1487
- $checkboxBlockLabelID = "uc_dialog_left_blocklabel_".$this->type;;
1488
-
1489
- ?>
1490
-
1491
- <div class="unite-inputs-sap"></div>
1492
-
1493
- <label for="<?php echo $checkboxID?>" class="unite-inputs-label-inline-free">
1494
- <?php esc_html_e("Enable Condition", "unlimited-elements-for-elementor")?>:
1495
- </label>
1496
- <input id="<?php echo $checkboxID?>" type="checkbox" name="enable_condition" class="uc-control" data-controlled-selector=".uc-dialog-conditions-content">
1497
-
1498
-
1499
- <div class="uc-dialog-conditions-content">
1500
-
1501
- <div class="unite-inputs-sap"></div>
1502
-
1503
- <div class="uc-dialog-conditions-empty">
1504
-
1505
- <?php _e("No parent attribute (dropdown, checkbox or radio) exists in this category")?>
1506
- </div>
1507
 
1508
- <div class="uc-dialog-conditions-inputs">
1509
-
1510
- <label class="unite-inputs-label">
1511
- <?php _e("Show When", "unlimited-elements-for-elementor")?>:
1512
- </label>
1513
-
1514
- <table class="uc-table-dialog-conditions">
1515
- <tr>
1516
- <td>
1517
- <select class="uc-dialog-condition-attribute" name="condition_attribute"></select>
1518
-
1519
- </td>
1520
- <td>
1521
- <select class="uc-dialog-condition-operator" name="condition_operator">
1522
- <option value="equal"><?php _e("Equal","unlimited-elements-for-elementor")?></option>
1523
- <option value="not_equal"><?php _e("Not Equal","unlimited-elements-for-elementor")?></option>
1524
- </select>
1525
- </td>
1526
- <td>
1527
- <select class="uc-dialog-condition-value" name="condition_value"></select>
1528
- </td>
1529
- </tr>
1530
- </table>
1531
-
1532
- </div>
1533
-
1534
- </div>
1535
-
1536
- <div class="unite-inputs-sap"></div>
1537
-
1538
- <label for="<?php echo $checkboxBlockLabelID?>" class="unite-inputs-label-inline-free">
1539
- <?php esc_html_e("Label Block", "unlimited-elements-for-elementor")?>:
1540
- </label>
1541
- <input id="<?php echo $checkboxBlockLabelID?>" type="checkbox" name="label_block">
1542
-
1543
-
1544
- <?php
1545
  }
1546
 
1547
 
@@ -1564,6 +1590,8 @@ class UniteCreatorDialogParamWork{
1564
  //put items param types
1565
  $addParams = "";
1566
 
 
 
1567
  ?>
1568
 
1569
  <!-- Dialog Param: <?php echo esc_html($type)?> -->
@@ -1614,6 +1642,22 @@ class UniteCreatorDialogParamWork{
1614
 
1615
  <?php endif?>
1616
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1617
  <?php if($this->option_putAdminLabel == true):?>
1618
  <div class='uc-dialog-param-admin-label-wrapper'>
1619
  <div class="unite-inputs-sap"></div>
@@ -1728,6 +1772,7 @@ class UniteCreatorDialogParamWork{
1728
  self::PARAM_LINK,
1729
  self::PARAM_EDITOR,
1730
  self::PARAM_HR,
 
1731
  self::PARAM_IMAGE,
1732
  self::PARAM_AUDIO,
1733
  self::PARAM_ICON,
@@ -1764,6 +1809,7 @@ class UniteCreatorDialogParamWork{
1764
  self::PARAM_LINK,
1765
  self::PARAM_EDITOR,
1766
  self::PARAM_HR,
 
1767
  self::PARAM_IMAGE,
1768
  self::PARAM_AUDIO,
1769
  self::PARAM_ICON,
22
  const PARAM_DROPDOWN = "uc_dropdown";
23
  const PARAM_MULTIPLE_SELECT = "uc_multiple_select";
24
  const PARAM_HR = "uc_hr";
25
+ const PARAM_HEADING = "uc_heading";
26
  const PARAM_CONTENT = "uc_content";
27
  const PARAM_POST = "uc_post";
28
  const PARAM_DATASET = "uc_dataset";
176
  $this->addParam(self::PARAM_MULTIPLE_SELECT, esc_html__("Multiple Select", "unlimited-elements-for-elementor"));
177
  $this->addParam(self::PARAM_COLORPICKER, esc_html__("Color Picker", "unlimited-elements-for-elementor"));
178
  $this->addParam(self::PARAM_LINK, esc_html__("Link", "unlimited-elements-for-elementor"));
179
+ $this->addParam(self::PARAM_IMAGE, esc_html__("Image (media)", "unlimited-elements-for-elementor"));
180
  $this->addParam(self::PARAM_HR, esc_html__("HR Line", "unlimited-elements-for-elementor"));
181
+ $this->addParam(self::PARAM_HEADING, esc_html__("Heading", "unlimited-elements-for-elementor"));
182
  $this->addParam(self::PARAM_FONT_OVERRIDE, esc_html__("Font Override", "unlimited-elements-for-elementor"));
183
  $this->addParam(self::PARAM_ADDONPICKER, esc_html__("Addon Picker", "unlimited-elements-for-elementor"));
184
 
375
  /**
376
  * put default value param in params dialog
377
  */
378
+ protected function putDefaultValueParam($isTextarea = false, $class="", $addStyleChekbox = false, $useFor = ""){
379
 
380
  //disable in form item mode
381
  $putTextareaText = true;
384
  $addStyleChekbox = false;
385
  $putTextareaText = false;
386
  }
387
+
388
+ $text = __("Default Value", "unlimited-elements-for-elementor");
389
+
390
+ if($useFor == "heading"){
391
+ $putTextareaText = false;
392
+ $text = __("Enter Text", "unlimited-elements-for-elementor");
393
+ }
394
+
395
  $strClass = "";
396
  if(!empty($class))
397
  $strClass = "class='{$class}'";
398
+
399
  ?>
400
  <div class="unite-inputs-label">
401
+ <?php echo $text?>:
402
  </div>
403
 
404
  <?php if($isTextarea == false):?>
566
  <?php
567
  }
568
 
569
+
570
  /**
571
  * put image param settings
572
  */
573
  private function putImageParam(){
574
 
575
+ $arrTypes = array();
576
+ $arrTypes["image"] = "Image";
577
+ $arrTypes["json"] = "Json (lottie)";
578
+
579
+ $htmlSelect = HelperHtmlUC::getHTMLSelect($arrTypes,"image", "name='media_type' class='uc-control' data-controlled-selector='.uc-media-param-image-attributes'",true);
580
+
581
  ?>
582
+ <?php _e("Media Type","unlimited-elements-for-elementor") ?>:
583
+
584
  <div class="unite-inputs-sap"></div>
585
+
586
+ <?php echo $htmlSelect?>
587
 
588
  <div class="unite-inputs-sap-double"></div>
589
 
590
+ <div class="uc-media-param-image-attributes" data-control="image">
591
+
592
+
593
+ <?php $this->putImageSelectInput("default_value",esc_html__("Default Image","unlimited-elements-for-elementor")); ?>
594
+
595
+ <div class="unite-inputs-sap-double"></div>
596
+
597
+ <?php $this->putCheckbox("add_image_sizes", __("Add Image Size Select","unlimited-elements-for-elementor"))?>
598
+
599
+ </div>
600
+
601
+ <div class="uc-media-param-image-attributes" data-control="json">
602
+
603
+ <div class="unite-inputs-label">
604
+ <?php esc_html_e("Default Json File", "unlimited-elements-for-elementor")?>
605
+ </div>
606
+
607
+ <input type="text" name="default_value_json" value="">
608
+
609
+ <div class="unite-inputs-description">
610
+ * <?php esc_html_e("Write a json file, from assets folder. Important to specify it that the widget will not look empty.", "unlimited-elements-for-elementor")?>
611
+ </div>
612
+
613
+ </div>
614
+
615
+
616
+
617
  <?php
618
  }
619
 
813
 
814
  $arrItems = array(
815
  "template"=>__("Template Loop","unlimited-elements-for-elementor"),
816
+ "gallery"=>__("Gallery","unlimited-elements-for-elementor"),
817
+ "remote"=>__("Remote","unlimited-elements-for-elementor")
818
  );
819
 
820
+ $htmlSelect = HelperHtmlUC::getHTMLSelect($arrItems,"template","name='use_for' class='unite-inputs-select uc-control' data-controlled-selector='.uc-listing-param-options'", true);
821
+
822
+
823
+ $arrRemoteItems = array(
824
+ "parent"=>__("Remote Parent","unlimited-elements-for-elementor"),
825
+ "controller"=>__("Remote Controller","unlimited-elements-for-elementor")
826
+ );
827
+
828
+ $htmlSelectRemote = HelperHtmlUC::getHTMLSelect($arrRemoteItems,"parent","name='remote_type' class='unite-inputs-select'", true);
829
 
830
  ?>
831
 
835
 
836
  <div class="unite-inputs-sap-double"></div>
837
 
838
+ <!-- Gallery -->
839
+
840
+ <div class="uc-listing-param-options" data-control="gallery">
841
  <?php
842
 
843
+ $this->putCheckbox("gallery_enable_video", __("Enable Video Items", "unlimited-elements-for-elementor"));
844
+
845
+ ?>
846
+ </div>
847
+
848
+ <!-- Template -->
849
+
850
+ <div class="uc-listing-param-options" data-control="template">
851
+ <?php
852
+
853
+ $this->putCheckbox("enable_pagination", __("Enable Pagination", "unlimited-elements-for-elementor"));
854
 
855
  ?>
856
  </div>
857
+
858
+ <!-- Remote -->
859
+
860
+ <div class="uc-listing-param-options" data-control="remote">
861
+
862
+ <?php
863
+
864
+ _e("Widget Type","unlimited-elements-for-elementor");?>:
865
+
866
+ <?php echo $htmlSelectRemote; ?>
867
+ </div>
868
+
869
  <?php
870
 
871
  }
925
  $this->putCheckbox("is_filterable", __("Enable Filterable Options", "unlimited-elements-for-elementor"));
926
  ?>
927
  <?php endif?>
928
+
929
+ <div class="vert_sap10"></div>
930
+
931
+ <?php
932
+ $this->putCheckbox("enable_ajax", __("Enable Ajax Options", "unlimited-elements-for-elementor"));
933
+ ?>
934
 
935
  <div class="vert_sap10"></div>
936
 
1412
  case self::PARAM_HR:
1413
  $this->putNoDefaultValueText();
1414
  break;
1415
+ case self::PARAM_HEADING:
1416
+ $this->putDefaultValueParam(true,"",false,"heading");
1417
+ break;
1418
  case self::PARAM_FONT_OVERRIDE:
1419
  $text = esc_html__("Use this font override in css tab using special function", "unlimited-elements-for-elementor");
1420
  $this->putNoDefaultValueText($text);
1566
  */
1567
  private function putHtmlConditionLeft(){
1568
 
1569
+ HelperHtmlUC::putHtmlConditions($this->type);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1570
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1571
  }
1572
 
1573
 
1590
  //put items param types
1591
  $addParams = "";
1592
 
1593
+ $checkboxBlockLabelID = "uc_dialog_left_blocklabel_".$this->type;
1594
+
1595
  ?>
1596
 
1597
  <!-- Dialog Param: <?php echo esc_html($type)?> -->
1642
 
1643
  <?php endif?>
1644
 
1645
+ <div class="unite-inputs-sap"></div>
1646
+
1647
+ <label for="<?php echo $checkboxBlockLabelID?>" class="unite-inputs-label-inline-free">
1648
+ <?php esc_html_e("Label Block", "unlimited-elements-for-elementor")?>:
1649
+ </label>
1650
+ <input id="<?php echo $checkboxBlockLabelID?>" type="checkbox" name="label_block">
1651
+
1652
+ <div class="unite-inputs-sap"></div>
1653
+
1654
+ <label class="uc-dialog-label-inline">
1655
+ <?php esc_html_e("Tab", "unlimited-elements-for-elementor")?>:
1656
+ </label>
1657
+
1658
+ <input type="text" name="tabname" class="unite-input-medium">
1659
+
1660
+
1661
  <?php if($this->option_putAdminLabel == true):?>
1662
  <div class='uc-dialog-param-admin-label-wrapper'>
1663
  <div class="unite-inputs-sap"></div>
1772
  self::PARAM_LINK,
1773
  self::PARAM_EDITOR,
1774
  self::PARAM_HR,
1775
+ self::PARAM_HEADING,
1776
  self::PARAM_IMAGE,
1777
  self::PARAM_AUDIO,
1778
  self::PARAM_ICON,
1809
  self::PARAM_LINK,
1810
  self::PARAM_EDITOR,
1811
  self::PARAM_HR,
1812
+ self::PARAM_HEADING,
1813
  self::PARAM_IMAGE,
1814
  self::PARAM_AUDIO,
1815
  self::PARAM_ICON,
inc_php/unitecreator_filters_process.class.php CHANGED
@@ -18,6 +18,8 @@ class UniteCreatorFiltersProcess{
18
 
19
  private static $isScriptAdded = false;
20
  private static $isFilesAdded = false;
 
 
21
  private static $showDebug = false;
22
  private static $originalQueryVars = null;
23
 
@@ -111,24 +113,32 @@ class UniteCreatorFiltersProcess{
111
  return(self::$arrInputFiltersCache);
112
 
113
  $request = $this->getArrRequest();
114
-
115
  $strFilters = UniteFunctionsUC::getVal($request, "ucfilters");
116
 
117
- if(empty($strFilters))
118
- return(null);
 
119
 
120
- if(self::$showDebug == true){
 
 
121
 
122
- dmp("input filters found: $strFilters");
123
  }
 
 
 
124
 
125
- $arrOutput = $this->parseStrFilters($strFilters);
 
126
 
127
  self::$arrInputFiltersCache = $arrOutput;
128
 
129
  return($arrOutput);
130
  }
131
 
 
132
  /**
133
  * get input filters in assoc mode
134
  */
@@ -138,7 +148,7 @@ class UniteCreatorFiltersProcess{
138
  return(self::$arrFiltersAssocCache);
139
 
140
  $arrFilters = $this->getArrInputFilters();
141
-
142
  $output = array();
143
 
144
  $terms = UniteFunctionsUC::getVal($arrFilters, "terms");
@@ -153,8 +163,8 @@ class UniteCreatorFiltersProcess{
153
  $key = "term_{$taxonomy}_{$slug}";
154
 
155
  $output[$key] = true;
156
-
157
  }
 
158
  }
159
 
160
  self::$arrFiltersAssocCache = $output;
@@ -167,14 +177,15 @@ class UniteCreatorFiltersProcess{
167
  * get filters arguments
168
  */
169
  public function getRequestFilters(){
170
-
171
  if(self::$filters !== null)
172
  return(self::$filters);
173
 
174
  self::$filters = array();
175
 
176
  $arrInputFilters = $this->getArrInputFilters();
177
-
 
178
  if(empty($arrInputFilters))
179
  return(self::$filters);
180
 
@@ -202,13 +213,34 @@ class UniteCreatorFiltersProcess{
202
  if(!empty($arrFilterTerms)){
203
  self::$filters["category"] = $arrFilterTerms;
204
  self::$filters["category_relation"] = "OR";
205
-
206
  }
207
 
 
 
 
 
 
 
 
 
208
  return(self::$filters);
209
  }
210
 
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  /**
213
  * get fitler url from the given slugs
214
  */
@@ -354,25 +386,133 @@ class UniteCreatorFiltersProcess{
354
 
355
  return($currentTerm);
356
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  private function _______AJAX__________(){}
359
 
 
 
 
 
 
 
 
 
 
 
 
 
360
 
361
  /**
362
- * get widget ajax data
 
363
  */
364
- private function putWidgetGridFrontAjaxData(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
 
366
 
367
- //init widget by post id and element id
368
 
369
- $layoutID = UniteFunctionsUC::getPostGetVariable("layoutid","",UniteFunctionsUC::SANITIZE_KEY);
370
- $elementID = UniteFunctionsUC::getPostGetVariable("elid","",UniteFunctionsUC::SANITIZE_KEY);
 
371
 
372
- $arrContent = HelperProviderCoreUC_EL::getElementorContentByPostID($layoutID);
373
 
374
- if(empty($arrContent))
375
- UniteFunctionsUC::throwError("Elementor content not found");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
 
377
  $arrElement = HelperProviderCoreUC_EL::getArrElementFromContent($arrContent, $elementID);
378
 
@@ -388,32 +528,121 @@ class UniteCreatorFiltersProcess{
388
 
389
  if(strpos($widgetType, "ucaddon_") === false)
390
  UniteFunctionsUC::throwError("Cannot output widget content");
 
 
391
 
392
  $widgetName = str_replace("ucaddon_", "", $widgetType);
393
 
394
- //make a check that ajax option is on in this widget
395
-
396
- //get the addon, set the params there
397
-
398
  $addon = new UniteCreatorAddon();
399
  $addon->initByAlias($widgetName, GlobalsUC::ADDON_TYPE_ELEMENTOR);
 
 
400
 
401
- $arrSettingsValues = UniteFunctionsUC::getVal($arrElement, "settings");
 
 
 
 
 
402
 
403
  $addon->setParamsValues($arrSettingsValues);
404
 
405
  //------ get the html output
406
 
407
  //collect the debug html
408
- ob_start();
409
 
410
- $objOutput = new UniteCreatorOutput();
411
- $objOutput->initByAddon($addon);
 
 
 
412
 
413
- $htmlDebug = ob_get_contents();
414
- ob_end_clean();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
 
416
- $html = $objOutput->getHtmlItems();
 
 
 
 
 
 
 
 
 
 
417
 
418
  //output the html
419
  $outputData = array();
@@ -421,8 +650,11 @@ class UniteCreatorFiltersProcess{
421
  if(!empty($htmlDebug))
422
  $outputData["html_debug"] = $htmlDebug;
423
 
424
- $outputData["html_items"] = $html;
425
 
 
 
 
426
  HelperUC::ajaxResponseData($outputData);
427
 
428
  }
@@ -466,14 +698,37 @@ class UniteCreatorFiltersProcess{
466
  UniteProviderFunctionsUC::printCustomScript($script);
467
  }
468
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  /**
470
  * include the client side scripts
471
  */
472
  private function includeClientSideScripts(){
473
 
474
  $this->includeJSFiles();
 
475
  $this->putCustomJsScripts();
476
 
 
 
477
  }
478
 
479
 
@@ -562,7 +817,7 @@ class UniteCreatorFiltersProcess{
562
  $taxonomy = "product_cat";
563
 
564
  $terms = $this->getActiveArchiveTerms($taxonomy);
565
-
566
  if(empty($terms))
567
  return(null);
568
 
@@ -581,29 +836,34 @@ class UniteCreatorFiltersProcess{
581
  */
582
  public function addWidgetFilterableVariables($data, $addon){
583
 
584
- //check if ajax related
585
-
586
  $param = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
587
 
588
  $postListName = UniteFunctionsUC::getVal($param, "name");
589
 
590
  $dataPosts = UniteFunctionsUC::getVal($data, $postListName);
591
 
 
592
  $isAjax = UniteFunctionsUC::getVal($dataPosts, $postListName."_isajax");
593
  $isAjax = UniteFunctionsUC::strToBool($isAjax);
594
 
 
 
 
 
 
 
595
  //check if ajax
596
  $strAttributes = "";
597
 
598
- if($isAjax == true){
599
  $strAttributes .= " data-ajax='true' ";
600
-
601
- $this->includeClientSideScripts();
602
- }
603
 
604
  $data["uc_filtering_attributes"] = $strAttributes;
605
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
606
 
 
607
  return($data);
608
  }
609
 
@@ -630,7 +890,6 @@ class UniteCreatorFiltersProcess{
630
 
631
  /**
632
  * modify post query
633
- * Enter description here ...
634
  */
635
  public function checkModifyMainQuery($query){
636
 
@@ -648,13 +907,12 @@ class UniteCreatorFiltersProcess{
648
 
649
  if(empty($args))
650
  return(false);
651
-
652
-
653
- $query->query_vars = array_merge($query->query_vars, $args);
654
 
 
655
 
656
  }
657
 
 
658
  /**
659
  * show the main query debug
660
  */
@@ -683,7 +941,6 @@ class UniteCreatorFiltersProcess{
683
  exit();
684
  }
685
 
686
-
687
  $frontAjaxAction = UniteFunctionsUC::getPostGetVariable("ucfrontajaxaction","",UniteFunctionsUC::SANITIZE_KEY);
688
 
689
  if(empty($frontAjaxAction))
@@ -712,10 +969,7 @@ class UniteCreatorFiltersProcess{
712
  * init wordpress front filters
713
  */
714
  public function initWPFrontFilters(){
715
-
716
- if(GlobalsUC::$inDev == false)
717
- return(false);
718
-
719
  if(is_admin() == true)
720
  return(false);
721
 
18
 
19
  private static $isScriptAdded = false;
20
  private static $isFilesAdded = false;
21
+ private static $isStyleAdded = false;
22
+
23
  private static $showDebug = false;
24
  private static $originalQueryVars = null;
25
 
113
  return(self::$arrInputFiltersCache);
114
 
115
  $request = $this->getArrRequest();
116
+
117
  $strFilters = UniteFunctionsUC::getVal($request, "ucfilters");
118
 
119
+ $arrOutput = array();
120
+
121
+ //parse filters
122
 
123
+ if(!empty($strFilters)){
124
+ if(self::$showDebug == true)
125
+ dmp("input filters found: $strFilters");
126
 
127
+ $arrOutput = $this->parseStrFilters($strFilters);
128
  }
129
+
130
+ $page = UniteFunctionsUC::getVal($request, "ucpage");
131
+ $page = (int)$page;
132
 
133
+ if(!empty($page))
134
+ $arrOutput["page"] = $page;
135
 
136
  self::$arrInputFiltersCache = $arrOutput;
137
 
138
  return($arrOutput);
139
  }
140
 
141
+
142
  /**
143
  * get input filters in assoc mode
144
  */
148
  return(self::$arrFiltersAssocCache);
149
 
150
  $arrFilters = $this->getArrInputFilters();
151
+
152
  $output = array();
153
 
154
  $terms = UniteFunctionsUC::getVal($arrFilters, "terms");
163
  $key = "term_{$taxonomy}_{$slug}";
164
 
165
  $output[$key] = true;
 
166
  }
167
+
168
  }
169
 
170
  self::$arrFiltersAssocCache = $output;
177
  * get filters arguments
178
  */
179
  public function getRequestFilters(){
180
+
181
  if(self::$filters !== null)
182
  return(self::$filters);
183
 
184
  self::$filters = array();
185
 
186
  $arrInputFilters = $this->getArrInputFilters();
187
+
188
+
189
  if(empty($arrInputFilters))
190
  return(self::$filters);
191
 
213
  if(!empty($arrFilterTerms)){
214
  self::$filters["category"] = $arrFilterTerms;
215
  self::$filters["category_relation"] = "OR";
 
216
  }
217
 
218
+ //get the page
219
+
220
+ $page = UniteFunctionsUC::getVal($arrInputFilters, "page");
221
+
222
+ if(!empty($page))
223
+ self::$filters["page"] = $page;
224
+
225
+
226
  return(self::$filters);
227
  }
228
 
229
 
230
+ /**
231
+ * check if under ajax request
232
+ */
233
+ private function isUnderAjax(){
234
+
235
+ $ajaxAction = UniteFunctionsUC::getPostGetVariable("ucfrontajaxaction","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
236
+
237
+ if(!empty($ajaxAction))
238
+ return(true);
239
+
240
+ return(false);
241
+ }
242
+
243
+
244
  /**
245
  * get fitler url from the given slugs
246
  */
386
 
387
  return($currentTerm);
388
  }
389
+
390
+ private function _______FILTER_ARGS__________(){}
391
+
392
+
393
+ /**
394
+ * get offset
395
+ */
396
+ private function processRequestFilters_getOffset($args, $page){
397
+
398
+ if(empty($page))
399
+ return(null);
400
+
401
+ $perPage = UniteFunctionsUC::getVal($args, "posts_per_page");
402
+
403
+ if(empty($perPage))
404
+ return(null);
405
+
406
+ $offset = ($page-1)*$perPage;
407
+
408
+ if(empty($offset))
409
+ return(null);
410
+
411
+ return($offset);
412
+ }
413
+
414
+
415
+ /**
416
+ * process request filters
417
+ */
418
+ public function processRequestFilters($args){
419
+
420
+ $isUnderAjax = $this->isUnderAjax();
421
+
422
+ if($isUnderAjax == false)
423
+ return($args);
424
+
425
+ $arrFilters = $this->getRequestFilters();
426
+
427
+ //---- set offset ----
428
+
429
+ $page = UniteFunctionsUC::getVal($arrFilters, "page");
430
+ if(!empty($page)){
431
+ $offset = $this->processRequestFilters_getOffset($args, $page);
432
+ if(!empty($offset))
433
+ $args["offset"] = $offset;
434
+ }
435
+
436
+ return($args);
437
+ }
438
+
439
 
440
  private function _______AJAX__________(){}
441
 
442
+ /**
443
+ * get addon post list name
444
+ */
445
+ private function getAddonPostListName($addon){
446
+
447
+ $paramPostList = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
448
+
449
+ $postListName = UniteFunctionsUC::getVal($paramPostList, "name");
450
+
451
+ return($postListName);
452
+ }
453
+
454
 
455
  /**
456
+ * validate if the addon ajax ready
457
+ * if it's have post list and has option that enable ajax
458
  */
459
+ private function validateAddonAjaxReady($addon, $arrSettingsValues){
460
+
461
+ $paramPostList = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
462
+
463
+ if(empty($paramPostList))
464
+ UniteFunctionsUC::throwError("Widget not ready for ajax");
465
+
466
+ $postListName = UniteFunctionsUC::getVal($paramPostList, "name");
467
+
468
+ $isAjaxReady = UniteFunctionsUC::getVal($arrSettingsValues, $postListName."_isajax");
469
+ $isAjaxReady = UniteFunctionsUC::strToBool($isAjaxReady);
470
+
471
+ if($isAjaxReady == false)
472
+ UniteFunctionsUC::throwError("The ajax is not ready for this widget");
473
+
474
+ return($postListName);
475
+ }
476
+
477
+
478
+ /**
479
+ * process the html output - convert all the links, remove the query part
480
+ */
481
+ private function processAjaxHtmlOutput($html){
482
 
483
+ $currentUrl = GlobalsUC::$current_page_url;
484
 
485
+ $arrUrl = parse_url($currentUrl);
486
 
487
+ $query = "?".UniteFunctionsUC::getVal($arrUrl, "query");
488
+
489
+ $html = str_replace($query, "", $html);
490
 
491
+ $query = str_replace("&", "&#038;", $query);
492
 
493
+ $html = str_replace($query, "", $html);
494
+
495
+ return($html);
496
+ }
497
+
498
+ /**
499
+ * modify settings values before set to addon
500
+ * set pagination type to post list values
501
+ */
502
+ private function modifySettingsValues($arrSettingsValues, $postListName){
503
+
504
+ $paginationType = UniteFunctionsUC::getVal($arrSettingsValues, "pagination_type");
505
+
506
+ if(!empty($paginationType))
507
+ $arrSettingsValues[$postListName."_pagination_type"] = $paginationType;
508
+
509
+ return($arrSettingsValues);
510
+ }
511
+
512
+ /**
513
+ * get content element html
514
+ */
515
+ private function getContentWidgetHtml($arrContent, $elementID, $isGrid = true){
516
 
517
  $arrElement = HelperProviderCoreUC_EL::getArrElementFromContent($arrContent, $elementID);
518
 
528
 
529
  if(strpos($widgetType, "ucaddon_") === false)
530
  UniteFunctionsUC::throwError("Cannot output widget content");
531
+
532
+ $arrSettingsValues = UniteFunctionsUC::getVal($arrElement, "settings");
533
 
534
  $widgetName = str_replace("ucaddon_", "", $widgetType);
535
 
 
 
 
 
536
  $addon = new UniteCreatorAddon();
537
  $addon->initByAlias($widgetName, GlobalsUC::ADDON_TYPE_ELEMENTOR);
538
+
539
+ //make a check that ajax option is on in this widget
540
 
541
+ if($isGrid == true){
542
+
543
+ $postListName = $this->validateAddonAjaxReady($addon, $arrSettingsValues);
544
+
545
+ $arrSettingsValues = $this->modifySettingsValues($arrSettingsValues, $postListName);
546
+ }
547
 
548
  $addon->setParamsValues($arrSettingsValues);
549
 
550
  //------ get the html output
551
 
552
  //collect the debug html
 
553
 
554
+ if($isGrid == true)
555
+ ob_start();
556
+
557
+ $objOutput = new UniteCreatorOutput();
558
+ $objOutput->initByAddon($addon);
559
 
560
+ if($isGrid == true){
561
+ $htmlDebug = ob_get_contents();
562
+ ob_end_clean();
563
+ }
564
+
565
+
566
+ $output = array();
567
+
568
+ //get only items
569
+ if($isGrid == true){
570
+ $htmlGridItems = $objOutput->getHtmlItems();
571
+ $output["html"] = $htmlGridItems;
572
+ }
573
+
574
+ //get output of the html template
575
+ if($isGrid == false){
576
+
577
+ $htmlBody = $objOutput->getHtmlOnly();
578
+
579
+ $htmlBody = $this->processAjaxHtmlOutput($htmlBody);
580
+
581
+ $output["html"] = $htmlBody;
582
+ }
583
+
584
+ if($isGrid == true && !empty($htmlDebug))
585
+ $output["html_debug"] = $htmlDebug;
586
+
587
+ return($output);
588
+ }
589
+
590
+
591
+ /**
592
+ * get content widgets html
593
+ */
594
+ private function getContentWidgetsHTML($arrContent, $strIDs){
595
+
596
+ if(empty($strIDs))
597
+ return(null);
598
+
599
+ $arrIDs = explode(",", $strIDs);
600
+
601
+ $arrHTML = array();
602
+
603
+ foreach($arrIDs as $elementID){
604
+
605
+ $output = $this->getContentWidgetHtml($arrContent, $elementID, false);
606
+
607
+ $html = UniteFunctionsUC::getVal($output, "html");
608
+
609
+ $arrHTML[$elementID] = $html;
610
+ }
611
+
612
+ return($arrHTML);
613
+ }
614
+
615
+ /**
616
+ * get widget ajax data
617
+ */
618
+ private function putWidgetGridFrontAjaxData(){
619
+
620
+ //validate by response code
621
+
622
+ $responseCode = http_response_code();
623
+ if($responseCode != 200){
624
+ http_response_code(200);
625
+ UniteFunctionsUC::throwError("Request not allowed, please make sure the pagination is allowed for the ajax grid");
626
+ }
627
+
628
+ //init widget by post id and element id
629
+
630
+ $layoutID = UniteFunctionsUC::getPostGetVariable("layoutid","",UniteFunctionsUC::SANITIZE_KEY);
631
+ $elementID = UniteFunctionsUC::getPostGetVariable("elid","",UniteFunctionsUC::SANITIZE_KEY);
632
+
633
+ $addElIDs = UniteFunctionsUC::getPostGetVariable("addelids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
634
 
635
+ $arrContent = HelperProviderCoreUC_EL::getElementorContentByPostID($layoutID);
636
+
637
+ if(empty($arrContent))
638
+ UniteFunctionsUC::throwError("Elementor content not found");
639
+
640
+ $arrHtmlWidget = $this->getContentWidgetHtml($arrContent, $elementID);
641
+
642
+ $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
643
+ $htmlDebug = UniteFunctionsUC::getVal($arrHtmlWidget, "html_debug");
644
+
645
+ $addWidgetsHTML = $this->getContentWidgetsHTML($arrContent, $addElIDs);
646
 
647
  //output the html
648
  $outputData = array();
650
  if(!empty($htmlDebug))
651
  $outputData["html_debug"] = $htmlDebug;
652
 
653
+ $outputData["html_items"] = $htmlGridItems;
654
 
655
+ if(!empty($addWidgetsHTML))
656
+ $outputData["html_widgets"] = $addWidgetsHTML;
657
+
658
  HelperUC::ajaxResponseData($outputData);
659
 
660
  }
698
  UniteProviderFunctionsUC::printCustomScript($script);
699
  }
700
 
701
+ /**
702
+ * put custom style
703
+ */
704
+ private function putCustomStyle(){
705
+
706
+ if(self::$isStyleAdded == true)
707
+ return(false);
708
+
709
+ self::$isStyleAdded = true;
710
+
711
+ $style = "
712
+ .uc-ajax-loading{
713
+ opacity:0.6;
714
+ }
715
+ ";
716
+
717
+ UniteProviderFunctionsUC::printCustomStyle($style);
718
+ }
719
+
720
+
721
  /**
722
  * include the client side scripts
723
  */
724
  private function includeClientSideScripts(){
725
 
726
  $this->includeJSFiles();
727
+
728
  $this->putCustomJsScripts();
729
 
730
+ $this->putCustomStyle();
731
+
732
  }
733
 
734
 
817
  $taxonomy = "product_cat";
818
 
819
  $terms = $this->getActiveArchiveTerms($taxonomy);
820
+
821
  if(empty($terms))
822
  return(null);
823
 
836
  */
837
  public function addWidgetFilterableVariables($data, $addon){
838
 
 
 
839
  $param = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
840
 
841
  $postListName = UniteFunctionsUC::getVal($param, "name");
842
 
843
  $dataPosts = UniteFunctionsUC::getVal($data, $postListName);
844
 
845
+ //check if ajax related
846
  $isAjax = UniteFunctionsUC::getVal($dataPosts, $postListName."_isajax");
847
  $isAjax = UniteFunctionsUC::strToBool($isAjax);
848
 
849
+ if($isAjax == false)
850
+ return($data);
851
+
852
+ if(empty($param))
853
+ return($data);
854
+
855
  //check if ajax
856
  $strAttributes = "";
857
 
858
+ if($isAjax == true)
859
  $strAttributes .= " data-ajax='true' ";
860
+
861
+ $this->includeClientSideScripts();
 
862
 
863
  $data["uc_filtering_attributes"] = $strAttributes;
864
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
865
 
866
+
867
  return($data);
868
  }
869
 
890
 
891
  /**
892
  * modify post query
 
893
  */
894
  public function checkModifyMainQuery($query){
895
 
907
 
908
  if(empty($args))
909
  return(false);
 
 
 
910
 
911
+ $query->query_vars = array_merge($query->query_vars, $args);
912
 
913
  }
914
 
915
+
916
  /**
917
  * show the main query debug
918
  */
941
  exit();
942
  }
943
 
 
944
  $frontAjaxAction = UniteFunctionsUC::getPostGetVariable("ucfrontajaxaction","",UniteFunctionsUC::SANITIZE_KEY);
945
 
946
  if(empty($frontAjaxAction))
969
  * init wordpress front filters
970
  */
971
  public function initWPFrontFilters(){
972
+
 
 
 
973
  if(is_admin() == true)
974
  return(false);
975
 
inc_php/unitecreator_helper.class.php CHANGED
@@ -27,6 +27,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
27
  private static $arrLocalText = array();
28
  private static $arrDebug;
29
  private static $hasOutput = false;
 
 
30
 
31
  public static function a____GENERAL____(){}
32
 
@@ -336,6 +338,53 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
336
  return(self::$arrDebug);
337
  }
338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
 
340
 
341
  public static function a_______NOTICES________(){}
@@ -1347,6 +1396,19 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1347
 
1348
  UniteProviderFunctionsUC::addScript($handle, $urlScript,$inFooter);
1349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
  }
1351
 
1352
 
27
  private static $arrLocalText = array();
28
  private static $arrDebug;
29
  private static $hasOutput = false;
30
+ public static $arrWidgetScripts = array();
31
+
32
 
33
  public static function a____GENERAL____(){}
34
 
338
  return(self::$arrDebug);
339
  }
340
 
341
+ /**
342
+ * show the debug
343
+ */
344
+ public static function showDebug($type = null){
345
+
346
+ dmp("Showing Debug");
347
+
348
+ if(!empty($type))
349
+ dmp("$type mode");
350
+
351
+ $arrDebug = HelperUC::getDebug();
352
+
353
+ if(empty($arrDebug)){
354
+ dmp("no debug content found");
355
+ return(false);
356
+ }
357
+
358
+ foreach($arrDebug as $item){
359
+
360
+ $name = UniteFunctionsUC::getVal($item, "name");
361
+
362
+ if($type == "query"){
363
+
364
+ switch($name){
365
+ case "getpostlist_values":
366
+ case "getpostlist_param":
367
+ case "post_filters":
368
+ case "post_additions":
369
+ continue(2);
370
+ break;
371
+ }
372
+ }
373
+
374
+ $title = UniteFunctionsUC::getVal($item, "title");
375
+ $content = UniteFunctionsUC::getVal($item, "content");
376
+
377
+ $titleOutput = $title;
378
+ if(!empty($content))
379
+ $titleOutput = "<b>$title:</b>";
380
+
381
+ dmp($titleOutput);
382
+ dmp($content);
383
+
384
+ }
385
+
386
+
387
+ }
388
 
389
 
390
  public static function a_______NOTICES________(){}
1396
 
1397
  UniteProviderFunctionsUC::addScript($handle, $urlScript,$inFooter);
1398
 
1399
+ if(UniteCreatorElementorIntegrate::$isEditMode == true)
1400
+ self::$arrWidgetScripts[$handle] = $urlScript;
1401
+
1402
+ }
1403
+
1404
+ /**
1405
+ * add remote script
1406
+ */
1407
+ public static function addRemoteControlsScript(){
1408
+
1409
+ $urlFiltersJS = GlobalsUC::$url_assets_libraries."remote/ue-remote-controls.js";
1410
+ HelperUC::addScriptAbsoluteUrl($urlFiltersJS, "ue_remote_controls");
1411
+
1412
  }
1413
 
1414
 
inc_php/unitecreator_helperhtml.class.php CHANGED
@@ -175,11 +175,17 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
175
  $jsonFaIcons = UniteFontManagerUC::fa_getJsonIcons();
176
  $js .= self::TAB2.'var g_ucFaIcons = '.$jsonFaIcons.';'.self::BR;
177
 
 
 
 
 
 
178
  //output shapes
 
179
  $objShapes = new UniteShapeManagerUC();
180
  $jsonShapes = $objShapes->getJsonShapes();
181
  $js .= self::TAB2.'var g_ucArrSvgShapes = '.$jsonShapes.';'.self::BR;
182
-
183
 
184
  //get nonce
185
  if(method_exists("UniteProviderFunctionsUC", "getNonce"))
@@ -913,6 +919,173 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
913
  return($arrRating);
914
  }
915
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
916
 
917
  } //end class
918
 
175
  $jsonFaIcons = UniteFontManagerUC::fa_getJsonIcons();
176
  $js .= self::TAB2.'var g_ucFaIcons = '.$jsonFaIcons.';'.self::BR;
177
 
178
+ //output elementor icons
179
+ $jsonElementorIcons = UniteFontManagerUC::elementor_getJsonIcons();
180
+ $js .= self::TAB2.'var g_ucElIcons = '.$jsonElementorIcons.';'.self::BR;
181
+
182
+
183
  //output shapes
184
+ /*
185
  $objShapes = new UniteShapeManagerUC();
186
  $jsonShapes = $objShapes->getJsonShapes();
187
  $js .= self::TAB2.'var g_ucArrSvgShapes = '.$jsonShapes.';'.self::BR;
188
+ */
189
 
190
  //get nonce
191
  if(method_exists("UniteProviderFunctionsUC", "getNonce"))
919
  return($arrRating);
920
  }
921
 
922
+ /**
923
+ * put unite gallery item html
924
+ */
925
+ public static function getUniteGalleryHtmlItem($item){
926
+
927
+
928
+ $type = UniteFunctionsUC::getVal($item, "type");
929
+ $title = UniteFunctionsUC::getVal($item, "title");
930
+ $link = UniteFunctionsUC::getVal($item, "link");
931
+ $image = UniteFunctionsUC::getVal($item, "image");
932
+ $thumb = UniteFunctionsUC::getVal($item, "thumb");
933
+ $description = UniteFunctionsUC::getVal($item, "description");
934
+
935
+ $title = htmlspecialchars($title);
936
+ $description = htmlspecialchars($description);
937
+
938
+ $linkStart = "";
939
+ $linkEnd = "";
940
+
941
+ if(!empty($link)){
942
+ $linkStart = "<a href=\"{$link}\">";
943
+ $linkEnd = "</a>";
944
+ }
945
+
946
+ $nl = "\n";
947
+
948
+ $html = "";
949
+
950
+ if($linkStart)
951
+ $html .= $nl.$linkStart;
952
+
953
+ $html .= $nl."<img alt=\"{$title}\"";
954
+ $html .= $nl." src=\"$thumb\"";
955
+
956
+ if(!empty($image))
957
+ $html .= $nl." data-image=\"$image\"";
958
+
959
+ if(!empty($title))
960
+ $html .= $nl." data-title=\"$title\"";
961
+
962
+ if(!empty($description))
963
+ $html .= $nl." data-description=\"$description\"";
964
+
965
+ if($type != "image")
966
+ $html .= $nl." data-type=\"$type\"";
967
+
968
+
969
+ switch($type){
970
+
971
+ case "youtube":
972
+ case "vimeo":
973
+ case "wistia":
974
+
975
+ $videoID = UniteFunctionsUC::getVal($item, "videoid");
976
+
977
+ if(!empty($videoID))
978
+ $html .= $nl." data-videoid=\"$videoID\"";
979
+
980
+ break;
981
+ case "html5video":
982
+
983
+ $urlMp4 = UniteFunctionsUC::getVal($item, "url_mp4");
984
+
985
+ if(!empty($urlMp4))
986
+ $html .= $nl." data-videomp4=\"$urlMp4\"";
987
+
988
+ break;
989
+ }
990
+
991
+ $html .= ">"; //image end
992
+
993
+ if($type != "image")
994
+
995
+ if(!empty($linkEnd))
996
+ $html .= $linkEnd;
997
+
998
+ return($html);
999
+ }
1000
+
1001
+ /**
1002
+ * put conditions html
1003
+ */
1004
+ public static function putHtmlConditions($type){
1005
+
1006
+ $checkboxID = "uc_dialog_left_condition_".$type;
1007
+ $tableID = "uc_dialog_left_condition_table".$type;
1008
+
1009
+ ?>
1010
+
1011
+ <div class="unite-inputs-sap"></div>
1012
+
1013
+ <label for="<?php echo $checkboxID?>" class="unite-inputs-label-inline-free">
1014
+ <?php esc_html_e("Enable Condition", "unlimited-elements-for-elementor")?>:
1015
+ </label>
1016
+ <input id="<?php echo $checkboxID?>" type="checkbox" name="enable_condition" class="uc-control" data-controlled-selector=".uc-dialog-conditions-content">
1017
+
1018
+
1019
+ <div class="uc-dialog-conditions-content">
1020
+
1021
+ <div class="unite-inputs-sap"></div>
1022
+
1023
+ <div class="uc-dialog-conditions-empty">
1024
+
1025
+ <?php _e("No parent attribute (dropdown, checkbox or radio) exists in this category")?>
1026
+ </div>
1027
+
1028
+ <div class="uc-dialog-conditions-inputs">
1029
+
1030
+ <label class="unite-inputs-label">
1031
+ <?php _e("Show When", "unlimited-elements-for-elementor")?>:
1032
+ </label>
1033
+
1034
+ <table class="uc-table-dialog-conditions">
1035
+ <tr>
1036
+ <td>
1037
+ <select class="uc-dialog-condition-attribute" name="condition_attribute"></select>
1038
+ </td>
1039
+ <td>
1040
+ <select class="uc-dialog-condition-operator" name="condition_operator">
1041
+ <option value="equal"><?php _e("Equal","unlimited-elements-for-elementor")?></option>
1042
+ <option value="not_equal"><?php _e("Not Equal","unlimited-elements-for-elementor")?></option>
1043
+ </select>
1044
+ </td>
1045
+ <td>
1046
+ <div class="uc-dialog-condition-value-wrapper">
1047
+ <select class="uc-dialog-condition-value" name="condition_value"></select>
1048
+
1049
+ <a href="javascript:void(0)" class="uc-dialog-link-addcondition" title="<?php _e("Add Condition", "unlimited-elements-for-elementor") ?>">+</a>
1050
+ </div>
1051
+ </td>
1052
+ </tr>
1053
+ <tr class="uc-row-condition2" style="display:none">
1054
+ <td>
1055
+ <select class="uc-dialog-condition-attribute" name="condition_attribute2"></select>
1056
+ </td>
1057
+ <td>
1058
+ <select class="uc-dialog-condition-operator" name="condition_operator2">
1059
+ <option value="equal"><?php _e("Equal","unlimited-elements-for-elementor")?></option>
1060
+ <option value="not_equal"><?php _e("Not Equal","unlimited-elements-for-elementor")?></option>
1061
+ </select>
1062
+ </td>
1063
+ <td>
1064
+ <select class="uc-dialog-condition-value" name="condition_value2"></select>
1065
+ </td>
1066
+
1067
+ </tr>
1068
+ </table>
1069
+
1070
+ </div>
1071
+
1072
+ </div>
1073
+
1074
+ <?php
1075
+
1076
+ }
1077
+
1078
+ /**
1079
+ * put remote parent js
1080
+ */
1081
+ public static function putRemoteParentJS($arg1){
1082
+
1083
+ ?>
1084
+ <?php echo $arg1?>.trigger("uc-object-ready");
1085
+ jQuery("body").trigger("uc-remote-parent-init", [<?php echo $arg1?>]);
1086
+ <?php
1087
+ }
1088
+
1089
 
1090
  } //end class
1091
 
inc_php/unitecreator_output.class.php CHANGED
@@ -289,10 +289,8 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
289
 
290
  //get all libraries without provider process
291
  $arrLibraries = $this->addon->getArrLibraryIncludesUrls($processProviderLibrary);
292
-
293
  }
294
 
295
-
296
  $arrIncludesJS = array();
297
  $arrIncludesCss = array();
298
 
@@ -306,7 +304,6 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
306
 
307
  $arrIncludesJS = array_merge($arrLibJs, $arrIncludesJS);
308
  $arrIncludesJS = $this->processIncludesList($arrIncludesJS, "js");
309
-
310
  }
311
 
312
 
@@ -324,7 +321,27 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
324
 
325
  $arrProcessedIncludes = $this->excludeExistingInlcudes($arrProcessedIncludes);
326
 
 
 
 
 
 
 
 
 
 
 
 
327
 
 
 
 
 
 
 
 
 
 
328
  return($arrProcessedIncludes);
329
  }
330
 
@@ -406,7 +423,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
406
  $addonName = $this->addon->getName();
407
 
408
  $arrDep = $this->addon->getIncludesJsDependancies();
409
-
410
  foreach($arrIncludes as $include){
411
 
412
  $type = $include["type"];
@@ -1492,6 +1509,20 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1492
  }
1493
 
1494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1495
  /**
1496
  * place output by shortcode
1497
  */
@@ -1647,7 +1678,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1647
 
1648
  if(!empty($this->cacheConstants))
1649
  return($this->cacheConstants);
1650
-
1651
  $data = array();
1652
 
1653
  $prefix = "ucid";
@@ -1797,7 +1828,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1797
  $arrParams = $this->getAddonParams();
1798
 
1799
  $arrData = array_merge($arrData, $arrParams);
1800
-
1801
  //set templates
1802
  $html = $this->addon->getHtml();
1803
  $css = $this->addon->getCss();
289
 
290
  //get all libraries without provider process
291
  $arrLibraries = $this->addon->getArrLibraryIncludesUrls($processProviderLibrary);
 
292
  }
293
 
 
294
  $arrIncludesJS = array();
295
  $arrIncludesCss = array();
296
 
304
 
305
  $arrIncludesJS = array_merge($arrLibJs, $arrIncludesJS);
306
  $arrIncludesJS = $this->processIncludesList($arrIncludesJS, "js");
 
307
  }
308
 
309
 
321
 
322
  $arrProcessedIncludes = $this->excludeExistingInlcudes($arrProcessedIncludes);
323
 
324
+ // add widget scripts to editor
325
+
326
+ if(!empty(HelperUC::$arrWidgetScripts)){
327
+
328
+ foreach(HelperUC::$arrWidgetScripts as $handle=>$urlScript){
329
+
330
+ $arrScript = array(
331
+ "type"=>"js",
332
+ "handle"=>$handle,
333
+ "url"=>$urlScript,
334
+ );
335
 
336
+ $arrProcessedIncludes[] = $arrScript;
337
+ }
338
+
339
+ //empty the array
340
+ HelperUC::$arrWidgetScripts = array();
341
+
342
+ }
343
+
344
+
345
  return($arrProcessedIncludes);
346
  }
347
 
423
  $addonName = $this->addon->getName();
424
 
425
  $arrDep = $this->addon->getIncludesJsDependancies();
426
+
427
  foreach($arrIncludes as $include){
428
 
429
  $type = $include["type"];
1509
  }
1510
 
1511
 
1512
+ /**
1513
+ * get only html template output, no css and no js
1514
+ */
1515
+ public function getHtmlOnly(){
1516
+
1517
+ $this->validateInited();
1518
+
1519
+ $html = $this->objTemplate->getRenderedHtml(self::TEMPLATE_HTML);
1520
+ $html = $this->processHtml($html);
1521
+
1522
+ return($html);
1523
+ }
1524
+
1525
+
1526
  /**
1527
  * place output by shortcode
1528
  */
1678
 
1679
  if(!empty($this->cacheConstants))
1680
  return($this->cacheConstants);
1681
+
1682
  $data = array();
1683
 
1684
  $prefix = "ucid";
1828
  $arrParams = $this->getAddonParams();
1829
 
1830
  $arrData = array_merge($arrData, $arrParams);
1831
+
1832
  //set templates
1833
  $html = $this->addon->getHtml();
1834
  $css = $this->addon->getCss();
inc_php/unitecreator_params_editor.class.php CHANGED
@@ -35,7 +35,7 @@ class UniteCreatorParamsEditor{
35
 
36
  if(self::$isDialogsPut == true)
37
  return(false);
38
-
39
  ?>
40
 
41
  <div id="uc_dialog_attribute_category_addsection" title="<?php esc_html_e("Add Section","unlimited-elements-for-elementor")?>"
@@ -54,6 +54,13 @@ class UniteCreatorParamsEditor{
54
 
55
  <input type="text" class="unite-input-wide uc-section-title">
56
 
 
 
 
 
 
 
 
57
  <div class="unite-inputs-sap"></div>
58
  <br>
59
  <br>
@@ -61,6 +68,8 @@ class UniteCreatorParamsEditor{
61
 
62
  <div class="unite-dialog-error mtop_10 uc-error-message" data-error_empty="<?php _e("Please fill the section title","unlimited-elements-for-elementor")?>" style="display:none"></div>
63
 
 
 
64
  </div>
65
 
66
  </div>
35
 
36
  if(self::$isDialogsPut == true)
37
  return(false);
38
+
39
  ?>
40
 
41
  <div id="uc_dialog_attribute_category_addsection" title="<?php esc_html_e("Add Section","unlimited-elements-for-elementor")?>"
54
 
55
  <input type="text" class="unite-input-wide uc-section-title">
56
 
57
+ <div class="unite-inputs-sap"></div>
58
+
59
+ <?php
60
+ if(GlobalsUC::$inDev)
61
+ HelperHtmlUC::putHtmlConditions("section")
62
+ ?>
63
+
64
  <div class="unite-inputs-sap"></div>
65
  <br>
66
  <br>
68
 
69
  <div class="unite-dialog-error mtop_10 uc-error-message" data-error_empty="<?php _e("Please fill the section title","unlimited-elements-for-elementor")?>" style="display:none"></div>
70
 
71
+
72
+
73
  </div>
74
 
75
  </div>
inc_php/unitecreator_params_processor.class.php CHANGED
@@ -13,6 +13,8 @@ class UniteCreatorParamsProcessorWork{
13
  protected $addon;
14
  private $processType;
15
  private static $counter = 0;
 
 
16
 
17
  const ITEMS_ATTRIBUTE_PREFIX = "uc_items_attribute_";
18
  const KEY_ITEM_INDEX = "_uc_item_index_";
@@ -92,6 +94,9 @@ class UniteCreatorParamsProcessorWork{
92
  break;
93
  }
94
 
 
 
 
95
  $addonType = $this->addon->getType();
96
 
97
  if($addonType == "elementor")
@@ -176,17 +181,21 @@ class UniteCreatorParamsProcessorWork{
176
  if($isResponsive == false)
177
  return($data);
178
 
179
- $valueTablet = UniteFunctionsUC::getVal($param, "value_tablet");
180
- $valueMobile = UniteFunctionsUC::getVal($param, "value_mobile");
 
 
 
181
 
182
  $name = UniteFunctionsUC::getVal($param, "name");
183
 
184
  $data[$name."_tablet"] = $valueTablet;
185
  $data[$name."_mobile"] = $valueMobile;
186
-
187
  return($data);
188
  }
189
-
 
190
  private function a________FONTS_________(){}
191
 
192
 
@@ -368,7 +377,6 @@ class UniteCreatorParamsProcessorWork{
368
  */
369
  private function processFonts($arrValues, $type, $itemIndex=null){
370
 
371
-
372
  $this->validateProcessTypeInited();
373
 
374
  $arrFonts = $this->addon->getArrFonts();
@@ -814,14 +822,81 @@ class UniteCreatorParamsProcessorWork{
814
  return($data);
815
  }
816
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
817
  /**
818
  * process image param value, add to data
819
  * @param $param
820
  */
821
  protected function getProcessedParamsValue_image($data, $value, $param){
822
-
 
 
823
  $name = $param["name"];
824
 
 
 
 
 
 
 
 
825
  $urlImage = $value; //in case that the value is image id
826
  if(is_numeric($value)){
827
  $urlImage = UniteProviderFunctionsUC::getImageUrlFromImageID($value);
@@ -831,13 +906,16 @@ class UniteCreatorParamsProcessorWork{
831
  $value = HelperUC::URLtoFull($value);
832
  $data[$name] = $value;
833
  }
834
-
 
 
 
835
  $sizeFilters = UniteFunctionsUC::getVal($param, "size_filters");
836
  $isNoAttributes = UniteFunctionsUC::getVal($param, "no_attributes");
837
  $isNoImageData = UniteFunctionsUC::getVal($param, "no_image_data");
838
 
839
  $data = $this->addOtherImageThumbs($data, $name, $value, $sizeFilters);
840
-
841
  if($isNoImageData !== true)
842
  $data = $this->addOtherImageData($data, $name, $value);
843
 
@@ -850,7 +928,6 @@ class UniteCreatorParamsProcessorWork{
850
  if(empty($urlThumb))
851
  $data[$keyThumb] = $urlImage;
852
 
853
-
854
  return($data);
855
  }
856
 
@@ -957,11 +1034,10 @@ class UniteCreatorParamsProcessorWork{
957
  private function z_________INSTAGRAM_________(){}
958
 
959
 
960
-
961
  /**
962
  * get instagram data
963
  */
964
- private function getInstagramData($value, $name, $param){
965
 
966
  try{
967
 
@@ -977,18 +1053,18 @@ class UniteCreatorParamsProcessorWork{
977
 
978
  $value = UniteFunctionsUC::getVal($param, $name);
979
  }
980
-
981
  if(empty($value))
982
  $value = UniteCreatorSettingsWork::INSTAGRAM_DEFAULT_VALUE;
983
-
984
  $maxItems = UniteFunctionsUC::getVal($param, "max_items");
985
 
986
  if(!empty($valueMaxItems))
987
  $maxItems = $valueMaxItems;
988
-
989
  $services = new UniteServicesUC();
990
  $data = $services->getInstagramData($value, $maxItems);
991
-
992
  return($data);
993
 
994
  }catch(Exception $e){
@@ -1026,16 +1102,17 @@ class UniteCreatorParamsProcessorWork{
1026
  * process items variables, based on variable type and item content
1027
  */
1028
  private function getItemsVariablesProcessed($arrItem, $index, $numItems){
1029
-
1030
  $arrVars = $this->addon->getVariablesItem();
1031
  $arrVarData = array();
1032
-
1033
  //get variables output object
1034
- $arrParams = $this->getProcessedMainParamsValues($this->processType);
 
1035
 
1036
  $objVarOutput = new UniteCreatorVariablesOutput();
1037
- $objVarOutput->init($arrParams);
1038
-
1039
  foreach($arrVars as $var){
1040
  $name = UniteFunctionsUC::getVal($var, "name");
1041
  UniteFunctionsUC::validateNotEmpty($name, "variable name");
@@ -1363,6 +1440,16 @@ class UniteCreatorParamsProcessorWork{
1363
  $url = UniteFunctionsUC::getVal($value, "url");
1364
  $isExternal = UniteFunctionsUC::getVal($value, "is_external");
1365
  $noFollow = UniteFunctionsUC::getVal($value, "nofollow");
 
 
 
 
 
 
 
 
 
 
1366
 
1367
  $addHtml = "";
1368
  if($isExternal == "on")
@@ -1373,6 +1460,8 @@ class UniteCreatorParamsProcessorWork{
1373
 
1374
  $data[$name] = $url;
1375
  $data[$name."_html_attributes"] = $addHtml;
 
 
1376
 
1377
  return($data);
1378
  }
@@ -1429,8 +1518,12 @@ class UniteCreatorParamsProcessorWork{
1429
 
1430
  if($isResponsive == true){
1431
 
1432
- $valueTablet = UniteFunctionsUC::getVal($param, "value_tablet");
1433
- $valueMobile = UniteFunctionsUC::getVal($param, "value_mobile");
 
 
 
 
1434
 
1435
  $data = $this->getSliderData_work($data, $valueTablet, $name."_tablet", true);
1436
  $data = $this->getSliderData_work($data, $valueMobile, $name."_mobile", true);
@@ -1599,7 +1692,7 @@ class UniteCreatorParamsProcessorWork{
1599
  * get main params processed, for output
1600
  */
1601
  public function getProcessedMainParamsValues($processType){
1602
-
1603
  $this->validateInited();
1604
 
1605
  self::validateProcessType($processType);
@@ -1644,14 +1737,22 @@ class UniteCreatorParamsProcessorWork{
1644
  }
1645
 
1646
 
 
1647
  /**
1648
  * get item data
1649
  */
1650
  public function getProcessedItemsData($arrItems, $processType, $forTemplate = true, $filterType = null){
1651
-
1652
  $this->validateInited();
1653
  self::validateProcessType($processType);
1654
 
 
 
 
 
 
 
 
1655
  $this->setProcessType($processType);
1656
 
1657
  if(empty($arrItems))
@@ -1690,7 +1791,6 @@ class UniteCreatorParamsProcessorWork{
1690
 
1691
  foreach($arrItems as $index => $arrItemValues){
1692
 
1693
-
1694
  $elementorID = UniteFunctionsUC::getVal($arrItemValues, "_id");
1695
 
1696
  //if not found - generate one
@@ -1698,9 +1798,9 @@ class UniteCreatorParamsProcessorWork{
1698
  $elementorID = UniteFunctionsUC::getRandomString(5);
1699
 
1700
  $arrParamsNew = $this->addon->setParamsValuesItems($arrItemValues, $arrItemParams);
1701
-
1702
  $item = $this->getProcessedParamsValues($arrParamsNew, $processType, $filterType);
1703
-
1704
  if($this->isOutputProcessType($processType) == true){
1705
  $item = $this->processFonts($item, "items", $index);
1706
  }
@@ -1738,7 +1838,6 @@ class UniteCreatorParamsProcessorWork{
1738
  $arrVarsData = $this->getItemsVariablesProcessed($item, $index, $numItems);
1739
  $item = array_merge($item, $arrVarsData);
1740
 
1741
-
1742
  //add elementor id
1743
  if($itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
1744
  $item["item_repeater_class"] = "elementor-repeater-item-".$elementorID;
13
  protected $addon;
14
  private $processType;
15
  private static $counter = 0;
16
+ private $arrMainParamsValuesCache = array();
17
+
18
 
19
  const ITEMS_ATTRIBUTE_PREFIX = "uc_items_attribute_";
20
  const KEY_ITEM_INDEX = "_uc_item_index_";
94
  break;
95
  }
96
 
97
+ if($value == "uc_no_editor_items")
98
+ $value = __("The background items will be shown only in front end","unlimited-elements-for-elementor");
99
+
100
  $addonType = $this->addon->getType();
101
 
102
  if($addonType == "elementor")
181
  if($isResponsive == false)
182
  return($data);
183
 
184
+ $defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
185
+ $defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
186
+
187
+ $valueTablet = UniteFunctionsUC::getVal($param, "value_tablet", $defaultValueTablet);
188
+ $valueMobile = UniteFunctionsUC::getVal($param, "value_mobile",$defaultValueMobile);
189
 
190
  $name = UniteFunctionsUC::getVal($param, "name");
191
 
192
  $data[$name."_tablet"] = $valueTablet;
193
  $data[$name."_mobile"] = $valueMobile;
194
+
195
  return($data);
196
  }
197
+
198
+
199
  private function a________FONTS_________(){}
200
 
201
 
377
  */
378
  private function processFonts($arrValues, $type, $itemIndex=null){
379
 
 
380
  $this->validateProcessTypeInited();
381
 
382
  $arrFonts = $this->addon->getArrFonts();
822
  return($data);
823
  }
824
 
825
+ /**
826
+ * get default url of json image
827
+ */
828
+ private function getImageJsonDefaultUrl($param){
829
+
830
+ //no value at all - return nothing
831
+
832
+ $defaultValue = UniteFunctionsUC::getVal($param, "default_value_json");
833
+ if(empty($defaultValue)){
834
+ return("");
835
+ }
836
+
837
+ //only default:
838
+
839
+ $urlAssets = $this->addon->getUrlAssets();
840
+
841
+ if(empty($urlAssets))
842
+ return("");
843
+
844
+ $urlDefault = $urlAssets.$defaultValue;
845
+
846
+ return($urlDefault);
847
+ }
848
+
849
+ /**
850
+ * get image as json processed data
851
+ */
852
+ private function getProcessedParamsValue_imageJson($data, $value, $param){
853
+
854
+ //if the value is emtpy
855
+ if(empty($value)){
856
+
857
+ $urlDefault = $this->getImageJsonDefaultUrl($param);
858
+ return($urlDefault);
859
+ }
860
+
861
+ //if the value is string, must be a url, return it
862
+
863
+ if(is_numeric($value) == false)
864
+ return($value);
865
+
866
+ //if the value is number, get the url
867
+
868
+ $postThumb = get_post($value);
869
+
870
+ //if no thumb found by id - return default
871
+ if(empty($postThumb)){
872
+
873
+ $urlDefault = $this->getImageJsonDefaultUrl($param);
874
+ return($urlDefault);
875
+ }
876
+
877
+ $urlJson = $postThumb->guid;
878
+
879
+ return($urlJson);
880
+ }
881
+
882
+
883
  /**
884
  * process image param value, add to data
885
  * @param $param
886
  */
887
  protected function getProcessedParamsValue_image($data, $value, $param){
888
+
889
+ $mediaType = UniteFunctionsUC::getVal($param, "media_type");
890
+
891
  $name = $param["name"];
892
 
893
+ if($mediaType == "json"){
894
+
895
+ $data[$name] = $this->getProcessedParamsValue_imageJson($data, $value, $param);
896
+
897
+ return($data);
898
+ }
899
+
900
  $urlImage = $value; //in case that the value is image id
901
  if(is_numeric($value)){
902
  $urlImage = UniteProviderFunctionsUC::getImageUrlFromImageID($value);
906
  $value = HelperUC::URLtoFull($value);
907
  $data[$name] = $value;
908
  }
909
+
910
+ if(is_numeric($value) == false)
911
+ return($data);
912
+
913
  $sizeFilters = UniteFunctionsUC::getVal($param, "size_filters");
914
  $isNoAttributes = UniteFunctionsUC::getVal($param, "no_attributes");
915
  $isNoImageData = UniteFunctionsUC::getVal($param, "no_image_data");
916
 
917
  $data = $this->addOtherImageThumbs($data, $name, $value, $sizeFilters);
918
+
919
  if($isNoImageData !== true)
920
  $data = $this->addOtherImageData($data, $name, $value);
921
 
928
  if(empty($urlThumb))
929
  $data[$keyThumb] = $urlImage;
930
 
 
931
  return($data);
932
  }
933
 
1034
  private function z_________INSTAGRAM_________(){}
1035
 
1036
 
 
1037
  /**
1038
  * get instagram data
1039
  */
1040
+ protected function getInstagramData($value, $name, $param){
1041
 
1042
  try{
1043
 
1053
 
1054
  $value = UniteFunctionsUC::getVal($param, $name);
1055
  }
1056
+
1057
  if(empty($value))
1058
  $value = UniteCreatorSettingsWork::INSTAGRAM_DEFAULT_VALUE;
1059
+
1060
  $maxItems = UniteFunctionsUC::getVal($param, "max_items");
1061
 
1062
  if(!empty($valueMaxItems))
1063
  $maxItems = $valueMaxItems;
1064
+
1065
  $services = new UniteServicesUC();
1066
  $data = $services->getInstagramData($value, $maxItems);
1067
+
1068
  return($data);
1069
 
1070
  }catch(Exception $e){
1102
  * process items variables, based on variable type and item content
1103
  */
1104
  private function getItemsVariablesProcessed($arrItem, $index, $numItems){
1105
+
1106
  $arrVars = $this->addon->getVariablesItem();
1107
  $arrVarData = array();
1108
+
1109
  //get variables output object
1110
+ if(!empty($this->arrMainParamsValuesCache))
1111
+ $this->arrMainParamsValuesCache = $this->getProcessedMainParamsValues($this->processType);
1112
 
1113
  $objVarOutput = new UniteCreatorVariablesOutput();
1114
+ $objVarOutput->init($this->arrMainParamsValuesCache);
1115
+
1116
  foreach($arrVars as $var){
1117
  $name = UniteFunctionsUC::getVal($var, "name");
1118
  UniteFunctionsUC::validateNotEmpty($name, "variable name");
1440
  $url = UniteFunctionsUC::getVal($value, "url");
1441
  $isExternal = UniteFunctionsUC::getVal($value, "is_external");
1442
  $noFollow = UniteFunctionsUC::getVal($value, "nofollow");
1443
+
1444
+ $urlFull = $url;
1445
+ $scheme = parse_url($url, PHP_URL_SCHEME);
1446
+
1447
+ if(empty($scheme)){
1448
+ $urlFull = "https://{$url}";
1449
+ $urlNoPrefix = $url;
1450
+ }else
1451
+ $urlNoPrefix = str_replace($scheme, "", $url);
1452
+
1453
 
1454
  $addHtml = "";
1455
  if($isExternal == "on")
1460
 
1461
  $data[$name] = $url;
1462
  $data[$name."_html_attributes"] = $addHtml;
1463
+ $data[$name."_full"] = $addHtml;
1464
+ $data[$name."_noprefix"] = $addHtml;
1465
 
1466
  return($data);
1467
  }
1518
 
1519
  if($isResponsive == true){
1520
 
1521
+ $defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
1522
+ $defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
1523
+
1524
+ $valueTablet = UniteFunctionsUC::getVal($param, "value_tablet", $defaultValueTablet);
1525
+ $valueMobile = UniteFunctionsUC::getVal($param, "value_mobile", $defaultValueMobile);
1526
+
1527
 
1528
  $data = $this->getSliderData_work($data, $valueTablet, $name."_tablet", true);
1529
  $data = $this->getSliderData_work($data, $valueMobile, $name."_mobile", true);
1692
  * get main params processed, for output
1693
  */
1694
  public function getProcessedMainParamsValues($processType){
1695
+
1696
  $this->validateInited();
1697
 
1698
  self::validateProcessType($processType);
1737
  }
1738
 
1739
 
1740
+
1741
  /**
1742
  * get item data
1743
  */
1744
  public function getProcessedItemsData($arrItems, $processType, $forTemplate = true, $filterType = null){
1745
+
1746
  $this->validateInited();
1747
  self::validateProcessType($processType);
1748
 
1749
+ //in case of gallery grouped settings, don't process at all
1750
+
1751
+ $specialType = $this->addon->getSpecialType();
1752
+ if($specialType == UniteCreatorAddon::ITEMS_TYPE_IMAGE)
1753
+ return($arrItems);
1754
+
1755
+
1756
  $this->setProcessType($processType);
1757
 
1758
  if(empty($arrItems))
1791
 
1792
  foreach($arrItems as $index => $arrItemValues){
1793
 
 
1794
  $elementorID = UniteFunctionsUC::getVal($arrItemValues, "_id");
1795
 
1796
  //if not found - generate one
1798
  $elementorID = UniteFunctionsUC::getRandomString(5);
1799
 
1800
  $arrParamsNew = $this->addon->setParamsValuesItems($arrItemValues, $arrItemParams);
1801
+
1802
  $item = $this->getProcessedParamsValues($arrParamsNew, $processType, $filterType);
1803
+
1804
  if($this->isOutputProcessType($processType) == true){
1805
  $item = $this->processFonts($item, "items", $index);
1806
  }
1838
  $arrVarsData = $this->getItemsVariablesProcessed($item, $index, $numItems);
1839
  $item = array_merge($item, $arrVarsData);
1840
 
 
1841
  //add elementor id
1842
  if($itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
1843
  $item["item_repeater_class"] = "elementor-repeater-item-".$elementorID;
inc_php/unitecreator_settings.class.php CHANGED
@@ -157,7 +157,8 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
157
  "uc_icon",
158
  UniteCreatorDialogParam::PARAM_ICON_LIBRARY,
159
  UniteCreatorDialogParam::PARAM_SHAPE,
160
- "uc_hr",
 
161
  "uc_font_override",
162
  UniteCreatorDialogParam::PARAM_POST,
163
  UniteCreatorDialogParam::PARAM_POSTS_LIST,
@@ -305,8 +306,8 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
305
 
306
  $defaultMaxItems = UniteFunctionsUC::getVal($extra, "max_items");
307
  if(is_numeric($defaultMaxItems) == false || $defaultMaxItems < 1)
308
- $defaultMaxItems = "";
309
-
310
  $objServies = new UniteServicesUC();
311
  $objServies->includeInstagramAPI();
312
 
@@ -697,9 +698,15 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
697
  case UniteCreatorDialogParam::PARAM_MAP:
698
  $this->addGoogleMap($name,$value,$title,$extra);
699
  break;
700
- case "uc_hr":
701
  $this->addHr($name);
702
  $isUpdateValue = false;
 
 
 
 
 
 
703
  break;
704
  case "uc_font_override":
705
  //don't draw anything
157
  "uc_icon",
158
  UniteCreatorDialogParam::PARAM_ICON_LIBRARY,
159
  UniteCreatorDialogParam::PARAM_SHAPE,
160
+ UniteCreatorDialogParam::PARAM_HR,
161
+ UniteCreatorDialogParam::PARAM_HEADING,
162
  "uc_font_override",
163
  UniteCreatorDialogParam::PARAM_POST,
164
  UniteCreatorDialogParam::PARAM_POSTS_LIST,
306
 
307
  $defaultMaxItems = UniteFunctionsUC::getVal($extra, "max_items");
308
  if(is_numeric($defaultMaxItems) == false || $defaultMaxItems < 1)
309
+ $defaultMaxItems = 12;
310
+
311
  $objServies = new UniteServicesUC();
312
  $objServies->includeInstagramAPI();
313
 
698
  case UniteCreatorDialogParam::PARAM_MAP:
699
  $this->addGoogleMap($name,$value,$title,$extra);
700
  break;
701
+ case UniteCreatorDialogParam::PARAM_HR:
702
  $this->addHr($name);
703
  $isUpdateValue = false;
704
+ break;
705
+ case UniteCreatorDialogParam::PARAM_HEADING:
706
+
707
+ $this->addStaticText($value);
708
+
709
+
710
  break;
711
  case "uc_font_override":
712
  //don't draw anything
inc_php/unitecreator_template_engine.class.php CHANGED
@@ -16,6 +16,7 @@ class UniteCreatorTemplateEngineWork{
16
  protected $arrItems = array();
17
  protected $addon = null;
18
  protected $objParamsProcessor;
 
19
 
20
 
21
  /**
@@ -286,17 +287,33 @@ class UniteCreatorTemplateEngineWork{
286
  /**
287
  * filter uc date, clear html first, then replace the date
288
  */
289
- public function filterUCDate($dateStamp, $format = "d F Y, H:i"){
290
 
291
  $hasTags = false;
292
  $stamp = $dateStamp;
293
 
 
294
  if(is_numeric($dateStamp) == false){
295
  $hasTags = true;
296
  $stamp = strip_tags($dateStamp);
297
  $stamp = trim($stamp);
298
  }
299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  $strDate = date_i18n($format, $stamp);
301
 
302
  if($hasTags == true)
@@ -336,7 +353,7 @@ class UniteCreatorTemplateEngineWork{
336
  public function put_date_utc($strDate){
337
 
338
  $stamp = strtotime($strDate);
339
-
340
  $strUTC = gmdate('Y/m/d H:i:s', $stamp);
341
 
342
  echo UniteProviderFunctionsUC::escCombinedHtml($strUTC);
@@ -362,45 +379,7 @@ class UniteCreatorTemplateEngineWork{
362
  */
363
  public function showDebug($type = null){
364
 
365
- dmp("Showing Debug");
366
-
367
- if(!empty($type))
368
- dmp("$type mode");
369
-
370
- $arrDebug = HelperUC::getDebug();
371
-
372
- if(empty($arrDebug)){
373
- dmp("no debug content found");
374
- return(false);
375
- }
376
-
377
- foreach($arrDebug as $item){
378
-
379
- $name = UniteFunctionsUC::getVal($item, "name");
380
-
381
- if($type == "query"){
382
-
383
- switch($name){
384
- case "getpostlist_values":
385
- case "getpostlist_param":
386
- case "post_filters":
387
- case "post_additions":
388
- continue(2);
389
- break;
390
- }
391
- }
392
-
393
- $title = UniteFunctionsUC::getVal($item, "title");
394
- $content = UniteFunctionsUC::getVal($item, "content");
395
-
396
- $titleOutput = $title;
397
- if(!empty($content))
398
- $titleOutput = "<b>$title:</b>";
399
-
400
- dmp($titleOutput);
401
- dmp($content);
402
-
403
- }
404
 
405
  }
406
 
@@ -821,11 +800,12 @@ class UniteCreatorTemplateEngineWork{
821
 
822
  return($response);
823
  break;
824
- case "put_single_filter":
825
-
826
- $objFilters = new UniteCreatorFiltersProcess();
827
- $objFilters->putCheckboxFiltersTest($arg1);
828
 
 
829
  break;
830
  case "get_post_term":
831
 
@@ -846,15 +826,50 @@ class UniteCreatorTemplateEngineWork{
846
  else
847
  return("no");
848
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
849
  break;
850
  default:
851
- $strTypes = "put_date_range, get_general_setting,
852
- run_code_once, get_post_term,
853
- is_post_has_term, get_from_sql";
854
 
855
  $type = UniteFunctionsUC::sanitizeAttr($type);
856
 
857
- dmp("ucfunc error: unknown action <b>'$type'</b>, allowed actions are: <b>$strTypes</b>");
858
  break;
859
  }
860
 
@@ -1026,7 +1041,7 @@ class UniteCreatorTemplateEngineWork{
1026
 
1027
  $arrOptions = array();
1028
  $arrOptions["debug"] = true;
1029
-
1030
  $this->twig = new Twig_Environment($loader, $arrOptions);
1031
  $this->twig->addExtension(new Twig_Extension_Debug());
1032
 
16
  protected $arrItems = array();
17
  protected $addon = null;
18
  protected $objParamsProcessor;
19
+ private static $arrSetVarsCache = array();
20
 
21
 
22
  /**
287
  /**
288
  * filter uc date, clear html first, then replace the date
289
  */
290
+ public function filterUCDate($dateStamp, $format = "d F Y, H:i", $formatDateFrom = "d/m/Y"){
291
 
292
  $hasTags = false;
293
  $stamp = $dateStamp;
294
 
295
+ //try to stip tags
296
  if(is_numeric($dateStamp) == false){
297
  $hasTags = true;
298
  $stamp = strip_tags($dateStamp);
299
  $stamp = trim($stamp);
300
  }
301
 
302
+ /**
303
+ * convert from string
304
+ */
305
+ if(is_numeric($stamp) == false){
306
+
307
+ $hasTags = false;
308
+
309
+ $objDate = DateTime::createFromFormat($formatDateFrom, $stamp);
310
+
311
+ if(!empty($objDate))
312
+ $stamp = @$objDate->getTimeStamp();
313
+ else
314
+ $stamp = time();
315
+ }
316
+
317
  $strDate = date_i18n($format, $stamp);
318
 
319
  if($hasTags == true)
353
  public function put_date_utc($strDate){
354
 
355
  $stamp = strtotime($strDate);
356
+
357
  $strUTC = gmdate('Y/m/d H:i:s', $stamp);
358
 
359
  echo UniteProviderFunctionsUC::escCombinedHtml($strUTC);
379
  */
380
  public function showDebug($type = null){
381
 
382
+ HelperUC::showDebug();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
 
384
  }
385
 
800
 
801
  return($response);
802
  break;
803
+ case "get_loadmore_data":
804
+
805
+ $objPagination = new UniteCreatorElementorPagination();
806
+ $strData = $objPagination->getLoadmoreData(UniteCreatorElementorIntegrate::$isEditMode);
807
 
808
+ return($strData);
809
  break;
810
  case "get_post_term":
811
 
826
  else
827
  return("no");
828
 
829
+ break;
830
+ case "put_unite_gallery_item":
831
+
832
+ $htmlItem = HelperHtmlUC::getUniteGalleryHtmlItem($arg1);
833
+
834
+ echo $htmlItem;
835
+
836
+ break;
837
+ case "set": //set and remember
838
+ self::$arrSetVarsCache[$arg1] = $arg2;
839
+ break;
840
+ case "get":
841
+
842
+ $var = UniteFunctionsUC::getVal(self::$arrSetVarsCache, $arg1);
843
+
844
+ return($var);
845
+ break;
846
+ case "get_wc_variations":
847
+
848
+ $productID = $arg1;
849
+
850
+ $objWoo = new UniteCreatorWooIntegrate();
851
+ $arrVariations = $objWoo->getProductVariations($productID);
852
+
853
+ return($arrVariations);
854
+ break;
855
+ case "get_unitegallery_js":
856
+
857
+ $objUniteGallery = new UniteCreatorUniteGallery();
858
+
859
+ $objJsSettings = $objUniteGallery->getUniteGalleryJsSettings($this->arrParams, $this->addon);
860
+
861
+ return($objJsSettings);
862
+ break;
863
+ case "put_remote_parent_js":
864
+
865
+ HelperHtmlUC::putRemoteParentJS($arg1);
866
+
867
  break;
868
  default:
 
 
 
869
 
870
  $type = UniteFunctionsUC::sanitizeAttr($type);
871
 
872
+ dmp("ucfunc error: unknown action <b>'$type'</b>");
873
  break;
874
  }
875
 
1041
 
1042
  $arrOptions = array();
1043
  $arrOptions["debug"] = true;
1044
+
1045
  $this->twig = new Twig_Environment($loader, $arrOptions);
1046
  $this->twig->addExtension(new Twig_Extension_Debug());
1047
 
inc_php/unitecreator_unitegallery.class.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unlimited Elements
4
+ * @author unlimited-elements.com
5
+ * @copyright (C) 2021 Unlimited Elements, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
9
+
10
+ class UniteCreatorUniteGallery{
11
+
12
+
13
+ /**
14
+ * get gallery js settings from data
15
+ */
16
+ public function getUniteGalleryJsSettings($data,UniteCreatorAddon $addon){
17
+
18
+ dmp($data);
19
+ dmp("get settings from data");
20
+ //exit();
21
+
22
+ }
23
+
24
+ }
includes.php CHANGED
@@ -12,7 +12,7 @@ if(!defined('UNLIMITED_ELEMENTS_INC'))
12
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
13
 
14
  if(!defined("UNLIMITED_ELEMENTS_VERSION"))
15
- define("UNLIMITED_ELEMENTS_VERSION", "1.4.80");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
@@ -85,6 +85,7 @@ require_once GlobalsUC::$pathProvider."provider_dialog_param.class.php";
85
  require_once $folderIncludesMain . 'unitecreator_form.class.php';
86
  require_once $folderIncludesMain . 'unitecreator_addon_validator.class.php';
87
  require_once $folderIncludesMain . 'unitecreator_filters_process.class.php';
 
88
  require_once GlobalsUC::$pathProvider . 'integrations.class.php';
89
 
90
  //page builder related
12
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
13
 
14
  if(!defined("UNLIMITED_ELEMENTS_VERSION"))
15
+ define("UNLIMITED_ELEMENTS_VERSION", "1.4.85");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
85
  require_once $folderIncludesMain . 'unitecreator_form.class.php';
86
  require_once $folderIncludesMain . 'unitecreator_addon_validator.class.php';
87
  require_once $folderIncludesMain . 'unitecreator_filters_process.class.php';
88
+ require_once $folderIncludesMain . 'unitecreator_unitegallery.class.php';
89
  require_once GlobalsUC::$pathProvider . 'integrations.class.php';
90
 
91
  //page builder related
js/admin.js CHANGED
@@ -845,7 +845,7 @@ function UniteAdminUC(){
845
  var inputName = objInput.prop("name");
846
  if(!inputName)
847
  inputName = objInput[0].tagname;
848
-
849
  trace(objInput);
850
  console.trace();
851
 
@@ -2573,7 +2573,7 @@ function trace(data,clear){
2573
 
2574
  if(!g_ucAdmin)
2575
  g_ucAdmin = new UniteAdminUC();
2576
-
2577
  g_ucAdmin.trace(data,clear);
2578
  }
2579
 
845
  var inputName = objInput.prop("name");
846
  if(!inputName)
847
  inputName = objInput[0].tagname;
848
+
849
  trace(objInput);
850
  console.trace();
851
 
2573
 
2574
  if(!g_ucAdmin)
2575
  g_ucAdmin = new UniteAdminUC();
2576
+
2577
  g_ucAdmin.trace(data,clear);
2578
  }
2579
 
js/manager/unitecreator_manager_actions_inline.js CHANGED
@@ -169,7 +169,7 @@ function UCManagerActionsInline(){
169
  }
170
 
171
  urlImage = g_ucAdmin.urlToRelative(urlImage);
172
-
173
  addItemFromImage(urlImage);
174
  });
175
 
@@ -307,7 +307,7 @@ function UCManagerActionsInline(){
307
  * generate item html
308
  */
309
  function generateItemHtml(params, id){
310
-
311
  //set title
312
  var title = generateItemTitle();
313
  var altTitle = getTitleFromParams(params);
@@ -326,6 +326,9 @@ function UCManagerActionsInline(){
326
  if(!urlImage && g_imageField && params.hasOwnProperty(g_imageField))
327
  urlImage = jQuery.trim(params[g_imageField]);
328
 
 
 
 
329
  var descStyle = "";
330
  if(urlImage){
331
  urlImage = g_ucAdmin.urlToFull(urlImage);
@@ -433,8 +436,9 @@ function UCManagerActionsInline(){
433
  * set thumb field for viewing the thumb
434
  */
435
  function init_setImageField(){
436
-
437
  var arrFieldNames = g_objSettings.getFieldNamesByType("image");
 
438
  if(arrFieldNames.length == 0)
439
  return(false);
440
 
@@ -466,7 +470,7 @@ function UCManagerActionsInline(){
466
 
467
  g_objSettings = new UniteSettingsUC();
468
  g_objSettings.init(g_objSettingsWrapper);
469
-
470
  init_setImageField();
471
  }
472
 
169
  }
170
 
171
  urlImage = g_ucAdmin.urlToRelative(urlImage);
172
+
173
  addItemFromImage(urlImage);
174
  });
175
 
307
  * generate item html
308
  */
309
  function generateItemHtml(params, id){
310
+
311
  //set title
312
  var title = generateItemTitle();
313
  var altTitle = getTitleFromParams(params);
326
  if(!urlImage && g_imageField && params.hasOwnProperty(g_imageField))
327
  urlImage = jQuery.trim(params[g_imageField]);
328
 
329
+ trace('generateItemHtml');
330
+ trace(urlImage);
331
+
332
  var descStyle = "";
333
  if(urlImage){
334
  urlImage = g_ucAdmin.urlToFull(urlImage);
436
  * set thumb field for viewing the thumb
437
  */
438
  function init_setImageField(){
439
+
440
  var arrFieldNames = g_objSettings.getFieldNamesByType("image");
441
+
442
  if(arrFieldNames.length == 0)
443
  return(false);
444
 
470
 
471
  g_objSettings = new UniteSettingsUC();
472
  g_objSettings.init(g_objSettingsWrapper);
473
+
474
  init_setImageField();
475
  }
476
 
js/manager/unitecreator_manager_cats.js CHANGED
@@ -55,6 +55,7 @@ function UCManagerAdminCats(){
55
  initEvents();
56
 
57
  //update sortable categories
 
58
  g_objListCats.sortable({
59
  axis:'y',
60
  start: function( event, ui ) {
@@ -64,7 +65,11 @@ function UCManagerAdminCats(){
64
  updateCatOrder();
65
  //save sorting order
66
  }
67
- });
 
 
 
 
68
 
69
  initAddCategoryDialog();
70
 
55
  initEvents();
56
 
57
  //update sortable categories
58
+ try{
59
  g_objListCats.sortable({
60
  axis:'y',
61
  start: function( event, ui ) {
65
  updateCatOrder();
66
  //save sorting order
67
  }
68
+ });
69
+ }catch(error){
70
+ trace("error occured in jquery sortable!");
71
+ trace(error);
72
+ }
73
 
74
  initAddCategoryDialog();
75
 
js/settings.js CHANGED
@@ -1917,9 +1917,13 @@ function UniteSettingsUC(){
1917
  var objDialogWrapper = jQuery("#"+dialogID);
1918
  if(objDialogWrapper.length){
1919
  g_iconsHash = jQuery("body").data("uc_icons_hash");
 
1920
  return(objDialogWrapper);
1921
  }
1922
 
 
 
 
1923
  //set "fa" template
1924
  if(type == "fa"){
1925
 
@@ -1933,6 +1937,17 @@ function UniteSettingsUC(){
1933
  return(html);
1934
  });
1935
 
 
 
 
 
 
 
 
 
 
 
 
1936
  }
1937
 
1938
  var objType = iconPicker_getObjIconsType(type);
1917
  var objDialogWrapper = jQuery("#"+dialogID);
1918
  if(objDialogWrapper.length){
1919
  g_iconsHash = jQuery("body").data("uc_icons_hash");
1920
+
1921
  return(objDialogWrapper);
1922
  }
1923
 
1924
+ if(type == "elementor" && g_ucFaIcons.length == 0)
1925
+ type = "fa";
1926
+
1927
  //set "fa" template
1928
  if(type == "fa"){
1929
 
1937
  return(html);
1938
  });
1939
 
1940
+ }else if(type == "elementor"){
1941
+
1942
+ t.iconPicker_addIconsType("elementor", g_ucElIcons, function(icon){ //icon to html functoin
1943
+
1944
+ var html = '<i class="'+icon+'"></i>';
1945
+
1946
+ return(html);
1947
+ });
1948
+
1949
+
1950
+
1951
  }
1952
 
1953
  var objType = iconPicker_getObjIconsType(type);
js/unitecreator_params_dialog.js CHANGED
@@ -690,7 +690,7 @@ function UniteCreatorParamsDialog(){
690
 
691
  clearDropdownParam(objTable);
692
 
693
- if(!options)
694
  dropdownParamAddRow(objTable);
695
  else{
696
 
@@ -860,9 +860,9 @@ function UniteCreatorParamsDialog(){
860
 
861
  //fill
862
  objDropdownParam.onFillInputData = function(objTable, objData){
863
-
864
- if(objData.options)
865
  fillDropdownParamOptions(objTable, objData.options, objData.default_value);
 
866
  }
867
 
868
 
@@ -1411,6 +1411,10 @@ function UniteCreatorParamsDialog(){
1411
 
1412
  objRow.removeClass("uc-no-attribute-selected");
1413
 
 
 
 
 
1414
  //fill values select
1415
  var paramType = g_ucAdmin.getVal(objParam, "type");
1416
 
@@ -1420,7 +1424,7 @@ function UniteCreatorParamsDialog(){
1420
  var trueValue = g_ucAdmin.getVal(objParam, "true_value");
1421
 
1422
  var falseName = g_ucAdmin.getVal(objParam, "false_name");
1423
- var falseValue = g_ucAdmin.getVal(objParam, "false_value");
1424
 
1425
  var options = {};
1426
  options[trueName] = trueValue;
@@ -1436,9 +1440,9 @@ function UniteCreatorParamsDialog(){
1436
 
1437
  if(isInitValues === true)
1438
  var currentValue = g_ucAdmin.getVal(g_objData, selectName);
1439
-
1440
  var isExists = false;
1441
-
1442
  jQuery.each(options,function(text, value){
1443
 
1444
  if(currentValue === null)
@@ -1449,9 +1453,10 @@ function UniteCreatorParamsDialog(){
1449
 
1450
  g_ucAdmin.addOptionToSelect(objSelectValues, value, text);
1451
  });
1452
-
1453
- if(currentValue && isExists == true)
1454
  objSelectValues.val(currentValue);
 
1455
  }
1456
 
1457
 
@@ -1459,9 +1464,9 @@ function UniteCreatorParamsDialog(){
1459
  * fill conditions select row
1460
  */
1461
  function fillConditionSelectRow(objSelect, arrParams){
1462
-
1463
  var selectName = objSelect.prop("name");
1464
-
1465
  var currentValue = g_ucAdmin.getVal(g_objData, selectName);
1466
  if(!currentValue)
1467
  currentValue = "";
@@ -1489,7 +1494,7 @@ function UniteCreatorParamsDialog(){
1489
  currentValue = "";
1490
 
1491
  setTimeout(function(){
1492
-
1493
  objSelect.data("init_value",true);
1494
  objSelect.val(currentValue).trigger("change");
1495
 
@@ -1527,7 +1532,9 @@ function UniteCreatorParamsDialog(){
1527
 
1528
  var objConditionsWrapper = g_objWrapper.find(".uc-dialog-conditions-content");
1529
  var objSelects = g_objWrapper.find(".uc-dialog-condition-attribute");
1530
-
 
 
1531
  var arrParams = g_objParent.getControlParams(g_currentOpenedType);
1532
  var hasParams = (jQuery.isEmptyObject(arrParams) == false);
1533
 
@@ -1543,6 +1550,34 @@ function UniteCreatorParamsDialog(){
1543
  g_objWrapper.data("condition_params", arrParams);
1544
 
1545
  fillConditionsSelects(arrParams);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1546
  }
1547
 
1548
 
@@ -1560,8 +1595,22 @@ function UniteCreatorParamsDialog(){
1560
 
1561
  g_objWrapper.on("change",".uc-dialog-condition-attribute", onSelectConditionsAttributeChange);
1562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1563
  }
1564
 
 
1565
  function ____________EVENTS____________(){};
1566
 
1567
 
@@ -1909,11 +1958,7 @@ function UniteCreatorParamsDialog(){
1909
 
1910
  var objChild = jQuery(child);
1911
  var childValue = objChild.data("control");
1912
-
1913
- trace(objChild);
1914
- trace(childValue);
1915
- trace(value);
1916
-
1917
  if(childValue == value)
1918
  objChild.show();
1919
  else
690
 
691
  clearDropdownParam(objTable);
692
 
693
+ if(jQuery.isEmptyObject(options))
694
  dropdownParamAddRow(objTable);
695
  else{
696
 
860
 
861
  //fill
862
  objDropdownParam.onFillInputData = function(objTable, objData){
863
+
 
864
  fillDropdownParamOptions(objTable, objData.options, objData.default_value);
865
+
866
  }
867
 
868
 
1411
 
1412
  objRow.removeClass("uc-no-attribute-selected");
1413
 
1414
+ //show condition 2
1415
+ if(objRow.hasClass("uc-row-condition2"))
1416
+ addMoreCondition();
1417
+
1418
  //fill values select
1419
  var paramType = g_ucAdmin.getVal(objParam, "type");
1420
 
1424
  var trueValue = g_ucAdmin.getVal(objParam, "true_value");
1425
 
1426
  var falseName = g_ucAdmin.getVal(objParam, "false_name");
1427
+ var falseValue = "";
1428
 
1429
  var options = {};
1430
  options[trueName] = trueValue;
1440
 
1441
  if(isInitValues === true)
1442
  var currentValue = g_ucAdmin.getVal(g_objData, selectName);
1443
+
1444
  var isExists = false;
1445
+
1446
  jQuery.each(options,function(text, value){
1447
 
1448
  if(currentValue === null)
1453
 
1454
  g_ucAdmin.addOptionToSelect(objSelectValues, value, text);
1455
  });
1456
+
1457
+ if(isExists == true)
1458
  objSelectValues.val(currentValue);
1459
+
1460
  }
1461
 
1462
 
1464
  * fill conditions select row
1465
  */
1466
  function fillConditionSelectRow(objSelect, arrParams){
1467
+
1468
  var selectName = objSelect.prop("name");
1469
+
1470
  var currentValue = g_ucAdmin.getVal(g_objData, selectName);
1471
  if(!currentValue)
1472
  currentValue = "";
1494
  currentValue = "";
1495
 
1496
  setTimeout(function(){
1497
+
1498
  objSelect.data("init_value",true);
1499
  objSelect.val(currentValue).trigger("change");
1500
 
1532
 
1533
  var objConditionsWrapper = g_objWrapper.find(".uc-dialog-conditions-content");
1534
  var objSelects = g_objWrapper.find(".uc-dialog-condition-attribute");
1535
+
1536
+ resetMoreConditions();
1537
+
1538
  var arrParams = g_objParent.getControlParams(g_currentOpenedType);
1539
  var hasParams = (jQuery.isEmptyObject(arrParams) == false);
1540
 
1550
  g_objWrapper.data("condition_params", arrParams);
1551
 
1552
  fillConditionsSelects(arrParams);
1553
+
1554
+ }
1555
+
1556
+ /**
1557
+ * add more condition
1558
+ */
1559
+ function addMoreCondition(){
1560
+
1561
+ var objSecondRow = g_objWrapper.find(".uc-row-condition2");
1562
+ objSecondRow.show();
1563
+
1564
+ var objLinkAdd = g_objWrapper.find(".uc-dialog-link-addcondition");
1565
+
1566
+ objLinkAdd.hide();
1567
+ }
1568
+
1569
+ /**
1570
+ * init more conditions
1571
+ */
1572
+ function resetMoreConditions(){
1573
+
1574
+ var objSecondRow = g_objWrapper.find(".uc-row-condition2");
1575
+ objSecondRow.hide();
1576
+
1577
+ var objLinkAdd = g_objWrapper.find(".uc-dialog-link-addcondition");
1578
+
1579
+ objLinkAdd.show();
1580
+
1581
  }
1582
 
1583
 
1595
 
1596
  g_objWrapper.on("change",".uc-dialog-condition-attribute", onSelectConditionsAttributeChange);
1597
 
1598
+ var objLinkAdd = g_objWrapper.find(".uc-dialog-link-addcondition");
1599
+
1600
+ objLinkAdd.on("click", addMoreCondition);
1601
+
1602
+ }
1603
+
1604
+ /**
1605
+ * init sections conditions
1606
+ */
1607
+ this.initSectionsConditions = function(){
1608
+
1609
+ trace("init sections conditions");
1610
+
1611
  }
1612
 
1613
+
1614
  function ____________EVENTS____________(){};
1615
 
1616
 
1958
 
1959
  var objChild = jQuery(child);
1960
  var childValue = objChild.data("control");
1961
+
 
 
 
 
1962
  if(childValue == value)
1963
  objChild.show();
1964
  else
js/unitecreator_params_editor.js CHANGED
@@ -233,6 +233,56 @@ function UniteCreatorParamsEditor(){
233
  return getCatsData();
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
  /**
238
  * get row html, taken from param object
@@ -268,25 +318,22 @@ function UniteCreatorParamsEditor(){
268
  var conditionText = null;
269
 
270
  if(enableCondition == true){
 
271
  var conditionAttribute = g_ucAdmin.getVal(objParam, "condition_attribute");
272
  if(!conditionAttribute)
273
  enableCondition = false;
274
-
275
- var conditionOperator = g_ucAdmin.getVal(objParam, "condition_operator");
276
- var conditionValue = g_ucAdmin.getVal(objParam, "condition_value");
277
-
278
- conditionText = conditionAttribute;
279
-
280
- if(conditionOperator == "equal")
281
- conditionText += " = ";
282
  else
283
- conditionText += " != ";
284
-
285
- conditionText += conditionValue;
286
- if(!conditionValue)
287
- conditionText += "'["+g_uctext["empty_text"]+"]'";
288
  }
289
-
 
 
 
 
 
 
 
 
290
  //icon move
291
  html += " <td class='uc-hide-on-movemode'><div class='uc-table-row-handle'></div><div class='uc-table-admin-label"+adminLabelClass+"' title='Admin Label'></div></td>";
292
  html += " <td class='uc-show-on-movemode'> <input type='checkbox' class='uc-check-param-move' data-name='" + objParam.name + "'> </td>";
@@ -298,6 +345,9 @@ function UniteCreatorParamsEditor(){
298
  if(enableCondition)
299
  html += "<div class='uc-text-condition' title='"+g_uctext["display_condition"]+"'>" + conditionText + "</div>";
300
 
 
 
 
301
  html += "</td>";
302
 
303
  html += " <td "+textRowAdd+">" + objParam.name + "</td>";
@@ -1583,8 +1633,13 @@ function UniteCreatorParamsEditor(){
1583
  g_temp.funcOnUpdate();
1584
  });
1585
 
1586
- if(g_temp.hasCats == true)
 
1587
  initCatsEvents();
 
 
 
 
1588
 
1589
  }
1590
 
233
  return getCatsData();
234
  }
235
 
236
+ /**
237
+ * get condition text row
238
+ */
239
+ function getParamRowHtml_getConditionTextRow(objParam, suffix){
240
+
241
+ var conditionText = "";
242
+
243
+ var conditionAttribute = g_ucAdmin.getVal(objParam, "condition_attribute"+suffix);
244
+
245
+ if(!conditionAttribute){
246
+ return(null);
247
+ }
248
+
249
+ var conditionOperator = g_ucAdmin.getVal(objParam, "condition_operator"+suffix);
250
+ var conditionValue = g_ucAdmin.getVal(objParam, "condition_value"+suffix);
251
+
252
+ conditionText = conditionAttribute;
253
+
254
+ if(conditionOperator == "equal")
255
+ conditionText += " = ";
256
+ else
257
+ conditionText += " != ";
258
+
259
+ conditionText += conditionValue;
260
+ if(!conditionValue)
261
+ conditionText += "[null]";
262
+
263
+
264
+ return(conditionText);
265
+ }
266
+
267
+
268
+ /**
269
+ * get condition text
270
+ */
271
+ function getParamRowHtml_getConditionText(objParam){
272
+
273
+ var textRow1 = getParamRowHtml_getConditionTextRow(objParam,"");
274
+
275
+ if(!textRow1)
276
+ return(null);
277
+
278
+ var textRow2 = getParamRowHtml_getConditionTextRow(objParam,"2");
279
+
280
+ var text = textRow1;
281
+ if(textRow2)
282
+ text += " and " + textRow2;
283
+
284
+ return(text);
285
+ }
286
 
287
  /**
288
  * get row html, taken from param object
318
  var conditionText = null;
319
 
320
  if(enableCondition == true){
321
+
322
  var conditionAttribute = g_ucAdmin.getVal(objParam, "condition_attribute");
323
  if(!conditionAttribute)
324
  enableCondition = false;
 
 
 
 
 
 
 
 
325
  else
326
+ conditionText = getParamRowHtml_getConditionText(objParam);
 
 
 
 
327
  }
328
+
329
+ var tabText = null;
330
+
331
+ var tabName = g_ucAdmin.getVal(objParam, "tabname");
332
+ tabName = jQuery.trim(tabName);
333
+
334
+ if(tabName)
335
+ tabText = tabName;
336
+
337
  //icon move
338
  html += " <td class='uc-hide-on-movemode'><div class='uc-table-row-handle'></div><div class='uc-table-admin-label"+adminLabelClass+"' title='Admin Label'></div></td>";
339
  html += " <td class='uc-show-on-movemode'> <input type='checkbox' class='uc-check-param-move' data-name='" + objParam.name + "'> </td>";
345
  if(enableCondition)
346
  html += "<div class='uc-text-condition' title='"+g_uctext["display_condition"]+"'>" + conditionText + "</div>";
347
 
348
+ if(tabText)
349
+ html += "<div class='uc-text-tab'>" + tabText + "</div>";
350
+
351
  html += "</td>";
352
 
353
  html += " <td "+textRowAdd+">" + objParam.name + "</td>";
1633
  g_temp.funcOnUpdate();
1634
  });
1635
 
1636
+ if(g_temp.hasCats == true){
1637
+
1638
  initCatsEvents();
1639
+
1640
+ var objDialogSpecial = new UniteCreatorParamsDialog();
1641
+ objDialogSpecial.initSectionsConditions();
1642
+ }
1643
 
1644
  }
1645
 
js/unitecreator_params_panel.js CHANGED
@@ -109,7 +109,7 @@ function UniteCreatorParamsPanel(){
109
  * add child params
110
  */
111
  function addChildParams(objParentParam, arrChildKeys, filter){
112
-
113
  var baseName = objParentParam.name;
114
  var parentName = baseName;
115
 
@@ -125,6 +125,7 @@ function UniteCreatorParamsPanel(){
125
  paramParent.visual = visual;
126
 
127
  addParam(paramParent, null, filter);
 
128
 
129
  //add child params:
130
  jQuery.each(arrChildKeys, function(index, objChildParam){
@@ -286,6 +287,15 @@ function UniteCreatorParamsPanel(){
286
  paramVisual = name + " wrapping code";
287
  }
288
 
 
 
 
 
 
 
 
 
 
289
  break;
290
  default:
291
 
109
  * add child params
110
  */
111
  function addChildParams(objParentParam, arrChildKeys, filter){
112
+
113
  var baseName = objParentParam.name;
114
  var parentName = baseName;
115
 
125
  paramParent.visual = visual;
126
 
127
  addParam(paramParent, null, filter);
128
+
129
 
130
  //add child params:
131
  jQuery.each(arrChildKeys, function(index, objChildParam){
287
  paramVisual = name + " wrapping code";
288
  }
289
 
290
+ break;
291
+ case "uc_image":
292
+
293
+ isTakeChildred = true;
294
+
295
+ var mediaType = g_ucAdmin.getVal(objParam, "media_type");
296
+ if(mediaType == "json")
297
+ isTakeChildred = false;
298
+
299
  break;
300
  default:
301
 
provider/core/plugins/unlimited_elements/copy_paste.class.php CHANGED
@@ -146,10 +146,7 @@ class UniteCreatorElementorCopyPaste{
146
  * on paste section ajax action
147
  */
148
  public function pasteSectionAjaxAction($data){
149
-
150
- if(GlobalsUC::$inDev == false && !defined("UC_ENABLE_COPYPASTE"))
151
- return(false);
152
-
153
  $paramsData = UniteFunctionsUC::getVal($data, "params_data");
154
  if(empty($paramsData))
155
  UniteFunctionsUC::throwError("no paste data found");
@@ -184,8 +181,6 @@ class UniteCreatorElementorCopyPaste{
184
  */
185
  public function getSectionZipFromData($data){
186
 
187
- if(GlobalsUC::$inDev == false && !defined("UC_ENABLE_COPYPASTE"))
188
- return(null);
189
  try{
190
 
191
  $postID = UniteFunctionsUC::getVal($data, "postid");
146
  * on paste section ajax action
147
  */
148
  public function pasteSectionAjaxAction($data){
149
+
 
 
 
150
  $paramsData = UniteFunctionsUC::getVal($data, "params_data");
151
  if(empty($paramsData))
152
  UniteFunctionsUC::throwError("no paste data found");
181
  */
182
  public function getSectionZipFromData($data){
183
 
 
 
184
  try{
185
 
186
  $postID = UniteFunctionsUC::getVal($data, "postid");
provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php CHANGED
@@ -384,9 +384,12 @@ class UniteCreatorDialogParamElementor extends UniteCreatorDialogParam{
384
  $arrUnits["%"] = "%";
385
  $arrUnits["em"] = "EM";
386
  $arrUnits["vh"] = __("VH","unlimited-elements-for-elementor");
 
387
  $arrUnits["px_percent"] = __("PX, %","unlimited-elements-for-elementor");
388
  $arrUnits["px_percent_em"] = __("PX, %, EM","unlimited-elements-for-elementor");
389
  $arrUnits["vh_px"] = __("VH, PX","unlimited-elements-for-elementor");
 
 
390
 
391
 
392
  $arrUnits = array_flip($arrUnits);
384
  $arrUnits["%"] = "%";
385
  $arrUnits["em"] = "EM";
386
  $arrUnits["vh"] = __("VH","unlimited-elements-for-elementor");
387
+ $arrUnits["percent_px"] = __("%, PX","unlimited-elements-for-elementor");
388
  $arrUnits["px_percent"] = __("PX, %","unlimited-elements-for-elementor");
389
  $arrUnits["px_percent_em"] = __("PX, %, EM","unlimited-elements-for-elementor");
390
  $arrUnits["vh_px"] = __("VH, PX","unlimited-elements-for-elementor");
391
+ $arrUnits["px_vh"] = __("PX, VH","unlimited-elements-for-elementor");
392
+ $arrUnits["px_vh_percent"] = __("PX, VH, %","unlimited-elements-for-elementor");
393
 
394
 
395
  $arrUnits = array_flip($arrUnits);
provider/core/plugins/unlimited_elements/elementor/assets/template_library_admin.js CHANGED
@@ -14,8 +14,17 @@ function UniteCreatorElementorTemplateLibraryAdmin(){
14
 
15
  var objButtonCloned = objButton.clone();
16
 
17
- var objHeaderEnd = jQuery(".wp-header-end");
18
- objHeaderEnd.before(objButtonCloned);
 
 
 
 
 
 
 
 
 
19
 
20
  //set event
21
  objButtonCloned.click(onToggleButtonClick);
14
 
15
  var objButtonCloned = objButton.clone();
16
 
17
+ var objAdminBarButtonsNew = jQuery(".e-admin-top-bar__main-area-buttons");
18
+
19
+ if(objAdminBarButtonsNew.length){
20
+
21
+ objAdminBarButtonsNew.append(objButtonCloned);
22
+
23
+ }else{
24
+ var objHeaderEnd = jQuery(".wp-header-end");
25
+ objHeaderEnd.before(objButtonCloned);
26
+ }
27
+
28
 
29
  //set event
30
  objButtonCloned.click(onToggleButtonClick);
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.css CHANGED
@@ -1,24 +1,33 @@
1
  @CHARSET "ISO-8859-1";
2
 
3
-
4
- .uc-button-edit-html{
5
  margin-top:5px;
6
  }
7
 
8
- .uc-elementor-control-disabled input[type='text']{
9
  background-color:#f9f9f9;
10
  color:#928D8C;
11
  }
12
 
13
- .unite-setting-post-type{
14
  height:70px;
15
  min-width:135px !important;
16
  }
17
 
18
 
19
- /* --- tooltip --- */
 
 
 
 
20
 
21
- .ue-widget-icon::after{
 
 
 
 
 
 
22
  xcontent:"UE";
23
  content:url(../images/logo-mini.svg);
24
  opacity:0.5;
@@ -35,23 +44,22 @@
35
  padding-right:4px;
36
  }
37
 
38
- .ue-widget-icon.ue-dark-mode::after{
39
  filter: brightness(4);
40
  }
41
 
42
-
43
- .ue-wi-svg::after{
44
  height:44px;
45
  background-size:auto 34px;
46
  background-position:center bottom;
47
  background-repeat:no-repeat;
48
  }
49
 
50
- .ue-wi-svg::before{
51
  opacity:0;
52
  }
53
 
54
- .elementor-element-wrapper:hover .ue-widget-icon.uc-wi-preview::after{
55
  content:"";
56
  display:block;
57
  position:absolute;
@@ -85,12 +93,12 @@
85
  opacity:1;
86
  }
87
 
88
- .elementor-element-wrapper:hover .ue-widget-icon.ue-dark-mode.uc-wi-preview::after{
89
  background-color:#404349;
90
  box-shadow: inset 0 -22px 6px -6px rgba(64, 67, 73, 0.9);
91
  }
92
 
93
- .uc-panel-ajax-loader{
94
  display:inline-block;
95
  background-image:url(../images/loader.gif);
96
  background-repeat:no-repeat;
@@ -105,23 +113,23 @@
105
  }
106
 
107
  /* button edit post */
108
- .uc-button-edit-wrapper{
109
  padding-top:5px;
110
  padding-right:5px;
111
  text-align:right;
112
  }
113
 
114
- .uc-button-edit-wrapper a{
115
  font-size:11px !important;
116
  font-weight:normal !important;
117
  color:#6d7882 !important;
118
  }
119
 
120
- .uc-button-edit-wrapper a:hover{
121
  text-decoration:underline;
122
  }
123
 
124
- .uc-notification-control{
125
  background-color:#fef8ee;
126
  border-left:2px solid #f0b848;
127
  padding:10px;
1
  @CHARSET "ISO-8859-1";
2
 
3
+ .elementor-panel .uc-button-edit-html{
 
4
  margin-top:5px;
5
  }
6
 
7
+ .elementor-panel .uc-elementor-control-disabled input[type='text']{
8
  background-color:#f9f9f9;
9
  color:#928D8C;
10
  }
11
 
12
+ .elementor-panel .unite-setting-post-type{
13
  height:70px;
14
  min-width:135px !important;
15
  }
16
 
17
 
18
+ /* --- icons --- */
19
+
20
+ .elementor-panel .uc-default-widget-icon::after{
21
+ background-image:url('../images/widget-icon.svg');
22
+ }
23
 
24
+ .elementor-panel .ue-widget-icon{
25
+ min-width:40px;
26
+ min-height:23px;
27
+ display:inline-block;
28
+ }
29
+
30
+ .elementor-panel .ue-widget-icon::after{
31
  xcontent:"UE";
32
  content:url(../images/logo-mini.svg);
33
  opacity:0.5;
44
  padding-right:4px;
45
  }
46
 
47
+ .elementor-panel .ue-widget-icon.ue-dark-mode::after{
48
  filter: brightness(4);
49
  }
50
 
51
+ .elementor-panel .ue-wi-svg::after{
 
52
  height:44px;
53
  background-size:auto 34px;
54
  background-position:center bottom;
55
  background-repeat:no-repeat;
56
  }
57
 
58
+ .elementor-panel .ue-wi-svg::before{
59
  opacity:0;
60
  }
61
 
62
+ .elementor-panel .elementor-element-wrapper:hover .ue-widget-icon.uc-wi-preview::after{
63
  content:"";
64
  display:block;
65
  position:absolute;
93
  opacity:1;
94
  }
95
 
96
+ .elementor-panel .elementor-element-wrapper:hover .ue-widget-icon.ue-dark-mode.uc-wi-preview::after{
97
  background-color:#404349;
98
  box-shadow: inset 0 -22px 6px -6px rgba(64, 67, 73, 0.9);
99
  }
100
 
101
+ .elementor-panel .uc-panel-ajax-loader{
102
  display:inline-block;
103
  background-image:url(../images/loader.gif);
104
  background-repeat:no-repeat;
113
  }
114
 
115
  /* button edit post */
116
+ .elementor-panel .uc-button-edit-wrapper{
117
  padding-top:5px;
118
  padding-right:5px;
119
  text-align:right;
120
  }
121
 
122
+ .elementor-panel .uc-button-edit-wrapper a{
123
  font-size:11px !important;
124
  font-weight:normal !important;
125
  color:#6d7882 !important;
126
  }
127
 
128
+ .elementor-panel .uc-button-edit-wrapper a:hover{
129
  text-decoration:underline;
130
  }
131
 
132
+ .elementor-panel .uc-notification-control{
133
  background-color:#fef8ee;
134
  border-left:2px solid #f0b848;
135
  padding:10px;
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js CHANGED
@@ -7,7 +7,7 @@ function UniteCreatorElementorEditorAdmin(){
7
  var g_objSettingsPanel;
8
  var g_objAddonParams, g_objAddonParamsItems, g_lastAddonName;
9
  var g_numRepeaterItems = 0;
10
- var g_windowFront, g_searchDataID, g_searchData;
11
  var g_temp = {};
12
 
13
 
@@ -178,7 +178,7 @@ function UniteCreatorElementorEditorAdmin(){
178
 
179
  var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
180
  if(isCurrentTaxRelevant == false && firstVisibleOption){
181
-
182
  selectPostTaxonomy.val(firstVisibleOption).trigger("change");
183
  }
184
 
@@ -1256,6 +1256,7 @@ function UniteCreatorElementorEditorAdmin(){
1256
  if(g_searchDataID == elID){
1257
 
1258
  g_searchData = getVal(item, "settings");
 
1259
  return(false);
1260
  }
1261
 
@@ -1278,7 +1279,7 @@ function UniteCreatorElementorEditorAdmin(){
1278
  * get settings from elementor
1279
  */
1280
  function getSettingsFromElementor(id){
1281
-
1282
  var data = elementor.config.data;
1283
 
1284
  var objSettings = searchElementorData(data, id);
@@ -1328,16 +1329,41 @@ function UniteCreatorElementorEditorAdmin(){
1328
  funcError(textStatus);
1329
  }
1330
  }
1331
-
1332
  jQuery.ajax(ajaxOptions);
1333
 
1334
  }
1335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1336
  /**
1337
  * get relevant settings data from all settings
1338
  */
1339
  function getBGSettingsData(type, objSettings){
1340
-
1341
  if(!objSettings)
1342
  return({});
1343
 
@@ -1350,9 +1376,17 @@ function UniteCreatorElementorEditorAdmin(){
1350
 
1351
  var shortKey = key.replace(type+"_", "");
1352
 
1353
- objSettingsData[shortKey] = objSettings[key];
 
 
 
 
 
 
1354
  }
1355
 
 
 
1356
  return(objSettingsData);
1357
  }
1358
 
@@ -1493,9 +1527,12 @@ function UniteCreatorElementorEditorAdmin(){
1493
  window.ucLastElementorModel = model.attributes;
1494
 
1495
  window.lastWidgetType = getVal(model.attributes, "widgetType");
 
 
1496
 
1497
  }
1498
 
 
1499
  /**
1500
  * run ajax action
1501
  */
@@ -1555,12 +1592,18 @@ function UniteCreatorElementorEditorAdmin(){
1555
  return(false);
1556
  }
1557
 
 
 
1558
  g_windowFront = windowFront;
1559
 
 
 
1560
  if(typeof g_ucHasBackgrounds !== "undefined" && g_ucHasBackgrounds === true)
1561
  initBackgrounds();
1562
 
1563
  elementor.hooks.addAction("panel/open_editor/widget", onElementorOpenWidget);
 
 
1564
  }
1565
 
1566
 
@@ -1587,6 +1630,54 @@ function UniteCreatorElementorEditorAdmin(){
1587
 
1588
  }
1589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1590
  var g_objUCElementorEditorAdmin = new UniteCreatorElementorEditorAdmin();
1591
 
1592
 
7
  var g_objSettingsPanel;
8
  var g_objAddonParams, g_objAddonParamsItems, g_lastAddonName;
9
  var g_numRepeaterItems = 0;
10
+ var g_windowFront, g_searchDataID, g_searchData, g_frontAPI;
11
  var g_temp = {};
12
 
13
 
178
 
179
  var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
180
  if(isCurrentTaxRelevant == false && firstVisibleOption){
181
+
182
  selectPostTaxonomy.val(firstVisibleOption).trigger("change");
183
  }
184
 
1256
  if(g_searchDataID == elID){
1257
 
1258
  g_searchData = getVal(item, "settings");
1259
+
1260
  return(false);
1261
  }
1262
 
1279
  * get settings from elementor
1280
  */
1281
  function getSettingsFromElementor(id){
1282
+
1283
  var data = elementor.config.data;
1284
 
1285
  var objSettings = searchElementorData(data, id);
1329
  funcError(textStatus);
1330
  }
1331
  }
1332
+
1333
  jQuery.ajax(ajaxOptions);
1334
 
1335
  }
1336
 
1337
+
1338
+ /**
1339
+ * get repeater data
1340
+ */
1341
+ function getRepeaterData(objData){
1342
+
1343
+ var models = getVal(objData, "models");
1344
+
1345
+ if(!models || jQuery.isEmptyObject(models))
1346
+ return([]);
1347
+
1348
+ var settings = [];
1349
+
1350
+ jQuery.each(models, function(index, model){
1351
+
1352
+ var attributes = getVal(model, "attributes");
1353
+
1354
+ settings.push(attributes);
1355
+
1356
+ });
1357
+
1358
+ return(settings);
1359
+ }
1360
+
1361
+
1362
  /**
1363
  * get relevant settings data from all settings
1364
  */
1365
  function getBGSettingsData(type, objSettings){
1366
+
1367
  if(!objSettings)
1368
  return({});
1369
 
1376
 
1377
  var shortKey = key.replace(type+"_", "");
1378
 
1379
+ var objData = objSettings[key];
1380
+
1381
+ if(typeof objData == "object" && objData.hasOwnProperty("model") && objData.hasOwnProperty("_byId")){
1382
+ objData = getRepeaterData(objData);
1383
+ }
1384
+
1385
+ objSettingsData[shortKey] = objData;
1386
  }
1387
 
1388
+ trace(objSettingsData);
1389
+
1390
  return(objSettingsData);
1391
  }
1392
 
1527
  window.ucLastElementorModel = model.attributes;
1528
 
1529
  window.lastWidgetType = getVal(model.attributes, "widgetType");
1530
+
1531
+ g_frontAPI.triggerEvent("open_widget_settings", window.ucLastElementorModel);
1532
 
1533
  }
1534
 
1535
+
1536
  /**
1537
  * run ajax action
1538
  */
1592
  return(false);
1593
  }
1594
 
1595
+ g_frontAPI = new UniteCreatorElementorFrontAPI();
1596
+
1597
  g_windowFront = windowFront;
1598
 
1599
+ g_windowFront.g_ueSettingsAPI = g_frontAPI;
1600
+
1601
  if(typeof g_ucHasBackgrounds !== "undefined" && g_ucHasBackgrounds === true)
1602
  initBackgrounds();
1603
 
1604
  elementor.hooks.addAction("panel/open_editor/widget", onElementorOpenWidget);
1605
+
1606
+
1607
  }
1608
 
1609
 
1630
 
1631
  }
1632
 
1633
+ /**
1634
+ * front api
1635
+ */
1636
+ function UniteCreatorElementorFrontAPI(){
1637
+
1638
+ var g_objAdmin;
1639
+
1640
+ /**
1641
+ * debug some string
1642
+ */
1643
+ function trace(str){
1644
+ console.log(str);
1645
+ }
1646
+
1647
+ /**
1648
+ * trigger event
1649
+ */
1650
+ this.triggerEvent = function(eventName, model, options){
1651
+
1652
+ var data = {};
1653
+ data.model = model;
1654
+
1655
+ jQuery(window).trigger("ue_event_"+eventName, data);
1656
+
1657
+ }
1658
+
1659
+
1660
+ /**
1661
+ * on event
1662
+ */
1663
+ this.onEvent = function(eventName, func){
1664
+
1665
+ jQuery(window).on("ue_event_"+eventName, func);
1666
+
1667
+ }
1668
+
1669
+
1670
+ /**
1671
+ * editor admin
1672
+ */
1673
+ this.initAPI = function(objAdmin){
1674
+
1675
+ g_objAdmin = objAdmin;
1676
+ }
1677
+
1678
+ }
1679
+
1680
+
1681
  var g_objUCElementorEditorAdmin = new UniteCreatorElementorEditorAdmin();
1682
 
1683
 
provider/core/plugins/unlimited_elements/elementor/assets/uc_front_admin.js CHANGED
@@ -1,4 +1,95 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  function ucDocReady(fn) {
4
  // see if DOM is already available
@@ -10,9 +101,10 @@ function ucDocReady(fn) {
10
  }
11
  }
12
 
 
13
  ucDocReady(function(){
14
 
15
- window.parent.g_objUCElementorEditorAdmin.initFrontEndInteraction(window, elementorFrontend);
16
-
17
  });
18
 
1
 
2
+ window.g_ueSettingsAPI = null;
3
+
4
+ function UnlimitedElementsWidgetSettingsAPI(){
5
+
6
+ var g_id, g_frontAPI;
7
+
8
+ function trace(str){
9
+ console.log(str);
10
+ }
11
+
12
+
13
+ /**
14
+ * on event
15
+ */
16
+ this.on = function(name, func){
17
+
18
+ if(typeof func !== "function")
19
+ throw new Error("settings api error - second parameter of event: "+name+"should be a function");
20
+
21
+ g_frontAPI.onEvent(name, function(event, data){
22
+
23
+ if(!data)
24
+ return(false);
25
+
26
+ var model = data.model;
27
+
28
+ if(!model)
29
+ return(false);
30
+
31
+ if(model.id != g_id)
32
+ return(false);
33
+
34
+ var attributes = model.settings.attributes;
35
+
36
+ //run the event function
37
+ func(attributes);
38
+
39
+ });
40
+
41
+ }
42
+
43
+
44
+ /**
45
+ * init the api
46
+ */
47
+ this.init = function(objWidget){
48
+
49
+ if(!objWidget || objWidget.length == 0)
50
+ return(false);
51
+
52
+ var objParent = objWidget.parents(".elementor-element.elementor-element-edit-mode");
53
+
54
+ if(objParent.length == 0)
55
+ throw new Error("settings api error - parent element not found");
56
+
57
+ var elementType = objParent.data("element_type");
58
+
59
+ g_id = objParent.data("id");
60
+
61
+ if(elementType != "widget")
62
+ throw new Error("settings api error - wrong element type");
63
+
64
+ if(!window.g_ueSettingsAPI)
65
+ throw new Error("settings api error - main api not inited");
66
+
67
+ g_frontAPI = window.g_ueSettingsAPI;
68
+
69
+ }
70
+
71
+
72
+
73
+ }
74
+
75
+ /**
76
+ * get editor api by id
77
+ */
78
+ function ueGetEditorSettingsAPI(widgetID){
79
+
80
+ var objWidget = jQuery("#"+widgetID);
81
+
82
+ if(objWidget.length == 0)
83
+ throw new Error("settings api error, no widget found by id: "+widgetID);
84
+
85
+ var objWidgetAPI = new UnlimitedElementsWidgetSettingsAPI();
86
+
87
+ objWidgetAPI.init(objWidget);
88
+
89
+ return(objWidgetAPI);
90
+ }
91
+
92
+
93
 
94
  function ucDocReady(fn) {
95
  // see if DOM is already available
101
  }
102
  }
103
 
104
+
105
  ucDocReady(function(){
106
 
107
+ window.g_ueSettingsAPI = window.parent.g_objUCElementorEditorAdmin.initFrontEndInteraction(window, elementorFrontend);
108
+
109
  });
110
 
provider/core/plugins/unlimited_elements/elementor/elementor_background_widget.class.php CHANGED
@@ -90,6 +90,14 @@ class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget
90
 
91
  $params = $this->objAddon->getProcessedMainParams();
92
 
 
 
 
 
 
 
 
 
93
  if(empty($params)){
94
 
95
  $this->addNoParamsBGHeading();
@@ -100,9 +108,6 @@ class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget
100
 
101
  $params = $this->addDynamicAttributes($params);
102
 
103
- //if($isGeneralSection == true && $isItemsEnabled == true && $itemsType == "image")
104
- //$this->addGalleryControlUC();
105
-
106
  foreach($params as $param){
107
 
108
  $type = UniteFunctionsUC::getVal($param, "type");
@@ -114,8 +119,12 @@ class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget
114
  $this->addElementorParamUC($param);
115
  }
116
 
 
 
 
117
  }
118
 
 
119
  /**
120
  * get background settings by section settings
121
  */
90
 
91
  $params = $this->objAddon->getProcessedMainParams();
92
 
93
+ $isItemsEnabled = $this->objAddon->isHasItems();
94
+ $itemsType = $this->objAddon->getItemsType();
95
+
96
+ $isAddItems = false;
97
+ if($isItemsEnabled == true && $itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
98
+ $isAddItems = true;
99
+
100
+
101
  if(empty($params)){
102
 
103
  $this->addNoParamsBGHeading();
108
 
109
  $params = $this->addDynamicAttributes($params);
110
 
 
 
 
111
  foreach($params as $param){
112
 
113
  $type = UniteFunctionsUC::getVal($param, "type");
119
  $this->addElementorParamUC($param);
120
  }
121
 
122
+ if($isAddItems == true)
123
+ $this->addItemsControlsUC($itemsType);
124
+
125
  }
126
 
127
+
128
  /**
129
  * get background settings by section settings
130
  */
provider/core/plugins/unlimited_elements/elementor/elementor_content.class.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
4
-
5
- class UniteCreatorElementorContnet{
6
-
7
-
8
-
9
- }
 
 
 
 
 
 
 
 
 
provider/core/plugins/unlimited_elements/elementor/elementor_controls.class.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ use Elementor\Widget_Base;
3
+ use Elementor\Controls_Manager;
4
+ use Elementor\Repeater;
5
+ use \Elementor\Utils;
6
+
7
+ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
8
+
9
+
10
+ class UniteCreatorElementorControls{
11
+
12
+
13
+
14
+ /**
15
+ * get repeater default items
16
+ */
17
+ private function getRepeaterDefaultItems($objAddon){
18
+
19
+ $arrSourceItems = $objAddon->getArrItemsNonProcessed();
20
+
21
+ if(empty($arrSourceItems))
22
+ return(array());
23
+
24
+ $urlAssets = $objAddon->getUrlAssets();
25
+
26
+ $arrItems = array();
27
+
28
+ foreach($arrSourceItems as $item){
29
+
30
+ $urlImage = UniteFunctionsUC::getVal($item, "image");
31
+ $title = UniteFunctionsUC::getVal($item, "title");
32
+
33
+ if(empty($urlImage))
34
+ continue;
35
+
36
+ if(!empty($urlAssets))
37
+ $urlImage = HelperUC::convertFromUrlAssets($urlImage, $urlAssets);
38
+
39
+ $outputItem = array();
40
+ $outputItem["image"] = array("url"=>$urlImage);
41
+ $outputItem["title"] = $title;
42
+
43
+ $arrItems[] = $outputItem;
44
+ }
45
+
46
+ return($arrItems);
47
+ }
48
+
49
+
50
+ /**
51
+ * add repeater control
52
+ */
53
+ public function addGalleryImageVideoRepeater($objControls, $textPrefix, $name, $listingParam, $objAddon){
54
+
55
+ $isEnableVideo = UniteFunctionsUC::getVal($listingParam, "gallery_enable_video");
56
+
57
+ $arrDefaultItems = $this->getRepeaterDefaultItems($objAddon);
58
+
59
+ $repeater = new Repeater();
60
+
61
+ $objControls->start_controls_section(
62
+ 'uc_section_listing_gallery_repeater', array(
63
+ 'label' => $textPrefix.__(" Items", "unlimited-elements-for-elementor"),
64
+ 'condition'=>array($name."_source"=>"image_video_repeater")
65
+ )
66
+ );
67
+
68
+ // ---- item type ---------
69
+
70
+ if($isEnableVideo == true):
71
+
72
+ $repeater->add_control(
73
+ 'item_type',
74
+ array(
75
+ 'label' => __( 'Item Type', 'unlimited-elements-for-elementor' ),
76
+ 'type' => Controls_Manager::SELECT,
77
+ 'default' => 'image',
78
+ 'options' => array(
79
+ 'image' => __( 'Image', 'unlimited-elements-for-elementor' ),
80
+ 'youtube' => __( 'Youtube', 'unlimited-elements-for-elementor' ),
81
+ 'vimeo' => __( 'Vimeo', 'unlimited-elements-for-elementor' ),
82
+ 'wistia' => __( 'Wistia', 'unlimited-elements-for-elementor' ),
83
+ 'html5' => __( 'HTML5 Video', 'unlimited-elements-for-elementor' )
84
+ )
85
+ )
86
+ );
87
+
88
+
89
+ //--------- youtube url --------
90
+
91
+ $repeater->add_control(
92
+ 'url_youtube',
93
+ array(
94
+ 'label' => __( 'Youtube Url or ID', 'unlimited-elements-for-elementor' ),
95
+ 'type' => Controls_Manager::TEXT,
96
+ 'default' => __( '', 'unlimited-elements-for-elementor' ),
97
+ 'description'=>'For example: https://www.youtube.com/watch?v=qrO4YZeyl0I or qrO4YZeyl0I',
98
+ 'separator'=>'before',
99
+ 'label_block'=>true,
100
+ 'condition'=>array('item_type'=>'youtube')
101
+ )
102
+ );
103
+
104
+ //--------- vimeo id --------
105
+
106
+ $repeater->add_control(
107
+ 'vimeo_id',
108
+ array(
109
+ 'label' => __( 'Vimeo Video ID or Url', 'unlimited-elements-for-elementor' ),
110
+ 'type' => Controls_Manager::TEXT,
111
+ 'default' => __( '', 'unlimited-elements-for-elementor' ),
112
+ 'description'=>__('For example: 581014653, or https://vimeo.com/581014653','unlimited-elements-for-elementor'),
113
+ 'separator'=>'before',
114
+ 'label_block'=>true,
115
+ 'condition'=>array('item_type'=>'vimeo')
116
+ )
117
+ );
118
+
119
+ //--------- wistia --------
120
+
121
+ $repeater->add_control(
122
+ 'wistia_id',
123
+ array(
124
+ 'label' => __( 'Wistia Video ID', 'unlimited-elements-for-elementor' ),
125
+ 'type' => Controls_Manager::TEXT,
126
+ 'default' => __( '', 'unlimited-elements-for-elementor' ),
127
+ 'description'=>__('For example: 9oedgxuciv','unlimited-elements-for-elementor'),
128
+ 'separator'=>'before',
129
+ 'label_block'=>true,
130
+ 'condition'=>array('item_type'=>'wistia')
131
+ )
132
+ );
133
+
134
+ //--------- html5 video --------
135
+
136
+ $repeater->add_control(
137
+ 'url_html5',
138
+ array(
139
+ 'label' => __( 'MP4 Video Url', 'unlimited-elements-for-elementor' ),
140
+ 'type' => Controls_Manager::TEXT,
141
+ 'default' => __( '', 'unlimited-elements-for-elementor' ),
142
+ 'description'=>__('Enter url of the mp4 video in current or external site. Example: http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4','unlimited-elements-for-elementor'),
143
+ 'separator'=>'before',
144
+ 'label_block'=>true,
145
+ 'condition'=>array('item_type'=>'html5')
146
+ )
147
+ );
148
+
149
+ endif; //enable video
150
+
151
+
152
+ //--------- image --------
153
+
154
+ $repeater->add_control(
155
+ 'image',
156
+ array(
157
+ 'label' => __( 'Choose Image', 'unlimited-elements-for-elementor' ),
158
+ 'type' => Controls_Manager::MEDIA,
159
+ 'separator'=>'before',
160
+ 'default' => array(
161
+ 'url' => Utils::get_placeholder_image_src(),
162
+ ),
163
+ 'dynamic'=>array('active'=>true),
164
+ 'recursive'=>true
165
+ )
166
+ );
167
+
168
+ //--------- image heading --------
169
+ if($isEnableVideo == true)
170
+ $repeater->add_control(
171
+ 'image_heading_text',
172
+ array(
173
+ 'label' => __( 'This image will be used for gallery thumbnail and video placeholder', 'unlimited-elements-for-elementor' ),
174
+ 'type' => Controls_Manager::HEADING,
175
+ 'condition'=>array('item_type!'=>'image')
176
+ )
177
+ );
178
+
179
+ //--------- title --------
180
+
181
+ $repeater->add_control(
182
+ 'title',
183
+ array(
184
+ 'label' => __( 'Item Title', 'unlimited-elements-for-elementor' ),
185
+ 'type' => Controls_Manager::TEXT,
186
+ 'default' => __( '', 'unlimited-elements-for-elementor' ),
187
+ 'label_block'=>true,
188
+ 'separator'=>'before',
189
+ 'dynamic'=>array('active'=>true),
190
+ 'recursive'=>true
191
+ )
192
+ );
193
+
194
+ //--------- description --------
195
+
196
+ $repeater->add_control(
197
+ 'description',
198
+ array(
199
+ 'label' => __( 'Item Description', 'unlimited-elements-for-elementor' ),
200
+ 'type' => Controls_Manager::TEXTAREA,
201
+ 'default' => __( '', 'unlimited-elements-for-elementor' ),
202
+ 'label_block'=>true,
203
+ 'dynamic'=>array('active'=>true),
204
+ 'recursive'=>true
205
+ )
206
+ );
207
+
208
+ $arrControl["recursive"] = true;
209
+
210
+ //--------- link --------
211
+
212
+ $repeater->add_control(
213
+ 'link',
214
+ array(
215
+ 'label' => __( 'Item Link', 'unlimited-elements-for-elementor' ),
216
+ 'type' => Controls_Manager::URL,
217
+ 'default' => array(
218
+ 'url' => '',
219
+ 'is_external' => true,
220
+ 'nofollow' => false),
221
+ 'label_block'=>true,
222
+ 'dynamic'=>array('active'=>true),
223
+ 'recursive'=>true
224
+ )
225
+ );
226
+
227
+
228
+
229
+ $objControls->add_control(
230
+ $name.'_items',
231
+ array(
232
+ 'label' => __( 'Gallery Items', 'unlimited-elements-for-elementor' ),
233
+ 'type' => Controls_Manager::REPEATER,
234
+ 'fields' => $repeater->get_controls(),
235
+ 'default' => $arrDefaultItems,
236
+ 'title_field' => '{{{ title }}}',
237
+ )
238
+ );
239
+
240
+ $objControls->end_controls_section();
241
+
242
+ }
243
+
244
+ }
provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php CHANGED
@@ -12,7 +12,7 @@ class UniteCreatorElementorIntegrate{
12
  const ADDONS_CATEGORY_TITLE = "Unlimited Elements";
13
  const ADDONS_CATEGORY_NAME = "unlimited_elements";
14
  const ADDONS_TYPE = "elementor";
15
- const DEFAULT_ICON = "fa fa-gears";
16
  const TEMPLATE_TYPE_ARCHIVE = "archive";
17
  const CONTROL_BACKGROUND_TYPE = "uc_background_type";
18
 
@@ -306,7 +306,7 @@ class UniteCreatorElementorIntegrate{
306
  self::logMemoryUsage("before widgets registered");
307
 
308
  self::$numRegistered = 0;
309
-
310
  if(self::$isConsolidated)
311
  $this->registerWidgets_categories();
312
  else{
@@ -512,9 +512,9 @@ class UniteCreatorElementorIntegrate{
512
  return(false);
513
 
514
  foreach($params as $param){
515
-
516
  $type = UniteFunctionsUC::getVal($param, "type");
517
- if($type != UniteCreatorDialogParam::PARAM_POSTS_LIST)
518
  continue;
519
 
520
  //post list only
@@ -950,10 +950,10 @@ class UniteCreatorElementorIntegrate{
950
  public function onRegisterFrontScripts(){
951
 
952
  //background related
953
- if($this->enableBackgroundWidgets == true && self::$isFrontendEditorMode == true){
954
-
955
- HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_front_admin.js", "unlimited_elments_editor_admin");
956
- HelperUC::addStyleAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_front_admin.css", "unlimited_elments_front_admin_css");
957
  }
958
 
959
  //---- copy paste related
@@ -1050,6 +1050,8 @@ class UniteCreatorElementorIntegrate{
1050
 
1051
  $nonce = UniteProviderFunctionsUC::getNonce();
1052
 
 
 
1053
  ?>
1054
  <style>
1055
 
@@ -1071,10 +1073,11 @@ class UniteCreatorElementorIntegrate{
1071
  font-size: 18px;
1072
  }
1073
 
 
1074
  </style>
1075
 
1076
  <div style="display:none">
1077
-
1078
  <a id="uc_button_import_layout" href="javascript:void(0)" class="page-title-action"><?php esc_html_e("Import Template With Images", "unlimited-elements-for-elementor")?></a>
1079
 
1080
  <div id="uc_import_layout_area" style="display:none">
@@ -1090,7 +1093,6 @@ class UniteCreatorElementorIntegrate{
1090
  </div>
1091
 
1092
  </div>
1093
-
1094
  <?php
1095
  }
1096
 
@@ -1128,7 +1130,8 @@ class UniteCreatorElementorIntegrate{
1128
 
1129
  if(empty(self::$arrWidgetIcons))
1130
  return(null);
1131
-
 
1132
  $styles = "";
1133
  foreach(self::$arrWidgetIcons as $class => $arrWidget){
1134
 
@@ -1149,7 +1152,7 @@ class UniteCreatorElementorIntegrate{
1149
  $text = htmlspecialchars($text);
1150
 
1151
  if(!empty($urlPreview)){
1152
- $cssHover .= "background-image:url('{$urlPreview}');";
1153
 
1154
  if(!empty($text))
1155
  $cssHover .= "content:\"{$text}\" !important;";
@@ -1163,7 +1166,7 @@ class UniteCreatorElementorIntegrate{
1163
  //--- icon related ---
1164
 
1165
  if(!empty($urlIcon))
1166
- $cssAfter .= "background-image:url('$urlIcon');";
1167
 
1168
  if(!empty($cssAfter))
1169
  $style .= ".".$class."::after{{$cssAfter}}\n";
@@ -1175,6 +1178,7 @@ class UniteCreatorElementorIntegrate{
1175
  }
1176
 
1177
 
 
1178
  return($styles);
1179
  }
1180
 
@@ -1182,7 +1186,7 @@ class UniteCreatorElementorIntegrate{
1182
  * on enqueue front end scripts
1183
  */
1184
  public function onEnqueueEditorScripts(){
1185
-
1186
  $adminStyleHandle = "unlimited_elements_editor_admin_css";
1187
 
1188
  HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.js", "unlimited_elments_editor_admin");
@@ -1192,7 +1196,13 @@ class UniteCreatorElementorIntegrate{
1192
 
1193
  if(!empty($stylesIcons))
1194
  wp_add_inline_style($adminStyleHandle, $stylesIcons);
1195
-
 
 
 
 
 
 
1196
  $script = $this->getEditorPageCustomScripts();
1197
  UniteProviderFunctionsUC::printCustomScript($script, true);
1198
  }
@@ -1363,13 +1373,14 @@ class UniteCreatorElementorIntegrate{
1363
  * check allow pagination for single page pagination
1364
  */
1365
  public function checkAllowWidgetPagination($filterValue, $wp_query){
1366
-
1367
  if(is_admin() == true || is_archive() == true || is_front_page() == true)
1368
  return($filterValue);
1369
-
 
1370
  if(empty(self::$arrPostsWidgetNames))
1371
  return($filterValue);
1372
-
1373
  $postID = $wp_query->queried_object_id;
1374
 
1375
  if(empty($postID))
@@ -1381,7 +1392,7 @@ class UniteCreatorElementorIntegrate{
1381
  return($filterValue);
1382
 
1383
  $editorData = $document->get_elements_data();
1384
-
1385
  Plugin::$instance->db->iterate_data($editorData, function( $element ) use ( &$filterValue ) {
1386
 
1387
  $widgetName = UniteFunctionsUC::getVal($element, "widgetType");
@@ -1389,8 +1400,10 @@ class UniteCreatorElementorIntegrate{
1389
  if(!empty($widgetName)){
1390
 
1391
  $widgetName = str_replace("ucaddon_", "", $widgetName);
1392
-
1393
- if(isset(self::$arrPostsWidgetNames[$widgetName])){
 
 
1394
 
1395
  $settings = UniteFunctionsUC::getVal($element, "settings");
1396
 
@@ -1431,40 +1444,12 @@ class UniteCreatorElementorIntegrate{
1431
  self::$enableEditHTMLButton = UniteFunctionsUC::strToBool(self::$enableEditHTMLButton);
1432
  }
1433
 
1434
- /**
1435
- * init copy paste functionality
1436
- */
1437
- private function initCopyPaste(){
1438
-
1439
- if(GlobalsUC::$inDev == false && !defined("UC_ENABLE_COPYPASTE"))
1440
- return(false);
1441
-
1442
- //check current user
1443
- $currentUserID = get_current_user_id();
1444
-
1445
- if(empty($currentUserID))
1446
- return(false);
1447
-
1448
- $isUserAdmin = current_user_can('administrator');
1449
- if($isUserAdmin == false)
1450
- return(false);
1451
-
1452
- self::$enableCopySectionButton = HelperProviderCoreUC_EL::getGeneralSetting("copy_mode_enable_copy");
1453
- self::$enableCopySectionButton = UniteFunctionsUC::strToBool(self::$enableCopySectionButton);
1454
-
1455
- self::$enablePasteSectionButton = HelperProviderCoreUC_EL::getGeneralSetting("copy_mode_enable_paste");
1456
- self::$enablePasteSectionButton = UniteFunctionsUC::strToBool(self::$enablePasteSectionButton);
1457
-
1458
- $this->objCopyPaste = new UniteCreatorElementorCopyPaste();
1459
- $this->objCopyPaste->init();
1460
-
1461
- }
1462
 
1463
  /**
1464
  * check and add dynamic loop styles before render
1465
  */
1466
  public function onBeforeRenderElement($element){
1467
-
1468
  if(!empty(GlobalsUnlimitedElements::$renderingDynamicData))
1469
  HelperProviderCoreUC_EL::putDynamicLoopElementStyle($element);
1470
 
@@ -1495,8 +1480,11 @@ class UniteCreatorElementorIntegrate{
1495
 
1496
  $arrSettingsValues = HelperProviderCoreUC_EL::getGeneralSettingsValues();
1497
 
1498
- self::$isConsolidated = UniteFunctionsUC::getVal($arrSettingsValues, "consolidate_addons");
1499
- self::$isConsolidated = UniteFunctionsUC::strToBool(self::$isConsolidated);
 
 
 
1500
 
1501
  $enableExportImport = HelperProviderCoreUC_EL::getGeneralSetting("enable_import_export");
1502
  $enableExportImport = UniteFunctionsUC::strToBool($enableExportImport);
@@ -1516,9 +1504,7 @@ class UniteCreatorElementorIntegrate{
1516
  $this->enableExportTemplate = false;
1517
  $this->enableImportTemplate = false;
1518
  }
1519
-
1520
- $this->initCopyPaste();
1521
-
1522
  add_action('elementor/editor/init', array($this, 'onEditorInit'));
1523
 
1524
  add_action('elementor/widgets/widgets_registered', array($this, 'onWidgetsRegistered'));
12
  const ADDONS_CATEGORY_TITLE = "Unlimited Elements";
13
  const ADDONS_CATEGORY_NAME = "unlimited_elements";
14
  const ADDONS_TYPE = "elementor";
15
+ const DEFAULT_ICON = "uc-default-widget-icon ue-wi-svg";
16
  const TEMPLATE_TYPE_ARCHIVE = "archive";
17
  const CONTROL_BACKGROUND_TYPE = "uc_background_type";
18
 
306
  self::logMemoryUsage("before widgets registered");
307
 
308
  self::$numRegistered = 0;
309
+
310
  if(self::$isConsolidated)
311
  $this->registerWidgets_categories();
312
  else{
512
  return(false);
513
 
514
  foreach($params as $param){
515
+
516
  $type = UniteFunctionsUC::getVal($param, "type");
517
+ if($type != UniteCreatorDialogParam::PARAM_POSTS_LIST && $type != UniteCreatorDialogParam::PARAM_LISTING)
518
  continue;
519
 
520
  //post list only
950
  public function onRegisterFrontScripts(){
951
 
952
  //background related
953
+ if(self::$isFrontendEditorMode == true){
954
+
955
+ HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_front_admin.js", "unlimited_elements_front_admin");
956
+ HelperUC::addStyleAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_front_admin.css", "unlimited_elements_front_admin_css");
957
  }
958
 
959
  //---- copy paste related
1050
 
1051
  $nonce = UniteProviderFunctionsUC::getNonce();
1052
 
1053
+ dmp("import layout!!!");
1054
+
1055
  ?>
1056
  <style>
1057
 
1073
  font-size: 18px;
1074
  }
1075
 
1076
+
1077
  </style>
1078
 
1079
  <div style="display:none">
1080
+
1081
  <a id="uc_button_import_layout" href="javascript:void(0)" class="page-title-action"><?php esc_html_e("Import Template With Images", "unlimited-elements-for-elementor")?></a>
1082
 
1083
  <div id="uc_import_layout_area" style="display:none">
1093
  </div>
1094
 
1095
  </div>
 
1096
  <?php
1097
  }
1098
 
1130
 
1131
  if(empty(self::$arrWidgetIcons))
1132
  return(null);
1133
+
1134
+
1135
  $styles = "";
1136
  foreach(self::$arrWidgetIcons as $class => $arrWidget){
1137
 
1152
  $text = htmlspecialchars($text);
1153
 
1154
  if(!empty($urlPreview)){
1155
+ $cssHover .= "background-image:url('{$urlPreview}') !important;";
1156
 
1157
  if(!empty($text))
1158
  $cssHover .= "content:\"{$text}\" !important;";
1166
  //--- icon related ---
1167
 
1168
  if(!empty($urlIcon))
1169
+ $cssAfter .= "background-image:url('$urlIcon') !important;";
1170
 
1171
  if(!empty($cssAfter))
1172
  $style .= ".".$class."::after{{$cssAfter}}\n";
1178
  }
1179
 
1180
 
1181
+
1182
  return($styles);
1183
  }
1184
 
1186
  * on enqueue front end scripts
1187
  */
1188
  public function onEnqueueEditorScripts(){
1189
+
1190
  $adminStyleHandle = "unlimited_elements_editor_admin_css";
1191
 
1192
  HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.js", "unlimited_elments_editor_admin");
1196
 
1197
  if(!empty($stylesIcons))
1198
  wp_add_inline_style($adminStyleHandle, $stylesIcons);
1199
+
1200
+ //include font awesome
1201
+ $urlFontAwesomeCSS = HelperUC::getUrlFontAwesome();
1202
+
1203
+ HelperUC::addStyleAbsoluteUrl($urlFontAwesomeCSS, "font-awesome");
1204
+
1205
+
1206
  $script = $this->getEditorPageCustomScripts();
1207
  UniteProviderFunctionsUC::printCustomScript($script, true);
1208
  }
1373
  * check allow pagination for single page pagination
1374
  */
1375
  public function checkAllowWidgetPagination($filterValue, $wp_query){
1376
+
1377
  if(is_admin() == true || is_archive() == true || is_front_page() == true)
1378
  return($filterValue);
1379
+
1380
+
1381
  if(empty(self::$arrPostsWidgetNames))
1382
  return($filterValue);
1383
+
1384
  $postID = $wp_query->queried_object_id;
1385
 
1386
  if(empty($postID))
1392
  return($filterValue);
1393
 
1394
  $editorData = $document->get_elements_data();
1395
+
1396
  Plugin::$instance->db->iterate_data($editorData, function( $element ) use ( &$filterValue ) {
1397
 
1398
  $widgetName = UniteFunctionsUC::getVal($element, "widgetType");
1400
  if(!empty($widgetName)){
1401
 
1402
  $widgetName = str_replace("ucaddon_", "", $widgetName);
1403
+
1404
+ $isPostWidget = isset(self::$arrPostsWidgetNames[$widgetName]);
1405
+
1406
+ if($isPostWidget){
1407
 
1408
  $settings = UniteFunctionsUC::getVal($element, "settings");
1409
 
1444
  self::$enableEditHTMLButton = UniteFunctionsUC::strToBool(self::$enableEditHTMLButton);
1445
  }
1446
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1447
 
1448
  /**
1449
  * check and add dynamic loop styles before render
1450
  */
1451
  public function onBeforeRenderElement($element){
1452
+
1453
  if(!empty(GlobalsUnlimitedElements::$renderingDynamicData))
1454
  HelperProviderCoreUC_EL::putDynamicLoopElementStyle($element);
1455
 
1480
 
1481
  $arrSettingsValues = HelperProviderCoreUC_EL::getGeneralSettingsValues();
1482
 
1483
+ //self::$isConsolidated = UniteFunctionsUC::getVal($arrSettingsValues, "consolidate_addons");
1484
+ //self::$isConsolidated = UniteFunctionsUC::strToBool(self::$isConsolidated);
1485
+
1486
+ //consolidation always false
1487
+ self::$isConsolidated = false;
1488
 
1489
  $enableExportImport = HelperProviderCoreUC_EL::getGeneralSetting("enable_import_export");
1490
  $enableExportImport = UniteFunctionsUC::strToBool($enableExportImport);
1504
  $this->enableExportTemplate = false;
1505
  $this->enableImportTemplate = false;
1506
  }
1507
+
 
 
1508
  add_action('elementor/editor/init', array($this, 'onEditorInit'));
1509
 
1510
  add_action('elementor/widgets/widgets_registered', array($this, 'onWidgetsRegistered'));
provider/core/plugins/unlimited_elements/elementor/elementor_layout_exporter.class.php CHANGED
@@ -503,7 +503,6 @@ class UniteCreatorLayoutsExporterElementor extends UniteCreatorLayoutsExporter{
503
  if(empty($arrPageLayout) || is_array($arrPageLayout) == false)
504
  UniteFunctionsUC::throwError("No page elementor layout found");
505
 
506
-
507
  //insert the section
508
 
509
  $arrPageLayoutNEW = array();
@@ -1055,7 +1054,7 @@ class UniteCreatorLayoutsExporterElementor extends UniteCreatorLayoutsExporter{
1055
  }
1056
 
1057
  $arrContent = $this->modifyExportDeleteGlobals($arrContent);
1058
-
1059
  $this->putLayoutFile_elementor($arrContent);
1060
 
1061
  //make zip
503
  if(empty($arrPageLayout) || is_array($arrPageLayout) == false)
504
  UniteFunctionsUC::throwError("No page elementor layout found");
505
 
 
506
  //insert the section
507
 
508
  $arrPageLayoutNEW = array();
1054
  }
1055
 
1056
  $arrContent = $this->modifyExportDeleteGlobals($arrContent);
1057
+
1058
  $this->putLayoutFile_elementor($arrContent);
1059
 
1060
  //make zip
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php CHANGED
@@ -19,7 +19,7 @@ use Elementor\Utils;
19
 
20
  class UniteCreatorElementorWidget extends Widget_Base {
21
 
22
- private $objAddon;
23
 
24
  private $isConsolidated = false;
25
  private $objCat, $arrAddons;
@@ -122,9 +122,11 @@ class UniteCreatorElementorWidget extends Widget_Base {
122
 
123
  if(empty($addonName))
124
  UniteFunctionsUC::throwError("Widget name is empty");
125
-
126
  $this->objAddon = new UniteCreatorAddon();
127
 
 
 
128
  $record = UniteFunctionsUC::getVal(UniteCreatorElementorIntegrate::$arrAddonsRecords, $addonName);
129
 
130
  if(!empty($record))
@@ -351,8 +353,31 @@ class UniteCreatorElementorWidget extends Widget_Base {
351
  * modify value before add by type
352
  */
353
  protected function modifyValueByTypeUC($type, $value){
354
-
355
  switch($type){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  case UniteCreatorDialogParam::PARAM_IMAGE:
357
 
358
  if(empty($value))
@@ -389,6 +414,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
389
 
390
  $arrData = array();
391
 
 
392
  foreach($arrValues as $paramName=>$value){
393
 
394
  $type = UniteFunctionsUC::getVal($arrTypes, $paramName);
@@ -454,7 +480,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
454
 
455
  if($itemsType == "image")
456
  return(false);
457
-
458
  $itemsLabel = esc_html__("Items", "unlimited-elements-for-elementor");
459
 
460
  $itemsTitle = $this->objAddon->getOption("items_section_title");
@@ -466,12 +492,16 @@ class UniteCreatorElementorWidget extends Widget_Base {
466
 
467
  if(!empty($itemsTitle))
468
  $itemsLabel = $itemsTitle;
469
-
470
- $this->start_controls_section(
471
- 'section_items', array(
472
- 'label' => $itemsLabel,
473
- )
474
- );
 
 
 
 
475
 
476
  //add heading label text
477
  if(!empty($itemsHeading)){
@@ -487,9 +517,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
487
 
488
 
489
  }
490
-
491
-
492
-
493
  $repeater = new Repeater();
494
 
495
  $paramsItems = $this->objAddon->getProcessedItemsParams();
@@ -504,14 +532,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
504
 
505
  if($name == "title")
506
  $titleField = $name;
507
-
508
- if($name == "uc_filters_item_selector"){
509
-
510
- $param["type"] = "uc_filters_repeater_params";
511
- $this->addElementorParamUC($param, $repeater);
512
- continue;
513
- }
514
-
515
  switch($type){
516
  case UniteCreatorDialogParam::PARAM_TEMPLATE: //convert template to text param
517
 
@@ -532,13 +553,25 @@ class UniteCreatorElementorWidget extends Widget_Base {
532
 
533
 
534
  $arrControl = $this->getControlArrayUC($param, true);
535
- $repeater->add_control($name, $arrControl);
 
 
 
 
 
 
 
 
 
 
536
 
 
537
  //add some child params
538
  $this->checkAddRelatedControls($param, $repeater);
539
 
540
  }
541
 
 
542
  $arrItemsControl = array();
543
  $arrItemsControl["type"] = Controls_Manager::REPEATER;
544
  $arrItemsControl["fields"] = $repeater->get_controls();
@@ -556,10 +589,26 @@ class UniteCreatorElementorWidget extends Widget_Base {
556
  $arrItemsData = array();
557
 
558
  $arrItemsControl["default"] = $arrItemsData;
559
-
560
- $this->objControls->add_control('uc_items', $arrItemsControl);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
 
562
- $this->end_controls_section();
 
 
563
  }
564
 
565
  /**
@@ -595,15 +644,32 @@ class UniteCreatorElementorWidget extends Widget_Base {
595
 
596
  $arrCondition = array();
597
 
598
- if(!empty($elementorCondition) && is_array($elementorCondition)){
599
  $arrCondition = $elementorCondition;
600
- }
601
 
602
- if($conditionAttribute == "not_equal")
603
- $conditionValue = "!".$conditionValue;
604
 
605
  $arrCondition[$conditionAttribute] = $conditionValue;
606
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  return($arrCondition);
608
  }
609
 
@@ -638,7 +704,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
638
  $elementorCondition = $this->getControlArrayUC_getCondition($param, $elementorCondition);
639
  }
640
 
641
-
642
  if(isset($param["value"]))
643
  $value = $param["value"];
644
 
@@ -745,6 +810,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
745
  //$controlType = "uc_hr";
746
  $controlType = Controls_Manager::DIVIDER;
747
  break;
 
 
 
748
  case UniteCreatorDialogParam::PARAM_AUDIO:
749
  $controlType = "uc_mp3";
750
  break;
@@ -850,6 +918,26 @@ class UniteCreatorElementorWidget extends Widget_Base {
850
  }
851
  */
852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  break;
854
  case "uc_select_special":
855
 
@@ -1140,6 +1228,10 @@ class UniteCreatorElementorWidget extends Widget_Base {
1140
  $arrControl["size_units"] = array("px","%");
1141
  $rangeUnit = "px";
1142
  break;
 
 
 
 
1143
  case "vh":
1144
  $arrControl["size_units"] = array("vh");
1145
  $rangeUnit = "vh";
@@ -1148,11 +1240,20 @@ class UniteCreatorElementorWidget extends Widget_Base {
1148
  $arrControl["size_units"] = array("vh","px");
1149
  $rangeUnit = "vh";
1150
  break;
 
 
 
 
 
 
 
 
1151
  case "px_percent_em":
1152
  default:
1153
  $arrControl["size_units"] = array("px","%","em");
1154
  $rangeUnit = "px";
1155
  break;
 
1156
  }
1157
 
1158
  //set range
@@ -1220,8 +1321,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
1220
  if($isResponsive == true){
1221
  $arrControl["uc_responsive"] = true;
1222
 
1223
- $defaultTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
1224
- $defaultMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
1225
 
1226
  $arrControl["desktop_default"] = $defaultValue;
1227
  $arrControl["tablet_default"] = $defaultTablet;
@@ -1307,10 +1408,12 @@ class UniteCreatorElementorWidget extends Widget_Base {
1307
 
1308
  break;
1309
  case UniteCreatorDialogParam::PARAM_GALLERY:
1310
-
1311
- if(is_string($defaultValue)){
1312
- $defaultValue = array();
1313
- $arrControl["default"] = $defaultValue;
 
 
1314
  }
1315
 
1316
  $param["add_dynamic"] = true;
@@ -1533,7 +1636,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
1533
  call_user_func($function, $this->objControls, $param);
1534
 
1535
  break;
1536
- case "uc_filters_repeater_params":
1537
  case UniteCreatorDialogParam::PARAM_INSTAGRAM:
1538
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
1539
  case UniteCreatorDialogParam::PARAM_WOO_CATS:
@@ -1693,26 +1795,47 @@ class UniteCreatorElementorWidget extends Widget_Base {
1693
  }
1694
 
1695
  /**
1696
- * get gallery control
1697
  */
1698
- protected function getGalleryParamUC(){
1699
-
1700
- //get internal defaults
1701
 
1702
  $arrItems = $this->objAddon->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_OUTPUT);
1703
  if(empty($arrItems))
1704
  $arrItems = array();
1705
-
1706
  $arrDefaults = array();
1707
 
 
 
1708
  foreach($arrItems as $arrItem){
1709
- $itemData = UniteFunctionsUC::getVal($arrItem, "item");
 
1710
 
1711
- $urlImage = UniteFunctionsUC::getVal($itemData, "image");
 
 
 
1712
 
1713
- $arrDefaults[] = array("url"=>$urlImage);
 
 
 
 
 
 
1714
  }
1715
 
 
 
 
 
 
 
 
 
 
 
 
1716
  $param = array();
1717
  $param["type"] = "uc_gallery";
1718
  $param["title"] = __("Add Images","unlimited-elements-for-elementor");
@@ -1777,8 +1900,10 @@ class UniteCreatorElementorWidget extends Widget_Base {
1777
  foreach($params as $index => $param){
1778
 
1779
  $type = UniteFunctionsUC::getVal($param, "type");
1780
-
1781
  switch($type){
 
 
1782
  case UniteCreatorDialogParam::PARAM_TEXTAREA:
1783
  case UniteCreatorDialogParam::PARAM_TEXTFIELD:
1784
  case UniteCreatorDialogParam::PARAM_LINK:
@@ -1791,6 +1916,13 @@ class UniteCreatorElementorWidget extends Widget_Base {
1791
  break;
1792
  }
1793
 
 
 
 
 
 
 
 
1794
  $param["add_dynamic"] = true;
1795
 
1796
  $params[$index] = $param;
@@ -2030,15 +2162,57 @@ class UniteCreatorElementorWidget extends Widget_Base {
2030
  $arrSectionOptions["tab"] = "style";
2031
 
2032
  $this->start_controls_section($catID, $arrSectionOptions);
2033
-
2034
  if($isGeneralSection == true && $isItemsEnabled == true && $itemsType == "image")
2035
  $this->addGalleryControlUC();
2036
 
2037
  //add dynamic to all the addons, not only dynamic
2038
- $params = $this->addDynamicAttributes($params);
2039
-
 
 
2040
  foreach($params as $param){
 
 
 
 
2041
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2042
  $type = UniteFunctionsUC::getVal($param, "type");
2043
  if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
2044
  $hasPostsList = true;
@@ -2054,23 +2228,39 @@ class UniteCreatorElementorWidget extends Widget_Base {
2054
  }
2055
 
2056
  if($type == UniteCreatorDialogParam::PARAM_LISTING){
2057
- $hasListing = true;
2058
- $listingParam = $param;
 
 
 
 
 
 
 
 
2059
  }
2060
 
2061
  $this->addElementorParamUC($param);
2062
- }
 
 
 
 
 
 
 
 
2063
 
2064
-
2065
  //add free version notification
2066
  if($isGeneralSection && GlobalsUC::$isProVersion == false)
2067
  $this->addFreeVersionCTAControl();
2068
 
2069
 
2070
  $this->end_controls_section();
2071
-
2072
  } //end sections foreach
2073
 
 
2074
  //add query controls section (post list) if exists
2075
  if($hasPostsList == true){
2076
 
@@ -2150,7 +2340,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2150
  $this->addAdvancedSectionControls($showMore, $isItemsEnabled);
2151
 
2152
  }
2153
-
2154
  private function a__________DYNAMIC_SECTIONS_________(){}
2155
 
2156
 
@@ -2158,18 +2348,25 @@ class UniteCreatorElementorWidget extends Widget_Base {
2158
  * put listing sections
2159
  */
2160
  private function putListingSections($listingParam){
2161
-
 
 
2162
  $name = UniteFunctionsUC::getVal($listingParam, "name");
2163
 
2164
  $useFor = UniteFunctionsUC::getVal($listingParam, "use_for");
2165
  $isForGallery = ($useFor == "gallery");
2166
 
 
 
 
 
 
 
2167
  //set text prefix
2168
  $textPrefix = __("Items ","unlimited-elements-for-elementor");
2169
  if($isForGallery == true)
2170
  $textPrefix = __("Gallery ","unlimited-elements-for-elementor");
2171
 
2172
-
2173
  //add post section
2174
  $this->start_controls_section(
2175
  'uc_section_listing_posts_query', array(
@@ -2189,6 +2386,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2189
 
2190
  $this->end_controls_section();
2191
 
 
2192
  //woocommerce
2193
 
2194
  $isWooActive = UniteCreatorWooIntegrate::isWooActive();
@@ -2215,30 +2413,32 @@ class UniteCreatorElementorWidget extends Widget_Base {
2215
 
2216
  $this->end_controls_section();
2217
 
2218
-
2219
-
2220
  }
2221
-
2222
 
2223
-
2224
- //add term section
2225
- /*
2226
- $this->start_controls_section(
2227
- 'uc_section_listing_terms_query', array(
2228
- 'label' => __("Terms Query", "unlimited-elements-for-elementor"),
2229
- 'condition'=>array($name."_source"=>"terms")
2230
- )
2231
- );
2232
-
2233
- $termsParam = $listingParam;
2234
-
2235
- $termsParam["type"] = UniteCreatorDialogParam::PARAM_POST_TERMS;
2236
- $termsParam["name"] = $name."_terms";
2237
-
2238
- $this->addElementorParamUC($termsParam);
2239
-
2240
- $this->end_controls_section();
2241
- */
 
 
 
 
 
2242
 
2243
  }
2244
 
@@ -3122,7 +3322,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
3122
 
3123
  $arrMainParamValues = $this->getArrMainParamValuesUC($arrValues, $objAddon);
3124
 
 
3125
  $arrPostListParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
 
3126
  if(!empty($arrPostListParam)){
3127
 
3128
  $paginationType = UniteFunctionsUC::getVal($arrMainParamValues, "pagination_type");
@@ -3131,6 +3333,17 @@ class UniteCreatorElementorWidget extends Widget_Base {
3131
  $arrMainParamValues[$postListName."_pagination_type"] = $paginationType;
3132
  }
3133
 
 
 
 
 
 
 
 
 
 
 
 
3134
  //check if inside editor
3135
  $isEditMode = $this->isEditMode();
3136
 
@@ -3223,6 +3436,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
3223
  return(false);
3224
  }
3225
 
 
3226
  if($this->isConsolidated == false){
3227
 
3228
  $this->ucRenderByAddon($this->objAddon);
19
 
20
  class UniteCreatorElementorWidget extends Widget_Base {
21
 
22
+ protected $objAddon;
23
 
24
  private $isConsolidated = false;
25
  private $objCat, $arrAddons;
122
 
123
  if(empty($addonName))
124
  UniteFunctionsUC::throwError("Widget name is empty");
125
+
126
  $this->objAddon = new UniteCreatorAddon();
127
 
128
+ $this->objAddon->setOperationType(UniteCreatorAddon::OPERATION_WIDGET);
129
+
130
  $record = UniteFunctionsUC::getVal(UniteCreatorElementorIntegrate::$arrAddonsRecords, $addonName);
131
 
132
  if(!empty($record))
353
  * modify value before add by type
354
  */
355
  protected function modifyValueByTypeUC($type, $value){
356
+
357
  switch($type){
358
+ case "image_json":
359
+
360
+ //get json url
361
+
362
+ $arrEmpty = array("url"=>"");
363
+
364
+ $value = trim($value);
365
+
366
+ if(empty($value))
367
+ return($arrEmpty);
368
+
369
+ $urlAssets = $this->objAddon->getUrlAssets();
370
+
371
+ if(empty($urlAssets))
372
+ return($arrEmpty);
373
+
374
+ $value = $urlAssets.$value;
375
+
376
+ $arrOutput = array("url"=>$value);
377
+
378
+ return($arrOutput);
379
+
380
+ break;
381
  case UniteCreatorDialogParam::PARAM_IMAGE:
382
 
383
  if(empty($value))
414
 
415
  $arrData = array();
416
 
417
+
418
  foreach($arrValues as $paramName=>$value){
419
 
420
  $type = UniteFunctionsUC::getVal($arrTypes, $paramName);
480
 
481
  if($itemsType == "image")
482
  return(false);
483
+
484
  $itemsLabel = esc_html__("Items", "unlimited-elements-for-elementor");
485
 
486
  $itemsTitle = $this->objAddon->getOption("items_section_title");
492
 
493
  if(!empty($itemsTitle))
494
  $itemsLabel = $itemsTitle;
495
+
496
+ if($this->isBGWidget == false){
497
+
498
+ $this->start_controls_section(
499
+ 'section_items', array(
500
+ 'label' => $itemsLabel,
501
+ )
502
+ );
503
+
504
+ }
505
 
506
  //add heading label text
507
  if(!empty($itemsHeading)){
517
 
518
 
519
  }
520
+
 
 
521
  $repeater = new Repeater();
522
 
523
  $paramsItems = $this->objAddon->getProcessedItemsParams();
532
 
533
  if($name == "title")
534
  $titleField = $name;
535
+
 
 
 
 
 
 
 
536
  switch($type){
537
  case UniteCreatorDialogParam::PARAM_TEMPLATE: //convert template to text param
538
 
553
 
554
 
555
  $arrControl = $this->getControlArrayUC($param, true);
556
+
557
+ //add control (responsive or not)
558
+ if(isset($arrControl["uc_responsive"])){
559
+
560
+ unset($arrControl["uc_responsive"]);
561
+ $repeater->add_responsive_control($name, $arrControl);
562
+
563
+ }else{
564
+
565
+ $repeater->add_control($name, $arrControl);
566
+ }
567
 
568
+
569
  //add some child params
570
  $this->checkAddRelatedControls($param, $repeater);
571
 
572
  }
573
 
574
+
575
  $arrItemsControl = array();
576
  $arrItemsControl["type"] = Controls_Manager::REPEATER;
577
  $arrItemsControl["fields"] = $repeater->get_controls();
589
  $arrItemsData = array();
590
 
591
  $arrItemsControl["default"] = $arrItemsData;
592
+
593
+ $controlName = 'uc_items';
594
+
595
+ if($this->isBGWidget == true){
596
+
597
+ $alias = $this->objAddon->getAlias();
598
+ $condition = array(UniteCreatorElementorIntegrate::CONTROL_BACKGROUND_TYPE=>$alias);
599
+
600
+ $controlName = $alias."_".$controlName;
601
+
602
+ $arrItemsControl["condition"] = $condition;
603
+
604
+ }
605
+
606
+
607
+ $this->objControls->add_control($controlName, $arrItemsControl);
608
 
609
+ if($this->isBGWidget == false)
610
+ $this->end_controls_section();
611
+
612
  }
613
 
614
  /**
644
 
645
  $arrCondition = array();
646
 
647
+ if(!empty($elementorCondition) && is_array($elementorCondition))
648
  $arrCondition = $elementorCondition;
 
649
 
650
+ if($conditionOperator == "not_equal")
651
+ $conditionAttribute .= "!";
652
 
653
  $arrCondition[$conditionAttribute] = $conditionValue;
654
+
655
+ // add second condition
656
+
657
+ $conditionAttribute2 = UniteFunctionsUC::getVal($param, "condition_attribute2");
658
+ $conditionOperator2 = UniteFunctionsUC::getVal($param, "condition_operator2");
659
+ $conditionValue2 = UniteFunctionsUC::getVal($param, "condition_value2");
660
+
661
+ if(empty($conditionAttribute2))
662
+ return($arrCondition);
663
+
664
+ if($conditionOperator2 == "not_equal")
665
+ $conditionAttribute2 .= "!";
666
+
667
+ if(isset($arrCondition[$conditionAttribute2]))
668
+ return($arrCondition);
669
+
670
+ $arrCondition[$conditionAttribute2] = $conditionValue2;
671
+
672
+
673
  return($arrCondition);
674
  }
675
 
704
  $elementorCondition = $this->getControlArrayUC_getCondition($param, $elementorCondition);
705
  }
706
 
 
707
  if(isset($param["value"]))
708
  $value = $param["value"];
709
 
810
  //$controlType = "uc_hr";
811
  $controlType = Controls_Manager::DIVIDER;
812
  break;
813
+ case UniteCreatorDialogParam::PARAM_HEADING:
814
+ $controlType = Controls_Manager::HEADING;
815
+ break;
816
  case UniteCreatorDialogParam::PARAM_AUDIO:
817
  $controlType = "uc_mp3";
818
  break;
918
  }
919
  */
920
 
921
+ break;
922
+ case UniteCreatorDialogParam::PARAM_HEADING:
923
+
924
+ $arrControl["label"] = $defaultValue;
925
+ unset($arrControl["default"]);
926
+
927
+ break;
928
+ case UniteCreatorDialogParam::PARAM_IMAGE:
929
+
930
+ $mediaType = UniteFunctionsUC::getVal($param, "media_type");
931
+
932
+ if($mediaType == "json"){
933
+
934
+ $defaultValue = UniteFunctionsUC::getVal($param, "default_value_json");
935
+ $defaultValue = $this->modifyValueByTypeUC("image_json", $defaultValue);
936
+
937
+ $arrControl['media_type'] = 'application/json';
938
+ $arrControl['default'] = $defaultValue;
939
+ }
940
+
941
  break;
942
  case "uc_select_special":
943
 
1228
  $arrControl["size_units"] = array("px","%");
1229
  $rangeUnit = "px";
1230
  break;
1231
+ case "percent_px":
1232
+ $arrControl["size_units"] = array("%","px");
1233
+ $rangeUnit = "%";
1234
+ break;
1235
  case "vh":
1236
  $arrControl["size_units"] = array("vh");
1237
  $rangeUnit = "vh";
1240
  $arrControl["size_units"] = array("vh","px");
1241
  $rangeUnit = "vh";
1242
  break;
1243
+ case "px_vh":
1244
+ $arrControl["size_units"] = array("px","vh");
1245
+ $rangeUnit = "px";
1246
+ break;
1247
+ case "px_vh_percent":
1248
+ $arrControl["size_units"] = array("px","vh","%");
1249
+ $rangeUnit = "px";
1250
+ break;
1251
  case "px_percent_em":
1252
  default:
1253
  $arrControl["size_units"] = array("px","%","em");
1254
  $rangeUnit = "px";
1255
  break;
1256
+
1257
  }
1258
 
1259
  //set range
1321
  if($isResponsive == true){
1322
  $arrControl["uc_responsive"] = true;
1323
 
1324
+ $defaultTablet = UniteFunctionsUC::getVal($param, "default_value_tablet",$defaultValue);
1325
+ $defaultMobile = UniteFunctionsUC::getVal($param, "default_value_mobile",$defaultValue);
1326
 
1327
  $arrControl["desktop_default"] = $defaultValue;
1328
  $arrControl["tablet_default"] = $defaultTablet;
1408
 
1409
  break;
1410
  case UniteCreatorDialogParam::PARAM_GALLERY:
1411
+
1412
+ if(empty($defaultValue)){
1413
+
1414
+ $arrDefaults = $this->getGalleryParamDefaultItems();
1415
+
1416
+ $arrControl["default"] = $arrDefaults;
1417
  }
1418
 
1419
  $param["add_dynamic"] = true;
1636
  call_user_func($function, $this->objControls, $param);
1637
 
1638
  break;
 
1639
  case UniteCreatorDialogParam::PARAM_INSTAGRAM:
1640
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
1641
  case UniteCreatorDialogParam::PARAM_WOO_CATS:
1795
  }
1796
 
1797
  /**
1798
+ * get gallery param default items
1799
  */
1800
+ private function getGalleryParamDefaultItems(){
 
 
1801
 
1802
  $arrItems = $this->objAddon->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_OUTPUT);
1803
  if(empty($arrItems))
1804
  $arrItems = array();
1805
+
1806
  $arrDefaults = array();
1807
 
1808
+ $urlAssets = $this->objAddon->getUrlAssets();
1809
+
1810
  foreach($arrItems as $arrItem){
1811
+
1812
+ $urlImage = UniteFunctionsUC::getVal($arrItem, "image");
1813
 
1814
+ if(is_array($urlImage)){
1815
+ $urlImage = UniteFunctionsUC::getVal($urlImage, "item");
1816
+ $urlImage = UniteFunctionsUC::getVal($urlImage, "image");
1817
+ }
1818
 
1819
+ if(empty($urlImage))
1820
+ continue;
1821
+
1822
+ if(!empty($urlAssets))
1823
+ $urlImage = HelperUC::convertFromUrlAssets($urlImage, $urlAssets);
1824
+
1825
+ $arrDefaults[] = array("url"=>$urlImage,"id"=>null);
1826
  }
1827
 
1828
+ return($arrDefaults);
1829
+ }
1830
+
1831
+ /**
1832
+ * get gallery control
1833
+ */
1834
+ protected function getGalleryParamUC(){
1835
+
1836
+ //get internal defaults
1837
+ $arrDefaults = $this->getGalleryParamDefaultItems();
1838
+
1839
  $param = array();
1840
  $param["type"] = "uc_gallery";
1841
  $param["title"] = __("Add Images","unlimited-elements-for-elementor");
1900
  foreach($params as $index => $param){
1901
 
1902
  $type = UniteFunctionsUC::getVal($param, "type");
1903
+
1904
  switch($type){
1905
+ case UniteCreatorDialogParam::PARAM_NUMBER:
1906
+ case UniteCreatorDialogParam::PARAM_SLIDER:
1907
  case UniteCreatorDialogParam::PARAM_TEXTAREA:
1908
  case UniteCreatorDialogParam::PARAM_TEXTFIELD:
1909
  case UniteCreatorDialogParam::PARAM_LINK:
1916
  break;
1917
  }
1918
 
1919
+ //skip selector enabled
1920
+ $selector = UniteFunctionsUC::getVal($param, "selector");
1921
+ $selector = trim($selector);
1922
+
1923
+ if(!empty($selector))
1924
+ continue;
1925
+
1926
  $param["add_dynamic"] = true;
1927
 
1928
  $params[$index] = $param;
2162
  $arrSectionOptions["tab"] = "style";
2163
 
2164
  $this->start_controls_section($catID, $arrSectionOptions);
2165
+
2166
  if($isGeneralSection == true && $isItemsEnabled == true && $itemsType == "image")
2167
  $this->addGalleryControlUC();
2168
 
2169
  //add dynamic to all the addons, not only dynamic
2170
+ $params = $this->addDynamicAttributes($params);
2171
+
2172
+ $activeTab = null;
2173
+
2174
  foreach($params as $param){
2175
+
2176
+ //add tab
2177
+ $tabName = UniteFunctionsUC::getVal($param, "tabname");
2178
+ $tabName = trim($tabName);
2179
 
2180
+ //handle tabs
2181
+ if(!empty($tabName)){
2182
+
2183
+ if(empty($activeTab)){
2184
+ $tabsID = "tabs_".UniteFunctionsUC::getRandomString();
2185
+ $this->start_controls_tabs($tabsID);
2186
+
2187
+ }
2188
+
2189
+ //start new tab or switch tab
2190
+ if($activeTab != $tabName){
2191
+
2192
+ if(!empty($activeTab)){
2193
+ $this->end_controls_tab();
2194
+ }
2195
+
2196
+ $tabID = "tab_".UniteFunctionsUC::getRandomString();
2197
+ $this->start_controls_tab($tabID, array("label"=>$tabName));
2198
+
2199
+ }
2200
+
2201
+ $activeTab = $tabName;
2202
+
2203
+ }else{ //if no tab, close tabs
2204
+
2205
+ if(!empty($activeTab)){
2206
+
2207
+ $this->end_controls_tab();
2208
+ $this->end_controls_tabs();
2209
+
2210
+ $activeTab = null;
2211
+ }
2212
+
2213
+ }
2214
+
2215
+
2216
  $type = UniteFunctionsUC::getVal($param, "type");
2217
  if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
2218
  $hasPostsList = true;
2228
  }
2229
 
2230
  if($type == UniteCreatorDialogParam::PARAM_LISTING){
2231
+
2232
+ $useFor = UniteFunctionsUC::getVal($param, "use_for");
2233
+ switch($useFor){
2234
+ case "remote":
2235
+ break;
2236
+ default:
2237
+ $hasListing = true;
2238
+ $listingParam = $param;
2239
+ break;
2240
+ }
2241
  }
2242
 
2243
  $this->addElementorParamUC($param);
2244
+ } //end params foreach
2245
+
2246
+ if(!empty($activeTab)){
2247
+
2248
+ $this->end_controls_tab();
2249
+ $this->end_controls_tabs();
2250
+ $activeTab = null;
2251
+ }
2252
+
2253
 
 
2254
  //add free version notification
2255
  if($isGeneralSection && GlobalsUC::$isProVersion == false)
2256
  $this->addFreeVersionCTAControl();
2257
 
2258
 
2259
  $this->end_controls_section();
2260
+
2261
  } //end sections foreach
2262
 
2263
+
2264
  //add query controls section (post list) if exists
2265
  if($hasPostsList == true){
2266
 
2340
  $this->addAdvancedSectionControls($showMore, $isItemsEnabled);
2341
 
2342
  }
2343
+
2344
  private function a__________DYNAMIC_SECTIONS_________(){}
2345
 
2346
 
2348
  * put listing sections
2349
  */
2350
  private function putListingSections($listingParam){
2351
+
2352
+ $objUEControls = new UniteCreatorElementorControls();
2353
+
2354
  $name = UniteFunctionsUC::getVal($listingParam, "name");
2355
 
2356
  $useFor = UniteFunctionsUC::getVal($listingParam, "use_for");
2357
  $isForGallery = ($useFor == "gallery");
2358
 
2359
+ switch($useFor){
2360
+ case "remote":
2361
+ return(false);
2362
+ break;
2363
+ }
2364
+
2365
  //set text prefix
2366
  $textPrefix = __("Items ","unlimited-elements-for-elementor");
2367
  if($isForGallery == true)
2368
  $textPrefix = __("Gallery ","unlimited-elements-for-elementor");
2369
 
 
2370
  //add post section
2371
  $this->start_controls_section(
2372
  'uc_section_listing_posts_query', array(
2386
 
2387
  $this->end_controls_section();
2388
 
2389
+
2390
  //woocommerce
2391
 
2392
  $isWooActive = UniteCreatorWooIntegrate::isWooActive();
2413
 
2414
  $this->end_controls_section();
2415
 
 
 
2416
  }
 
2417
 
2418
+ //add the gallery repeater
2419
+ if($isForGallery == true){
2420
+
2421
+ $objUEControls->addGalleryImageVideoRepeater($this, $textPrefix, $name, $listingParam, $this->objAddon);
2422
+
2423
+ //add instagram param
2424
+
2425
+ $this->start_controls_section(
2426
+ 'uc_section_listing_instagram', array(
2427
+ 'label' => __("Instagram Source", "unlimited-elements-for-elementor"),
2428
+ 'condition'=>array($name."_source"=>"instagram")
2429
+ )
2430
+ );
2431
+
2432
+
2433
+ $instagramParam = $listingParam;
2434
+
2435
+ $instagramParam["type"] = UniteCreatorDialogParam::PARAM_INSTAGRAM;
2436
+ $instagramParam["name"] = $name."_instagram";
2437
+
2438
+ $this->addElementorParamUC($instagramParam);
2439
+
2440
+ $this->end_controls_section();
2441
+ }
2442
 
2443
  }
2444
 
3322
 
3323
  $arrMainParamValues = $this->getArrMainParamValuesUC($arrValues, $objAddon);
3324
 
3325
+ //transfer the pagination type
3326
  $arrPostListParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
3327
+
3328
  if(!empty($arrPostListParam)){
3329
 
3330
  $paginationType = UniteFunctionsUC::getVal($arrMainParamValues, "pagination_type");
3333
  $arrMainParamValues[$postListName."_pagination_type"] = $paginationType;
3334
  }
3335
 
3336
+ $arrListingParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
3337
+ if(!empty($arrListingParam)){
3338
+
3339
+ $paginationType = UniteFunctionsUC::getVal($arrMainParamValues, "pagination_type");
3340
+ $postListingName = UniteFunctionsUC::getVal($arrListingParam, "name");
3341
+
3342
+ $arrMainParamValues[$postListingName."_posts_pagination_type"] = $paginationType;
3343
+ $arrMainParamValues[$postListingName."_products_pagination_type"] = $paginationType;
3344
+ }
3345
+
3346
+
3347
  //check if inside editor
3348
  $isEditMode = $this->isEditMode();
3349
 
3436
  return(false);
3437
  }
3438
 
3439
+
3440
  if($this->isConsolidated == false){
3441
 
3442
  $this->ucRenderByAddon($this->objAddon);
provider/core/plugins/unlimited_elements/elementor/images/widget-icon.svg ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 432 432" style="enable-background:new 0 0 432 432;" xml:space="preserve">
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="_x34_0_x2C_000">
7
+ <g id="loading-copy" transform="translate(-188.000000, -88.000000)">
8
+ <g id="Combined-Shape">
9
+ <path d="M404,520c-57.7,0-111.9-22.5-152.7-63.3c-40.8-40.8-63.3-95-63.3-152.7s22.5-111.9,63.3-152.7
10
+ C292.1,110.5,346.3,88,404,88c57.7,0,111.9,22.5,152.7,63.3c40.8,40.8,63.3,95,63.3,152.7s-22.5,111.9-63.3,152.7
11
+ C515.9,497.5,461.7,520,404,520z M404,96c-114.7,0-208,93.3-208,208c0,114.7,93.3,208,208,208s208-93.3,208-208
12
+ C612,189.3,518.7,96,404,96z M352.1,438.8c-21.7,0-42.1-8.7-57.5-24.5c-15.3-15.8-23.8-36.8-23.8-59.1v-71.2
13
+ c0-12,9.5-21.8,21.3-21.8s21.3,9.8,21.3,21.8v71.2c0,10.7,4,20.8,11.4,28.4c7.3,7.5,17,11.7,27.3,11.7c21.4,0,38.7-18,38.7-40
14
+ v-71.2c0-12,9.5-21.8,21.3-21.8s21.3,9.8,21.3,21.8v71.2C433.3,401.3,396.9,438.8,352.1,438.8z M292.1,270.1
15
+ c-7.3,0-13.3,6.2-13.3,13.8v71.2c0,20.2,7.6,39.2,21.5,53.5c13.8,14.3,32.2,22.1,51.8,22.1c40.4,0,73.2-33.9,73.2-75.6v-71.2
16
+ c0-7.6-5.9-13.8-13.3-13.8s-13.3,6.2-13.3,13.8v71.2c0,26.5-21,48-46.7,48c-12.5,0-24.3-5-33.1-14.1
17
+ c-8.8-9.1-13.6-21.1-13.6-33.9v-71.2C305.4,276.3,299.4,270.1,292.1,270.1z M502.8,375.1h-38.4c-11.8,0-21.3-10-21.3-22.3
18
+ s9.6-22.3,21.3-22.3h38.4c11.8,0,21.3,10,21.3,22.3S514.6,375.1,502.8,375.1z M464.4,338.5c-7.4,0-13.3,6.4-13.3,14.3
19
+ s6,14.3,13.3,14.3h38.4c7.4,0,13.3-6.4,13.3-14.3s-6-14.3-13.3-14.3H464.4z M350.8,370.4c-11.6,0-21-9.6-21-21.5v-68.3
20
+ c0-45.3,36-82.2,80.2-82.2h93.2c11.6,0,21,9.6,21,21.5c0,11.8-9.4,21.5-21,21.5H410c-21,0-38.1,17.6-38.1,39.2v68.3
21
+ C371.8,360.7,362.4,370.4,350.8,370.4z M410,206.5c-39.8,0-72.2,33.3-72.2,74.2v68.3c0,7.4,5.8,13.5,13,13.5c7.2,0,13-6,13-13.5
22
+ v-68.3c0-26.1,20.7-47.2,46.1-47.2h93.2c7.2,0,13-6,13-13.5c0-7.4-5.8-13.5-13-13.5H410z M502.8,306.7h-38.4
23
+ c-11.8,0-21.3-10-21.3-22.3s9.6-22.3,21.3-22.3h38.4c11.8,0,21.3,10,21.3,22.3S514.6,306.7,502.8,306.7z M464.4,270.1
24
+ c-7.4,0-13.3,6.4-13.3,14.3s6,14.3,13.3,14.3h38.4c7.4,0,13.3-6.4,13.3-14.3s-6-14.3-13.3-14.3H464.4z"/>
25
+ </g>
26
+ </g>
27
+ </g>
28
+ </svg>
provider/core/plugins/unlimited_elements/elementor/pagination.class.php CHANGED
@@ -21,10 +21,19 @@ class UniteCreatorElementorPagination{
21
  $isFilterable = UniteFunctionsUC::getVal($postListParam, "is_filterable");
22
  $isFilterable = UniteFunctionsUC::strToBool($isFilterable);
23
 
 
 
 
 
 
 
24
  $textSection = esc_html__("Posts Pagination", "unlimited-elements-for-elementor");
25
  if($isFilterable == true)
26
  $textSection = esc_html__("Posts Pagination and Filter", "unlimited-elements-for-elementor");
27
 
 
 
 
28
  $widget->start_controls_section(
29
  'section_pagination', array(
30
  'label' => $textSection,
@@ -58,9 +67,7 @@ class UniteCreatorElementorPagination{
58
  //add filter enabled controls
59
 
60
  if($isFilterable == true){
61
-
62
- $paramName = UniteFunctionsUC::getVal($postListParam, "name");
63
-
64
  $widget->add_control(
65
  $paramName.'_filterable',
66
  [
@@ -75,6 +82,10 @@ class UniteCreatorElementorPagination{
75
  ]
76
  );
77
 
 
 
 
 
78
  $widget->add_control(
79
  $paramName.'_isajax',
80
  [
@@ -89,9 +100,7 @@ class UniteCreatorElementorPagination{
89
  ]
90
  );
91
 
92
-
93
  }
94
-
95
 
96
  $widget->end_controls_section();
97
  }
@@ -295,6 +304,39 @@ class UniteCreatorElementorPagination{
295
  return($options);
296
  }
297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
 
299
  /**
300
  * get single page options
@@ -323,6 +365,9 @@ class UniteCreatorElementorPagination{
323
  $options['base'] = trailingslashit( get_permalink() ) . '%_%';
324
  $options['format'] = user_trailingslashit( '%#%', 'single_paged' );
325
 
 
 
 
326
  }else{ //if not permalinks
327
  $options['format'] = '?page=%#%'; // add ?page=2
328
  }
@@ -345,6 +390,30 @@ class UniteCreatorElementorPagination{
345
  return($options);
346
  }
347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
  /**
350
  * put pagination widget html
@@ -376,6 +445,7 @@ class UniteCreatorElementorPagination{
376
  $isDebug = UniteFunctionsUC::getVal($args, "debug_pagination_options");
377
  $isDebug = UniteFunctionsUC::strToBool($isDebug);
378
 
 
379
  //--------- prepare options
380
 
381
  $options = array();
@@ -406,27 +476,33 @@ class UniteCreatorElementorPagination{
406
  $isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
407
 
408
  if($isArchivePage == true){
409
-
410
  $options = $this->getArchivePageOptions($options);
411
  $pagination = get_the_posts_pagination($options);
412
 
413
  }else{ //on single
414
-
415
  //skip for home pages
416
- if(is_home() == true)
417
- return(false);
418
 
419
  $options = $this->getSinglePageOptions($options);
420
 
421
- if(isset($options["current"]) == false)
 
 
 
 
 
 
 
422
  return(false);
 
423
 
424
  if(empty($nextText))
425
  $options["next_text"] = _x( 'Next', 'next set of posts' );
426
 
427
  if(empty($prevText))
428
  $options["prev_text"] = _x( 'Previous', 'previous set of posts' );
429
-
430
  $pagination = paginate_links($options);
431
  }
432
 
@@ -438,5 +514,44 @@ class UniteCreatorElementorPagination{
438
  echo $pagination;
439
  }
440
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
441
 
442
  }
21
  $isFilterable = UniteFunctionsUC::getVal($postListParam, "is_filterable");
22
  $isFilterable = UniteFunctionsUC::strToBool($isFilterable);
23
 
24
+ $enableAjax = UniteFunctionsUC::getVal($postListParam, "enable_ajax");
25
+ $enableAjax = UniteFunctionsUC::strToBool($enableAjax);
26
+
27
+ $paramName = UniteFunctionsUC::getVal($postListParam, "name");
28
+
29
+
30
  $textSection = esc_html__("Posts Pagination", "unlimited-elements-for-elementor");
31
  if($isFilterable == true)
32
  $textSection = esc_html__("Posts Pagination and Filter", "unlimited-elements-for-elementor");
33
 
34
+ if($enableAjax == true)
35
+ $textSection = esc_html__("Posts Pagination and Ajax", "unlimited-elements-for-elementor");
36
+
37
  $widget->start_controls_section(
38
  'section_pagination', array(
39
  'label' => $textSection,
67
  //add filter enabled controls
68
 
69
  if($isFilterable == true){
70
+
 
 
71
  $widget->add_control(
72
  $paramName.'_filterable',
73
  [
82
  ]
83
  );
84
 
85
+ }
86
+
87
+ if($enableAjax == true){
88
+
89
  $widget->add_control(
90
  $paramName.'_isajax',
91
  [
100
  ]
101
  );
102
 
 
103
  }
 
104
 
105
  $widget->end_controls_section();
106
  }
304
  return($options);
305
  }
306
 
307
+ /**
308
+ * get current page
309
+ */
310
+ private function getCurrentPage(){
311
+
312
+ $currentPage = 1;
313
+ if(!empty(GlobalsProviderUC::$lastPostQuery_page))
314
+ $currentPage = GlobalsProviderUC::$lastPostQuery_page;
315
+ else{
316
+ $currentPage = get_query_var("page");
317
+ }
318
+
319
+ if(empty($currentPage))
320
+ $currentPage = 1;
321
+
322
+ return($currentPage);
323
+ }
324
+
325
+ /**
326
+ * get total pages from current query
327
+ */
328
+ private function getTotalPages(){
329
+
330
+ if(empty(GlobalsProviderUC::$lastPostQuery))
331
+ return(0);
332
+
333
+ $numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
334
+ if($numPages <= 1)
335
+ return(0);
336
+
337
+ return($numPages);
338
+ }
339
+
340
 
341
  /**
342
  * get single page options
365
  $options['base'] = trailingslashit( get_permalink() ) . '%_%';
366
  $options['format'] = user_trailingslashit( '%#%', 'single_paged' );
367
 
368
+ if(is_front_page())
369
+ $options['format'] = user_trailingslashit( 'page/%#%', 'single_paged' );
370
+
371
  }else{ //if not permalinks
372
  $options['format'] = '?page=%#%'; // add ?page=2
373
  }
390
  return($options);
391
  }
392
 
393
+ /**
394
+ * get last request paging data
395
+ */
396
+ private function getPagingData(){
397
+
398
+ $currentPage = $this->getCurrentPage();
399
+
400
+ $totalPages = $this->getTotalPages();
401
+
402
+ $hasMore = false;
403
+ if(!empty($currentPage) && !empty($totalPages) && $currentPage < $totalPages)
404
+ $hasMore = true;
405
+
406
+ $nextPage = $currentPage+1;
407
+
408
+ $output = array();
409
+ $output["current"] = $currentPage;
410
+ $output["next"] = $nextPage;
411
+ $output["total"] = $totalPages;
412
+ $output["has_more"] = $hasMore;
413
+
414
+ return($output);
415
+ }
416
+
417
 
418
  /**
419
  * put pagination widget html
445
  $isDebug = UniteFunctionsUC::getVal($args, "debug_pagination_options");
446
  $isDebug = UniteFunctionsUC::strToBool($isDebug);
447
 
448
+
449
  //--------- prepare options
450
 
451
  $options = array();
476
  $isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
477
 
478
  if($isArchivePage == true){
479
+
480
  $options = $this->getArchivePageOptions($options);
481
  $pagination = get_the_posts_pagination($options);
482
 
483
  }else{ //on single
484
+
485
  //skip for home pages
 
 
486
 
487
  $options = $this->getSinglePageOptions($options);
488
 
489
+ if(isset($options["current"]) == false){
490
+
491
+ if($isDebug == true){
492
+ dmp("<b>Pagination Options (custom) </b>: <br>");
493
+ dmp("No pagination found for the last query <br>");
494
+ dmp($options);
495
+ }
496
+
497
  return(false);
498
+ }
499
 
500
  if(empty($nextText))
501
  $options["next_text"] = _x( 'Next', 'next set of posts' );
502
 
503
  if(empty($prevText))
504
  $options["prev_text"] = _x( 'Previous', 'previous set of posts' );
505
+
506
  $pagination = paginate_links($options);
507
  }
508
 
514
  echo $pagination;
515
  }
516
 
517
+ /**
518
+ * get load more data
519
+ */
520
+ public function getLoadmoreData($isEditMode = false){
521
+
522
+ if($isEditMode == true){
523
+
524
+ $output = array();
525
+ $output["attributes"] = "";
526
+ $output["style"] = "";
527
+ $output["more"] = true;
528
+
529
+ return($output);
530
+ }
531
+
532
+
533
+ $arrPagingData = $this->getPagingData();
534
+
535
+ $hasMore = UniteFunctionsUC::getVal($arrPagingData, "has_more");
536
+
537
+ $nextPage = UniteFunctionsUC::getVal($arrPagingData, "next");
538
+
539
+ $attributes = "";
540
+ $style = "";
541
+
542
+ if($hasMore == true)
543
+ $attributes = "data-more=\"$hasMore\" data-nextpage=\"$nextPage\"";
544
+ else
545
+ $style = "style='display:none'";
546
+
547
+ $output = array();
548
+ $output["attributes"] = $attributes;
549
+ $output["style"] = $style;
550
+ $output["more"] = $hasMore;
551
+
552
+
553
+ return($output);
554
+ }
555
+
556
 
557
  }
provider/core/plugins/unlimited_elements/helper_provider_core.class.php CHANGED
@@ -581,8 +581,10 @@ class HelperProviderCoreUC_EL{
581
 
582
  if(empty($arrControls))
583
  return(false);
 
 
584
 
585
- $settings = @$element->parse_dynamic_settings( $dynamicSettings, $arrControls);
586
 
587
  if(empty($settings))
588
  return(false);
@@ -693,7 +695,7 @@ class HelperProviderCoreUC_EL{
693
  //set path and url
694
  self::$pathCore = dirname(__FILE__)."/";
695
  self::$urlCore = HelperUC::pathToFullUrl(self::$pathCore);
696
-
697
  self::$filepathGeneralSettings = self::$pathCore."settings/general_settings_el.xml";
698
 
699
  GlobalsProviderUC::$pluginName = "unlimited_elementor";
581
 
582
  if(empty($arrControls))
583
  return(false);
584
+
585
+ unset($dynamicSettings["link"]);
586
 
587
+ $settings = @$element->parse_dynamic_settings( $dynamicSettings, $arrControls);
588
 
589
  if(empty($settings))
590
  return(false);
695
  //set path and url
696
  self::$pathCore = dirname(__FILE__)."/";
697
  self::$urlCore = HelperUC::pathToFullUrl(self::$pathCore);
698
+
699
  self::$filepathGeneralSettings = self::$pathCore."settings/general_settings_el.xml";
700
 
701
  GlobalsProviderUC::$pluginName = "unlimited_elementor";
provider/core/plugins/unlimited_elements/plugin.php CHANGED
@@ -87,7 +87,7 @@ class UnlimitedElementsPluginUC extends UniteCreatorPluginBase{
87
  require_once $this->pathPlugin . 'elementor/elementor_integrate.class.php';
88
  require_once $this->pathPlugin . 'elementor/pagination.class.php';
89
  require_once $this->pathPlugin . "elementor/elementor_dynamic_visibility.class.php";
90
- require_once $this->pathPlugin . "copy_paste.class.php";
91
 
92
  if(is_admin()){
93
  require_once $this->pathPlugin . 'elementor/elementor_layout_exporter.class.php';
87
  require_once $this->pathPlugin . 'elementor/elementor_integrate.class.php';
88
  require_once $this->pathPlugin . 'elementor/pagination.class.php';
89
  require_once $this->pathPlugin . "elementor/elementor_dynamic_visibility.class.php";
90
+ require_once $this->pathPlugin . "elementor/elementor_controls.class.php";
91
 
92
  if(is_admin()){
93
  require_once $this->pathPlugin . 'elementor/elementor_layout_exporter.class.php';
provider/core/plugins/unlimited_elements/settings/general_settings_el.xml CHANGED
@@ -152,28 +152,11 @@
152
  <field name="google_map_key"
153
  type="text"
154
  label="Google Map API Key"
155
- description="Used to output a map in google maps related widget"
156
  default="">
157
  </field>
158
 
159
  </fieldset>
160
- <fieldset name="copy_paste_mode" label="Copy Paste Mode - Test" visibility="dev">
161
-
162
- <field name="copy_mode_enable_copy"
163
- type="boolean"
164
- default="false"
165
- label=" Enable Copy"
166
- description="">
167
- </field>
168
-
169
- <field name="copy_mode_enable_paste"
170
- type="boolean"
171
- default="false"
172
- label=" Enable Paste"
173
- description="">
174
- </field>
175
-
176
- </fieldset>
177
  <fieldset name="troubleshooting" label="Troubleshooting">
178
 
179
  <field name="memory_limit_text"
@@ -183,7 +166,7 @@
183
 
184
  <field name="memory_limit_text_desc"
185
  type="statictext"
186
- label="In case of insuficciant memory, you can increase WordPress memory limit wp config file (wp-config.php)">
187
  </field>
188
 
189
  <field name="enable_memory_usage_test"
@@ -193,6 +176,17 @@
193
  description="Use it when you have some memory crash. &lt;br&gt; When enabling it it will log every addon and field register operation &lt;br&gt; and sugniffically slow down the editor work. Use it only for testing and turn it off after.">
194
  </field>
195
 
 
 
 
 
 
 
 
 
 
 
 
196
  <field name="memory_usage_button"
197
  type="button"
198
  value="Show Memory Usage Log"
152
  <field name="google_map_key"
153
  type="text"
154
  label="Google Map API Key"
155
+ description="Used to output a map in google maps related widget. &lt;a href='https://unlimited-elements.com/docs/google-map-api-key/' target='_blank'&gt;Read this article&lt;/a&gt; for instructions: "
156
  default="">
157
  </field>
158
 
159
  </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  <fieldset name="troubleshooting" label="Troubleshooting">
161
 
162
  <field name="memory_limit_text"
166
 
167
  <field name="memory_limit_text_desc"
168
  type="statictext"
169
+ label="In case of insufficient memory, you can increase WordPress memory limit wp config file (wp-config.php)">
170
  </field>
171
 
172
  <field name="enable_memory_usage_test"
176
  description="Use it when you have some memory crash. &lt;br&gt; When enabling it it will log every addon and field register operation &lt;br&gt; and sugniffically slow down the editor work. Use it only for testing and turn it off after.">
177
  </field>
178
 
179
+ <field name="before_show_php_message"
180
+ type="hr">
181
+ </field>
182
+
183
+ <field name="show_php_error"
184
+ type="boolean"
185
+ default="false"
186
+ label="Show PHP Error Message"
187
+ description="Use it when you see some text about php error and want to see it.">
188
+ </field>
189
+
190
  <field name="memory_usage_button"
191
  type="button"
192
  value="Show Memory Usage Log"
provider/core/plugins/unlimited_elements/template.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
4
+
5
+ class UCEmptyTemplate{
6
+
7
+ const SHOW_DEBUG = false;
8
+
9
+ private $templateID;
10
+
11
+
12
+ /**
13
+ * construct
14
+ */
15
+ public function __construct(){
16
+ $this->init();
17
+ }
18
+
19
+ /**
20
+ * put error message
21
+ */
22
+ private function putErrorMessage($message = null){
23
+
24
+ if(self::SHOW_DEBUG == true)
25
+ dmp($message);
26
+
27
+ dmp("no output");
28
+
29
+ }
30
+
31
+ /**
32
+ * render header debug
33
+ */
34
+ private function renderHeader(){
35
+ ?>
36
+ <header class="site-header">
37
+ <p class="site-title">
38
+ <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
39
+ <?php bloginfo( 'name' ); ?>
40
+ </a>
41
+ </p>
42
+ <p class="site-description"><?php bloginfo( 'description' ); ?></p>
43
+ </header>
44
+ <?php
45
+ }
46
+
47
+ /**
48
+ * render regular post body
49
+ */
50
+ private function renderRegularBody(){
51
+
52
+ $this->renderHeader();
53
+
54
+ if ( have_posts() ) :
55
+
56
+ while ( have_posts() ) :
57
+
58
+ the_post();
59
+ the_content();
60
+
61
+ endwhile;
62
+ endif;
63
+ }
64
+
65
+ /**
66
+ * validate that template exists
67
+ */
68
+ private function validateTemplateExists(){
69
+
70
+ if(empty($this->templateID))
71
+ UniteFunctionsUC::throwError("no template found");
72
+
73
+ $template = get_post($this->templateID);
74
+ if(empty($template))
75
+ UniteFunctionsUC::throwError("template not found");
76
+
77
+ $postType = $template->post_type;
78
+
79
+ if($postType != "elementor_library")
80
+ UniteFunctionsUC::throwError("bad template");
81
+
82
+ }
83
+
84
+ /**
85
+ * render header part
86
+ */
87
+ private function renderHeaderPart(){
88
+ ?>
89
+ <!DOCTYPE html>
90
+ <html <?php language_attributes(); ?>>
91
+ <head>
92
+ <meta charset="<?php bloginfo( 'charset' ); ?>">
93
+ <meta name="viewport" content="width=device-width, initial-scale=1">
94
+ <link rel="profile" href="https://gmpg.org/xfn/11">
95
+ <?php wp_head(); ?>
96
+ </head>
97
+ <body <?php body_class(); ?>>
98
+
99
+ <?php
100
+ }
101
+
102
+ /**
103
+ * render footer part
104
+ */
105
+ private function renderFooter(){
106
+ wp_footer();
107
+
108
+ ?>
109
+ </body>
110
+ </html>
111
+ <?php
112
+ }
113
+
114
+ /**
115
+ * render template
116
+ */
117
+ private function renderTemplate(){
118
+
119
+ $this->validateTemplateExists();
120
+
121
+ $content = HelperProviderCoreUC_EL::getElementorTemplate($this->templateID);
122
+
123
+ $this->renderHeaderPart();
124
+
125
+ //$this->renderRegularBody();
126
+
127
+ echo $content;
128
+
129
+ $this->renderFooter();
130
+
131
+ }
132
+
133
+
134
+
135
+ /**
136
+ * init the template
137
+ */
138
+ private function init(){
139
+
140
+ try{
141
+
142
+ show_admin_bar(false);
143
+
144
+ $renderTemplateID = UniteFunctionsUC::getGetVar("ucrendertemplate","",UniteFunctionsUC::SANITIZE_ID);
145
+
146
+ if(empty($renderTemplateID))
147
+ UniteFunctionsUC::throwError("template id not found");
148
+
149
+ if(is_singular() == false)
150
+ UniteFunctionsUC::throwError("not singlular");
151
+
152
+ $this->templateID = $renderTemplateID;
153
+
154
+ $this->renderTemplate();
155
+
156
+
157
+ }catch(Exception $e){
158
+
159
+ $message = $e->getMessage();
160
+
161
+ $this->putErrorMessage($message);
162
+
163
+ }
164
+
165
+ }
166
+
167
+ }
168
+
169
+ new UCEmptyTemplate();
provider/functions_wordpress.class.php CHANGED
@@ -3026,23 +3026,33 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
3026
 
3027
  return($admin_title);
3028
  }
3029
-
3030
  /**
3031
- * get action functions of some tag
3032
  */
3033
- public static function getActionFunctionsKeys($tag){
3034
 
3035
  global $wp_filter;
3036
  if(isset($wp_filter[$tag]) == false)
3037
  return(array());
3038
 
3039
  $objFilter = $wp_filter[$tag];
3040
-
3041
- $arrFunctions = array();
3042
  $arrCallbacks = $objFilter->callbacks;
3043
  if(empty($arrCallbacks))
3044
  return(array());
3045
 
 
 
 
 
 
 
 
 
 
 
 
3046
  foreach($arrCallbacks as $priority=>$callbacks){
3047
  $arrKeys = array_keys($callbacks);
3048
 
3026
 
3027
  return($admin_title);
3028
  }
3029
+
3030
  /**
3031
+ * get all filters callbacks
3032
  */
3033
+ public static function getFilterCallbacks($tag){
3034
 
3035
  global $wp_filter;
3036
  if(isset($wp_filter[$tag]) == false)
3037
  return(array());
3038
 
3039
  $objFilter = $wp_filter[$tag];
3040
+
 
3041
  $arrCallbacks = $objFilter->callbacks;
3042
  if(empty($arrCallbacks))
3043
  return(array());
3044
 
3045
+ return($arrCallbacks);
3046
+ }
3047
+
3048
+
3049
+ /**
3050
+ * get action functions of some tag
3051
+ */
3052
+ public static function getActionFunctionsKeys($tag){
3053
+
3054
+ $arrCallbacks = self::getFilterCallbacks($tag);
3055
+
3056
  foreach($arrCallbacks as $priority=>$callbacks){
3057
  $arrKeys = array_keys($callbacks);
3058
 
provider/provider_admin.class.php CHANGED
@@ -252,13 +252,13 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
252
  *
253
  * add some wordpress action
254
  */
255
- protected function addAction($action, $eventFunction, $isStatic = false, $numArgs = 1){
256
 
257
  if($isStatic == false){
258
- add_action( $action, array($this, $eventFunction) ,10,$numArgs);
259
  }else{
260
 
261
- add_action( $action, array(self::$t, $eventFunction) ,10, $numArgs);
262
  }
263
 
264
  }
@@ -987,7 +987,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
987
 
988
  //if not inside plugin don't continue
989
  if($this->isInsidePlugin() == true){
990
- $this->addAction(self::ACTION_ADD_SCRIPTS, "onAddScripts", true);
991
  $this->addLocalFilter("admin_body_class", "addAdminBodyClass");
992
 
993
  }else{
@@ -1008,8 +1008,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1008
 
1009
  add_action("init", array($this,"checkRankmathAjaxCollision"));
1010
 
1011
-
1012
  $this->addAction("admin_init", "onAdminInit");
 
 
1013
  }
1014
 
1015
 
252
  *
253
  * add some wordpress action
254
  */
255
+ protected function addAction($action, $eventFunction, $isStatic = false, $numArgs = 1, $priority = 10){
256
 
257
  if($isStatic == false){
258
+ add_action( $action, array($this, $eventFunction) ,$priority,$numArgs);
259
  }else{
260
 
261
+ add_action( $action, array(self::$t, $eventFunction) ,$priority, $numArgs);
262
  }
263
 
264
  }
987
 
988
  //if not inside plugin don't continue
989
  if($this->isInsidePlugin() == true){
990
+ $this->addAction(self::ACTION_ADD_SCRIPTS, "onAddScripts", true,1, 9999);
991
  $this->addLocalFilter("admin_body_class", "addAdminBodyClass");
992
 
993
  }else{
1008
 
1009
  add_action("init", array($this,"checkRankmathAjaxCollision"));
1010
 
 
1011
  $this->addAction("admin_init", "onAdminInit");
1012
+
1013
+
1014
  }
1015
 
1016
 
provider/provider_front.class.php CHANGED
@@ -45,6 +45,28 @@ class UniteProviderFrontUC{
45
  return($tag);
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  /**
49
  *
50
  * the constructor
@@ -65,6 +87,13 @@ class UniteProviderFrontUC{
65
  //modify output <script> tag, add module to it
66
  $this->addFilter("script_loader_tag", 'onScriptTagOutput',10,3);
67
 
 
 
 
 
 
 
 
68
  }
69
 
70
 
45
  return($tag);
46
  }
47
 
48
+ /**
49
+ * on template include
50
+ */
51
+ public function onTemplateInclude($template){
52
+
53
+ if(is_singular() == false)
54
+ return($template);
55
+
56
+ $renderTemplateID = UniteFunctionsUC::getGetVar("ucrendertemplate","",UniteFunctionsUC::SANITIZE_ID);
57
+
58
+ if(empty($renderTemplateID))
59
+ return($template);
60
+
61
+ if(defined("ELEMENTOR_PATH") == false)
62
+ return($template);
63
+
64
+ $pathTemplate = HelperProviderCoreUC_EL::$pathCore."template.php";
65
+
66
+
67
+ return($pathTemplate);
68
+ }
69
+
70
  /**
71
  *
72
  * the constructor
87
  //modify output <script> tag, add module to it
88
  $this->addFilter("script_loader_tag", 'onScriptTagOutput',10,3);
89
 
90
+ if(GlobalsUC::$inDev == true){
91
+
92
+ //set elementor canvas accorging "GET" variable
93
+ $this->addFilter("template_include", "onTemplateInclude");
94
+
95
+ }
96
+
97
  }
98
 
99
 
provider/provider_functions.class.php CHANGED
@@ -160,6 +160,7 @@ class UniteProviderFunctionsUC{
160
 
161
  public static function a________SCRIPTS_________(){}
162
 
 
163
  /**
164
  * add scripts and styles framework
165
  * $specialSettings - (nojqueryui)
@@ -181,8 +182,9 @@ class UniteProviderFunctionsUC{
181
  wp_enqueue_script("jquery-ui-position");
182
  wp_enqueue_script("jquery-ui-selectable");
183
  wp_enqueue_script("jquery-ui-sortable");
184
-
185
-
 
186
  //no jquery ui style
187
  if($specialSettings != "nojqueryui"){
188
  HelperUC::addStyle("jquery-ui.structure.min","jui-smoothness-structure","css/jui/new");
@@ -217,7 +219,7 @@ class UniteProviderFunctionsUC{
217
  $version = UNLIMITED_ELEMENTS_VERSION;
218
  if(GlobalsUC::$inDev == true) //add script
219
  $version = time();
220
-
221
  wp_register_script($handle , $url, $deps, $version, $inFooter);
222
  wp_enqueue_script($handle);
223
  }
@@ -572,7 +574,7 @@ class UniteProviderFunctionsUC{
572
  * veryfy nonce
573
  */
574
  public static function verifyNonce($nonce){
575
-
576
  $verified = wp_verify_nonce($nonce, GlobalsUC::PLUGIN_NAME."_actions");
577
  if($verified == false)
578
  UniteFunctionsUC::throwError("Action security failed, please repeat action");
160
 
161
  public static function a________SCRIPTS_________(){}
162
 
163
+
164
  /**
165
  * add scripts and styles framework
166
  * $specialSettings - (nojqueryui)
182
  wp_enqueue_script("jquery-ui-position");
183
  wp_enqueue_script("jquery-ui-selectable");
184
  wp_enqueue_script("jquery-ui-sortable");
185
+ wp_enqueue_script("jquery-ui-autocomplete");
186
+
187
+
188
  //no jquery ui style
189
  if($specialSettings != "nojqueryui"){
190
  HelperUC::addStyle("jquery-ui.structure.min","jui-smoothness-structure","css/jui/new");
219
  $version = UNLIMITED_ELEMENTS_VERSION;
220
  if(GlobalsUC::$inDev == true) //add script
221
  $version = time();
222
+
223
  wp_register_script($handle , $url, $deps, $version, $inFooter);
224
  wp_enqueue_script($handle);
225
  }
574
  * veryfy nonce
575
  */
576
  public static function verifyNonce($nonce){
577
+
578
  $verified = wp_verify_nonce($nonce, GlobalsUC::PLUGIN_NAME."_actions");
579
  if($verified == false)
580
  UniteFunctionsUC::throwError("Action security failed, please repeat action");
provider/provider_helper.class.php CHANGED
@@ -103,6 +103,22 @@ class HelperProviderUC{
103
  return($arrOrderby);
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  /**
108
  * get post addditions array from options
@@ -299,6 +315,29 @@ class HelperProviderUC{
299
  UniteCreatorWooIntegrate::initActions();
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
 
303
  /**
304
  * global init function that common to the admin and front
@@ -312,6 +351,11 @@ class HelperProviderUC{
312
 
313
  add_action("plugins_loaded",array("HelperProviderUC", "onPluginsLoaded"));
314
 
 
 
 
 
 
315
 
316
 
317
  //add_action("wp_loaded", array("HelperProviderUC", "onWPLoaded"));
103
  return($arrOrderby);
104
  }
105
 
106
+ /**
107
+ * get remote parent names
108
+ */
109
+ public static function getArrRemoteParentNames(){
110
+
111
+ $arrNames = array();
112
+ $arrNames["auto"] = __("Auto Detectable", "unlimited-elements-for-elementor");
113
+ $arrNames["first"] = __("First", "unlimited-elements-for-elementor");
114
+ $arrNames["second"] = __("Second", "unlimited-elements-for-elementor");
115
+ $arrNames["third"] = __("Third", "unlimited-elements-for-elementor");
116
+ $arrNames["fourth"] = __("Fourth", "unlimited-elements-for-elementor");
117
+ $arrNames["custom"] = __("Custom Name", "unlimited-elements-for-elementor");
118
+
119
+ return($arrNames);
120
+ }
121
+
122
 
123
  /**
124
  * get post addditions array from options
315
  UniteCreatorWooIntegrate::initActions();
316
  }
317
 
318
+ /**
319
+ * on php error message
320
+ */
321
+ public static function onPHPErrorMessage($message, $error){
322
+
323
+ $errorMessage = UniteFunctionsUC::getVal($error, "message");
324
+
325
+ $file = UniteFunctionsUC::getVal($error, "file");
326
+ $line = UniteFunctionsUC::getVal($error, "line");
327
+
328
+ if(is_string($errorMessage))
329
+ $message .= "Unlimited Elements Troubleshooting: \n<br><pre>{$errorMessage}</pre>";
330
+
331
+ if(!empty($file))
332
+ $message .= "in : <b>$file</b>";
333
+
334
+ if(!empty($line))
335
+ $message .= " on line <b>$line</b>";
336
+
337
+ return($message);
338
+ }
339
+
340
+
341
 
342
  /**
343
  * global init function that common to the admin and front
351
 
352
  add_action("plugins_loaded",array("HelperProviderUC", "onPluginsLoaded"));
353
 
354
+ $showPHPError = HelperProviderCoreUC_EL::getGeneralSetting("show_php_error");
355
+ $showPHPError = UniteFunctionsUC::strToBool($showPHPError);
356
+
357
+ if($showPHPError == true)
358
+ add_filter("wp_php_error_message", array("HelperProviderUC","onPHPErrorMessage"),100,2);
359
 
360
 
361
  //add_action("wp_loaded", array("HelperProviderUC", "onWPLoaded"));
provider/provider_library.class.php CHANGED
@@ -2,11 +2,12 @@
2
 
3
  class UniteCreatorLibrary extends UniteCreatorLibraryWork{
4
 
 
5
  /**
6
  * get platform include by handle
7
  */
8
  protected function getUrlPlatformInclude($handle){
9
-
10
  $urlInclude = null;
11
 
12
  switch($handle){
@@ -16,6 +17,9 @@ class UniteCreatorLibrary extends UniteCreatorLibraryWork{
16
  case "jquery-migrate":
17
  $urlInclude = UniteProviderFunctionsUC::getUrlJQueryMigrateInclude();
18
  break;
 
 
 
19
  }
20
 
21
  return($urlInclude);
2
 
3
  class UniteCreatorLibrary extends UniteCreatorLibraryWork{
4
 
5
+
6
  /**
7
  * get platform include by handle
8
  */
9
  protected function getUrlPlatformInclude($handle){
10
+
11
  $urlInclude = null;
12
 
13
  switch($handle){
17
  case "jquery-migrate":
18
  $urlInclude = UniteProviderFunctionsUC::getUrlJQueryMigrateInclude();
19
  break;
20
+ //case "ue_remote_controls":
21
+ //$urlInclude = GlobalsUC::$url_assets."aaa_remote/ue_remote_controls.js";
22
+ //break;
23
  }
24
 
25
  return($urlInclude);
provider/provider_params_processor.class.php CHANGED
@@ -85,7 +85,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
85
 
86
  //change the hypen to underscore
87
  $thumbName = $name."_thumb_".$size;
88
- if($size == "medium")
89
  $thumbName = $name."_thumb";
90
 
91
  $thumbName = str_replace("-", "_", $thumbName);
@@ -111,7 +111,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
111
 
112
  $data[$thumbName] = $urlThumb;
113
  $data[$thumbName."_width"] = $thumbWidth;
114
- $data[$thumbName."_height"] = $thumbHeight;
 
115
  }
116
 
117
  return($data);
@@ -705,6 +706,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
705
  //check the single page pagination
706
  $paginationType = UniteFunctionsUC::getVal($value, $name."_pagination_type");
707
 
 
708
  if(empty($paginationType))
709
  return($args);
710
 
@@ -716,7 +718,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
716
  if(empty($page)){
717
  $page = get_query_var("paged", null);
718
  }
719
-
720
  if(empty($page))
721
  return($args);
722
 
@@ -730,7 +732,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
730
 
731
  //save the last page for the pagination output
732
  GlobalsProviderUC::$lastPostQuery_page = $page;
733
-
734
  return($args);
735
  }
736
 
@@ -932,13 +934,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
932
  $isForWoo = UniteFunctionsUC::getVal($param, "for_woocommerce_products");
933
  $isForWoo = UniteFunctionsUC::strToBool($isForWoo);
934
 
935
- //set if use get/post filters
936
- $isFilterable = false;
937
-
938
- $filterableOption = UniteFunctionsUC::getVal($value, $name."_filterable");
939
- if($filterableOption == "using_widget")
940
- $isFilterable = true;
941
-
942
 
943
  $isRelatedPosts = $source == "related";
944
  if(is_single() == false)
@@ -1145,19 +1140,18 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1145
  $filters["limit"] = $limit;
1146
 
1147
  $filters = $this->getPostListData_addOrderBy($filters, $value, $name);
 
 
 
1148
 
1149
- if(GlobalsUC::$inDev == true){ //filters
1150
-
1151
- if($isFilterable == true)
1152
- $filters = $this->getPostListData_getPostGetFilters_filters($filters);
1153
- }
1154
-
1155
  //add debug for further use
1156
  HelperUC::addDebug("Post Filters", $filters);
1157
 
1158
  //run custom query if available
1159
  $args = UniteFunctionsWPUC::getPostsArgs($filters);
1160
 
 
 
1161
  //exclude by authors
1162
 
1163
  if($excludeByAuthors == true){
@@ -1217,8 +1211,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1217
 
1218
 
1219
  // exclude duplicates
1220
-
1221
- if(!empty(GlobalsProviderUC::$arrFetchedPostIDs)){
1222
 
1223
  $arrFetchedIDs = array_keys(GlobalsProviderUC::$arrFetchedPostIDs);
1224
 
@@ -1249,6 +1242,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1249
  $arrIDsPHPFunction = array();
1250
  $arrIDsPostMeta = array();
1251
  $arrIDsDynamicField = array();
 
1252
 
1253
 
1254
  $makePostINOrder = false;
@@ -1302,6 +1296,12 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1302
  'compare'=>'!='
1303
  );
1304
 
 
 
 
 
 
 
1305
  break;
1306
  case "author":
1307
 
@@ -1473,6 +1473,11 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1473
  $makePostINOrder = true;
1474
  }
1475
 
 
 
 
 
 
1476
 
1477
  //make order as "post__id"
1478
 
@@ -1567,18 +1572,45 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1567
  //-------- show debug query --------------
1568
 
1569
  if($showDebugQuery == true){
 
 
1570
  dmp("The Query Is:");
1571
  dmp($args);
1572
  }
1573
-
1574
  $query = new WP_Query($args);
1575
 
1576
  if($showDebugQuery == true && $debugType == "show_query"){
1577
-
 
 
 
1578
  dmp("The Query Request Is:");
1579
  dmp($query->request);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1580
  }
1581
 
 
1582
  /*
1583
  dmp($query->request);
1584
  dmp("the query");
@@ -1600,8 +1632,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1600
  $arrPosts = UniteFunctionsWPUC::orderPostsByIDs($arrPosts, $arrStickyPosts);
1601
  }
1602
 
1603
- //save last query
1604
- GlobalsProviderUC::$lastPostQuery = $query;
1605
 
1606
  //remember duplicate posts
1607
  if($isAvoidDuplicates == true){
@@ -1610,16 +1642,43 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1610
  }
1611
 
1612
  HelperUC::addDebug("posts found: ".count($arrPosts));
1613
-
1614
  if($showDebugQuery == true){
1615
  dmp("Found Posts: ".count($arrPosts));
 
 
1616
  }
1617
 
1618
 
1619
  return($arrPosts);
1620
  }
1621
 
1622
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1623
 
1624
 
1625
  /**
@@ -1694,8 +1753,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1694
  HelperUC::addDebug("Query Vars", $currentQueryVars);
1695
 
1696
  //save last query
1697
- GlobalsProviderUC::$lastPostQuery = $query;
1698
-
1699
  $arrPosts = $query->posts;
1700
 
1701
  if(empty($arrPosts))
@@ -1849,18 +1908,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1849
  $imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
1850
  $arrImageSizes["desktop"] = $imageSize;
1851
  }
1852
-
1853
- //add filterable params like uc_listing_addclass, uc_listing_attributes
1854
-
1855
- $isFilterable = UniteFunctionsUC::getVal($value, $name."_filterable");
1856
- $isFilterable = ($isFilterable == "using_widget");
1857
-
1858
- if($isFilterable == true){
1859
 
1860
- $objFilters = new UniteCreatorFiltersProcess();
1861
- $data = $objFilters->addWidgetFilterableVariables($data, $this->addon);
1862
-
1863
- }
1864
 
1865
  //prepare listing output. no items prepare for the listing
1866
 
@@ -1891,8 +1941,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1891
  /**
1892
  * get gallery item title
1893
  */
1894
- private function getGalleryItem_title($source, $data, $name, $post){
1895
-
1896
  switch($source){
1897
  case "post_title":
1898
  $title = $post->post_title;
@@ -1915,6 +1965,12 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1915
  case "image_description":
1916
  $title = UniteFunctionsUC::getVal($data, $name."_description");
1917
  break;
 
 
 
 
 
 
1918
  default:
1919
  case "image_auto":
1920
 
@@ -1928,19 +1984,121 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1928
 
1929
  break;
1930
  }
 
1931
 
1932
  return($title);
1933
  }
1934
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1935
 
1936
  /**
1937
  * get gallery item
1938
  */
1939
  private function getGalleryItem($id, $url = null, $arrParams = null){
1940
 
1941
-
1942
  $data = array();
1943
-
1944
  $arrFilters = UniteFunctionsUC::getVal($arrParams, "size_filters");
1945
 
1946
  $thumbSize = UniteFunctionsUC::getVal($arrParams, "thumb_size");
@@ -1949,7 +2107,11 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1949
  $titleSource = UniteFunctionsUC::getVal($arrParams, "title_source");
1950
  $descriptionSource = UniteFunctionsUC::getVal($arrParams, "description_source");
1951
  $post = UniteFunctionsUC::getVal($arrParams, "post");
 
1952
 
 
 
 
1953
  $name = "image";
1954
 
1955
  $param = array();
@@ -1960,11 +2122,18 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1960
  //no extra data needed
1961
  if( strpos($titleSource,"post_") !== false && strpos($descriptionSource, "post_") !== false)
1962
  $param["no_image_data"] = true;
 
 
 
1963
 
 
1964
  $value = $id;
1965
  if(empty($value))
1966
  $value = $url;
1967
 
 
 
 
1968
  if(empty($value)){
1969
 
1970
  $item["image"] = GlobalsUC::$url_no_image_placeholder;
@@ -1974,22 +2143,26 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1974
  $item["image_height"] = 600;
1975
  $item["thumb_width"] = 600;
1976
  $item["thumb_height"] = 600;
1977
-
1978
- $title = $this->getGalleryItem_title($titleSource, $data, $name, $post);
1979
- $description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post);
1980
 
1981
- if(empty($title))
 
 
 
1982
  $title = $post->post_title;
1983
 
1984
  $item["title"] = $title;
1985
  $item["description"] = $description;
1986
-
 
 
 
 
 
1987
  $item["imageid"] = 0;
1988
 
1989
  return($item);
1990
  }
1991
 
1992
-
1993
  $data = $this->getProcessedParamsValue_image($data, $value, $param);
1994
 
1995
  $arrItem = array();
@@ -2002,7 +2175,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2002
  if(!isset($data[$keyImage]))
2003
  $keyImage = $name;
2004
 
2005
- $item = array();
 
 
 
2006
  $item["image"] = UniteFunctionsUC::getVal($data, $keyImage);
2007
  $item["thumb"] = UniteFunctionsUC::getVal($data, $keyThumb);
2008
 
@@ -2012,11 +2188,18 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2012
  $item["thumb_width"] = UniteFunctionsUC::getVal($data, $keyThumb."_width");
2013
  $item["thumb_height"] = UniteFunctionsUC::getVal($data, $keyThumb."_height");
2014
 
2015
- $title = $this->getGalleryItem_title($titleSource, $data, $name, $post);
2016
- $description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post);
2017
 
2018
  $item["title"] = $title;
2019
  $item["description"] = $description;
 
 
 
 
 
 
 
2020
  $item["imageid"] = $id;
2021
 
2022
  return($item);
@@ -2034,6 +2217,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2034
  $thumbSize = UniteFunctionsUC::getVal($value, $name."_thumb_size");
2035
  $imageSize = UniteFunctionsUC::getVal($value, $name."_image_size");
2036
 
 
 
 
2037
  $arrFilters = array();
2038
  if(!empty($thumbSize))
2039
  $arrFilters[] = $thumbSize;
@@ -2057,22 +2243,28 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2057
 
2058
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_post");
2059
  $descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_post");
2060
-
2061
  break;
2062
  case "gallery":
2063
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_gallery");
2064
  $descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_gallery");
2065
  break;
 
 
 
 
 
 
2066
  }
2067
 
2068
  $params["title_source"] = $titleSource;
2069
  $params["description_source"] = $descriptionSource;
2070
 
2071
-
2072
  $output = array();
2073
  foreach($arrItems as $item){
2074
 
2075
  switch($source){
 
2076
  case "posts":
2077
 
2078
  $postID = $item->ID;
@@ -2092,14 +2284,42 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2092
  $id = UniteFunctionsUC::getVal($item, "id");
2093
  $url = UniteFunctionsUC::getVal($item, "url");
2094
 
 
 
 
 
 
 
 
 
 
 
2095
  $galleryItem = $this->getGalleryItem($id, $url,$params);
2096
-
2097
  break;
2098
  case "current_post_meta":
2099
 
2100
  //item is ID
2101
  $galleryItem = $this->getGalleryItem($item,null,$params);
2102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2103
  break;
2104
  default:
2105
  UniteFunctionsUC::throwError("group gallery error: unknown type: $source");
@@ -2109,10 +2329,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2109
  if(!empty($galleryItem))
2110
  $output[] = $galleryItem;
2111
 
2112
-
2113
  }
2114
-
2115
-
2116
  return($output);
2117
  }
2118
 
@@ -2185,6 +2403,148 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2185
  return($arrIDs);
2186
  }
2187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2188
 
2189
  /**
2190
  * get listing data
@@ -2195,10 +2555,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2195
  return($data);
2196
 
2197
  $useFor = UniteFunctionsUC::getVal($param, "use_for");
 
 
 
 
 
 
 
 
 
 
2198
  $isForGallery = ($useFor == "gallery");
2199
 
2200
  $source = UniteFunctionsUC::getVal($value, $name."_source");
2201
 
 
 
 
2202
  $templateID = UniteFunctionsUC::getVal($value, $name."_template_templateid");
2203
 
2204
  $data[$name."_source"] = $source;
@@ -2229,7 +2602,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2229
 
2230
  $data = $this->getPostListData($value, $paramProducts["name"], $processType, $paramProducts, $data);
2231
 
2232
-
2233
  break;
2234
  case "terms":
2235
 
@@ -2238,26 +2610,60 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2238
 
2239
  break;
2240
  case "gallery":
 
 
 
 
 
 
 
 
2241
 
2242
- $data[$name."_items"] = UniteFunctionsUC::getVal($value, $name."_gallery");
2243
-
2244
  break;
2245
  case "current_post_meta": //meta field with image id's
2246
 
2247
  $data[$name."_items"] = $this->getGroupedData_getArrImageIDsFromMeta($value, $name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2248
 
2249
  break;
2250
  default:
2251
- UniteFunctionsUC::throwError("Wrong listing source: $source");
2252
  break;
2253
  }
2254
 
2255
  if($isForGallery == true){
2256
 
2257
  $arrItems = $data[$name."_items"];
2258
-
2259
- $data[$name."_items"] = $this->getGroupedData_convertForGallery($arrItems, $source, $value, $param);
2260
 
 
 
 
2261
  return($data);
2262
  }
2263
 
@@ -2305,28 +2711,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2305
 
2306
 
2307
 
2308
-
2309
- protected function z_______________FILTERS____________(){}
2310
-
2311
-
2312
- /**
2313
- * get custom filters
2314
- */
2315
- private function getPostListData_getPostGetFilters_filters($filters){
2316
-
2317
- if(GlobalsUC::$inDev == false) //filters
2318
- return($filters);
2319
-
2320
- $objFiltersProcess = new UniteCreatorFiltersProcess();
2321
- $requestFilters = $objFiltersProcess->getRequestFilters();
2322
-
2323
- if(isset($requestFilters["category"]))
2324
- $filters["category"] = $requestFilters["category"];
2325
-
2326
- return($filters);
2327
- }
2328
-
2329
-
2330
  protected function z_______________TERMS____________(){}
2331
 
2332
 
@@ -2501,7 +2885,11 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2501
 
2502
  $showDebug = UniteFunctionsUC::getVal($value, $name."_show_query_debug");
2503
  $showDebug = UniteFunctionsUC::strToBool($showDebug);
2504
-
 
 
 
 
2505
  $maxTerms = UniteFunctionsUC::getVal($value, $name."_maxterms");
2506
  $maxTerms = (int)$maxTerms;
2507
  if(empty($maxTerms))
@@ -2597,6 +2985,13 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2597
 
2598
  $arrMetaQuery = $this->addMetaQueryItem($arrMetaQuery, $metaKey, $metaValue, $metaCompare);
2599
 
 
 
 
 
 
 
 
2600
  break;
2601
  default:
2602
  dmp("wrong include by: $includeby");
@@ -2695,8 +3090,35 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2695
  dmp("The terms query is:");
2696
  dmp($args);
2697
  }
2698
-
2699
- $arrTermsObjects = get_terms($args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2700
 
2701
  if(!empty($arrExcludeSlugs)){
2702
  HelperUC::addDebug("Terms Before Filter:", $arrTermsObjects);
@@ -2709,7 +3131,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2709
  $arrTerms = UniteFunctionsWPUC::getTermsObjectsData($arrTermsObjects, $taxonomy);
2710
 
2711
  $arrTerms = $this->modifyArrTermsForOutput($arrTerms, $taxonomy, $useCustomFields);
2712
-
2713
  return($arrTerms);
2714
  }
2715
 
85
 
86
  //change the hypen to underscore
87
  $thumbName = $name."_thumb_".$size;
88
+ if($size == "medium" && empty($filterSizes))
89
  $thumbName = $name."_thumb";
90
 
91
  $thumbName = str_replace("-", "_", $thumbName);
111
 
112
  $data[$thumbName] = $urlThumb;
113
  $data[$thumbName."_width"] = $thumbWidth;
114
+ $data[$thumbName."_height"] = $thumbHeight;
115
+
116
  }
117
 
118
  return($data);
706
  //check the single page pagination
707
  $paginationType = UniteFunctionsUC::getVal($value, $name."_pagination_type");
708
 
709
+
710
  if(empty($paginationType))
711
  return($args);
712
 
718
  if(empty($page)){
719
  $page = get_query_var("paged", null);
720
  }
721
+
722
  if(empty($page))
723
  return($args);
724
 
732
 
733
  //save the last page for the pagination output
734
  GlobalsProviderUC::$lastPostQuery_page = $page;
735
+
736
  return($args);
737
  }
738
 
934
  $isForWoo = UniteFunctionsUC::getVal($param, "for_woocommerce_products");
935
  $isForWoo = UniteFunctionsUC::strToBool($isForWoo);
936
 
 
 
 
 
 
 
 
937
 
938
  $isRelatedPosts = $source == "related";
939
  if(is_single() == false)
1140
  $filters["limit"] = $limit;
1141
 
1142
  $filters = $this->getPostListData_addOrderBy($filters, $value, $name);
1143
+
1144
+ //update by post and get filters
1145
+ $objFiltersProcess = new UniteCreatorFiltersProcess();
1146
 
 
 
 
 
 
 
1147
  //add debug for further use
1148
  HelperUC::addDebug("Post Filters", $filters);
1149
 
1150
  //run custom query if available
1151
  $args = UniteFunctionsWPUC::getPostsArgs($filters);
1152
 
1153
+ $args = $objFiltersProcess->processRequestFilters($args);
1154
+
1155
  //exclude by authors
1156
 
1157
  if($excludeByAuthors == true){
1211
 
1212
 
1213
  // exclude duplicates
1214
+ if($isAvoidDuplicates == true && !empty(GlobalsProviderUC::$arrFetchedPostIDs)){
 
1215
 
1216
  $arrFetchedIDs = array_keys(GlobalsProviderUC::$arrFetchedPostIDs);
1217
 
1242
  $arrIDsPHPFunction = array();
1243
  $arrIDsPostMeta = array();
1244
  $arrIDsDynamicField = array();
1245
+ $arrIDsFromContent = array();
1246
 
1247
 
1248
  $makePostINOrder = false;
1296
  'compare'=>'!='
1297
  );
1298
 
1299
+ break;
1300
+ case "products_from_post": //get products from post content
1301
+
1302
+ $objWoo = new UniteCreatorWooIntegrate();
1303
+ $arrIDsFromContent = $objWoo->getProductIDsFromCurrentPostContent();
1304
+
1305
  break;
1306
  case "author":
1307
 
1473
  $makePostINOrder = true;
1474
  }
1475
 
1476
+ if(!empty($arrIDsFromContent)){
1477
+ $arrPostInIDs = $arrIDsFromContent;
1478
+ $makePostINOrder = true;
1479
+ }
1480
+
1481
 
1482
  //make order as "post__id"
1483
 
1572
  //-------- show debug query --------------
1573
 
1574
  if($showDebugQuery == true){
1575
+ echo "<div class='uc-debug-query-wrapper'>"; //start debug wrapper
1576
+
1577
  dmp("The Query Is:");
1578
  dmp($args);
1579
  }
1580
+
1581
  $query = new WP_Query($args);
1582
 
1583
  if($showDebugQuery == true && $debugType == "show_query"){
1584
+
1585
+ $originalQueryVars = $query->query_vars;
1586
+ $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
1587
+
1588
  dmp("The Query Request Is:");
1589
  dmp($query->request);
1590
+
1591
+ dmp("The finals query vars:");
1592
+ dmp($originalQueryVars);
1593
+
1594
+ global $wp_filter;
1595
+ $actionsTermArgs = UniteFunctionsUC::getVal($wp_filter, "get_terms_args");
1596
+
1597
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("posts_pre_query");
1598
+
1599
+ dmp("Query modify callbacks ( posts_pre_query ):");
1600
+ dmp($arrActions);
1601
+
1602
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("posts_orderby");
1603
+
1604
+ dmp("Query modify callbacks ( posts_orderby ):");
1605
+ dmp($arrActions);
1606
+ }
1607
+
1608
+ //show text
1609
+ if($showDebugQuery == true && $debugType == "show_debug_text"){
1610
+ HelperUC::showDebug();
1611
  }
1612
 
1613
+
1614
  /*
1615
  dmp($query->request);
1616
  dmp("the query");
1632
  $arrPosts = UniteFunctionsWPUC::orderPostsByIDs($arrPosts, $arrStickyPosts);
1633
  }
1634
 
1635
+ //save last query and page
1636
+ $this->saveLastQueryAndPage($query);
1637
 
1638
  //remember duplicate posts
1639
  if($isAvoidDuplicates == true){
1642
  }
1643
 
1644
  HelperUC::addDebug("posts found: ".count($arrPosts));
1645
+
1646
  if($showDebugQuery == true){
1647
  dmp("Found Posts: ".count($arrPosts));
1648
+
1649
+ echo "</div>";
1650
  }
1651
 
1652
 
1653
  return($arrPosts);
1654
  }
1655
 
1656
+ /**
1657
+ * save last query and page
1658
+ */
1659
+ private function saveLastQueryAndPage($query){
1660
+
1661
+ GlobalsProviderUC::$lastPostQuery = $query;
1662
+ GlobalsProviderUC::$lastPostQuery_page = 1;
1663
+
1664
+ $queryVars = $query->query;
1665
+
1666
+ $perPage = UniteFunctionsUC::getVal($queryVars, "posts_per_page");
1667
+
1668
+ if(empty($perPage))
1669
+ return(false);
1670
+
1671
+ $offset = UniteFunctionsUC::getVal($queryVars, "offset");
1672
+
1673
+ if(empty($offset))
1674
+ return(false);
1675
+
1676
+ $page = ceil($offset / $perPage)+1;
1677
+
1678
+ if(!empty($page))
1679
+ GlobalsProviderUC::$lastPostQuery_page = $page;
1680
+
1681
+ }
1682
 
1683
 
1684
  /**
1753
  HelperUC::addDebug("Query Vars", $currentQueryVars);
1754
 
1755
  //save last query
1756
+ $this->saveLastQueryAndPage($query);
1757
+
1758
  $arrPosts = $query->posts;
1759
 
1760
  if(empty($arrPosts))
1908
  $imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
1909
  $arrImageSizes["desktop"] = $imageSize;
1910
  }
 
 
 
 
 
 
 
1911
 
1912
+ $objFilters = new UniteCreatorFiltersProcess();
1913
+ $data = $objFilters->addWidgetFilterableVariables($data, $this->addon);
 
 
1914
 
1915
  //prepare listing output. no items prepare for the listing
1916
 
1941
  /**
1942
  * get gallery item title
1943
  */
1944
+ private function getGalleryItem_title($source, $data, $name, $post, $item){
1945
+
1946
  switch($source){
1947
  case "post_title":
1948
  $title = $post->post_title;
1965
  case "image_description":
1966
  $title = UniteFunctionsUC::getVal($data, $name."_description");
1967
  break;
1968
+ case "item_title":
1969
+ $title = UniteFunctionsUC::getVal($item, "title");
1970
+ break;
1971
+ case "item_description":
1972
+ $title = UniteFunctionsUC::getVal($item, "description");
1973
+ break;
1974
  default:
1975
  case "image_auto":
1976
 
1984
 
1985
  break;
1986
  }
1987
+
1988
 
1989
  return($title);
1990
  }
1991
 
1992
+ /**
1993
+ * get gallery item data
1994
+ */
1995
+ private function getGalleryItem_sourceItemData($item, $sourceItem){
1996
+
1997
+ $itemType = UniteFunctionsUC::getVal($sourceItem, "item_type", "image");
1998
+
1999
+ switch($itemType){
2000
+ case "image":
2001
+ break;
2002
+ case "youtube":
2003
+
2004
+ $urlYoutube = UniteFunctionsUC::getVal($sourceItem, "url_youtube");
2005
+
2006
+ $videoID = UniteFunctionsUC::getYoutubeVideoID($urlYoutube);
2007
+
2008
+ $item["type"] = "youtube";
2009
+ $item["videoid"] = $videoID;
2010
+
2011
+ break;
2012
+ case "html5":
2013
+
2014
+ $urlMp4 = UniteFunctionsUC::getVal($sourceItem, "url_html5");
2015
+
2016
+ $item["type"] = "html5video";
2017
+ $item["url_mp4"] = $urlMp4;
2018
+
2019
+ break;
2020
+ case "vimeo":
2021
+
2022
+ $videoID = UniteFunctionsUC::getVal($sourceItem, "vimeo_id");
2023
+
2024
+ $videoID = UniteFunctionsUC::getVimeoIDFromUrl($videoID);
2025
+
2026
+ $item["type"] = "vimeo";
2027
+ $item["videoid"] = $videoID;
2028
+ break;
2029
+ case "wistia":
2030
+
2031
+ $videoID = UniteFunctionsUC::getVal($sourceItem, "wistia_id");
2032
+
2033
+ $item["type"] = "wistia";
2034
+ $item["videoid"] = $videoID;
2035
+
2036
+ break;
2037
+ default:
2038
+
2039
+ dmp("wrong gallery item type: $itemType");
2040
+ dmp($sourceItem);
2041
+
2042
+ break;
2043
+ }
2044
+
2045
+ //get the link url
2046
+ $link = UniteFunctionsUC::getVal($sourceItem, "link");
2047
+ if(is_array($link))
2048
+ $link = UniteFunctionsUC::getVal($link, "url");
2049
+
2050
+ if(empty($link))
2051
+ $link = "";
2052
+
2053
+ $item["link"] = $link;
2054
+
2055
+
2056
+ return($item);
2057
+ }
2058
+
2059
+
2060
+ /**
2061
+ * get gallery item from instagram
2062
+ */
2063
+ private function getGalleryItem_instagram($instaItem, $isEnableVideo){
2064
+
2065
+ $isVideo = UniteFunctionsUC::getVal($instaItem, "isvideo");
2066
+ $isVideo = UniteFunctionsUC::strToBool($isVideo);
2067
+
2068
+ $item["type"] = "image";
2069
+ $item["image"] = UniteFunctionsUC::getVal($instaItem, "image");
2070
+ $item["thumb"] = UniteFunctionsUC::getVal($instaItem, "thumb");
2071
+
2072
+ if($isVideo == true && $isEnableVideo == true){
2073
+
2074
+ $urlVideo = UniteFunctionsUC::getVal($instaItem, "url_video");
2075
+
2076
+ $item["type"] = "html5video";
2077
+ $item["url_mp4"] = $urlVideo;
2078
+ }
2079
+
2080
+ $imageSize = 1080;
2081
+
2082
+ $item["image_width"] = $imageSize;
2083
+ $item["image_height"] = $imageSize;
2084
+ $item["thumb_width"] = $imageSize;
2085
+ $item["thumb_height"] = $imageSize;
2086
+
2087
+ $item["title"] = UniteFunctionsUC::getVal($instaItem, "caption");
2088
+ $item["description"] = "";
2089
+ $item["link"] = UniteFunctionsUC::getVal($instaItem, "link");
2090
+ $item["imageid"] = 0;
2091
+
2092
+ return($item);
2093
+ }
2094
 
2095
  /**
2096
  * get gallery item
2097
  */
2098
  private function getGalleryItem($id, $url = null, $arrParams = null){
2099
 
 
2100
  $data = array();
2101
+
2102
  $arrFilters = UniteFunctionsUC::getVal($arrParams, "size_filters");
2103
 
2104
  $thumbSize = UniteFunctionsUC::getVal($arrParams, "thumb_size");
2107
  $titleSource = UniteFunctionsUC::getVal($arrParams, "title_source");
2108
  $descriptionSource = UniteFunctionsUC::getVal($arrParams, "description_source");
2109
  $post = UniteFunctionsUC::getVal($arrParams, "post");
2110
+ $sourceItem = UniteFunctionsUC::getVal($arrParams, "item");
2111
 
2112
+ $isAddItemsData = UniteFunctionsUC::getVal($arrParams, "add_item_data");
2113
+ $isAddItemsData = UniteFunctionsUC::strToBool($isAddItemsData);
2114
+
2115
  $name = "image";
2116
 
2117
  $param = array();
2122
  //no extra data needed
2123
  if( strpos($titleSource,"post_") !== false && strpos($descriptionSource, "post_") !== false)
2124
  $param["no_image_data"] = true;
2125
+ else
2126
+ if($titleSource == "item_title" && $descriptionSource == "item_description")
2127
+ $param["no_image_data"] = true;
2128
 
2129
+
2130
  $value = $id;
2131
  if(empty($value))
2132
  $value = $url;
2133
 
2134
+ $item = array();
2135
+ $item["type"] = "image";
2136
+
2137
  if(empty($value)){
2138
 
2139
  $item["image"] = GlobalsUC::$url_no_image_placeholder;
2143
  $item["image_height"] = 600;
2144
  $item["thumb_width"] = 600;
2145
  $item["thumb_height"] = 600;
 
 
 
2146
 
2147
+ $title = $this->getGalleryItem_title($titleSource, $data, $name, $post, $sourceItem);
2148
+ $description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post, $sourceItem);
2149
+
2150
+ if(empty($title) && !empty($post))
2151
  $title = $post->post_title;
2152
 
2153
  $item["title"] = $title;
2154
  $item["description"] = $description;
2155
+
2156
+ $item["link"] = "";
2157
+
2158
+ if(!empty($post))
2159
+ $item["link"] = $post->guid;
2160
+
2161
  $item["imageid"] = 0;
2162
 
2163
  return($item);
2164
  }
2165
 
 
2166
  $data = $this->getProcessedParamsValue_image($data, $value, $param);
2167
 
2168
  $arrItem = array();
2175
  if(!isset($data[$keyImage]))
2176
  $keyImage = $name;
2177
 
2178
+ //add extra data
2179
+ if($isAddItemsData == true)
2180
+ $item = $this->getGalleryItem_sourceItemData($item, $sourceItem);
2181
+
2182
  $item["image"] = UniteFunctionsUC::getVal($data, $keyImage);
2183
  $item["thumb"] = UniteFunctionsUC::getVal($data, $keyThumb);
2184
 
2188
  $item["thumb_width"] = UniteFunctionsUC::getVal($data, $keyThumb."_width");
2189
  $item["thumb_height"] = UniteFunctionsUC::getVal($data, $keyThumb."_height");
2190
 
2191
+ $title = $this->getGalleryItem_title($titleSource, $data, $name, $post, $sourceItem);
2192
+ $description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post, $sourceItem);
2193
 
2194
  $item["title"] = $title;
2195
  $item["description"] = $description;
2196
+
2197
+ if(!isset($item["link"])){
2198
+ $item["link"] = "";
2199
+ if(!empty($post))
2200
+ $item["link"] = $post->guid;
2201
+ }
2202
+
2203
  $item["imageid"] = $id;
2204
 
2205
  return($item);
2217
  $thumbSize = UniteFunctionsUC::getVal($value, $name."_thumb_size");
2218
  $imageSize = UniteFunctionsUC::getVal($value, $name."_image_size");
2219
 
2220
+ $isEnableVideo = UniteFunctionsUC::getVal($param, "gallery_enable_video");
2221
+ $isEnableVideo = UniteFunctionsUC::strToBool($isEnableVideo);
2222
+
2223
  $arrFilters = array();
2224
  if(!empty($thumbSize))
2225
  $arrFilters[] = $thumbSize;
2243
 
2244
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_post");
2245
  $descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_post");
2246
+
2247
  break;
2248
  case "gallery":
2249
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_gallery");
2250
  $descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_gallery");
2251
  break;
2252
+ case "image_video_repeater":
2253
+
2254
+ $titleSource = "item_title";
2255
+ $descriptionSource = "item_description";
2256
+
2257
+ break;
2258
  }
2259
 
2260
  $params["title_source"] = $titleSource;
2261
  $params["description_source"] = $descriptionSource;
2262
 
 
2263
  $output = array();
2264
  foreach($arrItems as $item){
2265
 
2266
  switch($source){
2267
+ case "products":
2268
  case "posts":
2269
 
2270
  $postID = $item->ID;
2284
  $id = UniteFunctionsUC::getVal($item, "id");
2285
  $url = UniteFunctionsUC::getVal($item, "url");
2286
 
2287
+ //for default items
2288
+ if(empty($id) && empty($url)){
2289
+ $url = UniteFunctionsUC::getVal($item, "image");
2290
+
2291
+ if(!empty($url)){
2292
+ $params["item"] = $item;
2293
+ $params["title_source"] = "item_title";
2294
+ }
2295
+ }
2296
+
2297
  $galleryItem = $this->getGalleryItem($id, $url,$params);
2298
+
2299
  break;
2300
  case "current_post_meta":
2301
 
2302
  //item is ID
2303
  $galleryItem = $this->getGalleryItem($item,null,$params);
2304
 
2305
+ break;
2306
+ case "image_video_repeater":
2307
+
2308
+ $image = UniteFunctionsUC::getVal($item, "image");
2309
+
2310
+ $url = UniteFunctionsUC::getVal($image, "url");
2311
+ $id = UniteFunctionsUC::getVal($image, "id");
2312
+
2313
+ $params["add_item_data"] = true;
2314
+ $params["item"] = $item;
2315
+
2316
+ $galleryItem = $this->getGalleryItem($id, $url, $params);
2317
+
2318
+ break;
2319
+ case "instagram":
2320
+
2321
+ $galleryItem = $this->getGalleryItem_instagram($item, $isEnableVideo);
2322
+
2323
  break;
2324
  default:
2325
  UniteFunctionsUC::throwError("group gallery error: unknown type: $source");
2329
  if(!empty($galleryItem))
2330
  $output[] = $galleryItem;
2331
 
 
2332
  }
2333
+
 
2334
  return($output);
2335
  }
2336
 
2403
  return($arrIDs);
2404
  }
2405
 
2406
+ /**
2407
+ * try to get gallery items from addon items
2408
+ */
2409
+ private function getGalleryItemsFromDefaultItems(){
2410
+
2411
+ $arrItems = $this->addon->getArrItemsNonProcessed();
2412
+
2413
+ if(empty($arrItems))
2414
+ return(array());
2415
+
2416
+ $firstItem = $arrItems[0];
2417
+ if(isset($firstItem["image"]) == false)
2418
+ return(array());
2419
+
2420
+ return($arrItems);
2421
+ }
2422
+
2423
+
2424
+ /**
2425
+ * get remote parent type data
2426
+ */
2427
+ private function getRemoteParentData($value, $name, $processType, $param, $data){
2428
+
2429
+ $arrOutput = array();
2430
+
2431
+ $isEnable = UniteFunctionsUC::getVal($value, $name."_enable");
2432
+ $isEnable = UniteFunctionsUC::strToBool($isEnable);
2433
+
2434
+ $isDebug = UniteFunctionsUC::getVal($value, $name."_debug");
2435
+ $isDebug = UniteFunctionsUC::strToBool($isDebug);
2436
+
2437
+ $isSync = UniteFunctionsUC::getVal($value, $name."_sync");
2438
+ $isSync = UniteFunctionsUC::strToBool($isSync);
2439
+
2440
+
2441
+
2442
+ if($isEnable == false){
2443
+
2444
+ $arrOutput["attributes"] = "";
2445
+ $arrOutput["class"] = "";
2446
+
2447
+ $data[$name] = $arrOutput;
2448
+
2449
+ return($data);
2450
+ }
2451
+
2452
+ HelperUC::addRemoteControlsScript();
2453
+
2454
+ //get the name
2455
+ $parentName = UniteFunctionsUC::getVal($value, $name."_name");
2456
+
2457
+ if($parentName == "custom")
2458
+ $parentName = UniteFunctionsUC::getVal($value, $name."_custom_name");
2459
+
2460
+ if(empty($parentName))
2461
+ $parentName = "auto";
2462
+
2463
+ $parentName = UniteFunctionsUC::sanitizeAttr($parentName);
2464
+
2465
+ //create attributes and classes
2466
+
2467
+ $attributes = " data-remoteid='$parentName'";
2468
+
2469
+ if($isDebug == true)
2470
+ $attributes .= " data-debug='true'";
2471
+
2472
+ if($isSync == true){
2473
+
2474
+ //get the name
2475
+ $syncParentName = UniteFunctionsUC::getVal($value, $name."_sync_name");
2476
+
2477
+ if($syncParentName == "custom")
2478
+ $syncParentName = UniteFunctionsUC::getVal($value, $name."_sync_custom_name");
2479
+
2480
+ if(empty($syncParentName))
2481
+ $syncParentName = "auto";
2482
+
2483
+ $attributes .= " data-sync='true' data-parentid='$syncParentName'";
2484
+ }
2485
+
2486
+ $class = " uc-remote-parent";
2487
+
2488
+ //output
2489
+
2490
+ $arrOutput["attributes"] = $attributes;
2491
+ $arrOutput["class"] = $class;
2492
+
2493
+ $data[$name] = $arrOutput;
2494
+
2495
+ return($data);
2496
+ }
2497
+
2498
+
2499
+ /**
2500
+ * add remote controller data
2501
+ */
2502
+ private function getRemoteControllerData($value, $name, $processType, $param, $data){
2503
+
2504
+ HelperUC::addRemoteControlsScript();
2505
+
2506
+ $parentName = UniteFunctionsUC::getVal($value, $name."_name");
2507
+
2508
+ if($parentName == "custom")
2509
+ $parentName = UniteFunctionsUC::getVal($value, $name."_custom_name");
2510
+
2511
+ if(empty($name))
2512
+ $parentName = "auto";
2513
+
2514
+ $parentName = UniteFunctionsUC::sanitizeAttr($parentName);
2515
+
2516
+ $attributes = " data-parentid='$parentName'";
2517
+
2518
+ $arrOutput = array();
2519
+ $arrOutput["attributes"] = $attributes;
2520
+
2521
+ $data[$name] = $arrOutput;
2522
+
2523
+ return($data);
2524
+ }
2525
+
2526
+ /**
2527
+ * get remote settings data
2528
+ */
2529
+ private function getRemoteSettingsData($value, $name, $processType, $param, $data){
2530
+
2531
+ $type = UniteFunctionsUC::getVal($param, "remote_type");
2532
+
2533
+ switch($type){
2534
+ case "controller":
2535
+
2536
+ $data = $this->getRemoteControllerData($value, $name, $processType, $param, $data);
2537
+
2538
+ break;
2539
+ default:
2540
+ case "parent":
2541
+ $data = $this->getRemoteParentData($value, $name, $processType, $param, $data);
2542
+ break;
2543
+ }
2544
+
2545
+
2546
+ return($data);
2547
+ }
2548
 
2549
  /**
2550
  * get listing data
2555
  return($data);
2556
 
2557
  $useFor = UniteFunctionsUC::getVal($param, "use_for");
2558
+
2559
+ switch($useFor){
2560
+ case "remote":
2561
+
2562
+ $data = $this->getRemoteSettingsData($value, $name, $processType, $param, $data);
2563
+
2564
+ return($data);
2565
+ break;
2566
+ }
2567
+
2568
  $isForGallery = ($useFor == "gallery");
2569
 
2570
  $source = UniteFunctionsUC::getVal($value, $name."_source");
2571
 
2572
+ if(empty($source) && $isForGallery == true)
2573
+ $source = "gallery";
2574
+
2575
  $templateID = UniteFunctionsUC::getVal($value, $name."_template_templateid");
2576
 
2577
  $data[$name."_source"] = $source;
2602
 
2603
  $data = $this->getPostListData($value, $paramProducts["name"], $processType, $paramProducts, $data);
2604
 
 
2605
  break;
2606
  case "terms":
2607
 
2610
 
2611
  break;
2612
  case "gallery":
2613
+
2614
+ $arrGalleryItems = UniteFunctionsUC::getVal($value, $name."_gallery");
2615
+
2616
+ //output defaults
2617
+ if(empty($arrGalleryItems))
2618
+ $arrGalleryItems = $this->getGalleryItemsFromDefaultItems();
2619
+
2620
+ $data[$name."_items"] = $arrGalleryItems;
2621
 
 
 
2622
  break;
2623
  case "current_post_meta": //meta field with image id's
2624
 
2625
  $data[$name."_items"] = $this->getGroupedData_getArrImageIDsFromMeta($value, $name);
2626
+
2627
+ break;
2628
+ case "image_video_repeater":
2629
+
2630
+ $data[$name."_items"] = UniteFunctionsUC::getVal($value, $name."_items");
2631
+
2632
+ //do nothing, convert later
2633
+
2634
+ break;
2635
+ case "instagram":
2636
+
2637
+ $paramInstagram = $param;
2638
+ $paramInstagram["name"] = $paramInstagram["name"]."_instagram";
2639
+
2640
+ $arrInstagramData = $this->getInstagramData($value, $name."_instagram", $paramInstagram);
2641
+
2642
+ $error = UniteFunctionsUC::getVal($arrInstagramData, "error");
2643
+ if(!empty($error))
2644
+ UniteFunctionsUC::throwError($error);
2645
+
2646
+ $arrInstagramItems = UniteFunctionsUC::getVal($arrInstagramData, "items");
2647
+
2648
+
2649
+ if(empty($arrInstagramItems))
2650
+ $arrInstagramItems = array();
2651
+
2652
+ $data[$name."_items"] = $arrInstagramItems;
2653
 
2654
  break;
2655
  default:
2656
+ UniteFunctionsUC::throwError("Wrong dynamic content source: $source");
2657
  break;
2658
  }
2659
 
2660
  if($isForGallery == true){
2661
 
2662
  $arrItems = $data[$name."_items"];
 
 
2663
 
2664
+ $data[$name."_items"] = $this->getGroupedData_convertForGallery($arrItems, $source, $value, $param);
2665
+
2666
+
2667
  return($data);
2668
  }
2669
 
2711
 
2712
 
2713
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2714
  protected function z_______________TERMS____________(){}
2715
 
2716
 
2885
 
2886
  $showDebug = UniteFunctionsUC::getVal($value, $name."_show_query_debug");
2887
  $showDebug = UniteFunctionsUC::strToBool($showDebug);
2888
+
2889
+ $queryDebugType = "";
2890
+ if($showDebug == true)
2891
+ $queryDebugType = UniteFunctionsUC::getVal($value, $name."_query_debug_type");
2892
+
2893
  $maxTerms = UniteFunctionsUC::getVal($value, $name."_maxterms");
2894
  $maxTerms = (int)$maxTerms;
2895
  if(empty($maxTerms))
2985
 
2986
  $arrMetaQuery = $this->addMetaQueryItem($arrMetaQuery, $metaKey, $metaValue, $metaCompare);
2987
 
2988
+ break;
2989
+ case "children_of_current":
2990
+
2991
+ $parentTermID = UniteFunctionsWPUC::getCurrentTermID();
2992
+
2993
+ $args["parent"] = $parentTermID;
2994
+
2995
  break;
2996
  default:
2997
  dmp("wrong include by: $includeby");
3090
  dmp("The terms query is:");
3091
  dmp($args);
3092
  }
3093
+
3094
+ $term_query = new WP_Term_Query();
3095
+ $arrTermsObjects = $term_query->query( $args );
3096
+
3097
+ if($showDebug == true && $queryDebugType == "show_query"){
3098
+
3099
+ $originalQueryVars = $term_query->query_vars;
3100
+ $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
3101
+
3102
+ dmp("The Query Request Is:");
3103
+ dmp($term_query->request);
3104
+
3105
+ dmp("The finals query vars:");
3106
+ dmp($originalQueryVars);
3107
+
3108
+ global $wp_filter;
3109
+ $actionsTermArgs = UniteFunctionsUC::getVal($wp_filter, "get_terms_args");
3110
+
3111
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_args");
3112
+
3113
+ dmp("Query modify callbacks ( get_terms_args ):");
3114
+ dmp($arrActions);
3115
+
3116
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_orderby");
3117
+
3118
+ dmp("Query modify callbacks ( get_terms_orderby ):");
3119
+ dmp($arrActions);
3120
+
3121
+ }
3122
 
3123
  if(!empty($arrExcludeSlugs)){
3124
  HelperUC::addDebug("Terms Before Filter:", $arrTermsObjects);
3131
  $arrTerms = UniteFunctionsWPUC::getTermsObjectsData($arrTermsObjects, $taxonomy);
3132
 
3133
  $arrTerms = $this->modifyArrTermsForOutput($arrTerms, $taxonomy, $useCustomFields);
3134
+
3135
  return($arrTerms);
3136
  }
3137
 
provider/provider_settings.class.php CHANGED
@@ -115,19 +115,21 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
115
 
116
  $arrAllTax = array();
117
 
118
-
119
  //make taxonomies data
120
  $arrTaxonomies = array();
121
  foreach($arrPostTypesWithTax as $typeName => $arrType){
122
 
123
  $arrItemTax = UniteFunctionsUC::getVal($arrType, "taxonomies");
124
-
125
  $arrTaxOutput = array();
126
 
127
  //some fix that avoid double names
128
  $arrDuplicateValues = UniteFunctionsUC::getArrayDuplicateValues($arrItemTax);
129
 
130
  foreach($arrItemTax as $slug => $taxTitle){
 
 
 
131
 
132
  $isDuplicate = array_key_exists($taxTitle, $arrDuplicateValues);
133
 
@@ -328,9 +330,9 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
328
 
329
  $this->addRadioBoolean($name."_show_query_debug", __("Show Query Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
330
 
331
-
332
  }
333
-
 
334
  /**
335
  * add menu picker
336
  */
@@ -439,7 +441,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
439
 
440
  $arrIncludeBy = array();
441
  $arrIncludeBy["spacific_terms"] = __("Specific Terms","unlimited-elements-for-elementor");
442
- $arrIncludeBy["parents"] = __("Parent Of","unlimited-elements-for-elementor");
 
443
  $arrIncludeBy["search"] = __("By Search Text","unlimited-elements-for-elementor");
444
  $arrIncludeBy["childless"] = __("Only Childless","unlimited-elements-for-elementor");
445
  $arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
@@ -659,6 +662,20 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
659
 
660
  $this->addRadioBoolean($name."_show_query_debug", __("Show Query Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
 
663
  //add hr
664
  $params = array();
@@ -1219,6 +1236,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1219
  $arrIncludeBy["cross_sells"] = __("Cross Sells Products (woo)","unlimited-elements-for-elementor");
1220
  $arrIncludeBy["out_of_stock"] = __("Out Of Stock Products Only (woo)", "unlimited-elements-for-elementor");
1221
  $arrIncludeBy["recent"] = __("Recently Viewed Produts (woo)", "unlimited-elements-for-elementor");
 
1222
  }
1223
 
1224
  $addPostsText = sprintf(__("Add Specific %s", "unlimited-elements-for-elementor"), $textPosts);
@@ -1414,7 +1432,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1414
  $params["elementor_condition"] = $arrConditionIncludePostMeta;
1415
 
1416
  $this->addTextBox($name."_includeby_postmeta_metafield", "", esc_html__("Meta Field Name", "unlimited-elements-for-elementor"), $params);
1417
-
1418
  //----- include id's from dynamic field -------
1419
 
1420
  $arrConditionIncludeDynamic = $arrConditionIncludeBy;
@@ -1828,7 +1846,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1828
 
1829
  $this->addRadioBoolean($name."_show_query_debug", __("Show Query Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1830
 
1831
- //--------- debug type ---------
1832
 
1833
  $params = array();
1834
  $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
@@ -1836,7 +1854,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1836
 
1837
  $arrType = array();
1838
  $arrType["basic"] = __("Basic", "unlimited-elements-for-elementor");
1839
- $arrType["show_query"] = __("Show Raw DB Query", "unlimited-elements-for-elementor");
 
1840
 
1841
  $arrType = array_flip($arrType);
1842
 
@@ -1957,7 +1976,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1957
  $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1958
  $params["description"] = __("Show the current post meta fields, turn off it after choose the right one", "unlimited-elements-for-elementor");
1959
  $params["elementor_condition"] = $conditionCurrentMeta;
1960
-
1961
  $this->addRadioBoolean($name."_show_metafields", __("Debug - Show Meta Fields", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1962
 
1963
  //=========== GALLERY TITLE AND DESCRIPTION SOURCE =================
@@ -2025,6 +2044,141 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2025
  $arrSizes = array_flip($arrSizes);
2026
  $this->addSelect($name."_image_size", $arrSizes, __("Big Image Size", "unlimited-elements-for-elementor"), "large", $params);
2027
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2028
  }
2029
 
2030
 
@@ -2035,7 +2189,15 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2035
 
2036
  //add template picker
2037
  $useFor = UniteFunctionsUC::getVal($param, "use_for");
 
 
 
 
 
 
2038
  $isForGallery = ($useFor == "gallery");
 
 
2039
 
2040
  //set text prefix
2041
  $textPrefix = __("Items ","unlimited-elements-for-elementor");
@@ -2059,6 +2221,13 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2059
 
2060
  if($isForGallery == true){
2061
  $arrSource["gallery"] = __("Gallery", "unlimited-elements-for-elementor");
 
 
 
 
 
 
 
2062
  }
2063
 
2064
  $arrSource["posts"] = __("Posts", "unlimited-elements-for-elementor");
@@ -2067,7 +2236,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2067
  if($isWooActive == true)
2068
  $arrSource["products"] = __("Products", "unlimited-elements-for-elementor");
2069
 
2070
-
2071
  if($isForGallery == true){
2072
  $arrSource["current_post_meta"] = __("Current Post Metafield", "unlimited-elements-for-elementor");
2073
  }
115
 
116
  $arrAllTax = array();
117
 
 
118
  //make taxonomies data
119
  $arrTaxonomies = array();
120
  foreach($arrPostTypesWithTax as $typeName => $arrType){
121
 
122
  $arrItemTax = UniteFunctionsUC::getVal($arrType, "taxonomies");
123
+
124
  $arrTaxOutput = array();
125
 
126
  //some fix that avoid double names
127
  $arrDuplicateValues = UniteFunctionsUC::getArrayDuplicateValues($arrItemTax);
128
 
129
  foreach($arrItemTax as $slug => $taxTitle){
130
+
131
+ if(is_string($taxTitle) == false)
132
+ continue;
133
 
134
  $isDuplicate = array_key_exists($taxTitle, $arrDuplicateValues);
135
 
330
 
331
  $this->addRadioBoolean($name."_show_query_debug", __("Show Query Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
332
 
 
333
  }
334
+
335
+
336
  /**
337
  * add menu picker
338
  */
441
 
442
  $arrIncludeBy = array();
443
  $arrIncludeBy["spacific_terms"] = __("Specific Terms","unlimited-elements-for-elementor");
444
+ $arrIncludeBy["parents"] = __("Children Of","unlimited-elements-for-elementor");
445
+ $arrIncludeBy["children_of_current"] = __("Children Of Current Term","unlimited-elements-for-elementor");
446
  $arrIncludeBy["search"] = __("By Search Text","unlimited-elements-for-elementor");
447
  $arrIncludeBy["childless"] = __("Only Childless","unlimited-elements-for-elementor");
448
  $arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
662
 
663
  $this->addRadioBoolean($name."_show_query_debug", __("Show Query Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
664
 
665
+ //--------- debug type terms ---------
666
+
667
+ $params = array();
668
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
669
+ $params["elementor_condition"] = array($name."_show_query_debug"=>"true");
670
+
671
+ $arrType = array();
672
+ $arrType["basic"] = __("Basic", "unlimited-elements-for-elementor");
673
+ $arrType["show_query"] = __("Full", "unlimited-elements-for-elementor");
674
+
675
+ $arrType = array_flip($arrType);
676
+
677
+ $this->addSelect($name."_query_debug_type", $arrType, __("Debug Options", "unlimited-elements-for-elementor"), "basic", $params);
678
+
679
 
680
  //add hr
681
  $params = array();
1236
  $arrIncludeBy["cross_sells"] = __("Cross Sells Products (woo)","unlimited-elements-for-elementor");
1237
  $arrIncludeBy["out_of_stock"] = __("Out Of Stock Products Only (woo)", "unlimited-elements-for-elementor");
1238
  $arrIncludeBy["recent"] = __("Recently Viewed Produts (woo)", "unlimited-elements-for-elementor");
1239
+ $arrIncludeBy["products_from_post"] = __("Products From Post Content (woo)", "unlimited-elements-for-elementor");
1240
  }
1241
 
1242
  $addPostsText = sprintf(__("Add Specific %s", "unlimited-elements-for-elementor"), $textPosts);
1432
  $params["elementor_condition"] = $arrConditionIncludePostMeta;
1433
 
1434
  $this->addTextBox($name."_includeby_postmeta_metafield", "", esc_html__("Meta Field Name", "unlimited-elements-for-elementor"), $params);
1435
+
1436
  //----- include id's from dynamic field -------
1437
 
1438
  $arrConditionIncludeDynamic = $arrConditionIncludeBy;
1846
 
1847
  $this->addRadioBoolean($name."_show_query_debug", __("Show Query Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1848
 
1849
+ //--------- debug type posts ---------
1850
 
1851
  $params = array();
1852
  $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
1854
 
1855
  $arrType = array();
1856
  $arrType["basic"] = __("Basic", "unlimited-elements-for-elementor");
1857
+ $arrType["show_query"] = __("Full", "unlimited-elements-for-elementor");
1858
+ $arrType["show_debug_text"] = __("Show Debug Text", "unlimited-elements-for-elementor");
1859
 
1860
  $arrType = array_flip($arrType);
1861
 
1976
  $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1977
  $params["description"] = __("Show the current post meta fields, turn off it after choose the right one", "unlimited-elements-for-elementor");
1978
  $params["elementor_condition"] = $conditionCurrentMeta;
1979
+
1980
  $this->addRadioBoolean($name."_show_metafields", __("Debug - Show Meta Fields", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1981
 
1982
  //=========== GALLERY TITLE AND DESCRIPTION SOURCE =================
2044
  $arrSizes = array_flip($arrSizes);
2045
  $this->addSelect($name."_image_size", $arrSizes, __("Big Image Size", "unlimited-elements-for-elementor"), "large", $params);
2046
 
2047
+
2048
+ }
2049
+
2050
+ /**
2051
+ * add remote parent settings
2052
+ */
2053
+ private function addRemoteSettingsParent($name,$value,$title,$param){
2054
+
2055
+ $prefix = $name."_";
2056
+
2057
+ $remoteEnableName = $prefix."enable";
2058
+ $condition = array($remoteEnableName=>"true");
2059
+
2060
+ //---- enable remote -----
2061
+
2062
+ $params = array();
2063
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
2064
+ $params["description"] = __("Enable the remote connection functionality for this widget", "unlimited-elements-for-elementor");
2065
+
2066
+ $this->addRadioBoolean($remoteEnableName, __("Enable Remote Connection", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
2067
+
2068
+
2069
+ //widget name
2070
+
2071
+ $arrNames = HelperProviderUC::getArrRemoteParentNames();
2072
+ $arrNames = array_flip($arrNames);
2073
+
2074
+ $params = array(
2075
+ "description"=>__("This name will be used to connect and control this widget by other widgets"),
2076
+ "origtype" => UniteCreatorDialogParam::PARAM_DROPDOWN,
2077
+ "elementor_condition" => $condition
2078
+ );
2079
+
2080
+ $this->addSelect($prefix."name", $arrNames, __("Widget Name for Connection", "unlimited-elements-for-elementor"), "auto", $params);
2081
+
2082
+ $params = array();
2083
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
2084
+ $params["elementor_condition"] = array($remoteEnableName=>"true",$prefix."name"=>"custom");
2085
+
2086
+ $this->addTextBox($prefix."custom_name", "", __("Custom Name","unlimited-elements-for-elementor"), $params);
2087
+
2088
+
2089
+ //debug remote widgets
2090
+
2091
+ $params = array();
2092
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
2093
+ $params["description"] = __("Show information about remote widgets that connected to this widget. Please turn off this option before release", "unlimited-elements-for-elementor");
2094
+ $params["elementor_condition"] = $condition;
2095
+
2096
+ $this->addRadioBoolean($prefix."debug", __("Debug Connected Widgets", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
2097
+
2098
+ //sync
2099
+
2100
+ $params = array();
2101
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
2102
+ $params["elementor_condition"] = $condition;
2103
+
2104
+ $this->addRadioBoolean($prefix."sync", __("Sync", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
2105
+
2106
+ //sync with widget name
2107
+
2108
+ $arrNames = HelperProviderUC::getArrRemoteParentNames();
2109
+ $arrNames = array_flip($arrNames);
2110
+
2111
+ $conditionSync = $condition;
2112
+ $conditionSync[$prefix."sync"] = "true";
2113
+
2114
+ $params = array(
2115
+ "description"=>__("Choose remote name of the widget that you want to sync with"),
2116
+ "origtype" => UniteCreatorDialogParam::PARAM_DROPDOWN,
2117
+ "elementor_condition" => $conditionSync
2118
+ );
2119
+
2120
+ $this->addSelect($prefix."sync_name", $arrNames, __("Widget Name for Sync", "unlimited-elements-for-elementor"), "auto", $params);
2121
+
2122
+ $params = array();
2123
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
2124
+ $params["elementor_condition"] = array($remoteEnableName=>"true",$prefix."sync_name"=>"custom",$prefix."sync"=>"true");
2125
+
2126
+ $this->addTextBox($prefix."sync_custom_name", "", __("Custom Name for Sync","unlimited-elements-for-elementor"), $params);
2127
+
2128
+ }
2129
+
2130
+
2131
+ /**
2132
+ * add remote controller settings
2133
+ */
2134
+ private function addRemoteSettingsController($name,$value,$title,$param){
2135
+
2136
+ $prefix = $name."_";
2137
+
2138
+ $arrNames = HelperProviderUC::getArrRemoteParentNames();
2139
+ $arrNames = array_flip($arrNames);
2140
+
2141
+ $params = array(
2142
+ "description"=>__("Select the name of the parent for connetion"),
2143
+ "origtype" => UniteCreatorDialogParam::PARAM_DROPDOWN
2144
+ );
2145
+
2146
+ $this->addSelect($prefix."name", $arrNames, __("Remote Parent Name", "unlimited-elements-for-elementor"), "auto", $params);
2147
+
2148
+ $params = array();
2149
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
2150
+ $params["elementor_condition"] = array($prefix."name"=>"custom");
2151
+
2152
+ $this->addTextBox($prefix."custom_name", "", __("Custom Parent Name","unlimited-elements-for-elementor"), $params);
2153
+
2154
+ $params = array();
2155
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2156
+
2157
+ $this->addHr("hr_remote_child",$params);
2158
+
2159
+ }
2160
+
2161
+
2162
+ /**
2163
+ * add remote settings
2164
+ */
2165
+ protected function addRemoteSettings($name,$value,$title,$param){
2166
+
2167
+ $type = UniteFunctionsUC::getVal($param, "remote_type");
2168
+
2169
+ switch($type){
2170
+ case "controller":
2171
+
2172
+ $this->addRemoteSettingsController($name,$value,$title,$param);
2173
+
2174
+ break;
2175
+ default:
2176
+ case "parent":
2177
+
2178
+ $this->addRemoteSettingsParent($name,$value,$title,$param);
2179
+ break;
2180
+ }
2181
+
2182
  }
2183
 
2184
 
2189
 
2190
  //add template picker
2191
  $useFor = UniteFunctionsUC::getVal($param, "use_for");
2192
+
2193
+ if($useFor == "remote"){
2194
+ $this->addRemoteSettings($name, $value, $title, $param);
2195
+ return(false);
2196
+ }
2197
+
2198
  $isForGallery = ($useFor == "gallery");
2199
+ $isEnableVideoItems = UniteFunctionsUC::getVal($param, "gallery_enable_video");
2200
+ $isEnableVideoItems = UniteFunctionsUC::strToBool($isEnableVideoItems);
2201
 
2202
  //set text prefix
2203
  $textPrefix = __("Items ","unlimited-elements-for-elementor");
2221
 
2222
  if($isForGallery == true){
2223
  $arrSource["gallery"] = __("Gallery", "unlimited-elements-for-elementor");
2224
+
2225
+ if($isEnableVideoItems == true)
2226
+ $arrSource["image_video_repeater"] = __("Image And Video Items", "unlimited-elements-for-elementor");
2227
+ else
2228
+ $arrSource["image_video_repeater"] = __("Image Items", "unlimited-elements-for-elementor");
2229
+
2230
+ $arrSource["instagram"] = __("Instagram", "unlimited-elements-for-elementor");
2231
  }
2232
 
2233
  $arrSource["posts"] = __("Posts", "unlimited-elements-for-elementor");
2236
  if($isWooActive == true)
2237
  $arrSource["products"] = __("Products", "unlimited-elements-for-elementor");
2238
 
2239
+
2240
  if($isForGallery == true){
2241
  $arrSource["current_post_meta"] = __("Current Post Metafield", "unlimited-elements-for-elementor");
2242
  }
provider/woocommerce_integrate.class.php CHANGED
@@ -119,6 +119,29 @@ class UniteCreatorWooIntegrate{
119
  return(self::$instance);
120
  }
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  /**
123
  * add add to cart data
124
  */
@@ -255,6 +278,213 @@ class UniteCreatorWooIntegrate{
255
  return($arrProperties);
256
  }
257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
  /**
260
  * get product data
@@ -365,7 +595,6 @@ class UniteCreatorWooIntegrate{
365
  $arrKeys[] = "woo_link_addcart_checkout";
366
  $arrKeys[] = "woo_addcart_ajax_attributes";
367
 
368
-
369
  return($arrKeys);
370
  }
371
 
@@ -525,6 +754,45 @@ class UniteCreatorWooIntegrate{
525
  }
526
 
527
  }
528
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
 
530
  }
119
  return(self::$instance);
120
  }
121
 
122
+ /**
123
+ * add to cart for variation
124
+ */
125
+ private function addAddToCartForVariation($arrVariation){
126
+
127
+ $variationID = UniteFunctionsUC::getVal($arrVariation, "variation_id");
128
+ $sku = UniteFunctionsUC::getVal($arrVariation, "sku");
129
+
130
+ $params = "add-to-cart={$variationID}";
131
+
132
+ $urlAddCart = UniteFunctionsUC::addUrlParams($this->urlCurrentPage, $params);
133
+
134
+ $arrVariation["link_addcart_cart"] = UniteFunctionsUC::addUrlParams($this->urlCart, $params);
135
+ $arrVariation["link_addcart_checkout"] = UniteFunctionsUC::addUrlParams($this->urlCheckout, $params);
136
+
137
+ //add html ajax add to cart
138
+ $addCartAttributes = "href=\"{$urlAddCart}\" data-quantity=\"1\" class=\"uc-button-addcart product_type_simple add_to_cart_button ajax_add_to_cart\" data-product_id=\"{$variationID}\" data-product_sku=\"{$sku}\" rel=\"nofollow\"";
139
+
140
+ $arrVariation["addcart_ajax_attributes"] = $addCartAttributes;
141
+
142
+ return($arrVariation);
143
+ }
144
+
145
  /**
146
  * add add to cart data
147
  */
278
  return($arrProperties);
279
  }
280
 
281
+ /**
282
+ * get attribute simple title
283
+ */
284
+ private function getVariationAttributeTitle($slug, $value, $arrTitles){
285
+
286
+ $key = $slug."_".$value;
287
+
288
+ $title = UniteFunctionsUC::getVal($arrTitles, $key);
289
+
290
+ if(empty($title))
291
+ $title = UniteFunctionsUC::getVal($arrTitles, $slug);
292
+
293
+ //if not found - return simple text
294
+ if(empty($title)){
295
+
296
+ $slug = str_replace("attribute_", "", $slug);
297
+
298
+ $title = array("attr"=>$slug,"title"=>$value);
299
+
300
+ return($title);
301
+ }
302
+
303
+ if(is_array($title))
304
+ return($title);
305
+
306
+ //string type
307
+
308
+ $slug = str_replace("attribute_", "", $slug);
309
+
310
+ $arrTitle = array("attr"=>$title,"title"=>$value);
311
+
312
+ return($arrTitle);
313
+ }
314
+
315
+ /**
316
+ * add titles for variation
317
+ */
318
+ private function addTitlesForVariation($arrVariation, $arrAttributeTitles){
319
+
320
+ $simpleTitle = "";
321
+ $titleKey = "";
322
+ $arrTitleParts = array();
323
+
324
+ $arrAttributes = UniteFunctionsUC::getVal($arrVariation, "attributes");
325
+
326
+ if(empty($arrAttributes))
327
+ return($arrVariation);
328
+
329
+ foreach($arrAttributes as $slug=>$value){
330
+
331
+ $arrTitle = $this->getVariationAttributeTitle($slug, $value, $arrAttributeTitles);
332
+
333
+ $attrTitle = UniteFunctionsUC::getVal($arrTitle, "attr");
334
+ $valueTitle = UniteFunctionsUC::getVal($arrTitle, "title");
335
+
336
+ if(!empty($simpleTitle))
337
+ $simpleTitle .= ", ";
338
+
339
+ $arrTitleParts[] = $arrTitle;
340
+
341
+ $simpleTitle .= $attrTitle." - ".$valueTitle;
342
+
343
+ //make the key
344
+ $value = strtolower($value);
345
+ $slug = str_replace("attribute_", "", $slug);
346
+
347
+ if(!empty($titleKey))
348
+ $titleKey .= "_";
349
+
350
+ $titleKey .= $slug."_".$value;
351
+ }
352
+
353
+ $arrVariation["title"] = $simpleTitle;
354
+ $arrVariation["title_key"] = $titleKey;
355
+ $arrVariation["title_parts"] = $arrTitleParts;
356
+
357
+ return($arrVariation);
358
+ }
359
+
360
+
361
+ /**
362
+ * modify variation for output
363
+ */
364
+ private function modifyVariationForOutput($arrVariation, $arrAttributeTitles){
365
+
366
+ //add links
367
+
368
+ $arrVariation = $this->addAddToCartForVariation($arrVariation);
369
+
370
+ //add titles
371
+
372
+ $arrVariation = $this->addTitlesForVariation($arrVariation, $arrAttributeTitles);
373
+
374
+ return($arrVariation);
375
+ }
376
+
377
+
378
+ /**
379
+ * get attributes titles - in case that they are taxonomies
380
+ */
381
+ private function getAttributeTitles_simple($arrOutput, $objAttribute){
382
+
383
+ $name = $objAttribute->get_name();
384
+
385
+ $slug = "attribute_".strtolower($name);
386
+
387
+ $arrOutput[$slug] = $name;
388
+
389
+ return($arrOutput);
390
+ }
391
+
392
+
393
+ /**
394
+ * get attributes titles - in case that they are taxonomies
395
+ */
396
+ private function getAttributeTitles_tax($arrOutput, $objAttribute, $product){
397
+
398
+ $attribute_taxonomy = $objAttribute->get_taxonomy_object();
399
+ $attribute_values = wc_get_product_terms( $product->get_id(), $objAttribute->get_name(), array( 'fields' => 'all' ) );
400
+
401
+ $attribute_taxonomy = (array)$attribute_taxonomy;
402
+
403
+ if(empty($attribute_values))
404
+ return($arrOutput);
405
+
406
+ $attributeLabel = UniteFunctionsUC::getVal($attribute_taxonomy, "attribute_label");
407
+
408
+ foreach($attribute_values as $term){
409
+
410
+ $slug = $term->slug;
411
+ $taxonomy = $term->taxonomy;
412
+
413
+ $name = "attribute_".$taxonomy."_".$slug;
414
+
415
+ $termTitle = $term->name;
416
+
417
+ $title = array("attr"=>$attributeLabel,"title"=>$termTitle);
418
+
419
+ $arrOutput[$name] = $title;
420
+
421
+ } //foreach terms
422
+
423
+ return($arrOutput);
424
+ }
425
+
426
+
427
+ /**
428
+ * get product attribute names
429
+ *
430
+ */
431
+ private function getProductAttributeNames($product){
432
+
433
+ $arrAttributes = $product->get_attributes();
434
+
435
+ $arrOutput = array();
436
+
437
+ foreach($arrAttributes as $objAttribute){
438
+
439
+ $isTax = $objAttribute->is_taxonomy();
440
+
441
+ if($isTax == true)
442
+ $arrOutput = $this->getAttributeTitles_tax($arrOutput, $objAttribute, $product);
443
+ else
444
+ $arrOutput = $this->getAttributeTitles_simple($arrOutput, $objAttribute, $product);
445
+
446
+ } //foreach attributes
447
+
448
+ return($arrOutput);
449
+ }
450
+
451
+
452
+ /**
453
+ * get variations array
454
+ */
455
+ public function getProductVariations($productID){
456
+
457
+ if(function_exists("wc_get_product") == false)
458
+ return(array());
459
+
460
+ $product = wc_get_product($productID);
461
+
462
+ if(empty($product))
463
+ return(array());
464
+
465
+ $type = $product->get_type();
466
+
467
+ if($type != "variable")
468
+ return(array());
469
+
470
+ $variations = $product->get_available_variations();
471
+
472
+ if(empty($variations) || is_array($variations) == false)
473
+ return(array());
474
+
475
+ $arrAttributeTitles = $this->getProductAttributeNames($product);
476
+
477
+ //add add to cart links
478
+ foreach($variations as $key=>$arrVariation){
479
+
480
+ $arrVariation = $this->modifyVariationForOutput($arrVariation, $arrAttributeTitles);
481
+
482
+ $variations[$key] = $arrVariation;
483
+ }
484
+
485
+ return($variations);
486
+ }
487
+
488
 
489
  /**
490
  * get product data
595
  $arrKeys[] = "woo_link_addcart_checkout";
596
  $arrKeys[] = "woo_addcart_ajax_attributes";
597
 
 
598
  return($arrKeys);
599
  }
600
 
754
  }
755
 
756
  }
757
+
758
+
759
+
760
+ /**
761
+ * get product ids from current post content
762
+ */
763
+ public function getProductIDsFromCurrentPostContent(){
764
+
765
+ if(is_singular() == false)
766
+ return(false);
767
+
768
+ $post = get_post();
769
+
770
+ if(empty($post))
771
+ return(false);
772
+
773
+ $content = $post->post_content;
774
+
775
+ if(empty($content))
776
+ return(false);
777
+
778
+ $arrLinks = UniteFunctionsUC::parseHTMLGetLinks($content);
779
+
780
+ if(empty($arrLinks))
781
+ return(false);
782
+
783
+ $arrPostIDs = array();
784
+
785
+ foreach($arrLinks as $link){
786
+
787
+ $postID = url_to_postid($link);
788
+
789
+ if(empty($postID))
790
+ continue;
791
+
792
+ $arrPostIDs[] = $postID;
793
+ }
794
+
795
+ return($arrPostIDs);
796
+ }
797
 
798
  }
readme.txt CHANGED
@@ -91,16 +91,17 @@ Fully compatible and integrated with Toolset custom post types and fields.
91
 
92
  <h3>Creative Widgets for Elementor</h3>
93
  <ol>
 
 
 
94
  <li><a href="https://unlimited-elements.com/blob-shape-widget-for-elementor/">Blob Shapes Widget for Elementor (Free)</a> - Create Blob Shapes with animated morphing effects. This free Elementor widget will help you make your images into random, unique, and organic-looking blob shapes. </li>
95
  <li><a href="https://unlimited-elements.com/timeline-bullets-widget-for-elementor/">Timeline Bullets Widget for Elementor (Free)</a> - List your features or services using bullet points in a timeline layout to make it easier for users to read the important information.</li>
96
- <li><a href="https://unlimited-elements.com/animated-hamburger-icon-for-elementor/">Animated Hamburger Icon Widget for Elementor (Free)</a> - Use the animated hamburger icon widget to toggle Elementor pro popus. You can even put a menu in a popup and create a full screen menu.</li>
97
- <li><a href="https://unlimited-elements.com/flip-box-widget-for-elementor/">Flip Box Widget for Elementor (Free)</a> - Make your content more interesting with the Elementor Flip Box widget. Use the animated Flip Boxes to highlight any content inside your page with a flip effect.</li>
98
  <li><a href="https://unlimited-elements.com/image-tooltip-widget-for-elementor/">Image Tooltip Widget for Elementor (Free)</a> - The easiest way to set a tooltip to any Image on the page with a short text description or any HTML code.</li>
99
- <li><a href="https://unlimited-elements.com/material-bullets-widget-for-elementor">Material Bullets Widget for Elementor (Free)</a> - Display feature lists with custom icons and styles. Each list item can have its own icon title and text. Use the bullets widget to display features and highlights on your Elementor website.</li>
100
- <li><a href="https://unlimited-elements.com/number-box-widget-widget-for-elementor/">Number Box Widget for Elementor (Free)</a> - Create stunning number blocks with various styles. The Number Box widget for Elementor helps you display content for step by step diagrams and instructions.</li>
101
  <li><a href="https://unlimited-elements.com/svg-animation-widget-for-elementor">SVG Animation Widget for Elementor (Free)</a> - The SVG animation widget for Elementor makes it easy -to create impressive SVG animations for your websitet, without any coding skills just copy paste your SVG code and your animated icon is ready.</li>
 
102
  <li><a href="https://unlimited-elements.com/animated-mouse-scroll-icon-widget-for-elementor/">Animated Mouse Scroll Icon Widget for Elementor (Free)</a> - The Animated Mouse Scroll Icon is a small micro animation that indicates to user they needs to scroll the page. You can make the icon an anchor point which scroll down to any section when clicked on.
103
  </li>
 
104
  <li><a href="https://unlimited-elements.com/icon-accordion-widget-for-elementor/">Icon Accordion Widget for Elementor (Pro)</a> - Advanced accordion addon for Elementor page builder offers multiple styles to create interactive collapsable content with multiple layouts on your page.</li>
105
  <li><a href="https://unlimited-elements.com/image-shapes-for-elementor-page-builder/">Image Shapes Widget for Elementor (Pro)</a> - The Image Shapes Elementor Widget allows you to make complex shape addons by clipping images using CSS to make various element layouts: circle, ellipse, polygon and more.</li>
106
  <li><a href="https://unlimited-elements.com/image-particle-widget-for-elementor/">Particle Image Widget for Elementor (Pro)</a> - Create a dispersion interactive mouse aware distortion effect for any image using the Particle Image widget for Elementor.</li>
@@ -147,28 +148,36 @@ Fully compatible and integrated with Toolset custom post types and fields.
147
  <h3>Marketing Widgets for Elementor</h3>
148
  <ol>
149
  <li><a href="https://unlimited-elements.com/unlimited-timeline-widget-for-elementor">Unlimited Timeline Widget for Elementor (Free)</a> - Showcase your story or company history in a vertical timeline layout using the powerful Unlimited Timeline addon for Elementor.</li>
150
- <li><a href="https://unlimited-elements.com/timer-countdowns-for-elementor-page-builder/">Timer Countdown Widget for Elementor (Free)</a></li>
151
- <li><a href="https://unlimited-elements.com/review-box-widget-for-elementor">Review Box Widget for Elementor (Free)</a> - Simply create and display reviews on your Elementor website to build customers� trust and increase SEO.</li>
152
- <li><a href="https://unlimited-elements.com/business-hours-widget-for-elementor">Business Hours Widget for Elementor (Free)</a></li>
153
- <li><a href="https://unlimited-elements.com/pricing-table-widget-for-elementor/">Pricing Table Widget for Elementor (Free)</a> - Present the available pricing plans in an easy to read format. Use the Pricing Table widget to help your customers make purchasing decisions.</li>
154
- <li><a href="https://unlimited-elements.com/notification-widget-for-elementor">Notification Widget for Elementor (Free)</a> - The Notification widget enables you to display a colored alert box and draw attention to important messages on your Elementor website.</li>
155
  <li><a href="https://unlimited-elements.com/event-box-widget-for-elementor">Event Box Widget for Elementor (Free)</a> - Showcase events & special occasions on your websites using this unique Elementor addon.</li>
156
- <li><a href="https://unlimited-elements.com/price-list-widget-for-elementor/">Price List Widget for Elementor (Free)</a> - A powerful addon that allows displaying a list of items, products, services or features for your business with easy styling options.</li>
157
- <li><a href="https://unlimited-elements.com/statistic-counters-for-elementor">Counter Widget for Elementor (Free)</a> - Showcasing your business statistics and show fun facts and figures on your Elementor website.</li>
 
 
 
158
  <li><a href="https://unlimited-elements.com/call-to-action-button-widget-for-elementor/">Call To Action Button Widget for Elementor (Free)</a> - The Call to Action Button Widget is a tool for creating beautiful buttons that combine an icon, some text, and message notification.</li>
159
- <li><a href="https://unlimited-elements.com/timer-countdown-banner-widget-for-elementor">Timer Countdown Banner Widget for Elementor (Pro)</a></li>
160
- <li><a href="https://unlimited-elements.com/card-testimonial-review-carousel-widget-for-elementor">Review Carousel Widget for Elementor (Pro)</a></li>
161
- <li><a href="https://unlimited-elements.com/list-marquee-widget-for-elementor/">List Marquee Widget for Elementor (Pro)</a></li>
162
- <li><a href="https://unlimited-elements.com/pricing-flip-box-widget-for-elementor/">Pricing Table Flip Box Widget for Elementor (Pro)</a></li>
163
- <li><a href="https://unlimited-elements.com/event-list-widget-for-elementor/">Event List Widget for Elementor (Pro)</a></li>
164
- <li><a href="https://unlimited-elements.com/mobile-conversion-menu-for-elementor">Mobile Conversion Menu Widget for Elementor (Pro)</a> - Floating action buttons that display the primary actions in your Elementor website. Provide quick access to social icons or any important or common actions to increase conversions.</li>
165
- <li><a href="https://unlimited-elements.com/price-box-widget-for-elementor/">Price Box Widget for Elementor (Pro)</a></li>
166
- <li><a href="https://unlimited-elements.com/icon-mobile-menu-for-elementor">Icon Mobile Menu Widget for Elementor (Pro)</a> - A perfect way to add an icon menu for making your CTA buttons stand out for website visitors using mobile devices.</li>
167
- <li><a href="https://unlimited-elements.com/whatsapp-chat-widget-for-elementor">Whatsapp Chat Widget for Elementor (Pro)</a> - A floating WhatsApp button that allows your website visitors to start a chat conversation from your website directly to your WhatsApp phone number with just one click.</li>
168
  <li><a href="https://unlimited-elements.com/product-bullets-widget-for-elementor">Product Bullets Widget for Elementor (Pro)</a></li>
169
  <li><a href="https://unlimited-elements.com/two-column-product-bullets-widget-for-elementor/">Product Highlights Widget for Elementor (Pro)</a> - Design a visually attractive product feature lists that will help your potential buyers to make purchase decision and learn more about your products. </li>
 
 
170
  <li><a href="https://unlimited-elements.com/step-process-widget-for-elementor">Step Process Widget for Elementor (Pro)</a> - Showcase process/steps with unique layout variations. Create visual diagrams of step by step instructions to simplify processes to your website visitors.</li>
171
- <li><a href="https://unlimited-elements.com/copy-coupon-code-widget-for-elementor">Copy Coupon Code Widget for Elementor (Pro)</a></li>
 
 
 
 
 
 
 
 
 
 
172
  </ol>
173
 
174
  <h3>Woocommerce for Elementor</h3>
@@ -226,11 +235,11 @@ https://github.com/ykob/shape-overlays</li>
226
  <li><a href="https://unlimited-elements.com/coverflow-carousel-widget-for-elementor/">Coverflow Carousel Widget for Elementor (Pro)</a></li>
227
  <li><a href="https://unlimited-elements.com/icon-carousel-widget-for-elementor/">Icon Carousel Widget for Elementor (Pro)</a></li>
228
  <li><a href="https://unlimited-elements.com/image-card-carousel-widget-for-elementor">Image Card Carousel Widget for Elementor (Pro)</a></li>
229
- <li><a href="https://unlimited-elements.com/justified-image-carousel-widget-for-elementor/">Justified Image Carousel Widget for Elementor (Pro)</a></li>
230
  <li><a href="https://unlimited-elements.com/material-carousel-widget-for-elementor/">Material Carousel Widget for Elementor (Pro)</a></li>
231
  <li><a href="https://unlimited-elements.com/overlay-carousel-widget-for-elementor">Overlay Carousel Widget for Elementor (Pro)</a></li>
232
  <li><a href="https://unlimited-elements.com/swipe-css-carousel-widget-for-elementor/">Swipe Carousel Widget for Elementor (Pro)</a></li>
233
  <li><a href="https://unlimited-elements.com/portfolio-carousel-widget-for-elementor/">Portfolio Carousel Widget for Elementor (Pro)</a></li>
 
234
  </ol>
235
 
236
  <h3>Slider Widgets for Elementor</h3>
@@ -325,7 +334,6 @@ https://github.com/ykob/shape-overlays</li>
325
  <ol>
326
  <li><a href="https://unlimited-elements.com/content-tabs-widget-for-elementor/">Content Tabs Widget for Elementor (Free)</a></li>
327
  <li><a href="https://unlimited-elements.com/content-accordion-widget-for-elementor/">Content Accordion Widget for Elementor (Free)</a></li>
328
- <li><a href="https://unlimited-elements.com/content-timeline-widget-for-elementor/">Content Timeline Widget for Elementor (Free)</a></li>
329
  <li><a href="https://unlimited-elements.com/content-carousel-widget-for-elementor/">Content Carousel Widget for Elementor (Pro)</a></li>
330
  <li><a href="https://unlimited-elements.com/content-grid-widget-for-elementor/">Content Grid Widget for Elementor (Pro)</a></li>
331
  <li><a href="https://unlimited-elements.com/content-ticker-widget-for-elementor/">Content Ticker Widget for Elementor (Pro)</a></li>
@@ -388,16 +396,6 @@ https://github.com/ykob/shape-overlays</li>
388
  <li><a href="https://unlimited-elements.com/block-quote-slider-widget-for-elementor">Block Quote Slider Widget for Elementor (Pro)</a></li>
389
  </ol>
390
 
391
- <h3>Product Boxes for Elementor</h3>
392
- <ol>
393
- <li><a href="https://unlimited-elements.com/price-label-product-box-widget-for-elementor/">Product Box Widget for Elementor (Free)</a></li>
394
- <li><a href="https://unlimited-elements.com/overlay-product-box-widget-for-elementor/">Overlay Product Box Widget for Elementor (Free)</a></li>
395
- <li><a href="https://unlimited-elements.com/diagonal-product-box-widget-for-elementor">Diagonal Product Box Widget for Elementor (Free)</a></li>
396
- <li><a href="https://unlimited-elements.com/slide-up-product-box-widget-for-elementor">Slide Up Product Box Widget for Elementor (Pro)</a></li>
397
- <li><a href="https://unlimited-elements.com/button-overlay-product-box-widget-for-elementor">Button Overlay Product Box Widget for Elementor (Pro)</a></li>
398
- <li><a href="https://unlimited-elements.com/overlay-slide-product-box-widget-for-elementor">Overlay Slide Product Box Widget for Elementor (Pro)</a></li>
399
- </ol>
400
-
401
  <h3>Social Network Icons for Elementor</h3>
402
  <ol>
403
  <li><a href="https://unlimited-elements.com/glare-social-icons-widget-for-elementor/">Social Icons Glare Effect Widget for Elementor (Free)</a></li>
@@ -446,14 +444,6 @@ https://github.com/ykob/shape-overlays</li>
446
  <li><a href="https://unlimited-elements.com/solid-color-hero-widget-for-elementor">Solid Color Hero Widget for Elementor (Pro)</a></li>
447
  </ol>
448
 
449
- <h3>Restaurant Widgets for Elementor</h3>
450
- <ol>
451
- <li><a href="http://unlimited-elements.com/food-menu-box-widget-for-elementor/">Food Menu Box Widget for Elementor (Free)</a></li>
452
- <li><a href="https://unlimited-elements.com/food-menu-widget-for-elementor/">Food Menu Widget for Elementor (Pro)</a></li>
453
- <li><a href="https://unlimited-elements.com/food-menu-list-widget-for-elementor">Food Menu List Widget for Elementor (Pro)</a></li>
454
- <li><a href="https://unlimited-elements.com/food-menu-carousel-widget-for-elementor">Food Menu Carousel Widget for Elementor (Pro)</a></li>
455
- </ol>
456
-
457
 
458
 
459
  == Installation ==
@@ -466,6 +456,69 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
466
 
467
  == Changelog ==
468
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  version 1.4.80 = 2021-08-09:
470
 
471
  * Feature: added option to change items section label
91
 
92
  <h3>Creative Widgets for Elementor</h3>
93
  <ol>
94
+ <li><a href="https://unlimited-elements.com/lordicon-animated-icons-widget-for-elementor/">Lordicon: Animated Icons Widget for Elementor (Free)</a> - The most powerful animated icon library with 1500+ free and premium animated Lottie animations.</li>
95
+ <li><a href="https://unlimited-elements.com/material-bullets-widget-for-elementor">Material Bullets Widget for Elementor (Free)</a> - Display feature lists with custom icons and styles. Each list item can have its own icon title and text. Use the bullets widget to display features and highlights on your Elementor website.</li>
96
+ <li><a href="https://unlimited-elements.com/animated-hamburger-icon-for-elementor/">Animated Hamburger Icon Widget for Elementor (Free)</a> - Use the animated hamburger icon widget to toggle Elementor pro popus. You can even put a menu in a popup and create a full screen menu.</li>
97
  <li><a href="https://unlimited-elements.com/blob-shape-widget-for-elementor/">Blob Shapes Widget for Elementor (Free)</a> - Create Blob Shapes with animated morphing effects. This free Elementor widget will help you make your images into random, unique, and organic-looking blob shapes. </li>
98
  <li><a href="https://unlimited-elements.com/timeline-bullets-widget-for-elementor/">Timeline Bullets Widget for Elementor (Free)</a> - List your features or services using bullet points in a timeline layout to make it easier for users to read the important information.</li>
 
 
99
  <li><a href="https://unlimited-elements.com/image-tooltip-widget-for-elementor/">Image Tooltip Widget for Elementor (Free)</a> - The easiest way to set a tooltip to any Image on the page with a short text description or any HTML code.</li>
 
 
100
  <li><a href="https://unlimited-elements.com/svg-animation-widget-for-elementor">SVG Animation Widget for Elementor (Free)</a> - The SVG animation widget for Elementor makes it easy -to create impressive SVG animations for your websitet, without any coding skills just copy paste your SVG code and your animated icon is ready.</li>
101
+ <li><a href="https://unlimited-elements.com/flip-box-widget-for-elementor/">Flip Box Widget for Elementor (Free)</a> - Make your content more interesting with the Elementor Flip Box widget. Use the animated Flip Boxes to highlight any content inside your page with a flip effect.</li>
102
  <li><a href="https://unlimited-elements.com/animated-mouse-scroll-icon-widget-for-elementor/">Animated Mouse Scroll Icon Widget for Elementor (Free)</a> - The Animated Mouse Scroll Icon is a small micro animation that indicates to user they needs to scroll the page. You can make the icon an anchor point which scroll down to any section when clicked on.
103
  </li>
104
+ <li><a href="https://unlimited-elements.com/number-box-widget-widget-for-elementor/">Number Box Widget for Elementor (Free)</a> - Create stunning number blocks with various styles. The Number Box widget for Elementor helps you display content for step by step diagrams and instructions.</li>
105
  <li><a href="https://unlimited-elements.com/icon-accordion-widget-for-elementor/">Icon Accordion Widget for Elementor (Pro)</a> - Advanced accordion addon for Elementor page builder offers multiple styles to create interactive collapsable content with multiple layouts on your page.</li>
106
  <li><a href="https://unlimited-elements.com/image-shapes-for-elementor-page-builder/">Image Shapes Widget for Elementor (Pro)</a> - The Image Shapes Elementor Widget allows you to make complex shape addons by clipping images using CSS to make various element layouts: circle, ellipse, polygon and more.</li>
107
  <li><a href="https://unlimited-elements.com/image-particle-widget-for-elementor/">Particle Image Widget for Elementor (Pro)</a> - Create a dispersion interactive mouse aware distortion effect for any image using the Particle Image widget for Elementor.</li>
148
  <h3>Marketing Widgets for Elementor</h3>
149
  <ol>
150
  <li><a href="https://unlimited-elements.com/unlimited-timeline-widget-for-elementor">Unlimited Timeline Widget for Elementor (Free)</a> - Showcase your story or company history in a vertical timeline layout using the powerful Unlimited Timeline addon for Elementor.</li>
 
 
 
 
 
151
  <li><a href="https://unlimited-elements.com/event-box-widget-for-elementor">Event Box Widget for Elementor (Free)</a> - Showcase events & special occasions on your websites using this unique Elementor addon.</li>
152
+ <li><a href="https://unlimited-elements.com/overlay-product-box-widget-for-elementor/">Overlay Product Box Widget for Elementor (Free)</a></li>
153
+ <li><a href="https://unlimited-elements.com/business-hours-widget-for-elementor">Business Hours Widget for Elementor (Free)</a></li>
154
+ <li><a href="https://unlimited-elements.com/timer-countdowns-for-elementor-page-builder/">Timer Countdown Widget for Elementor (Free)</a> - Instantly create a beautiful, animated countdown clock addon, to share on your Elementor website. Count down to a date with your own unique timer.
155
+
156
+ </li>
157
  <li><a href="https://unlimited-elements.com/call-to-action-button-widget-for-elementor/">Call To Action Button Widget for Elementor (Free)</a> - The Call to Action Button Widget is a tool for creating beautiful buttons that combine an icon, some text, and message notification.</li>
158
+ <li><a href="https://unlimited-elements.com/statistic-counters-for-elementor">Counter Widget for Elementor (Free)</a> - Showcasing your business statistics and show fun facts and figures on your Elementor website.</li>
159
+ <li><a href="https://unlimited-elements.com/price-list-widget-for-elementor/">Price List Widget for Elementor (Free)</a> - A powerful addon that allows displaying a list of items, products, services or features for your business with easy styling options.</li>
160
+ <li><a href="https://unlimited-elements.com/price-label-product-box-widget-for-elementor/">Product Box Widget for Elementor (Free)</a></li>
161
+ <li><a href="https://unlimited-elements.com/notification-widget-for-elementor">Notification Widget for Elementor (Free)</a> - The Notification widget enables you to display a colored alert box and draw attention to important messages on your Elementor website.</li>
162
+ <li><a href="https://unlimited-elements.com/review-box-widget-for-elementor">Review Box Widget for Elementor (Free)</a> - Simply create and display reviews on your Elementor website to build customers� trust and increase SEO.</li>
163
+ <li><a href="http://unlimited-elements.com/food-menu-box-widget-for-elementor/">Product Card Widget for Elementor (Free)</a></li>
164
+ <li><a href="https://unlimited-elements.com/pricing-table-widget-for-elementor/">Pricing Table Widget for Elementor (Free)</a> - Present the available pricing plans in an easy to read format. Use the Pricing Table widget to help your customers make purchasing decisions.</li>
 
 
165
  <li><a href="https://unlimited-elements.com/product-bullets-widget-for-elementor">Product Bullets Widget for Elementor (Pro)</a></li>
166
  <li><a href="https://unlimited-elements.com/two-column-product-bullets-widget-for-elementor/">Product Highlights Widget for Elementor (Pro)</a> - Design a visually attractive product feature lists that will help your potential buyers to make purchase decision and learn more about your products. </li>
167
+ <li><a href="https://unlimited-elements.com/whatsapp-chat-widget-for-elementor">Whatsapp Chat Widget for Elementor (Pro)</a> - A floating WhatsApp button that allows your website visitors to start a chat conversation from your website directly to your WhatsApp phone number with just one click.</li>
168
+ <li><a href="https://unlimited-elements.com/icon-mobile-menu-for-elementor">Icon Mobile Menu Widget for Elementor (Pro)</a> - A perfect way to add an icon menu for making your CTA buttons stand out for website visitors using mobile devices.</li>
169
  <li><a href="https://unlimited-elements.com/step-process-widget-for-elementor">Step Process Widget for Elementor (Pro)</a> - Showcase process/steps with unique layout variations. Create visual diagrams of step by step instructions to simplify processes to your website visitors.</li>
170
+ <li><a href="https://unlimited-elements.com/price-box-widget-for-elementor/">Price Box Widget for Elementor (Pro)</a></li>
171
+ <li><a href="https://unlimited-elements.com/food-menu-carousel-widget-for-elementor">Product Carousel Widget for Elementor (Pro)</a></li>
172
+ <li><a href="https://unlimited-elements.com/event-list-widget-for-elementor/">Event List Widget for Elementor (Pro)</a> - The event list widget is a way to easily show your recent events like concerts, conferences, parties or special occasions.
173
+ </li>
174
+ <li><a href="https://unlimited-elements.com/pricing-flip-box-widget-for-elementor/">Pricing Table Flip Box Widget for Elementor (Pro)</a> - The Pricing Table Flip Box allows you to showcase the prices for your products, services, or packages in a beautiful flip box pricing table.</li>
175
+ <li><a href="https://unlimited-elements.com/list-marquee-widget-for-elementor/">List Marquee Widget for Elementor (Pro)</a></li>
176
+ <li><a href="https://unlimited-elements.com/card-testimonial-review-carousel-widget-for-elementor">Review Carousel Widget for Elementor (Pro)</a> - The Reviews Carousel increases the visibility reviews you want to highlight to your users by letting you display them throughout your site in an interactive carousel format. </li>
177
+ <li><a href="https://unlimited-elements.com/timer-countdown-banner-widget-for-elementor">Timer Countdown Banner Widget for Elementor (Pro)</a> - An awesome countdown banner with a a call to action button.</li>
178
+ <li><a href="https://unlimited-elements.com/google-maps-widget-for-elementor">Unlimited Google Maps Widget for Elementor (Pro)</a></li>
179
+ <li><a href="https://unlimited-elements.com/copy-coupon-code-widget-for-elementor">Copy Coupon Code Widget for Elementor (Pro)</a> - Click to copy coupon code to the clipboard. This widgets makes it easy for users to redeem your promotions coupon codes.</li>
180
+ <li><a href="https://unlimited-elements.com/mobile-conversion-menu-for-elementor">Mobile Conversion Menu Widget for Elementor (Pro)</a> - Floating action buttons that display the primary actions in your Elementor website. Provide quick access to social icons or any important or common actions to increase conversions.</li>
181
  </ol>
182
 
183
  <h3>Woocommerce for Elementor</h3>
235
  <li><a href="https://unlimited-elements.com/coverflow-carousel-widget-for-elementor/">Coverflow Carousel Widget for Elementor (Pro)</a></li>
236
  <li><a href="https://unlimited-elements.com/icon-carousel-widget-for-elementor/">Icon Carousel Widget for Elementor (Pro)</a></li>
237
  <li><a href="https://unlimited-elements.com/image-card-carousel-widget-for-elementor">Image Card Carousel Widget for Elementor (Pro)</a></li>
 
238
  <li><a href="https://unlimited-elements.com/material-carousel-widget-for-elementor/">Material Carousel Widget for Elementor (Pro)</a></li>
239
  <li><a href="https://unlimited-elements.com/overlay-carousel-widget-for-elementor">Overlay Carousel Widget for Elementor (Pro)</a></li>
240
  <li><a href="https://unlimited-elements.com/swipe-css-carousel-widget-for-elementor/">Swipe Carousel Widget for Elementor (Pro)</a></li>
241
  <li><a href="https://unlimited-elements.com/portfolio-carousel-widget-for-elementor/">Portfolio Carousel Widget for Elementor (Pro)</a></li>
242
+ <li><a href="https://unlimited-elements.com/justified-image-carousel-widget-for-elementor/">Justified Image Carousel Widget for Elementor (Pro)</a></li>
243
  </ol>
244
 
245
  <h3>Slider Widgets for Elementor</h3>
334
  <ol>
335
  <li><a href="https://unlimited-elements.com/content-tabs-widget-for-elementor/">Content Tabs Widget for Elementor (Free)</a></li>
336
  <li><a href="https://unlimited-elements.com/content-accordion-widget-for-elementor/">Content Accordion Widget for Elementor (Free)</a></li>
 
337
  <li><a href="https://unlimited-elements.com/content-carousel-widget-for-elementor/">Content Carousel Widget for Elementor (Pro)</a></li>
338
  <li><a href="https://unlimited-elements.com/content-grid-widget-for-elementor/">Content Grid Widget for Elementor (Pro)</a></li>
339
  <li><a href="https://unlimited-elements.com/content-ticker-widget-for-elementor/">Content Ticker Widget for Elementor (Pro)</a></li>
396
  <li><a href="https://unlimited-elements.com/block-quote-slider-widget-for-elementor">Block Quote Slider Widget for Elementor (Pro)</a></li>
397
  </ol>
398
 
 
 
 
 
 
 
 
 
 
 
399
  <h3>Social Network Icons for Elementor</h3>
400
  <ol>
401
  <li><a href="https://unlimited-elements.com/glare-social-icons-widget-for-elementor/">Social Icons Glare Effect Widget for Elementor (Free)</a></li>
444
  <li><a href="https://unlimited-elements.com/solid-color-hero-widget-for-elementor">Solid Color Hero Widget for Elementor (Pro)</a></li>
445
  </ol>
446
 
 
 
 
 
 
 
 
 
447
 
448
 
449
  == Installation ==
456
 
457
  == Changelog ==
458
 
459
+ version 1.4.85 = 2021-10-13:
460
+
461
+ -bug fix: small bug fix - headers sent bug
462
+
463
+ version 1.4.84 = 2021-10-13:
464
+
465
+ -Feature: added taxonomy terms full query debug option
466
+ -Feature: improved full debug type in posts query
467
+ -Feature: added items support in editor->background switcher
468
+ -Feature: added support for remote controls
469
+ -Feature: functionality to posts load more
470
+ -Feature: added second condition
471
+ -Feature: added tabs functionality to attributes
472
+ -Addition: added %,px to slider units
473
+ -Fix: fixed avoid duplicates related bug
474
+ -Fix: fixed conflicting wordpress codemirror script
475
+ -Fix: fixed post selection values init from editor
476
+ -Fix: fixed pagination on front page
477
+ -Fix: fixed some polylang related bugs
478
+
479
+
480
+ version 1.4.83 = 2021-09-22:
481
+
482
+ -Fix: fixed styles mishmash inside elementor editor navigator
483
+ -Fix: fixed dissapearing carousels after refresh bug
484
+ -Fix: fixed dynamic grid pagination not changed
485
+
486
+
487
+ version 1.4.82 = 2021-09-20:
488
+
489
+ -Feature: added troubleshooting setting - show php error message
490
+ -Feature: added px, vh, % options for slider attribute
491
+ -Feature: added dynamic group attributes for galleries, including image and video
492
+ -Feature: added option to convert one date string to another with ucdate filter
493
+ -Feature: added option to use items in background widgets
494
+ -Feature: added ucfunc("set") and ucfunc("get") functions in twig for remember and retrieve variables
495
+ -Feature: added include by option: "children of current term" to category selection options
496
+ -Feature: added option to pull woo product variations in twig
497
+ -Feature: added placeholder: link_withprefix, link_noprefix for link attribute
498
+ -Fix: fixed error when exists dynamic link in dynamic loop widgets
499
+ -Fix: enabled pagination in a single type in dynamic template grid
500
+ -Fix: the "not equal" attributes condition now works
501
+ -Fix: fixed not editable empty dropdown attribute in widget editor
502
+ -Fix: fixed mb_string absence php bug
503
+ -Fix: fixed heading attribute label
504
+ -Fix: fixed responsive elementor controls in widget items
505
+
506
+
507
+
508
+ version 1.4.81 = 2021-08-17:
509
+
510
+ * Feature: added json select (lottie) for image attribute type
511
+ * Feature: made option for ajax in widgets with post list attribute
512
+ * Feature: made the ajax pagination work with pagination widget
513
+ * Feature: added dynamic options for number and slider attribute types
514
+ * Feature: added new owl carousel sources in assets chooser
515
+ * Feature: added heading attribute
516
+ * Change: added more types of debug for pagination widget
517
+ * Change: changed widget icons chooser for elementor icon instead of font awesome icon
518
+ * Fix: fixed import with template button dissapear in the new bar
519
+ * Fix: fixed widgets icons
520
+
521
+
522
  version 1.4.80 = 2021-08-09:
523
 
524
  * Feature: added option to change items section label
release_log.txt CHANGED
@@ -1,4 +1,66 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  version 1.4.80:
4
 
@@ -13,6 +75,7 @@ version 1.4.80:
13
  -feature: added extra fields to image base gallery options
14
  -feature: added php filter option for variable
15
  -feature: added twig functions "get_post_term" and "is_post_has_term". The examples visible when you click on item.posts.putPostTerm placeholder
 
16
  -bug fix: fixed template dynamic background image didn't displayed bug in dynamic loops
17
 
18
 
1
 
2
+ version 1.4.84:
3
+
4
+ -bug fix: fixed conflicting wordpress codemirror script
5
+ -feature: added taxonomy terms full query debug option
6
+ -feature: improved full debug type in posts query
7
+ -bug fix: fixed avoid duplicates related bug
8
+ -feature: added items support in editor->background switcher
9
+ -addition: added %,px to slider units
10
+ -feature: added support for remote controls
11
+ -bug fix: fixed post selection values init from editor
12
+ -bug fix: fixed post selection values init from editor
13
+ -bug fix: fixed pagination on front page
14
+ -bug fix: fixed some polylang related bugs
15
+ -feature: functionality to posts load more
16
+ -feature: added second condition
17
+ -feature: added tabs functionality to attributes
18
+ -feature: added functionality for connected widgets
19
+
20
+
21
+ version 1.4.83:
22
+
23
+ -bug fix: fixed styles mishmash inside elementor editor navigator
24
+ -bug fix: fixed dissapearing carousels after refresh bug
25
+ -bug fix: fixed dynamic grid pagination not changed
26
+
27
+
28
+ version 1.4.82:
29
+
30
+ -feature: added troubleshooting setting - show php error message
31
+ -bug fix: fixed mb_string absence php bug
32
+ -bug fix: fixed heading attribute label
33
+ -bug fix: fixed responsive elementor controls in widget items
34
+ -feature: added px, vh, % options for slider attribute
35
+ -feature: added dynamic group attributes for galleries, including image and video
36
+ -feature: added option to convert one date string to another with ucdate filter
37
+ -feature: added option to use items in background widgets
38
+ -feature: added ucfunc("set") and ucfunc("get") functions in twig for remember and retrieve variables
39
+ -feature: added include by option: "children of current term" to category selection options
40
+ -feature: added option to pull woo product variations in twig
41
+ -bug fix: fixed error when exists dynamic link in dynamic loop widgets
42
+ -bug fix: enabled pagination in a single type in dynamic template grid
43
+ -feature: added placeholder: link_withprefix, link_noprefix for link attribute
44
+ -bug fix: the "not equal" attributes condition now works
45
+ -bug fix: fixed not editable empty dropdown attribute in widget editor
46
+
47
+
48
+
49
+
50
+ version 1.4.81:
51
+
52
+ -feature: added json select (lottie) for image attribute type
53
+ -feature: made option for ajax in widgets with post list attribute
54
+ -feature: made the ajax pagination work with pagination widget
55
+ -change: added more types of debug for pagination widget
56
+ -bug fix: fixed import with template button dissapear in the new bar
57
+ -bug fix: fixed widgets icons
58
+ -change: changed widget icons chooser for elementor icon instead of font awesome icon
59
+ -feature: added dynamic options for number and slider attribute types
60
+ -feature: added new owl carousel sources in assets chooser
61
+ -feature: added heading attribute
62
+
63
+
64
 
65
  version 1.4.80:
66
 
75
  -feature: added extra fields to image base gallery options
76
  -feature: added php filter option for variable
77
  -feature: added twig functions "get_post_term" and "is_post_has_term". The examples visible when you click on item.posts.putPostTerm placeholder
78
+ -feature: added current_user_id to include by meta field in post query selector
79
  -bug fix: fixed template dynamic background image didn't displayed bug in dynamic loops
80
 
81
 
settings/addon_fields.xml CHANGED
@@ -6,6 +6,7 @@
6
  <field name="addon_icon"
7
  type="icon"
8
  default=""
 
9
  label="Icon"
10
  description="The Icon that will be shown on Elementor Panel. If not set, it will show category default icon">
11
  </field>
6
  <field name="addon_icon"
7
  type="icon"
8
  default=""
9
+ icons_type = "elementor"
10
  label="Icon"
11
  description="The Icon that will be shown on Elementor Panel. If not set, it will show category default icon">
12
  </field>
settings/library.xml CHANGED
@@ -5,12 +5,12 @@
5
  <include handle="jquery" local="jquery-1.11.1.min.js"></include>
6
  </js>
7
  </item>
8
- <item name="mootools" title="Mootools">
9
  <js>
10
- <include handle="mootools" local="MooTools-Core-1.5.2.js"></include>
11
  </js>
12
  </item>
13
- <item name="font-awsome" title="Font Awsome">
14
  <css>
15
  <include handle="font-awesome" local="font-awsome/css/font-awesome.min.css" condition="fa4"></include>
16
  <include handle="font-awesome" local="font-awesome5/css/fontawesome-all.min.css" condition="fa5"></include>
@@ -26,6 +26,14 @@
26
  <include handle="owl-carousel" local="owl-carousel/owl.carousel.min.js"></include>
27
  </js>
28
  </item>
 
 
 
 
 
 
 
 
29
  <item name="bxslider" title="BX-Slider">
30
  <css>
31
  <include handle="bx-slider" local="bxslider/jquery.bxslider.min.css"></include>
5
  <include handle="jquery" local="jquery-1.11.1.min.js"></include>
6
  </js>
7
  </item>
8
+ <item name="mootools" title="Mootools" hidden="true">
9
  <js>
10
+ <include handle="mootools" hidden="true" local="MooTools-Core-1.5.2.js"></include>
11
  </js>
12
  </item>
13
+ <item name="font-awsome" title="Font Awesome">
14
  <css>
15
  <include handle="font-awesome" local="font-awsome/css/font-awesome.min.css" condition="fa4"></include>
16
  <include handle="font-awesome" local="font-awesome5/css/fontawesome-all.min.css" condition="fa5"></include>
26
  <include handle="owl-carousel" local="owl-carousel/owl.carousel.min.js"></include>
27
  </js>
28
  </item>
29
+ <item name="owl-carousel-new" title="Owl Carousel New">
30
+ <css>
31
+ <include handle="owl-carousel" local="owl-carousel-new/assets/owl.carousel.css"></include>
32
+ </css>
33
+ <js>
34
+ <include handle="owl-carousel" local="owl-carousel-new/owl.carousel.min.js"></include>
35
+ </js>
36
+ </item>
37
  <item name="bxslider" title="BX-Slider">
38
  <css>
39
  <include handle="bx-slider" local="bxslider/jquery.bxslider.min.css"></include>
unitecreator_admin.php CHANGED
@@ -129,6 +129,12 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
129
  HelperUC::addScript("unitecreator_params_panel", "unitecreator_params_panel");
130
  HelperUC::addScript("unitecreator_variables", "unitecreator_variables");
131
  HelperUC::addScript("unitecreator_admin", "unitecreator_view_admin");
 
 
 
 
 
 
132
  break;
133
  case GlobalsUC::VIEW_TEST_ADDON:
134
 
@@ -187,7 +193,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
187
  break;
188
 
189
  }
190
-
191
  //provider admin css always comes to end
192
  HelperUC::addStyleAbsoluteUrl(GlobalsUC::$url_provider."assets/provider_admin.css", "provider_admin_css");
193
 
129
  HelperUC::addScript("unitecreator_params_panel", "unitecreator_params_panel");
130
  HelperUC::addScript("unitecreator_variables", "unitecreator_variables");
131
  HelperUC::addScript("unitecreator_admin", "unitecreator_view_admin");
132
+
133
+ //deregister wp scripts that conflicts
134
+
135
+ wp_deregister_script("wp-codemirror");
136
+ wp_deregister_style("wp-codemirror");
137
+
138
  break;
139
  case GlobalsUC::VIEW_TEST_ADDON:
140
 
193
  break;
194
 
195
  }
196
+
197
  //provider admin css always comes to end
198
  HelperUC::addStyleAbsoluteUrl(GlobalsUC::$url_provider."assets/provider_admin.css", "provider_admin_css");
199
 
unlimited_elements.php CHANGED
@@ -4,12 +4,12 @@ Plugin Name: Unlimited Elements for Elementor
4
  Plugin URI: http://unlimited-elements.com
5
  Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
6
  Author: Unlimited Elements
7
- Version: 1.4.80
8
  Author URI: http://unlimited-elements.com
9
  Text Domain: unlimited-elements-for-elementor
10
  Domain Path: /languages
11
- Elementor tested up to: 3.3.1
12
- Elementor Pro tested up to: 3.3.5
13
  */
14
 
15
  if(!defined("UNLIMITED_ELEMENTS_INC"))
4
  Plugin URI: http://unlimited-elements.com
5
  Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
6
  Author: Unlimited Elements
7
+ Version: 1.4.85
8
  Author URI: http://unlimited-elements.com
9
  Text Domain: unlimited-elements-for-elementor
10
  Domain Path: /languages
11
+ Elementor tested up to: 3.4.5
12
+ Elementor Pro tested up to: 3.4.2
13
  */
14
 
15
  if(!defined("UNLIMITED_ELEMENTS_INC"))
views/addondefaults.php CHANGED
@@ -80,6 +80,8 @@ class UniteCreatorAddonDefaultsView{
80
  $this->addonID = $addonID;
81
 
82
  $addon = new UniteCreatorAddon();
 
 
83
  $addon->initByID($addonID);
84
 
85
  $this->addon = $addon;
80
  $this->addonID = $addonID;
81
 
82
  $addon = new UniteCreatorAddon();
83
+ $addon->setOperationType(UniteCreatorAddon::OPERATION_CONFIG);
84
+
85
  $addon->initByID($addonID);
86
 
87
  $this->addon = $addon;
views/objects/addon_view.class.php CHANGED
@@ -19,6 +19,7 @@ class UniteCreatorAddonView{
19
  protected $objAddon;
20
  protected $settingsItemOutput, $settingsJSOutput, $objAddonType, $addonType;
21
  protected $showToolbar = true, $showHeader = true;
 
22
 
23
  //show defenitions
24
  protected $putAllTabs = true, $arrTabsToPut = array();
@@ -225,6 +226,9 @@ class UniteCreatorAddonView{
225
  UniteFunctionsUC::throwError("Widget ID not given");
226
 
227
  $this->objAddon = new UniteCreatorAddon();
 
 
 
228
  $this->objAddon->initByID($addonID);
229
 
230
  $this->addonType = $this->objAddon->getType();
19
  protected $objAddon;
20
  protected $settingsItemOutput, $settingsJSOutput, $objAddonType, $addonType;
21
  protected $showToolbar = true, $showHeader = true;
22
+ protected $addonLocation;
23
 
24
  //show defenitions
25
  protected $putAllTabs = true, $arrTabsToPut = array();
226
  UniteFunctionsUC::throwError("Widget ID not given");
227
 
228
  $this->objAddon = new UniteCreatorAddon();
229
+
230
+ $this->objAddon->setOperationType(UniteCreatorAddon::OPERATION_EDIT);
231
+
232
  $this->objAddon->initByID($addonID);
233
 
234
  $this->addonType = $this->objAddon->getType();
views/objects/addon_view_childparams.class.php CHANGED
@@ -278,8 +278,13 @@ class UniteCreatorAddonViewChildParams{
278
  {# use the ucdate filter to convert timestamps to dates preserving wordpress format#}
279
  {{ your_timestamp|ucdate(\"m/d/Y\") }}
280
 
 
 
 
 
281
  {# to show data from - to range like 4-5 Mar 2021 use this function#}
282
  {{ucfunc(\"put_date_range\",1617187095,1619187095)}}
 
283
  ";
284
 
285
  $arrParams[] = $this->createChildParam_code($key, $text);
@@ -356,6 +361,19 @@ class UniteCreatorAddonViewChildParams{
356
  ";
357
 
358
  $arrParams[] = $this->createChildParam_code($key, $text);
 
 
 
 
 
 
 
 
 
 
 
 
 
359
 
360
 
361
  //----- output ------
@@ -871,6 +889,36 @@ function {{uc_id}}_start(){
871
 
872
  return($arrParam);
873
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
874
 
875
 
876
  /**
@@ -889,6 +937,7 @@ function {{uc_id}}_start(){
889
  return($arrParams);
890
 
891
  $arrParams[] = $this->createWooPostParam_getChildProducts();
 
892
 
893
  foreach($arrKeys as $key){
894
 
@@ -1226,7 +1275,7 @@ function {{uc_id}}_start(){
1226
  * add listing child param
1227
  */
1228
  public function getAddParams_listing(){
1229
-
1230
  $arrParams = array();
1231
 
1232
  $strCode = "
@@ -1267,6 +1316,8 @@ function {{uc_id}}_start(){
1267
 
1268
  $arrParams[] = $this->createAddParam();
1269
  $arrParams[] = $this->createAddParam("html_attributes|raw");
 
 
1270
 
1271
  return($arrParams);
1272
  }
278
  {# use the ucdate filter to convert timestamps to dates preserving wordpress format#}
279
  {{ your_timestamp|ucdate(\"m/d/Y\") }}
280
 
281
+ {# also, use the ucdate filter to convert strings from one format to another #}
282
+ {{ your_date_string|ucdate(\"m/d/Y\",\"d-m-Y\") }}
283
+
284
+
285
  {# to show data from - to range like 4-5 Mar 2021 use this function#}
286
  {{ucfunc(\"put_date_range\",1617187095,1619187095)}}
287
+
288
  ";
289
 
290
  $arrParams[] = $this->createChildParam_code($key, $text);
361
  ";
362
 
363
  $arrParams[] = $this->createChildParam_code($key, $text);
364
+
365
+ //----- set and get ------
366
+
367
+ $key = "set(), get()";
368
+ $text = "
369
+ {# remember variable in html editor, and use it in other editors, via get #}
370
+
371
+ {{ ucfunc(\"set\",\"my-var\", var) }}
372
+
373
+ {% set var2 = ucfunc(\"get\",\"my-var\") %}
374
+ ";
375
+
376
+ $arrParams[] = $this->createChildParam_code($key, $text);
377
 
378
 
379
  //----- output ------
889
 
890
  return($arrParam);
891
  }
892
+
893
+ /**
894
+ * create add child products param
895
+ */
896
+ private function createWooPostParam_putVariations(){
897
+
898
+ $strCode = "";
899
+ $strCode .= "{# The variations exists only at variable products #}\n\n";
900
+
901
+ $strCode .= "{% set variations = ucfunc(\"get_wc_variations\",[param_prefix].id) %}\n\n";
902
+
903
+ $strCode .= "{% for variation in variations %}\n\n";
904
+
905
+ $strCode .= " Title: <b>{{ variation.title }}</b> <br>\n\n";
906
+ $strCode .= " Title key for rename: <b>{{ variation.title_key }}</b><br>\n\n";
907
+ $strCode .= " Title parts for self combine: {{ printVar(variation.title_parts) }}<br>\n\n";
908
+ $strCode .= " Price Html: {{variation.price_html|raw}}<br>\n\n";
909
+ $strCode .= " Sku: <b>{{variation.sku}}</b><br>\n\n";
910
+ $strCode .= " ID: <b>{{variation.variation_id}}</b><br>\n\n";
911
+ $strCode .= " Link add to cart: {{variation.link_addcart_cart}}<br>\n\n";
912
+
913
+ $strCode .= " {# For other fields please look at output of this function #}<br>\n ";
914
+ $strCode .= " {{ printVar(variation) }} <br>\n\n ";
915
+
916
+ $strCode .= "{% endfor %}\n";
917
+
918
+ $arrParam = $this->createChildParam("putWooVariations", null, array("raw_insert_text"=>$strCode));
919
+
920
+ return($arrParam);
921
+ }
922
 
923
 
924
  /**
937
  return($arrParams);
938
 
939
  $arrParams[] = $this->createWooPostParam_getChildProducts();
940
+ $arrParams[] = $this->createWooPostParam_putVariations();
941
 
942
  foreach($arrKeys as $key){
943
 
1275
  * add listing child param
1276
  */
1277
  public function getAddParams_listing(){
1278
+
1279
  $arrParams = array();
1280
 
1281
  $strCode = "
1316
 
1317
  $arrParams[] = $this->createAddParam();
1318
  $arrParams[] = $this->createAddParam("html_attributes|raw");
1319
+ $arrParams[] = $this->createAddParam("withprefix");
1320
+ $arrParams[] = $this->createAddParam("noprefix");
1321
 
1322
  return($arrParams);
1323
  }
views/test_settings.php CHANGED
@@ -15,10 +15,12 @@ $data["term"] = "a";
15
  $data["q"] = "a";
16
  $data["_type"] = "query";
17
 
 
 
18
 
19
- //$response = $operations->getTermsListForSelectFromData($data);
20
-
21
- //dmp($response);
22
  exit();
23
 
24
  //$font = new UniteFontManagerUC();
15
  $data["q"] = "a";
16
  $data["_type"] = "query";
17
 
18
+ /*
19
+ dmp("test settings");
20
 
21
+ $manager = new UniteFontManagerUC();
22
+ $manager->fetchIcons();
23
+ */
24
  exit();
25
 
26
  //$font = new UniteFontManagerUC();