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

Version Description

Download this release

Release Info

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

Code changes from version 1.4.81 to 1.4.80

Files changed (37) hide show
  1. assets_libraries/filters/ue_filters.js +111 -705
  2. assets_libraries/owl-carousel-new/assets/owl.carousel.css +0 -186
  3. assets_libraries/owl-carousel-new/owl.carousel.js +0 -3448
  4. assets_libraries/owl-carousel-new/owl.carousel.min.js +0 -7
  5. inc_php/framework/font_manager.class.php +5 -42
  6. inc_php/framework/functions.class.php +0 -32
  7. inc_php/framework/settings.class.php +1 -5
  8. inc_php/unitecreator_dialog_param.class.php +9 -63
  9. inc_php/unitecreator_filters_process.class.php +32 -209
  10. inc_php/unitecreator_helperhtml.class.php +1 -7
  11. inc_php/unitecreator_output.class.php +1 -15
  12. inc_php/unitecreator_params_processor.class.php +3 -70
  13. inc_php/unitecreator_settings.class.php +2 -9
  14. includes.php +1 -1
  15. js/settings.js +0 -15
  16. js/unitecreator_params_panel.js +1 -11
  17. provider/core/plugins/unlimited_elements/copy_paste.class.php +7 -2
  18. provider/core/plugins/unlimited_elements/elementor/assets/template_library_admin.js +2 -11
  19. provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.css +2 -11
  20. provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js +2 -59
  21. provider/core/plugins/unlimited_elements/elementor/assets/uc_front_admin.js +2 -94
  22. provider/core/plugins/unlimited_elements/elementor/elementor_controls.class.php +0 -156
  23. provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php +37 -15
  24. provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +36 -61
  25. provider/core/plugins/unlimited_elements/elementor/images/widget-icon.svg +0 -28
  26. provider/core/plugins/unlimited_elements/elementor/pagination.class.php +8 -32
  27. provider/core/plugins/unlimited_elements/plugin.php +1 -1
  28. provider/core/plugins/unlimited_elements/settings/general_settings_el.xml +17 -0
  29. provider/provider_params_processor.class.php +14 -19
  30. provider/provider_settings.class.php +2 -5
  31. provider/woocommerce_integrate.class.php +1 -40
  32. readme.txt +7 -26
  33. release_log.txt +0 -16
  34. settings/addon_fields.xml +0 -1
  35. settings/library.xml +2 -10
  36. unlimited_elements.php +3 -3
  37. views/test_settings.php +3 -5
assets_libraries/filters/ue_filters.js CHANGED
@@ -2,27 +2,20 @@
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
  };
10
 
11
  var g_vars = {
12
- CLASS_DIV_DEBUG:"uc-div-ajax-debug",
13
- CLASS_GRID:"uc-filterable-grid",
14
- DEBUG_AJAX_OPTIONS: false,
15
- CLASS_PREDICTIVE_CACHE:"uc-predictive-cache-next",
16
- cachePredictiveKeys:{},
17
- handleTrashold:null
18
  };
19
 
20
  var g_options = {
21
- is_cache_enabled:true,
22
- is_predictive_cache_enabled:false,
23
- ajax_reload: false,
24
- widget_name: null,
25
- predictive_trashold_time: 3000
26
  };
27
 
28
 
@@ -36,41 +29,6 @@ function UEDynamicFilters(){
36
  function ________GENERAL_______________(){}
37
 
38
 
39
- /**
40
- * run function with trashold
41
- */
42
- function runWithTrashold(func, time){
43
-
44
- if(!time)
45
- var time = g_options.predictive_trashold_time;
46
-
47
- if(g_vars.handle)
48
- clearTimeout(g_vars.handleTrashold);
49
-
50
- g_vars.handleTrashold = setTimeout(func, g_options.predictive_trashold_time);
51
-
52
- };
53
-
54
-
55
- /**
56
- * add url param
57
- */
58
- function addUrlParam(url, param, value){
59
-
60
- if(url.indexOf("?") == -1)
61
- url += "?";
62
- else
63
- url += "&";
64
-
65
- if(typeof value == "undefined")
66
- url += param;
67
- else
68
- url += param + "=" + value;
69
-
70
- return(url);
71
- }
72
-
73
-
74
  /**
75
  * get object property
76
  */
@@ -129,49 +87,16 @@ function UEDynamicFilters(){
129
  */
130
  function getClosestGrid(objSource){
131
 
132
- //in case there is only one grid - return it
133
- if(g_objGrid)
134
- return(g_objGrid);
135
-
136
- //in case there are nothing:
137
- var objGrids = jQuery("."+ g_vars.CLASS_GRID);
138
-
139
- if(objGrids.length == 0)
140
  return(null);
141
 
142
- //get from current section
143
- var objSection = objSource.parents("section");
144
-
145
- var objGrid = objSection.find("."+ g_vars.CLASS_GRID);
146
-
147
- if(objGrid.length == 1)
148
- return(objGrid);
149
-
150
- var objPrevSection = objSection;
151
- var objNextSection = objSection;
152
-
153
- //get from previous section
154
- do{
155
- objPrevSection = objPrevSection.prev();
156
- objNextSection = objNextSection.next();
157
-
158
- objGrid = objPrevSection.find("."+ g_vars.CLASS_GRID);
159
- if(objGrid.length == 1)
160
- return(objGrid);
161
-
162
- objGrid = objNextSection.find("."+ g_vars.CLASS_GRID);
163
- if(objGrid.length == 1)
164
- return(objGrid);
165
-
166
- }while(objNextSection.length != 0 && objNextSection != 0);
167
 
168
- //return first grid in the list
169
 
170
- var objFirstGrid = jQuery(objGrids[0]);
171
- return(objFirstGrid);
172
  }
173
 
174
-
175
  /**
176
  * add filter object to grid
177
  */
@@ -188,67 +113,6 @@ function UEDynamicFilters(){
188
 
189
  }
190
 
191
- /**
192
- *
193
- * get element widget id from parent wrapper
194
- */
195
- function getElementWidgetID(objElement){
196
-
197
- if(!objElement || objElement.length == 0)
198
- throw new Error("Element not found");
199
-
200
- //get widget id
201
-
202
- var objWidget = objElement.parents(".elementor-widget");
203
-
204
- if(objWidget.langth == 0)
205
- throw new Error("Element parent not found");
206
-
207
- var widgetID = objWidget.data("id");
208
-
209
- if(!widgetID)
210
- throw new Error("widget id not found");
211
-
212
- return(widgetID);
213
- }
214
-
215
-
216
- /**
217
- * get element layout data
218
- */
219
- function getElementLayoutData(objElement){
220
-
221
- if(!objElement || objElement.length == 0)
222
- throw new Error("Element not found");
223
-
224
- //get widget id
225
-
226
- var objWidget = objElement.parents(".elementor-widget");
227
-
228
- if(objWidget.langth == 0)
229
- throw new Error("Element parent not found");
230
-
231
- var widgetID = objWidget.data("id");
232
-
233
- if(!widgetID)
234
- throw new Error("widget id not found");
235
-
236
- //get layout id
237
- var objLayout = objWidget.parents(".elementor");
238
-
239
- if(objLayout.length == 0)
240
- throw new Error("layout not found");
241
-
242
- var layoutID = objLayout.data("elementor-id");
243
-
244
- var output = {};
245
-
246
- output["widgetid"] = widgetID;
247
- output["layoutid"] = layoutID;
248
-
249
- return(output);
250
- }
251
-
252
 
253
 
254
  function ________FILTERS_______________(){}
@@ -396,17 +260,9 @@ function UEDynamicFilters(){
396
  /**
397
  * get pagination selected url or null if is current
398
  */
399
- function getPaginationSelectedUrl(objPagination, isPredictive){
400
 
401
- if(isPredictive == true){
402
-
403
- var objCurrentLink = objPagination.find("a."+g_vars.CLASS_PREDICTIVE_CACHE);
404
-
405
- if(objCurrentLink.length == 0)
406
- return(null);
407
- }
408
- else
409
- var objCurrentLink = objPagination.find("a.current");
410
 
411
  if(objCurrentLink.length == 0)
412
  return(null);
@@ -419,36 +275,6 @@ function UEDynamicFilters(){
419
  return(url);
420
  }
421
 
422
-
423
-
424
- /**
425
- * on ajax pagination click
426
- */
427
- function onAjaxPaginationLinkClick(event){
428
-
429
- var objLink = jQuery(this);
430
-
431
- var objPagination = objLink.parents(".uc-filter-pagination");
432
-
433
- var objLinkCurrent = objPagination.find(".current");
434
-
435
- objLinkCurrent.removeClass("current");
436
-
437
- objLink.addClass("current");
438
-
439
- var objGrid = objPagination.data("grid");
440
-
441
- if(!objGrid || objGrid.length == 0)
442
- throw new Error("Grid not found!");
443
-
444
- //run the ajax, prevent default
445
- refreshAjaxGrid(objGrid);
446
-
447
- event.preventDefault();
448
- return(false);
449
- }
450
-
451
-
452
  function ________DATA_______________(){}
453
 
454
 
@@ -604,351 +430,7 @@ function UEDynamicFilters(){
604
 
605
  return(url);
606
  }
607
-
608
- function ________AJAX_CACHE_________(){}
609
-
610
- /**
611
- * get ajax url
612
- */
613
- function getAjaxCacheKeyFromUrl(ajaxUrl){
614
-
615
- var key = ajaxUrl;
616
-
617
- key = key.replace(g_urlAjax, "");
618
- key = key.replace(g_urlBase, "");
619
-
620
- //replace special signs
621
- key = replaceAll(key, "/","");
622
- key = replaceAll(key, "?","_");
623
- key = replaceAll(key, "&","_");
624
- key = replaceAll(key, "=","_");
625
-
626
- return(key);
627
- }
628
-
629
- /**
630
- * get ajax cache key
631
- */
632
- function getAjaxCacheKey(ajaxUrl, action, objData){
633
-
634
- if(g_options.is_cache_enabled == false)
635
- return(false);
636
-
637
- //cache only by url meanwhile
638
-
639
- if(jQuery.isEmptyObject(objData) == false)
640
- return(false);
641
-
642
- if(action)
643
- return(false);
644
-
645
- var cacheKey = getAjaxCacheKeyFromUrl(ajaxUrl);
646
-
647
- if(!cacheKey)
648
- return(false);
649
-
650
- return(cacheKey);
651
- }
652
-
653
-
654
- /**
655
- * cache ajax response
656
- */
657
- function cacheAjaxResponse(ajaxUrl, action, objData, response){
658
-
659
- var cacheKey = getAjaxCacheKey(ajaxUrl, action, objData);
660
-
661
- if(!cacheKey)
662
- return(false);
663
-
664
- //some precoutions for overload
665
- if(g_cache.length > 100)
666
- return(false);
667
-
668
- g_cache[cacheKey] = response;
669
-
670
- }
671
-
672
-
673
- function ________PREDICTIVE_______________(){}
674
-
675
- /**
676
- * get predictive url
677
- */
678
- function setPredictiveCache_pagination(objPagination){
679
-
680
- if(g_options.is_predictive_cache_enabled == false)
681
- return(false);
682
-
683
- //check if already on the page
684
- var objPredictive = jQuery("." + g_vars.CLASS_PREDICTIVE_CACHE);
685
-
686
- if(objPredictive.length != 0)
687
- return(false);
688
-
689
- var objLinks = objPagination.find("a:not("+g_vars.CLASS_PREDICTIVE_CACHE+")");
690
-
691
- if(objLinks.length == 0)
692
- return(null);
693
-
694
- var paginationID = objPagination.attr("id");
695
-
696
- var urlNextLink = null;
697
-
698
- jQuery.each(objLinks, function(index, link){
699
-
700
- var objLink = jQuery(link);
701
-
702
- if(objLink.hasClass("current"))
703
- return(true);
704
-
705
- var linkID = paginationID + "_" + objLink.index();
706
-
707
- if(g_vars.cachePredictiveKeys.hasOwnProperty(linkID))
708
- return(true);
709
-
710
- //set next predictive
711
-
712
- objLink.addClass(g_vars.CLASS_PREDICTIVE_CACHE);
713
-
714
- //remember predictive item
715
- g_vars.cachePredictiveKeys[linkID] = true;
716
-
717
- //set only once
718
- return(false);
719
- });
720
-
721
- }
722
-
723
-
724
- /**
725
- * check the predictive request
726
- */
727
- function checkPredictiveRequest(){
728
-
729
- if(g_options.is_predictive_cache_enabled == false)
730
- return(false);
731
-
732
- //check if already on the page
733
- var objPredictive = jQuery("." + g_vars.CLASS_PREDICTIVE_CACHE);
734
-
735
- if(objPredictive.length == 0)
736
- return(false);
737
-
738
- if(objPredictive.length > 1){
739
- objPredictive.removeClass(g_vars.CLASS_PREDICTIVE_CACHE);
740
- return(false);
741
- }
742
-
743
- //run with delay
744
-
745
- runWithTrashold(function(){
746
-
747
- if(objPredictive.length == 0)
748
- return(false);
749
-
750
- objPredictive.trigger("predictive");
751
-
752
- });
753
-
754
-
755
- }
756
-
757
- /**
758
- * on predictive link click
759
- */
760
- function onAjaxPaginationPredictive(){
761
-
762
- var objLink = jQuery(this);
763
-
764
- var objPagination = objLink.parents(".uc-filter-pagination");
765
-
766
- var objGrid = objPagination.data("grid");
767
-
768
- if(!objGrid || objGrid.length == 0)
769
- return(false);
770
-
771
- var ajaxOptions = getGridAjaxOptions([objPagination], objGrid, true);
772
-
773
- if(!ajaxOptions)
774
- return(false);
775
 
776
- var ajaxUrl = ajaxOptions["ajax_url"];
777
-
778
- removePredictiveItem();
779
-
780
- ajaxRequest(ajaxUrl);
781
- }
782
-
783
-
784
- /**
785
- * remove predicfive from all
786
- */
787
- function removePredictiveItem(){
788
-
789
- var objPredictive = jQuery("."+g_vars.CLASS_PREDICTIVE_CACHE);
790
-
791
- if(objPredictive.length == 0)
792
- return(false);
793
-
794
- objPredictive.removeClass(g_vars.CLASS_PREDICTIVE_CACHE);
795
-
796
- }
797
-
798
-
799
- function ________AJAX_RESPONSE_______________(){}
800
-
801
- /**
802
- * replace the grid debug
803
- */
804
- function operateAjax_setHtmlDebug(response, objGrid){
805
-
806
- //replace the debug
807
- var htmlDebug = getVal(response, "html_debug");
808
-
809
- if(!htmlDebug)
810
- return(false);
811
-
812
- var gridParent = objGrid.parent();
813
-
814
- var objDebug = objGrid.siblings(".uc-debug-query-wrapper");
815
-
816
- if(objDebug.length == 0)
817
- return(false);
818
-
819
- objDebug.replaceWith(htmlDebug);
820
- }
821
-
822
-
823
- /**
824
- * set html grid from ajax response
825
- */
826
- function operateAjax_setHtmlGrid(response, objGrid){
827
-
828
- if(objGrid.length == 0)
829
- return(false);
830
-
831
- objItemsWrapper = getGridItemsWrapper(objGrid);
832
-
833
- var htmlItems = getVal(response, "html_items");
834
-
835
- objItemsWrapper.html(htmlItems);
836
-
837
- operateAjax_setHtmlDebug(response, objGrid);
838
-
839
- }
840
-
841
-
842
- /**
843
- * replace filters html
844
- */
845
- function operateAjax_setHtmlWidgets(response, objFilters){
846
-
847
- if(!objFilters)
848
- return(false);
849
-
850
- if(objFilters.length == 0)
851
- return(false);
852
-
853
- var objHtmlWidgets = getVal(response, "html_widgets");
854
-
855
- if(!objHtmlWidgets)
856
- return(false);
857
-
858
- if(objHtmlWidgets.length == 0)
859
- return(false);
860
-
861
- jQuery.each(objFilters, function(index, objFilter){
862
-
863
- var widgetID = getElementWidgetID(objFilter);
864
-
865
- if(!widgetID)
866
- return(true);
867
-
868
- var html = getVal(objHtmlWidgets, widgetID);
869
-
870
- var objHtml = jQuery(html);
871
-
872
- var htmlInner = objHtml.html();
873
-
874
- objFilter.html(htmlInner);
875
- });
876
-
877
- }
878
-
879
- /**
880
- * scroll to grid top
881
- */
882
- function scrollToGridTop(objGrid){
883
-
884
- var gapTop = 150;
885
-
886
- var gridOffset = objGrid.offset().top;
887
-
888
- var gridTop = gridOffset - gapTop;
889
-
890
- if(gridTop < 0)
891
- gridTop = 0;
892
-
893
- //check if the grid top is visible
894
-
895
- var currentPos = jQuery(window).scrollTop();
896
-
897
- if(currentPos <= gridOffset)
898
- return(false);
899
-
900
- window.scrollTo({ top: gridTop, behavior: 'smooth' });
901
-
902
- }
903
-
904
-
905
- /**
906
- * operate the response
907
- */
908
- function operateAjaxRefreshResponse(response, objGrid, objFilters){
909
-
910
- operateAjax_setHtmlGrid(response, objGrid);
911
-
912
- operateAjax_setHtmlWidgets(response, objFilters);
913
-
914
- objGrid.trigger("uc_ajax_refreshed");
915
-
916
- setTimeout(function(){
917
-
918
- scrollToGridTop(objGrid);
919
-
920
- },200);
921
-
922
- }
923
-
924
-
925
- /**
926
- * replace all occurances
927
- */
928
- function replaceAll(text, from, to){
929
-
930
- return text.split(from).join(to);
931
- };
932
-
933
-
934
-
935
-
936
- /**
937
- * get response from ajax cache
938
- */
939
- function getResponseFromAjaxCache(ajaxUrl, action, objData){
940
-
941
- var cacheKey = getAjaxCacheKey(ajaxUrl, action, objData);
942
-
943
- if(!cacheKey)
944
- return(false);
945
-
946
- var response = getVal(g_cache, cacheKey);
947
-
948
- return(response);
949
- }
950
-
951
-
952
  function ________AJAX_______________(){}
953
 
954
  /**
@@ -964,20 +446,15 @@ function UEDynamicFilters(){
964
  * get the debug object
965
  */
966
  function getDebugObject(){
967
-
968
- var objGrid = g_lastGridAjaxCall;
969
-
970
- if(!objGrid)
971
- return(null);
972
-
973
- var objDebug = objGrid.find("."+g_vars.CLASS_DIV_DEBUG);
974
 
975
  if(objDebug.length)
976
  return(objDebug);
977
 
978
  //insert if not exists
979
 
980
- objGrid.after("<div class='"+g_vars.CLASS_DIV_DEBUG+"' style='padding:10px;display:none;background-color:#D8FCC6'></div>");
981
 
982
  var objDebug = jQuery("body").find("."+g_vars.CLASS_DIV_DEBUG);
983
 
@@ -990,23 +467,9 @@ function UEDynamicFilters(){
990
  */
991
  function showAjaxDebug(str){
992
 
993
- str = jQuery.trim(str);
994
-
995
- if(!str || str.length == 0)
996
- return(false);
997
-
998
- var objStr = jQuery(str);
999
-
1000
- if(objStr.find("header").length || objStr.find("body").length){
1001
- str = "Wrong ajax response!";
1002
- }
1003
-
1004
  var objDebug = getDebugObject();
1005
 
1006
- if(!objDebug || objDebug.length == 0){
1007
-
1008
- alert(str);
1009
-
1010
  throw new Error("debug not found");
1011
  }
1012
 
@@ -1020,26 +483,13 @@ function UEDynamicFilters(){
1020
  * small ajax request
1021
  */
1022
  function ajaxRequest(ajaxUrl, action, objData, onSuccess){
1023
-
1024
  if(!objData)
1025
  var objData = {};
1026
 
1027
  if(typeof objData != "object")
1028
  throw new Error("wrong ajax param");
1029
-
1030
- //check response from cache
1031
- var responseFromCache = getResponseFromAjaxCache(ajaxUrl, action, objData);
1032
-
1033
- if(responseFromCache){
1034
-
1035
- //simulate ajax request
1036
- setTimeout(function(){
1037
- onSuccess(responseFromCache);
1038
- }, 300);
1039
-
1040
- return(false);
1041
- }
1042
-
1043
  var ajaxData = {};
1044
  ajaxData["action"] = "unlimitedelements_ajax_action";
1045
  ajaxData["client_action"] = action;
@@ -1050,7 +500,7 @@ function UEDynamicFilters(){
1050
  ajaxData["data"] = objData;
1051
  ajaxtype = "post";
1052
  }
1053
-
1054
  var ajaxOptions = {
1055
  type:ajaxtype,
1056
  url:ajaxUrl,
@@ -1097,12 +547,8 @@ function UEDynamicFilters(){
1097
  return(false);
1098
  }
1099
 
1100
- cacheAjaxResponse(ajaxUrl, action, objData, response);
1101
-
1102
- if(typeof onSuccess == "function"){
1103
-
1104
  onSuccess(response);
1105
- }
1106
 
1107
  },
1108
  error:function(jqXHR, textStatus, errorThrown){
@@ -1130,72 +576,52 @@ function UEDynamicFilters(){
1130
  }
1131
 
1132
 
1133
-
1134
  /**
1135
- * get grid items wrapper
1136
  */
1137
- function getGridItemsWrapper(objGrid){
1138
 
1139
- if(objGrid.hasClass("uc-items-wrapper"))
1140
- return(objGrid);
1141
 
1142
- var objItemsWrapper = objGrid.find(".uc-items-wrapper");
 
 
1143
 
1144
- if(objItemsWrapper.length == 0)
1145
- throw new Error("Missing items wrapper - with class: uc-items-wrapper");
1146
 
1147
- return(objItemsWrapper);
1148
- }
1149
-
1150
-
1151
- /**
1152
- * set ajax loader
1153
- */
1154
- function showAjaxLoader(objElement){
1155
 
1156
- objElement.addClass("uc-ajax-loading");
1157
- }
1158
-
1159
- /**
1160
- * hide ajax loader
1161
- */
1162
- function hideAjaxLoader(objElement){
 
 
 
1163
 
1164
- objElement.removeClass("uc-ajax-loading");
 
1165
  }
1166
 
1167
-
1168
  /**
1169
- * show multiple ajax loader
1170
  */
1171
- function showMultipleAjaxLoaders(objElements, isShow){
1172
 
1173
- if(!objElements)
1174
- return(false);
1175
 
1176
- if(objElements.length == 0)
1177
- return(false);
1178
-
1179
- jQuery.each(objElements,function(index, objElement){
1180
-
1181
- if(isShow == true)
1182
- showAjaxLoader(objElement);
1183
- else
1184
- hideAjaxLoader(objElement);
1185
- });
1186
 
1187
  }
1188
 
1189
-
1190
-
1191
-
1192
  /**
1193
  * refresh ajax grid
1194
  */
1195
  function refreshAjaxGrid(objGrid){
1196
 
1197
- removePredictiveItem();
1198
-
1199
  //get all grid filters
1200
  var objFilters = objGrid.data("filters");
1201
 
@@ -1205,34 +631,14 @@ function UEDynamicFilters(){
1205
  if(objFilters.length == 0)
1206
  return(false);
1207
 
1208
- var objAjaxOptions = getGridAjaxOptions(objFilters, objGrid);
1209
 
1210
  if(!objAjaxOptions)
1211
  return(false);
1212
 
1213
  var ajaxUrl = objAjaxOptions["ajax_url"];
1214
 
1215
- if(g_vars.DEBUG_AJAX_OPTIONS == true){
1216
-
1217
- trace("DEBUG AJAX OPTIONS");
1218
- trace(objAjaxOptions);
1219
- return(false);
1220
- }
1221
-
1222
- //do the ajax call
1223
- showAjaxLoader(objGrid);
1224
- showMultipleAjaxLoaders(objFilters, true);
1225
-
1226
- g_lastGridAjaxCall = objGrid;
1227
-
1228
- ajaxRequest(ajaxUrl,null,null, function(response){
1229
-
1230
- hideAjaxLoader(objGrid);
1231
- showMultipleAjaxLoaders(objFilters, false);
1232
-
1233
- operateAjaxRefreshResponse(response, objGrid, objFilters);
1234
-
1235
- });
1236
  }
1237
 
1238
 
@@ -1254,58 +660,73 @@ function UEDynamicFilters(){
1254
  }
1255
 
1256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1257
  /**
1258
  * get grid ajax options
1259
  */
1260
- function getGridAjaxOptions(objFilters, objGrid, isPredictive){
1261
 
1262
  if(!objFilters)
1263
  return(false);
1264
 
1265
  var urlAjax = g_urlBase;
1266
 
1267
- var strRefreshIDs = "";
1268
-
1269
  //get ajax options
1270
  jQuery.each(objFilters, function(index, objFilter){
1271
 
1272
  var isPagination = isPaginationFilter(objFilter);
1273
 
1274
  if(isPagination == true){
1275
- var urlPagination = getPaginationSelectedUrl(objFilter, isPredictive);
1276
-
1277
- if(isPredictive == true && !urlPagination)
1278
- urlAjax = null;
1279
-
1280
  if(urlPagination)
1281
  urlAjax = urlPagination;
1282
  }
1283
 
1284
- //add widget id of the filter to refresh
1285
-
1286
- var filterWidgetID = getElementWidgetID(objFilter);
1287
-
1288
- if(strRefreshIDs)
1289
- strRefreshIDs += ",";
1290
-
1291
- strRefreshIDs += filterWidgetID
1292
  });
1293
 
1294
- if(urlAjax == null)
1295
- return(null);
1296
-
1297
- var dataLayout = getElementLayoutData(objGrid);
1298
 
1299
  var widgetID = dataLayout["widgetid"];
1300
  var layoutID = dataLayout["layoutid"];
1301
 
1302
- var urlAddition = "ucfrontajaxaction=getfiltersdata&layoutid="+layoutID+"&elid="+widgetID;
1303
-
1304
- urlAjax = addUrlParam(urlAjax, urlAddition);
1305
-
1306
- //add refresh ids
1307
- if(strRefreshIDs)
1308
- urlAjax += "&addelids="+strRefreshIDs;
1309
 
1310
  var output = {};
1311
  output["ajax_url"] = urlAjax;
@@ -1330,25 +751,31 @@ function UEDynamicFilters(){
1330
 
1331
  }
1332
 
1333
-
1334
  /**
1335
  * init listing object
1336
  */
1337
  function initGridObject(){
1338
-
1339
  //init the listing
1340
- g_objGrid = jQuery("."+ g_vars.CLASS_GRID);
1341
 
1342
  if(g_objGrid.length == 0){
1343
  g_objGrid = null;
1344
  return(false);
1345
  }
1346
 
1347
- //set only available grid
 
 
1348
  if(g_objGrid.length > 1){
1349
- g_objGrid = null;
1350
  }
1351
-
 
 
 
 
 
1352
  }
1353
 
1354
 
@@ -1403,7 +830,12 @@ function UEDynamicFilters(){
1403
  /**
1404
  * init pagination filter
1405
  */
1406
- function initPaginationFilter(objPagination){
 
 
 
 
 
1407
 
1408
  var objGrid = getClosestGrid(objPagination);
1409
 
@@ -1415,40 +847,16 @@ function UEDynamicFilters(){
1415
  if(isAjax == false)
1416
  return(false);
1417
 
 
 
1418
  //bind grid to pagination
1419
  objPagination.data("grid", objGrid);
1420
 
1421
  //bind pagination to grid
1422
  bindFilterToGrid(objGrid, objPagination);
1423
 
1424
- }
1425
-
1426
-
1427
- /**
1428
- * init pagination filter
1429
- */
1430
- function initPaginationFilters(){
1431
-
1432
- var objPaginations = jQuery(".uc-filter-pagination");
1433
-
1434
- if(objPaginations.length == 0)
1435
- return(false);
1436
-
1437
- jQuery.each(objPaginations, function(index, pagination){
1438
-
1439
- var objPagination = jQuery(pagination);
1440
-
1441
- initPaginationFilter(objPagination);
1442
-
1443
- });
1444
-
1445
- //init the events
1446
- var objParent = objPaginations.parents(".elementor");
1447
-
1448
- if(g_options.is_predictive_cache_enabled == true)
1449
- objParent.on("predictive",".uc-filter-pagination a", onAjaxPaginationPredictive);
1450
-
1451
- objParent.on("click",".uc-filter-pagination a", onAjaxPaginationLinkClick);
1452
 
1453
  }
1454
 
@@ -1469,9 +877,7 @@ function UEDynamicFilters(){
1469
 
1470
  //initGridFilters();
1471
 
1472
- initPaginationFilters();
1473
-
1474
- checkPredictiveRequest();
1475
 
1476
  //clearFilters(true);
1477
  //initEvents();
@@ -1488,7 +894,7 @@ function UEDynamicFilters(){
1488
  trace("Filters not loaded, jQuery not loaded");
1489
  return(false);
1490
  }
1491
-
1492
  jQuery("document").ready(init);
1493
 
1494
  }
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
 
29
  function ________GENERAL_______________(){}
30
 
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * get object property
34
  */
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
 
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
 
118
  function ________FILTERS_______________(){}
260
  /**
261
  * get pagination selected url or null if is current
262
  */
263
+ function getPaginationSelectedUrl(objPagination){
264
 
265
+ var objCurrentLink = objPagination.find("a.current");
 
 
 
 
 
 
 
 
266
 
267
  if(objCurrentLink.length == 0)
268
  return(null);
275
  return(url);
276
  }
277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  function ________DATA_______________(){}
279
 
280
 
430
 
431
  return(url);
432
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  function ________AJAX_______________(){}
435
 
436
  /**
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
  */
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
  * 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
  ajaxData["data"] = objData;
501
  ajaxtype = "post";
502
  }
503
+
504
  var ajaxOptions = {
505
  type:ajaxtype,
506
  url:ajaxUrl,
547
  return(false);
548
  }
549
 
550
+ if(typeof onSuccess == "function")
 
 
 
551
  onSuccess(response);
 
552
 
553
  },
554
  error:function(jqXHR, textStatus, errorThrown){
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
  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
  }
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
 
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
 
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
 
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
 
877
 
878
  //initGridFilters();
879
 
880
+ initPaginationFilter();
 
 
881
 
882
  //clearFilters(true);
883
  //initEvents();
894
  trace("Filters not loaded, jQuery not loaded");
895
  return(false);
896
  }
897
+
898
  jQuery("document").ready(init);
899
 
900
  }
assets_libraries/owl-carousel-new/assets/owl.carousel.css DELETED
@@ -1,186 +0,0 @@
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 DELETED
@@ -1,3448 +0,0 @@
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 DELETED
@@ -1,7 +0,0 @@
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);
 
 
 
 
 
 
 
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,8 +56,6 @@ class UniteFontManagerUC{
56
  */
57
  private function fetchIconsFromCss_getArrIconsFromSvg($type){
58
 
59
- $pathCssFile = null;
60
-
61
  switch($type){
62
 
63
  case "brand":
@@ -69,23 +67,16 @@ class UniteFontManagerUC{
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,6 +102,7 @@ class UniteFontManagerUC{
111
  $arrIcons[$icon] = true;
112
  }
113
 
 
114
  return($arrIcons);
115
  }
116
 
@@ -147,7 +139,7 @@ class UniteFontManagerUC{
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,21 +179,6 @@ class UniteFontManagerUC{
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,18 +257,6 @@ class UniteFontManagerUC{
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,9 +424,7 @@ class UniteFontManagerUC{
459
  */
460
  public function fetchIcons(){
461
 
462
- $this->printElementorIcons();
463
-
464
- //$this->fetchIconsFromCss();
465
 
466
  }
467
 
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
  switch($type){
60
 
61
  case "brand":
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
  $arrIcons[$icon] = true;
103
  }
104
 
105
+
106
  return($arrIcons);
107
  }
108
 
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
  $this->printIcons($arrAllIcons);
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  /**
184
  * fetch font awsome icons array from site
257
  return($jsonIconsFA5);
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
  /**
262
  * get brand icons
424
  */
425
  public function fetchIcons(){
426
 
427
+ $this->fetchIconsFromCss();
 
 
428
 
429
  }
430
 
inc_php/framework/functions.class.php CHANGED
@@ -1492,38 +1492,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1492
  return($url);
1493
  }
1494
 
1495
- /**
1496
- * get links from some content
1497
- */
1498
- public static function parseHTMLGetLinks($html){
1499
-
1500
- $htmlDom = new DOMDocument;
1501
-
1502
- @$htmlDom->loadHTML($html);
1503
-
1504
- $links = $htmlDom->getElementsByTagName('a');
1505
-
1506
- if(empty($links))
1507
- return(array());
1508
-
1509
- if($links->length == 0)
1510
- return(array());
1511
-
1512
- $arrLinks = array();
1513
- foreach($links as $link){
1514
-
1515
- $linkHref = $link->getAttribute('href');
1516
- if(strlen(trim($linkHref)) == 0)
1517
- continue;
1518
- if($linkHref[0] == '#')
1519
- continue;
1520
-
1521
- $arrLinks[] = $linkHref;
1522
- }
1523
-
1524
- return($arrLinks);
1525
- }
1526
-
1527
 
1528
  public static function z___________VALIDATIONS_________(){}
1529
 
1492
  return($url);
1493
  }
1494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1495
 
1496
  public static function z___________VALIDATIONS_________(){}
1497
 
inc_php/framework/settings.class.php CHANGED
@@ -1170,12 +1170,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1170
  $visibility = (string)UniteFunctionsUC::getVal($attribs, "visibility");
1171
 
1172
  $isForceShow = false;
1173
-
1174
- /*
1175
- * //demo for show setting
1176
- if($sapName == "my_setting" && defined("UC_ENABLE_COPYPASTE"))
1177
  $isForceShow = true;
1178
- */
1179
 
1180
  if($visibility == "dev" && GlobalsUC::$inDev == false && $isForceShow == false)
1181
  continue;
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;
inc_php/unitecreator_dialog_param.class.php CHANGED
@@ -22,7 +22,6 @@ 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_HEADING = "uc_heading";
26
  const PARAM_CONTENT = "uc_content";
27
  const PARAM_POST = "uc_post";
28
  const PARAM_DATASET = "uc_dataset";
@@ -176,9 +175,8 @@ class UniteCreatorDialogParamWork{
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,7 +373,7 @@ class UniteCreatorDialogParamWork{
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,21 +382,14 @@ class UniteCreatorDialogParamWork{
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,54 +557,20 @@ class UniteCreatorDialogParamWork{
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
 
@@ -892,12 +849,6 @@ class UniteCreatorDialogParamWork{
892
  $this->putCheckbox("is_filterable", __("Enable Filterable Options", "unlimited-elements-for-elementor"));
893
  ?>
894
  <?php endif?>
895
-
896
- <div class="vert_sap10"></div>
897
-
898
- <?php
899
- $this->putCheckbox("enable_ajax", __("Enable Ajax Options", "unlimited-elements-for-elementor"));
900
- ?>
901
 
902
  <div class="vert_sap10"></div>
903
 
@@ -1379,9 +1330,6 @@ class UniteCreatorDialogParamWork{
1379
  case self::PARAM_HR:
1380
  $this->putNoDefaultValueText();
1381
  break;
1382
- case self::PARAM_HEADING:
1383
- $this->putDefaultValueParam(true,"",false,"heading");
1384
- break;
1385
  case self::PARAM_FONT_OVERRIDE:
1386
  $text = esc_html__("Use this font override in css tab using special function", "unlimited-elements-for-elementor");
1387
  $this->putNoDefaultValueText($text);
@@ -1780,7 +1728,6 @@ class UniteCreatorDialogParamWork{
1780
  self::PARAM_LINK,
1781
  self::PARAM_EDITOR,
1782
  self::PARAM_HR,
1783
- self::PARAM_HEADING,
1784
  self::PARAM_IMAGE,
1785
  self::PARAM_AUDIO,
1786
  self::PARAM_ICON,
@@ -1817,7 +1764,6 @@ class UniteCreatorDialogParamWork{
1817
  self::PARAM_LINK,
1818
  self::PARAM_EDITOR,
1819
  self::PARAM_HR,
1820
- self::PARAM_HEADING,
1821
  self::PARAM_IMAGE,
1822
  self::PARAM_AUDIO,
1823
  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_CONTENT = "uc_content";
26
  const PARAM_POST = "uc_post";
27
  const PARAM_DATASET = "uc_dataset";
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
  /**
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
  $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
  <?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
 
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
  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);
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
  self::PARAM_LINK,
1765
  self::PARAM_EDITOR,
1766
  self::PARAM_HR,
 
1767
  self::PARAM_IMAGE,
1768
  self::PARAM_AUDIO,
1769
  self::PARAM_ICON,
inc_php/unitecreator_filters_process.class.php CHANGED
@@ -18,8 +18,6 @@ class UniteCreatorFiltersProcess{
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
 
@@ -359,80 +357,22 @@ class UniteCreatorFiltersProcess{
359
 
360
  private function _______AJAX__________(){}
361
 
362
- /**
363
- * get addon post list name
364
- */
365
- private function getAddonPostListName($addon){
366
-
367
- $paramPostList = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
368
-
369
- $postListName = UniteFunctionsUC::getVal($paramPostList, "name");
370
-
371
- return($postListName);
372
- }
373
-
374
-
375
- /**
376
- * validate if the addon ajax ready
377
- * if it's have post list and has option that enable ajax
378
- */
379
- private function validateAddonAjaxReady($addon, $arrSettingsValues){
380
-
381
- $paramPostList = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
382
-
383
- if(empty($paramPostList))
384
- UniteFunctionsUC::throwError("Widget not ready for ajax");
385
-
386
- $postListName = UniteFunctionsUC::getVal($paramPostList, "name");
387
-
388
- $isAjaxReady = UniteFunctionsUC::getVal($arrSettingsValues, $postListName."_isajax");
389
- $isAjaxReady = UniteFunctionsUC::strToBool($isAjaxReady);
390
-
391
- if($isAjaxReady == false)
392
- UniteFunctionsUC::throwError("The ajax is not ready for this widget");
393
-
394
- return($postListName);
395
- }
396
-
397
 
398
  /**
399
- * process the html output - convert all the links, remove the query part
400
  */
401
- private function processAjaxHtmlOutput($html){
402
 
403
- $currentUrl = GlobalsUC::$current_page_url;
404
-
405
- $arrUrl = parse_url($currentUrl);
406
 
407
- $query = "?".UniteFunctionsUC::getVal($arrUrl, "query");
408
-
409
- $html = str_replace($query, "", $html);
410
-
411
- $query = str_replace("&", "&#038;", $query);
412
 
413
- $html = str_replace($query, "", $html);
414
-
415
- return($html);
416
- }
417
-
418
- /**
419
- * modify settings values before set to addon
420
- * set pagination type to post list values
421
- */
422
- private function modifySettingsValues($arrSettingsValues, $postListName){
423
 
424
- $paginationType = UniteFunctionsUC::getVal($arrSettingsValues, "pagination_type");
425
 
426
- if(!empty($paginationType))
427
- $arrSettingsValues[$postListName."_pagination_type"] = $paginationType;
428
-
429
- return($arrSettingsValues);
430
- }
431
-
432
- /**
433
- * get content element html
434
- */
435
- private function getContentWidgetHtml($arrContent, $elementID, $isGrid = true){
436
 
437
  $arrElement = HelperProviderCoreUC_EL::getArrElementFromContent($arrContent, $elementID);
438
 
@@ -448,122 +388,32 @@ class UniteCreatorFiltersProcess{
448
 
449
  if(strpos($widgetType, "ucaddon_") === false)
450
  UniteFunctionsUC::throwError("Cannot output widget content");
451
-
452
- $arrSettingsValues = UniteFunctionsUC::getVal($arrElement, "settings");
453
 
454
  $widgetName = str_replace("ucaddon_", "", $widgetType);
455
 
 
 
 
 
456
  $addon = new UniteCreatorAddon();
457
  $addon->initByAlias($widgetName, GlobalsUC::ADDON_TYPE_ELEMENTOR);
458
-
459
- //make a check that ajax option is on in this widget
460
 
461
- if($isGrid == true){
462
-
463
- $postListName = $this->validateAddonAjaxReady($addon, $arrSettingsValues);
464
-
465
- $arrSettingsValues = $this->modifySettingsValues($arrSettingsValues, $postListName);
466
- }
467
 
468
  $addon->setParamsValues($arrSettingsValues);
469
 
470
  //------ get the html output
471
 
472
  //collect the debug html
 
473
 
474
- if($isGrid == true)
475
- ob_start();
476
-
477
- $objOutput = new UniteCreatorOutput();
478
- $objOutput->initByAddon($addon);
479
 
480
- if($isGrid == true){
481
- $htmlDebug = ob_get_contents();
482
- ob_end_clean();
483
- }
484
-
485
-
486
- $output = array();
487
-
488
- //get only items
489
- if($isGrid == true){
490
- $htmlGridItems = $objOutput->getHtmlItems();
491
- $output["html"] = $htmlGridItems;
492
- }
493
-
494
- //get output of the html template
495
- if($isGrid == false){
496
-
497
- $htmlBody = $objOutput->getHtmlOnly();
498
-
499
- $htmlBody = $this->processAjaxHtmlOutput($htmlBody);
500
-
501
- $output["html"] = $htmlBody;
502
- }
503
-
504
- if($isGrid == true && !empty($htmlDebug))
505
- $output["html_debug"] = $htmlDebug;
506
-
507
- return($output);
508
- }
509
-
510
-
511
- /**
512
- * get content widgets html
513
- */
514
- private function getContentWidgetsHTML($arrContent, $strIDs){
515
-
516
- if(empty($strIDs))
517
- return(null);
518
-
519
- $arrIDs = explode(",", $strIDs);
520
-
521
- $arrHTML = array();
522
-
523
- foreach($arrIDs as $elementID){
524
-
525
- $output = $this->getContentWidgetHtml($arrContent, $elementID, false);
526
-
527
- $html = UniteFunctionsUC::getVal($output, "html");
528
-
529
- $arrHTML[$elementID] = $html;
530
- }
531
-
532
- return($arrHTML);
533
- }
534
-
535
- /**
536
- * get widget ajax data
537
- */
538
- private function putWidgetGridFrontAjaxData(){
539
-
540
- //validate by response code
541
-
542
- $responseCode = http_response_code();
543
- if($responseCode != 200){
544
- http_response_code(200);
545
- UniteFunctionsUC::throwError("Request not allowed, please make sure the pagination is allowed for the ajax grid");
546
- }
547
-
548
-
549
- //init widget by post id and element id
550
-
551
- $layoutID = UniteFunctionsUC::getPostGetVariable("layoutid","",UniteFunctionsUC::SANITIZE_KEY);
552
- $elementID = UniteFunctionsUC::getPostGetVariable("elid","",UniteFunctionsUC::SANITIZE_KEY);
553
-
554
- $addElIDs = UniteFunctionsUC::getPostGetVariable("addelids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
555
-
556
- $arrContent = HelperProviderCoreUC_EL::getElementorContentByPostID($layoutID);
557
-
558
- if(empty($arrContent))
559
- UniteFunctionsUC::throwError("Elementor content not found");
560
-
561
- $arrHtmlWidget = $this->getContentWidgetHtml($arrContent, $elementID);
562
-
563
- $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
564
- $htmlDebug = UniteFunctionsUC::getVal($arrHtmlWidget, "html_debug");
565
-
566
- $addWidgetsHTML = $this->getContentWidgetsHTML($arrContent, $addElIDs);
567
 
568
  //output the html
569
  $outputData = array();
@@ -571,10 +421,7 @@ class UniteCreatorFiltersProcess{
571
  if(!empty($htmlDebug))
572
  $outputData["html_debug"] = $htmlDebug;
573
 
574
- $outputData["html_items"] = $htmlGridItems;
575
-
576
- if(!empty($addWidgetsHTML))
577
- $outputData["html_widgets"] = $addWidgetsHTML;
578
 
579
  HelperUC::ajaxResponseData($outputData);
580
 
@@ -619,37 +466,14 @@ class UniteCreatorFiltersProcess{
619
  UniteProviderFunctionsUC::printCustomScript($script);
620
  }
621
 
622
- /**
623
- * put custom style
624
- */
625
- private function putCustomStyle(){
626
-
627
- if(self::$isStyleAdded == true)
628
- return(false);
629
-
630
- self::$isStyleAdded = true;
631
-
632
- $style = "
633
- .uc-ajax-loading{
634
- opacity:0.6;
635
- }
636
- ";
637
-
638
- UniteProviderFunctionsUC::printCustomStyle($style);
639
- }
640
-
641
-
642
  /**
643
  * include the client side scripts
644
  */
645
  private function includeClientSideScripts(){
646
 
647
  $this->includeJSFiles();
648
-
649
  $this->putCustomJsScripts();
650
 
651
- $this->putCustomStyle();
652
-
653
  }
654
 
655
 
@@ -757,34 +581,29 @@ class UniteCreatorFiltersProcess{
757
  */
758
  public function addWidgetFilterableVariables($data, $addon){
759
 
 
 
760
  $param = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
761
 
762
  $postListName = UniteFunctionsUC::getVal($param, "name");
763
 
764
  $dataPosts = UniteFunctionsUC::getVal($data, $postListName);
765
 
766
- //check if ajax related
767
  $isAjax = UniteFunctionsUC::getVal($dataPosts, $postListName."_isajax");
768
  $isAjax = UniteFunctionsUC::strToBool($isAjax);
769
 
770
- if($isAjax == false)
771
- return($data);
772
-
773
- if(empty($param))
774
- return($data);
775
-
776
  //check if ajax
777
  $strAttributes = "";
778
 
779
- if($isAjax == true)
780
  $strAttributes .= " data-ajax='true' ";
781
-
782
- $this->includeClientSideScripts();
 
783
 
784
  $data["uc_filtering_attributes"] = $strAttributes;
785
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
786
 
787
-
788
  return($data);
789
  }
790
 
@@ -864,6 +683,7 @@ class UniteCreatorFiltersProcess{
864
  exit();
865
  }
866
 
 
867
  $frontAjaxAction = UniteFunctionsUC::getPostGetVariable("ucfrontajaxaction","",UniteFunctionsUC::SANITIZE_KEY);
868
 
869
  if(empty($frontAjaxAction))
@@ -892,7 +712,10 @@ class UniteCreatorFiltersProcess{
892
  * init wordpress front filters
893
  */
894
  public function initWPFrontFilters(){
895
-
 
 
 
896
  if(is_admin() == true)
897
  return(false);
898
 
18
 
19
  private static $isScriptAdded = false;
20
  private static $isFilesAdded = false;
 
 
21
  private static $showDebug = false;
22
  private static $originalQueryVars = null;
23
 
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
 
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
  if(!empty($htmlDebug))
422
  $outputData["html_debug"] = $htmlDebug;
423
 
424
+ $outputData["html_items"] = $html;
 
 
 
425
 
426
  HelperUC::ajaxResponseData($outputData);
427
 
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
 
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
 
683
  exit();
684
  }
685
 
686
+
687
  $frontAjaxAction = UniteFunctionsUC::getPostGetVariable("ucfrontajaxaction","",UniteFunctionsUC::SANITIZE_KEY);
688
 
689
  if(empty($frontAjaxAction))
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
 
inc_php/unitecreator_helperhtml.class.php CHANGED
@@ -175,17 +175,11 @@ 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 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"))
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"))
inc_php/unitecreator_output.class.php CHANGED
@@ -1492,20 +1492,6 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1492
  }
1493
 
1494
 
1495
- /**
1496
- * get only html template output, no css and no js
1497
- */
1498
- public function getHtmlOnly(){
1499
-
1500
- $this->validateInited();
1501
-
1502
- $html = $this->objTemplate->getRenderedHtml(self::TEMPLATE_HTML);
1503
- $html = $this->processHtml($html);
1504
-
1505
- return($html);
1506
- }
1507
-
1508
-
1509
  /**
1510
  * place output by shortcode
1511
  */
@@ -1661,7 +1647,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1661
 
1662
  if(!empty($this->cacheConstants))
1663
  return($this->cacheConstants);
1664
-
1665
  $data = array();
1666
 
1667
  $prefix = "ucid";
1492
  }
1493
 
1494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1495
  /**
1496
  * place output by shortcode
1497
  */
1647
 
1648
  if(!empty($this->cacheConstants))
1649
  return($this->cacheConstants);
1650
+
1651
  $data = array();
1652
 
1653
  $prefix = "ucid";
inc_php/unitecreator_params_processor.class.php CHANGED
@@ -814,81 +814,14 @@ class UniteCreatorParamsProcessorWork{
814
  return($data);
815
  }
816
 
817
- /**
818
- * get default url of json image
819
- */
820
- private function getImageJsonDefaultUrl($param){
821
-
822
- //no value at all - return nothing
823
-
824
- $defaultValue = UniteFunctionsUC::getVal($param, "default_value_json");
825
- if(empty($defaultValue)){
826
- return("");
827
- }
828
-
829
- //only default:
830
-
831
- $urlAssets = $this->addon->getUrlAssets();
832
-
833
- if(empty($urlAssets))
834
- return("");
835
-
836
- $urlDefault = $urlAssets.$defaultValue;
837
-
838
- return($urlDefault);
839
- }
840
-
841
- /**
842
- * get image as json processed data
843
- */
844
- private function getProcessedParamsValue_imageJson($data, $value, $param){
845
-
846
- //if the value is emtpy
847
- if(empty($value)){
848
-
849
- $urlDefault = $this->getImageJsonDefaultUrl($param);
850
- return($urlDefault);
851
- }
852
-
853
- //if the value is string, must be a url, return it
854
-
855
- if(is_numeric($value) == false)
856
- return($value);
857
-
858
- //if the value is number, get the url
859
-
860
- $postThumb = get_post($value);
861
-
862
- //if no thumb found by id - return default
863
- if(empty($postThumb)){
864
-
865
- $urlDefault = $this->getImageJsonDefaultUrl($param);
866
- return($urlDefault);
867
- }
868
-
869
- $urlJson = $postThumb->guid;
870
-
871
- return($urlJson);
872
- }
873
-
874
-
875
  /**
876
  * process image param value, add to data
877
  * @param $param
878
  */
879
  protected function getProcessedParamsValue_image($data, $value, $param){
880
-
881
- $mediaType = UniteFunctionsUC::getVal($param, "media_type");
882
-
883
  $name = $param["name"];
884
 
885
- if($mediaType == "json"){
886
-
887
- $data[$name] = $this->getProcessedParamsValue_imageJson($data, $value, $param);
888
-
889
- return($data);
890
- }
891
-
892
  $urlImage = $value; //in case that the value is image id
893
  if(is_numeric($value)){
894
  $urlImage = UniteProviderFunctionsUC::getImageUrlFromImageID($value);
@@ -898,8 +831,7 @@ class UniteCreatorParamsProcessorWork{
898
  $value = HelperUC::URLtoFull($value);
899
  $data[$name] = $value;
900
  }
901
-
902
-
903
  $sizeFilters = UniteFunctionsUC::getVal($param, "size_filters");
904
  $isNoAttributes = UniteFunctionsUC::getVal($param, "no_attributes");
905
  $isNoImageData = UniteFunctionsUC::getVal($param, "no_image_data");
@@ -1758,6 +1690,7 @@ class UniteCreatorParamsProcessorWork{
1758
 
1759
  foreach($arrItems as $index => $arrItemValues){
1760
 
 
1761
  $elementorID = UniteFunctionsUC::getVal($arrItemValues, "_id");
1762
 
1763
  //if not found - generate one
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
  $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");
1690
 
1691
  foreach($arrItems as $index => $arrItemValues){
1692
 
1693
+
1694
  $elementorID = UniteFunctionsUC::getVal($arrItemValues, "_id");
1695
 
1696
  //if not found - generate one
inc_php/unitecreator_settings.class.php CHANGED
@@ -157,8 +157,7 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
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,
@@ -698,15 +697,9 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
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
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,
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
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.81");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
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);
js/settings.js CHANGED
@@ -1917,13 +1917,9 @@ function UniteSettingsUC(){
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,17 +1933,6 @@ function UniteSettingsUC(){
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);
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
  return(html);
1934
  });
1935
 
 
 
 
 
 
 
 
 
 
 
 
1936
  }
1937
 
1938
  var objType = iconPicker_getObjIconsType(type);
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,7 +125,6 @@ function UniteCreatorParamsPanel(){
125
  paramParent.visual = visual;
126
 
127
  addParam(paramParent, null, filter);
128
-
129
 
130
  //add child params:
131
  jQuery.each(arrChildKeys, function(index, objChildParam){
@@ -287,15 +286,6 @@ function UniteCreatorParamsPanel(){
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
 
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
  //add child params:
130
  jQuery.each(arrChildKeys, function(index, objChildParam){
286
  paramVisual = name + " wrapping code";
287
  }
288
 
 
 
 
 
 
 
 
 
 
289
  break;
290
  default:
291
 
provider/core/plugins/unlimited_elements/copy_paste.class.php CHANGED
@@ -146,7 +146,10 @@ class UniteCreatorElementorCopyPaste{
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");
@@ -180,7 +183,9 @@ class UniteCreatorElementorCopyPaste{
180
  * get section zip from data
181
  */
182
  public function getSectionZipFromData($data){
183
-
 
 
184
  try{
185
 
186
  $postID = UniteFunctionsUC::getVal($data, "postid");
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");
183
  * get section zip from data
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");
provider/core/plugins/unlimited_elements/elementor/assets/template_library_admin.js CHANGED
@@ -14,17 +14,8 @@ function UniteCreatorElementorTemplateLibraryAdmin(){
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);
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);
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.css CHANGED
@@ -16,17 +16,7 @@
16
  }
17
 
18
 
19
- /* --- icons --- */
20
-
21
- .uc-default-widget-icon::after{
22
- background-image:url('../images/widget-icon.svg');
23
- }
24
-
25
- .ue-widget-icon{
26
- min-width:40px;
27
- min-height:42px;
28
- display:inline-block;
29
- }
30
 
31
  .ue-widget-icon::after{
32
  xcontent:"UE";
@@ -49,6 +39,7 @@
49
  filter: brightness(4);
50
  }
51
 
 
52
  .ue-wi-svg::after{
53
  height:44px;
54
  background-size:auto 34px;
16
  }
17
 
18
 
19
+ /* --- tooltip --- */
 
 
 
 
 
 
 
 
 
 
20
 
21
  .ue-widget-icon::after{
22
  xcontent:"UE";
39
  filter: brightness(4);
40
  }
41
 
42
+
43
  .ue-wi-svg::after{
44
  height:44px;
45
  background-size:auto 34px;
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, g_frontAPI;
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
 
@@ -1493,12 +1493,9 @@ function UniteCreatorElementorEditorAdmin(){
1493
  window.ucLastElementorModel = model.attributes;
1494
 
1495
  window.lastWidgetType = getVal(model.attributes, "widgetType");
1496
-
1497
- g_frontAPI.triggerEvent("open_widget_settings", window.ucLastElementorModel);
1498
 
1499
  }
1500
 
1501
-
1502
  /**
1503
  * run ajax action
1504
  */
@@ -1558,18 +1555,12 @@ function UniteCreatorElementorEditorAdmin(){
1558
  return(false);
1559
  }
1560
 
1561
- g_frontAPI = new UniteCreatorElementorFrontAPI();
1562
-
1563
  g_windowFront = windowFront;
1564
 
1565
- g_windowFront.g_ueSettingsAPI = g_frontAPI;
1566
-
1567
  if(typeof g_ucHasBackgrounds !== "undefined" && g_ucHasBackgrounds === true)
1568
  initBackgrounds();
1569
 
1570
  elementor.hooks.addAction("panel/open_editor/widget", onElementorOpenWidget);
1571
-
1572
-
1573
  }
1574
 
1575
 
@@ -1596,54 +1587,6 @@ function UniteCreatorElementorEditorAdmin(){
1596
 
1597
  }
1598
 
1599
- /**
1600
- * front api
1601
- */
1602
- function UniteCreatorElementorFrontAPI(){
1603
-
1604
- var g_objAdmin;
1605
-
1606
- /**
1607
- * debug some string
1608
- */
1609
- function trace(str){
1610
- console.log(str);
1611
- }
1612
-
1613
- /**
1614
- * trigger event
1615
- */
1616
- this.triggerEvent = function(eventName, model, options){
1617
-
1618
- var data = {};
1619
- data.model = model;
1620
-
1621
- jQuery(window).trigger("ue_event_"+eventName, data);
1622
-
1623
- }
1624
-
1625
-
1626
- /**
1627
- * on event
1628
- */
1629
- this.onEvent = function(eventName, func){
1630
-
1631
- jQuery(window).on("ue_event_"+eventName, func);
1632
-
1633
- }
1634
-
1635
-
1636
- /**
1637
- * editor admin
1638
- */
1639
- this.initAPI = function(objAdmin){
1640
-
1641
- g_objAdmin = objAdmin;
1642
- }
1643
-
1644
- }
1645
-
1646
-
1647
  var g_objUCElementorEditorAdmin = new UniteCreatorElementorEditorAdmin();
1648
 
1649
 
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
 
179
  var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
180
  if(isCurrentTaxRelevant == false && firstVisibleOption){
181
+
182
  selectPostTaxonomy.val(firstVisibleOption).trigger("change");
183
  }
184
 
1493
  window.ucLastElementorModel = model.attributes;
1494
 
1495
  window.lastWidgetType = getVal(model.attributes, "widgetType");
 
 
1496
 
1497
  }
1498
 
 
1499
  /**
1500
  * run ajax action
1501
  */
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
 
1588
  }
1589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1590
  var g_objUCElementorEditorAdmin = new UniteCreatorElementorEditorAdmin();
1591
 
1592
 
provider/core/plugins/unlimited_elements/elementor/assets/uc_front_admin.js CHANGED
@@ -1,95 +1,4 @@
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,10 +10,9 @@ function ucDocReady(fn) {
101
  }
102
  }
103
 
104
-
105
  ucDocReady(function(){
106
 
107
- window.g_ueSettingsAPI = window.parent.g_objUCElementorEditorAdmin.initFrontEndInteraction(window, elementorFrontend);
108
-
109
  });
110
 
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  function ucDocReady(fn) {
4
  // see if DOM is already available
10
  }
11
  }
12
 
 
13
  ucDocReady(function(){
14
 
15
+ window.parent.g_objUCElementorEditorAdmin.initFrontEndInteraction(window, elementorFrontend);
16
+
17
  });
18
 
provider/core/plugins/unlimited_elements/elementor/elementor_controls.class.php DELETED
@@ -1,156 +0,0 @@
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
- * add repeater control
15
- */
16
- public function addGalleryImageVideoRepeater($objControls, $textPrefix, $name){
17
-
18
- $repeater = new Repeater();
19
-
20
- $objControls->start_controls_section(
21
- 'uc_section_listing_gallery_repeater', array(
22
- 'label' => $textPrefix.__(" Items", "unlimited-elements-for-elementor"),
23
- 'condition'=>array($name."_source"=>"image_video_repeater")
24
- )
25
- );
26
-
27
- // ---- item type ---------
28
-
29
- $repeater->add_control(
30
- 'item_type',
31
- array(
32
- 'label' => __( 'Item Type', 'plugin-domain' ),
33
- 'type' => Controls_Manager::SELECT,
34
- 'default' => 'image',
35
- 'options' => array(
36
- 'image' => __( 'Image', 'unlimited-elements-for-elementor' ),
37
- 'youtube' => __( 'Youtube', 'unlimited-elements-for-elementor' ),
38
- 'vimeo' => __( 'Vimeo', 'unlimited-elements-for-elementor' ),
39
- 'wistia' => __( 'Wistia', 'unlimited-elements-for-elementor' ),
40
- 'html5' => __( 'HTML5 Video', 'unlimited-elements-for-elementor' )
41
- )
42
- )
43
- );
44
-
45
- //--------- image --------
46
-
47
- $repeater->add_control(
48
- 'image',
49
- array(
50
- 'label' => __( 'Choose Image', 'unlimited-elements-for-elementor' ),
51
- 'type' => Controls_Manager::MEDIA,
52
- 'default' => array(
53
- 'url' => Utils::get_placeholder_image_src(),
54
- ),
55
- 'condition'=>array('item_type'=>'image')
56
- )
57
- );
58
-
59
- //--------- youtube url --------
60
-
61
- $repeater->add_control(
62
- 'url_youtube',
63
- array(
64
- 'label' => __( 'Youtube Url or ID', 'unlimited-elements-for-elementor' ),
65
- 'type' => Controls_Manager::TEXT,
66
- 'default' => __( '', 'unlimited-elements-for-elementor' ),
67
- 'description'=>'For example: https://www.youtube.com/watch?v=9bZkp7q19f0 or 9bZkp7q19f0',
68
- 'label_block'=>true,
69
- 'condition'=>array('item_type'=>'youtube')
70
- )
71
- );
72
-
73
- //--------- vimeo id --------
74
-
75
- $repeater->add_control(
76
- 'vimeo_id',
77
- array(
78
- 'label' => __( 'Vimeo Video ID or Url', 'unlimited-elements-for-elementor' ),
79
- 'type' => Controls_Manager::TEXT,
80
- 'default' => __( '', 'unlimited-elements-for-elementor' ),
81
- 'description'=>__('For example: 581014653, or https://vimeo.com/581014653','unlimited-elements-for-elementor'),
82
- 'label_block'=>true,
83
- 'condition'=>array('item_type'=>'vimeo')
84
- )
85
- );
86
-
87
- //--------- wistia --------
88
-
89
- $repeater->add_control(
90
- 'wistia_id',
91
- array(
92
- 'label' => __( 'Wistia Video ID', 'unlimited-elements-for-elementor' ),
93
- 'type' => Controls_Manager::TEXT,
94
- 'default' => __( '', 'unlimited-elements-for-elementor' ),
95
- 'description'=>__('For example: 9oedgxuciv','unlimited-elements-for-elementor'),
96
- 'label_block'=>true,
97
- 'condition'=>array('item_type'=>'wistia')
98
- )
99
- );
100
-
101
- //--------- html5 video --------
102
-
103
- $repeater->add_control(
104
- 'url_html5',
105
- array(
106
- 'label' => __( 'MP4 Video Url', 'unlimited-elements-for-elementor' ),
107
- 'type' => Controls_Manager::TEXT,
108
- 'default' => __( '', 'unlimited-elements-for-elementor' ),
109
- 'description'=>__('Enter url of the mp4 video in current or external site','unlimited-elements-for-elementor'),
110
- 'label_block'=>true,
111
- 'condition'=>array('item_type'=>'html5')
112
- )
113
- );
114
-
115
- //--------- title --------
116
-
117
- $repeater->add_control(
118
- 'title',
119
- array(
120
- 'label' => __( 'Item Title', 'unlimited-elements-for-elementor' ),
121
- 'type' => Controls_Manager::TEXT,
122
- 'default' => __( '', 'unlimited-elements-for-elementor' ),
123
- 'label_block'=>true,
124
- 'separator'=>'before'
125
- )
126
- );
127
-
128
- //--------- description --------
129
-
130
- $repeater->add_control(
131
- 'description',
132
- array(
133
- 'label' => __( 'Item Description', 'unlimited-elements-for-elementor' ),
134
- 'type' => Controls_Manager::WYSIWYG,
135
- 'default' => __( '', 'unlimited-elements-for-elementor' ),
136
- 'label_block'=>true
137
- )
138
- );
139
-
140
-
141
- $objControls->add_control(
142
- $name.'_items',
143
- array(
144
- 'label' => __( 'Gallery Items', 'unlimited-elements-for-elementor' ),
145
- 'type' => Controls_Manager::REPEATER,
146
- 'fields' => $repeater->get_controls(),
147
- 'default' => array(),
148
- 'title_field' => '{{{ title }}}',
149
- )
150
- );
151
-
152
- $objControls->end_controls_section();
153
-
154
- }
155
-
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = "uc-default-widget-icon ue-wi-svg";
16
  const TEMPLATE_TYPE_ARCHIVE = "archive";
17
  const CONTROL_BACKGROUND_TYPE = "uc_background_type";
18
 
@@ -1050,8 +1050,6 @@ class UniteCreatorElementorIntegrate{
1050
 
1051
  $nonce = UniteProviderFunctionsUC::getNonce();
1052
 
1053
- dmp("import layout!!!");
1054
-
1055
  ?>
1056
  <style>
1057
 
@@ -1073,11 +1071,10 @@ class UniteCreatorElementorIntegrate{
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,6 +1090,7 @@ class UniteCreatorElementorIntegrate{
1093
  </div>
1094
 
1095
  </div>
 
1096
  <?php
1097
  }
1098
 
@@ -1130,7 +1128,7 @@ class UniteCreatorElementorIntegrate{
1130
 
1131
  if(empty(self::$arrWidgetIcons))
1132
  return(null);
1133
-
1134
  $styles = "";
1135
  foreach(self::$arrWidgetIcons as $class => $arrWidget){
1136
 
@@ -1184,7 +1182,7 @@ class UniteCreatorElementorIntegrate{
1184
  * on enqueue front end scripts
1185
  */
1186
  public function onEnqueueEditorScripts(){
1187
-
1188
  $adminStyleHandle = "unlimited_elements_editor_admin_css";
1189
 
1190
  HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.js", "unlimited_elments_editor_admin");
@@ -1194,13 +1192,7 @@ class UniteCreatorElementorIntegrate{
1194
 
1195
  if(!empty($stylesIcons))
1196
  wp_add_inline_style($adminStyleHandle, $stylesIcons);
1197
-
1198
- //include font awesome
1199
- $urlFontAwesomeCSS = HelperUC::getUrlFontAwesome();
1200
-
1201
- HelperUC::addStyleAbsoluteUrl($urlFontAwesomeCSS, "font-awesome");
1202
-
1203
-
1204
  $script = $this->getEditorPageCustomScripts();
1205
  UniteProviderFunctionsUC::printCustomScript($script, true);
1206
  }
@@ -1439,6 +1431,34 @@ class UniteCreatorElementorIntegrate{
1439
  self::$enableEditHTMLButton = UniteFunctionsUC::strToBool(self::$enableEditHTMLButton);
1440
  }
1441
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1442
 
1443
  /**
1444
  * check and add dynamic loop styles before render
@@ -1496,7 +1516,9 @@ class UniteCreatorElementorIntegrate{
1496
  $this->enableExportTemplate = false;
1497
  $this->enableImportTemplate = false;
1498
  }
1499
-
 
 
1500
  add_action('elementor/editor/init', array($this, 'onEditorInit'));
1501
 
1502
  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 = "fa fa-gears";
16
  const TEMPLATE_TYPE_ARCHIVE = "archive";
17
  const CONTROL_BACKGROUND_TYPE = "uc_background_type";
18
 
1050
 
1051
  $nonce = UniteProviderFunctionsUC::getNonce();
1052
 
 
 
1053
  ?>
1054
  <style>
1055
 
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
  </div>
1091
 
1092
  </div>
1093
+
1094
  <?php
1095
  }
1096
 
1128
 
1129
  if(empty(self::$arrWidgetIcons))
1130
  return(null);
1131
+
1132
  $styles = "";
1133
  foreach(self::$arrWidgetIcons as $class => $arrWidget){
1134
 
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
 
1193
  if(!empty($stylesIcons))
1194
  wp_add_inline_style($adminStyleHandle, $stylesIcons);
1195
+
 
 
 
 
 
 
1196
  $script = $this->getEditorPageCustomScripts();
1197
  UniteProviderFunctionsUC::printCustomScript($script, true);
1198
  }
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
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'));
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php CHANGED
@@ -351,31 +351,8 @@ 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 "image_json":
357
-
358
- //get json url
359
-
360
- $arrEmpty = array("url"=>"");
361
-
362
- $value = trim($value);
363
-
364
- if(empty($value))
365
- return($arrEmpty);
366
-
367
- $urlAssets = $this->objAddon->getUrlAssets();
368
-
369
- if(empty($urlAssets))
370
- return($arrEmpty);
371
-
372
- $value = $urlAssets.$value;
373
-
374
- $arrOutput = array("url"=>$value);
375
-
376
- return($arrOutput);
377
-
378
- break;
379
  case UniteCreatorDialogParam::PARAM_IMAGE:
380
 
381
  if(empty($value))
@@ -412,7 +389,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
412
 
413
  $arrData = array();
414
 
415
-
416
  foreach($arrValues as $paramName=>$value){
417
 
418
  $type = UniteFunctionsUC::getVal($arrTypes, $paramName);
@@ -511,7 +487,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
511
 
512
 
513
  }
514
-
 
 
515
  $repeater = new Repeater();
516
 
517
  $paramsItems = $this->objAddon->getProcessedItemsParams();
@@ -526,7 +504,14 @@ class UniteCreatorElementorWidget extends Widget_Base {
526
 
527
  if($name == "title")
528
  $titleField = $name;
529
-
 
 
 
 
 
 
 
530
  switch($type){
531
  case UniteCreatorDialogParam::PARAM_TEMPLATE: //convert template to text param
532
 
@@ -760,9 +745,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
760
  //$controlType = "uc_hr";
761
  $controlType = Controls_Manager::DIVIDER;
762
  break;
763
- case UniteCreatorDialogParam::PARAM_HEADING:
764
- $controlType = Controls_Manager::HEADING;
765
- break;
766
  case UniteCreatorDialogParam::PARAM_AUDIO:
767
  $controlType = "uc_mp3";
768
  break;
@@ -868,20 +850,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
868
  }
869
  */
870
 
871
- break;
872
- case UniteCreatorDialogParam::PARAM_IMAGE:
873
-
874
- $mediaType = UniteFunctionsUC::getVal($param, "media_type");
875
-
876
- if($mediaType == "json"){
877
-
878
- $defaultValue = UniteFunctionsUC::getVal($param, "default_value_json");
879
- $defaultValue = $this->modifyValueByTypeUC("image_json", $defaultValue);
880
-
881
- $arrControl['media_type'] = 'application/json';
882
- $arrControl['default'] = $defaultValue;
883
- }
884
-
885
  break;
886
  case "uc_select_special":
887
 
@@ -1565,6 +1533,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
1565
  call_user_func($function, $this->objControls, $param);
1566
 
1567
  break;
 
1568
  case UniteCreatorDialogParam::PARAM_INSTAGRAM:
1569
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
1570
  case UniteCreatorDialogParam::PARAM_WOO_CATS:
@@ -1808,10 +1777,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
1808
  foreach($params as $index => $param){
1809
 
1810
  $type = UniteFunctionsUC::getVal($param, "type");
1811
-
1812
  switch($type){
1813
- case UniteCreatorDialogParam::PARAM_NUMBER:
1814
- case UniteCreatorDialogParam::PARAM_SLIDER:
1815
  case UniteCreatorDialogParam::PARAM_TEXTAREA:
1816
  case UniteCreatorDialogParam::PARAM_TEXTFIELD:
1817
  case UniteCreatorDialogParam::PARAM_LINK:
@@ -1824,13 +1791,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
1824
  break;
1825
  }
1826
 
1827
- //skip selector enabled
1828
- $selector = UniteFunctionsUC::getVal($param, "selector");
1829
- $selector = trim($selector);
1830
-
1831
- if(!empty($selector))
1832
- continue;
1833
-
1834
  $param["add_dynamic"] = true;
1835
 
1836
  $params[$index] = $param;
@@ -2198,9 +2158,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2198
  * put listing sections
2199
  */
2200
  private function putListingSections($listingParam){
2201
-
2202
- $objUEControls = new UniteCreatorElementorControls();
2203
-
2204
  $name = UniteFunctionsUC::getVal($listingParam, "name");
2205
 
2206
  $useFor = UniteFunctionsUC::getVal($listingParam, "use_for");
@@ -2231,7 +2189,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
2231
 
2232
  $this->end_controls_section();
2233
 
2234
-
2235
  //woocommerce
2236
 
2237
  $isWooActive = UniteCreatorWooIntegrate::isWooActive();
@@ -2258,12 +2215,30 @@ class UniteCreatorElementorWidget extends Widget_Base {
2258
 
2259
  $this->end_controls_section();
2260
 
 
 
2261
  }
 
2262
 
2263
- //add the gallery repeater
2264
- if($isForGallery == true)
2265
- $objUEControls->addGalleryImageVideoRepeater($this, $textPrefix, $name);
2266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2267
 
2268
  }
2269
 
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
 
390
  $arrData = array();
391
 
 
392
  foreach($arrValues as $paramName=>$value){
393
 
394
  $type = UniteFunctionsUC::getVal($arrTypes, $paramName);
487
 
488
 
489
  }
490
+
491
+
492
+
493
  $repeater = new Repeater();
494
 
495
  $paramsItems = $this->objAddon->getProcessedItemsParams();
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
 
745
  //$controlType = "uc_hr";
746
  $controlType = Controls_Manager::DIVIDER;
747
  break;
 
 
 
748
  case UniteCreatorDialogParam::PARAM_AUDIO:
749
  $controlType = "uc_mp3";
750
  break;
850
  }
851
  */
852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  break;
854
  case "uc_select_special":
855
 
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:
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
  break;
1792
  }
1793
 
 
 
 
 
 
 
 
1794
  $param["add_dynamic"] = true;
1795
 
1796
  $params[$index] = $param;
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");
2189
 
2190
  $this->end_controls_section();
2191
 
 
2192
  //woocommerce
2193
 
2194
  $isWooActive = UniteCreatorWooIntegrate::isWooActive();
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
 
provider/core/plugins/unlimited_elements/elementor/images/widget-icon.svg DELETED
@@ -1,28 +0,0 @@
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,19 +21,10 @@ class UniteCreatorElementorPagination{
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,7 +58,9 @@ class UniteCreatorElementorPagination{
67
  //add filter enabled controls
68
 
69
  if($isFilterable == true){
70
-
 
 
71
  $widget->add_control(
72
  $paramName.'_filterable',
73
  [
@@ -82,10 +75,6 @@ class UniteCreatorElementorPagination{
82
  ]
83
  );
84
 
85
- }
86
-
87
- if($enableAjax == true){
88
-
89
  $widget->add_control(
90
  $paramName.'_isajax',
91
  [
@@ -100,7 +89,9 @@ class UniteCreatorElementorPagination{
100
  ]
101
  );
102
 
 
103
  }
 
104
 
105
  $widget->end_controls_section();
106
  }
@@ -385,7 +376,6 @@ class UniteCreatorElementorPagination{
385
  $isDebug = UniteFunctionsUC::getVal($args, "debug_pagination_options");
386
  $isDebug = UniteFunctionsUC::strToBool($isDebug);
387
 
388
-
389
  //--------- prepare options
390
 
391
  $options = array();
@@ -423,27 +413,13 @@ class UniteCreatorElementorPagination{
423
  }else{ //on single
424
 
425
  //skip for home pages
426
- if(is_home() == true){
427
-
428
- if($isDebug == true){
429
- dmp("Pagination Debug - Home Page, Skip");
430
- }
431
-
432
  return(false);
433
- }
434
-
435
  $options = $this->getSinglePageOptions($options);
436
 
437
- if(isset($options["current"]) == false){
438
-
439
- if($isDebug == true){
440
- dmp("<b>Pagination Options (custom) </b>: <br>");
441
- dmp("No pagination found for the last query <br>");
442
- dmp($options);
443
- }
444
-
445
  return(false);
446
- }
447
 
448
  if(empty($nextText))
449
  $options["next_text"] = _x( 'Next', 'next set of posts' );
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
  //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
  ]
76
  );
77
 
 
 
 
 
78
  $widget->add_control(
79
  $paramName.'_isajax',
80
  [
89
  ]
90
  );
91
 
92
+
93
  }
94
+
95
 
96
  $widget->end_controls_section();
97
  }
376
  $isDebug = UniteFunctionsUC::getVal($args, "debug_pagination_options");
377
  $isDebug = UniteFunctionsUC::strToBool($isDebug);
378
 
 
379
  //--------- prepare options
380
 
381
  $options = array();
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' );
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 . "elementor/elementor_controls.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 . "copy_paste.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
@@ -157,6 +157,23 @@
157
  </field>
158
 
159
  </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  <fieldset name="troubleshooting" label="Troubleshooting">
161
 
162
  <field name="memory_limit_text"
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"
provider/provider_params_processor.class.php CHANGED
@@ -1151,7 +1151,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
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
 
@@ -1249,7 +1249,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1249
  $arrIDsPHPFunction = array();
1250
  $arrIDsPostMeta = array();
1251
  $arrIDsDynamicField = array();
1252
- $arrIDsFromContent = array();
1253
 
1254
 
1255
  $makePostINOrder = false;
@@ -1303,12 +1302,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1303
  'compare'=>'!='
1304
  );
1305
 
1306
- break;
1307
- case "products_from_post": //get products from post content
1308
-
1309
- $objWoo = new UniteCreatorWooIntegrate();
1310
- $arrIDsFromContent = $objWoo->getProductIDsFromCurrentPostContent();
1311
-
1312
  break;
1313
  case "author":
1314
 
@@ -1480,11 +1473,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1480
  $makePostINOrder = true;
1481
  }
1482
 
1483
- if(!empty($arrIDsFromContent)){
1484
- $arrPostInIDs = $arrIDsFromContent;
1485
- $makePostINOrder = true;
1486
- }
1487
-
1488
 
1489
  //make order as "post__id"
1490
 
@@ -1579,8 +1567,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1579
  //-------- show debug query --------------
1580
 
1581
  if($showDebugQuery == true){
1582
- echo "<div class='uc-debug-query-wrapper'>"; //start debug wrapper
1583
-
1584
  dmp("The Query Is:");
1585
  dmp($args);
1586
  }
@@ -1627,7 +1613,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1627
 
1628
  if($showDebugQuery == true){
1629
  dmp("Found Posts: ".count($arrPosts));
1630
- echo "</div>";
1631
  }
1632
 
1633
 
@@ -1864,9 +1849,18 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1864
  $imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
1865
  $arrImageSizes["desktop"] = $imageSize;
1866
  }
 
 
 
 
 
 
 
1867
 
1868
- $objFilters = new UniteCreatorFiltersProcess();
1869
- $data = $objFilters->addWidgetFilterableVariables($data, $this->addon);
 
 
1870
 
1871
  //prepare listing output. no items prepare for the listing
1872
 
@@ -2235,6 +2229,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2235
 
2236
  $data = $this->getPostListData($value, $paramProducts["name"], $processType, $paramProducts, $data);
2237
 
 
2238
  break;
2239
  case "terms":
2240
 
@@ -2250,7 +2245,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2250
  case "current_post_meta": //meta field with image id's
2251
 
2252
  $data[$name."_items"] = $this->getGroupedData_getArrImageIDsFromMeta($value, $name);
2253
-
2254
  break;
2255
  default:
2256
  UniteFunctionsUC::throwError("Wrong listing source: $source");
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
 
1249
  $arrIDsPHPFunction = array();
1250
  $arrIDsPostMeta = array();
1251
  $arrIDsDynamicField = array();
 
1252
 
1253
 
1254
  $makePostINOrder = false;
1302
  'compare'=>'!='
1303
  );
1304
 
 
 
 
 
 
 
1305
  break;
1306
  case "author":
1307
 
1473
  $makePostINOrder = true;
1474
  }
1475
 
 
 
 
 
 
1476
 
1477
  //make order as "post__id"
1478
 
1567
  //-------- show debug query --------------
1568
 
1569
  if($showDebugQuery == true){
 
 
1570
  dmp("The Query Is:");
1571
  dmp($args);
1572
  }
1613
 
1614
  if($showDebugQuery == true){
1615
  dmp("Found Posts: ".count($arrPosts));
 
1616
  }
1617
 
1618
 
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
 
2229
 
2230
  $data = $this->getPostListData($value, $paramProducts["name"], $processType, $paramProducts, $data);
2231
 
2232
+
2233
  break;
2234
  case "terms":
2235
 
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");
provider/provider_settings.class.php CHANGED
@@ -1219,7 +1219,6 @@ 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
- $arrIncludeBy["products_from_post"] = __("Products From Post Content (woo)", "unlimited-elements-for-elementor");
1223
  }
1224
 
1225
  $addPostsText = sprintf(__("Add Specific %s", "unlimited-elements-for-elementor"), $textPosts);
@@ -1415,7 +1414,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1415
  $params["elementor_condition"] = $arrConditionIncludePostMeta;
1416
 
1417
  $this->addTextBox($name."_includeby_postmeta_metafield", "", esc_html__("Meta Field Name", "unlimited-elements-for-elementor"), $params);
1418
-
1419
  //----- include id's from dynamic field -------
1420
 
1421
  $arrConditionIncludeDynamic = $arrConditionIncludeBy;
@@ -1958,7 +1957,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1958
  $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1959
  $params["description"] = __("Show the current post meta fields, turn off it after choose the right one", "unlimited-elements-for-elementor");
1960
  $params["elementor_condition"] = $conditionCurrentMeta;
1961
-
1962
  $this->addRadioBoolean($name."_show_metafields", __("Debug - Show Meta Fields", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1963
 
1964
  //=========== GALLERY TITLE AND DESCRIPTION SOURCE =================
@@ -2026,7 +2025,6 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2026
  $arrSizes = array_flip($arrSizes);
2027
  $this->addSelect($name."_image_size", $arrSizes, __("Big Image Size", "unlimited-elements-for-elementor"), "large", $params);
2028
 
2029
-
2030
  }
2031
 
2032
 
@@ -2072,7 +2070,6 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2072
 
2073
  if($isForGallery == true){
2074
  $arrSource["current_post_meta"] = __("Current Post Metafield", "unlimited-elements-for-elementor");
2075
- $arrSource["image_video_repeater"] = __("Image And Video Items", "unlimited-elements-for-elementor");
2076
  }
2077
 
2078
  //$arrSource["terms"] = __("Terms", "unlimited-elements-for-elementor");
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
  $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;
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
  $arrSizes = array_flip($arrSizes);
2026
  $this->addSelect($name."_image_size", $arrSizes, __("Big Image Size", "unlimited-elements-for-elementor"), "large", $params);
2027
 
 
2028
  }
2029
 
2030
 
2070
 
2071
  if($isForGallery == true){
2072
  $arrSource["current_post_meta"] = __("Current Post Metafield", "unlimited-elements-for-elementor");
 
2073
  }
2074
 
2075
  //$arrSource["terms"] = __("Terms", "unlimited-elements-for-elementor");
provider/woocommerce_integrate.class.php CHANGED
@@ -525,45 +525,6 @@ class UniteCreatorWooIntegrate{
525
  }
526
 
527
  }
528
-
529
-
530
-
531
- /**
532
- * get product ids from current post content
533
- */
534
- public function getProductIDsFromCurrentPostContent(){
535
-
536
- if(is_singular() == false)
537
- return(false);
538
-
539
- $post = get_post();
540
-
541
- if(empty($post))
542
- return(false);
543
-
544
- $content = $post->post_content;
545
-
546
- if(empty($content))
547
- return(false);
548
-
549
- $arrLinks = UniteFunctionsUC::parseHTMLGetLinks($content);
550
-
551
- if(empty($arrLinks))
552
- return(false);
553
-
554
- $arrPostIDs = array();
555
-
556
- foreach($arrLinks as $link){
557
-
558
- $postID = url_to_postid($link);
559
-
560
- if(empty($postID))
561
- continue;
562
-
563
- $arrPostIDs[] = $postID;
564
- }
565
-
566
- return($arrPostIDs);
567
- }
568
 
569
  }
525
  }
526
 
527
  }
528
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
 
530
  }
readme.txt CHANGED
@@ -147,9 +147,7 @@ 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> - Instantly create a beautiful, animated countdown clock addon, to share on your Elementor website. Count down to a date with your own unique timer.
151
-
152
- </li>
153
  <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>
154
  <li><a href="https://unlimited-elements.com/business-hours-widget-for-elementor">Business Hours Widget for Elementor (Free)</a></li>
155
  <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>
@@ -158,12 +156,11 @@ Fully compatible and integrated with Toolset custom post types and fields.
158
  <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>
159
  <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>
160
  <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>
161
- <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>
162
- <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>
163
  <li><a href="https://unlimited-elements.com/list-marquee-widget-for-elementor/">List Marquee Widget for Elementor (Pro)</a></li>
164
- <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>
165
- <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.
166
- </li>
167
  <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>
168
  <li><a href="https://unlimited-elements.com/price-box-widget-for-elementor/">Price Box Widget for Elementor (Pro)</a></li>
169
  <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>
@@ -171,7 +168,7 @@ Fully compatible and integrated with Toolset custom post types and fields.
171
  <li><a href="https://unlimited-elements.com/product-bullets-widget-for-elementor">Product Bullets Widget for Elementor (Pro)</a></li>
172
  <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>
173
  <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>
174
- <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>
175
  </ol>
176
 
177
  <h3>Woocommerce for Elementor</h3>
@@ -229,11 +226,11 @@ https://github.com/ykob/shape-overlays</li>
229
  <li><a href="https://unlimited-elements.com/coverflow-carousel-widget-for-elementor/">Coverflow Carousel Widget for Elementor (Pro)</a></li>
230
  <li><a href="https://unlimited-elements.com/icon-carousel-widget-for-elementor/">Icon Carousel Widget for Elementor (Pro)</a></li>
231
  <li><a href="https://unlimited-elements.com/image-card-carousel-widget-for-elementor">Image Card Carousel Widget for Elementor (Pro)</a></li>
 
232
  <li><a href="https://unlimited-elements.com/material-carousel-widget-for-elementor/">Material Carousel Widget for Elementor (Pro)</a></li>
233
  <li><a href="https://unlimited-elements.com/overlay-carousel-widget-for-elementor">Overlay Carousel Widget for Elementor (Pro)</a></li>
234
  <li><a href="https://unlimited-elements.com/swipe-css-carousel-widget-for-elementor/">Swipe Carousel Widget for Elementor (Pro)</a></li>
235
  <li><a href="https://unlimited-elements.com/portfolio-carousel-widget-for-elementor/">Portfolio Carousel Widget for Elementor (Pro)</a></li>
236
- <li><a href="https://unlimited-elements.com/justified-image-carousel-widget-for-elementor/">Justified Image Carousel Widget for Elementor (Pro)</a></li>
237
  </ol>
238
 
239
  <h3>Slider Widgets for Elementor</h3>
@@ -456,8 +453,6 @@ https://github.com/ykob/shape-overlays</li>
456
  <li><a href="https://unlimited-elements.com/food-menu-list-widget-for-elementor">Food Menu List Widget for Elementor (Pro)</a></li>
457
  <li><a href="https://unlimited-elements.com/food-menu-carousel-widget-for-elementor">Food Menu Carousel Widget for Elementor (Pro)</a></li>
458
  </ol>
459
-
460
-
461
 
462
 
463
 
@@ -471,20 +466,6 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
471
 
472
  == Changelog ==
473
 
474
- version 1.4.81 = 2021-08-17:
475
-
476
- * Feature: added json select (lottie) for image attribute type
477
- * Feature: made option for ajax in widgets with post list attribute
478
- * Feature: made the ajax pagination work with pagination widget
479
- * Feature: added dynamic options for number and slider attribute types
480
- * Feature: added new owl carousel sources in assets chooser
481
- * Feature: added heading attribute
482
- * Change: added more types of debug for pagination widget
483
- * Change: changed widget icons chooser for elementor icon instead of font awesome icon
484
- * Fix: fixed import with template button dissapear in the new bar
485
- * Fix: fixed widgets icons
486
-
487
-
488
  version 1.4.80 = 2021-08-09:
489
 
490
  * Feature: added option to change items section label
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>
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>
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
  <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>
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
 
466
 
467
  == Changelog ==
468
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  version 1.4.80 = 2021-08-09:
470
 
471
  * Feature: added option to change items section label
release_log.txt CHANGED
@@ -1,20 +1,5 @@
1
 
2
 
3
- version 1.4.81:
4
-
5
- -feature: added json select (lottie) for image attribute type
6
- -feature: made option for ajax in widgets with post list attribute
7
- -feature: made the ajax pagination work with pagination widget
8
- -change: added more types of debug for pagination widget
9
- -bug fix: fixed import with template button dissapear in the new bar
10
- -bug fix: fixed widgets icons
11
- -change: changed widget icons chooser for elementor icon instead of font awesome icon
12
- -feature: added dynamic options for number and slider attribute types
13
- -feature: added new owl carousel sources in assets chooser
14
- -feature: added heading attribute
15
-
16
-
17
-
18
  version 1.4.80:
19
 
20
  -bug fix: fixed some test widgets output relate bugs
@@ -28,7 +13,6 @@ version 1.4.80:
28
  -feature: added extra fields to image base gallery options
29
  -feature: added php filter option for variable
30
  -feature: added twig functions "get_post_term" and "is_post_has_term". The examples visible when you click on item.posts.putPostTerm placeholder
31
- -feature: added current_user_id to include by meta field in post query selector
32
  -bug fix: fixed template dynamic background image didn't displayed bug in dynamic loops
33
 
34
 
1
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  version 1.4.80:
4
 
5
  -bug fix: fixed some test widgets output relate bugs
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
 
settings/addon_fields.xml CHANGED
@@ -6,7 +6,6 @@
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>
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>
settings/library.xml CHANGED
@@ -7,10 +7,10 @@
7
  </item>
8
  <item name="mootools" title="Mootools">
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,14 +26,6 @@
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>
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
  <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>
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.81
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.0
12
- Elementor Pro tested up to: 3.3.7
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.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"))
views/test_settings.php CHANGED
@@ -15,12 +15,10 @@ $data["term"] = "a";
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();
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();