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

Version Description

Download this release

Release Info

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

Code changes from version 1.4.96 to 1.4.98

assets_libraries/filters/ue_filters.js CHANGED
@@ -409,6 +409,7 @@ function UEDynamicFilters(){
409
 
410
 
411
 
 
412
  function ________PAGINATION_FILTER______(){}
413
 
414
 
@@ -661,6 +662,53 @@ function UEDynamicFilters(){
661
  return(objTerm);
662
  }
663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
 
665
  function ________DATA_______________(){}
666
 
@@ -858,6 +906,14 @@ function UEDynamicFilters(){
858
 
859
  objItemsWrapper = getGridItemsWrapper(objGrid);
860
 
 
 
 
 
 
 
 
 
861
  var htmlItems = getVal(response, "html_items");
862
 
863
  if(isLoadMore === true){
@@ -868,7 +924,6 @@ function UEDynamicFilters(){
868
  objItemsWrapper.html(htmlItems);
869
  }
870
 
871
- operateAjax_setHtmlDebug(response, objGrid);
872
 
873
  }
874
 
@@ -905,6 +960,9 @@ function UEDynamicFilters(){
905
 
906
  var htmlInner = objHtml.html();
907
 
 
 
 
908
  objFilter.html(htmlInner);
909
 
910
  objFilter.trigger("uc_ajax_reloaded");
@@ -1246,13 +1304,7 @@ function UEDynamicFilters(){
1246
  function refreshAjaxGrid(objGrid, refreshType){
1247
 
1248
  var isLoadMore = (refreshType == "loadmore");
1249
-
1250
- if(refreshType = "filters"){
1251
-
1252
- trace("init by filters");
1253
- return(false);
1254
- }
1255
-
1256
 
1257
  //get all grid filters
1258
  var objFilters = objGrid.data("filters");
@@ -1263,8 +1315,8 @@ function UEDynamicFilters(){
1263
  if(objFilters.length == 0)
1264
  return(false);
1265
 
1266
- var objAjaxOptions = getGridAjaxOptions(objFilters, objGrid);
1267
-
1268
  if(!objAjaxOptions)
1269
  return(false);
1270
 
@@ -1308,8 +1360,8 @@ function UEDynamicFilters(){
1308
  /**
1309
  * get grid ajax options
1310
  */
1311
- function getGridAjaxOptions(objFilters, objGrid){
1312
-
1313
  if(!objFilters)
1314
  return(false);
1315
 
@@ -1321,6 +1373,8 @@ function UEDynamicFilters(){
1321
  var page = null;
1322
  var numItems = null;
1323
  var arrTerms = [];
 
 
1324
 
1325
  //get ajax options
1326
  jQuery.each(objFilters, function(index, objFilter){
@@ -1350,7 +1404,7 @@ function UEDynamicFilters(){
1350
 
1351
  if(objTerm)
1352
  arrTerms.push(objTerm);
1353
-
1354
  break;
1355
  case g_types.CHECKBOX:
1356
 
@@ -1361,15 +1415,31 @@ function UEDynamicFilters(){
1361
  throw new Error("Unknown filter type: "+type);
1362
  break;
1363
  }
1364
-
1365
  //add widget id of the filter to refresh
1366
 
1367
  var isNoRefresh = objFilter.data("uc_norefresh");
 
 
 
 
 
 
 
 
 
 
 
1368
  objFilter.data("uc_norefresh",false);
1369
 
1370
- if(isNoRefresh !== true){
 
1371
  var filterWidgetID = getElementWidgetID(objFilter);
1372
 
 
 
 
 
1373
  if(strRefreshIDs)
1374
  strRefreshIDs += ",";
1375
 
@@ -1382,6 +1452,22 @@ function UEDynamicFilters(){
1382
 
1383
  }); //end filters iteration
1384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1385
  if(urlAjax == null)
1386
  return(null);
1387
 
@@ -1393,7 +1479,10 @@ function UEDynamicFilters(){
1393
  var urlAddition = "ucfrontajaxaction=getfiltersdata&layoutid="+layoutID+"&elid="+widgetID;
1394
 
1395
  urlAjax = addUrlParam(urlAjax, urlAddition);
1396
-
 
 
 
1397
  if(page)
1398
  urlAjax += "&ucpage="+page;
1399
 
@@ -1447,7 +1536,7 @@ function UEDynamicFilters(){
1447
  * init the globals
1448
  */
1449
  function initGlobals(){
1450
-
1451
  if(typeof g_strFiltersData != "undefined"){
1452
  g_filtersData = JSON.parse(g_strFiltersData);
1453
  }
@@ -1571,33 +1660,6 @@ function UEDynamicFilters(){
1571
  }
1572
 
1573
 
1574
- /**
1575
- * get filter taxonomy id's
1576
- */
1577
- function getFilterTaxIDs(objFilter, objIDs){
1578
-
1579
- //skip the if
1580
- var objItems = objFilter.find(".ue_taxonomy_item");
1581
-
1582
- if(objItems.length == 0)
1583
- return([]);
1584
-
1585
- jQuery.each(objItems, function(index, item){
1586
-
1587
- var objItem = jQuery(item);
1588
- var taxID = objItem.data("id");
1589
-
1590
- if(!taxID)
1591
- return(true);
1592
-
1593
- objIDs[taxID] = true;
1594
- });
1595
-
1596
- return(objIDs);
1597
- }
1598
-
1599
-
1600
-
1601
  /**
1602
  * check and call ajax init filters
1603
  */
@@ -1629,7 +1691,7 @@ function UEDynamicFilters(){
1629
  * init
1630
  */
1631
  function init(){
1632
-
1633
  var success = initGlobals();
1634
 
1635
  if(success == false)
409
 
410
 
411
 
412
+
413
  function ________PAGINATION_FILTER______(){}
414
 
415
 
662
  return(objTerm);
663
  }
664
 
665
+ function ________INIT_FILTERS_______________(){}
666
+
667
+ /**
668
+ * get filter taxonomy id's
669
+ */
670
+ function getFilterTaxIDs(objFilter, objIDs){
671
+
672
+ //skip the if
673
+ var objItems = objFilter.find(".ue_taxonomy_item");
674
+
675
+ if(objItems.length == 0)
676
+ return([]);
677
+
678
+ jQuery.each(objItems, function(index, item){
679
+
680
+ var objItem = jQuery(item);
681
+ var taxID = objItem.data("id");
682
+
683
+ if(!taxID)
684
+ return(true);
685
+
686
+ objIDs[taxID] = true;
687
+ });
688
+
689
+ return(objIDs);
690
+ }
691
+
692
+ /**
693
+ * get tax id's list string from assoc object
694
+ */
695
+ function getTermDsList(objIDs){
696
+
697
+ var strIDs = "";
698
+ for(var id in objIDs){
699
+
700
+ if(jQuery.isNumeric(id) == false)
701
+ continue;
702
+
703
+ if(strIDs)
704
+ strIDs += ",";
705
+
706
+ strIDs += id;
707
+ }
708
+
709
+ return(strIDs);
710
+ }
711
+
712
 
713
  function ________DATA_______________(){}
714
 
906
 
907
  objItemsWrapper = getGridItemsWrapper(objGrid);
908
 
909
+ operateAjax_setHtmlDebug(response, objGrid);
910
+
911
+ //set grid items
912
+
913
+ //if init filters mode, and no items response - don't set
914
+ if(response.hasOwnProperty("html_items") == false)
915
+ return(false);
916
+
917
  var htmlItems = getVal(response, "html_items");
918
 
919
  if(isLoadMore === true){
924
  objItemsWrapper.html(htmlItems);
925
  }
926
 
 
927
 
928
  }
929
 
960
 
961
  var htmlInner = objHtml.html();
962
 
963
+ objFilter.removeClass("uc-filter-initing");
964
+ objFilter.removeClass("uc-ajax-refresh-soon");
965
+
966
  objFilter.html(htmlInner);
967
 
968
  objFilter.trigger("uc_ajax_reloaded");
1304
  function refreshAjaxGrid(objGrid, refreshType){
1305
 
1306
  var isLoadMore = (refreshType == "loadmore");
1307
+ var isFiltersInit = (refreshType == "filters");
 
 
 
 
 
 
1308
 
1309
  //get all grid filters
1310
  var objFilters = objGrid.data("filters");
1315
  if(objFilters.length == 0)
1316
  return(false);
1317
 
1318
+ var objAjaxOptions = getGridAjaxOptions(objFilters, objGrid, isFiltersInit);
1319
+
1320
  if(!objAjaxOptions)
1321
  return(false);
1322
 
1360
  /**
1361
  * get grid ajax options
1362
  */
1363
+ function getGridAjaxOptions(objFilters, objGrid, isFiltersInitMode){
1364
+
1365
  if(!objFilters)
1366
  return(false);
1367
 
1373
  var page = null;
1374
  var numItems = null;
1375
  var arrTerms = [];
1376
+ var objInitTaxIDs = {};
1377
+
1378
 
1379
  //get ajax options
1380
  jQuery.each(objFilters, function(index, objFilter){
1404
 
1405
  if(objTerm)
1406
  arrTerms.push(objTerm);
1407
+
1408
  break;
1409
  case g_types.CHECKBOX:
1410
 
1415
  throw new Error("Unknown filter type: "+type);
1416
  break;
1417
  }
1418
+
1419
  //add widget id of the filter to refresh
1420
 
1421
  var isNoRefresh = objFilter.data("uc_norefresh");
1422
+
1423
+ //handle filters init mode
1424
+
1425
+ if(isFiltersInitMode == true){
1426
+
1427
+ var isInit = objFilter.data("initafter");
1428
+
1429
+ if(isInit == false)
1430
+ isNoRefresh = true;
1431
+ }
1432
+
1433
  objFilter.data("uc_norefresh",false);
1434
 
1435
+ if(isNoRefresh !== true){ //add to refresh mode
1436
+
1437
  var filterWidgetID = getElementWidgetID(objFilter);
1438
 
1439
+ //add test tax id's for init mode
1440
+ if(isFiltersInitMode == true)
1441
+ objInitTaxIDs = getFilterTaxIDs(objFilter, objInitTaxIDs);
1442
+
1443
  if(strRefreshIDs)
1444
  strRefreshIDs += ",";
1445
 
1452
 
1453
  }); //end filters iteration
1454
 
1455
+
1456
+ //add init filters additions
1457
+
1458
+ var urlAddition_filtersInit = "";
1459
+
1460
+ if(isFiltersInitMode == true){
1461
+
1462
+ var strTaxIDs = getTermDsList(objInitTaxIDs);
1463
+
1464
+ if(!strTaxIDs)
1465
+ urlAjax = null;
1466
+ else{
1467
+ urlAddition_filtersInit += "&modeinit=true&inittermids="+strTaxIDs;
1468
+ }
1469
+ }
1470
+
1471
  if(urlAjax == null)
1472
  return(null);
1473
 
1479
  var urlAddition = "ucfrontajaxaction=getfiltersdata&layoutid="+layoutID+"&elid="+widgetID;
1480
 
1481
  urlAjax = addUrlParam(urlAjax, urlAddition);
1482
+
1483
+ if(urlAddition_filtersInit)
1484
+ urlAjax = addUrlParam(urlAjax, urlAddition_filtersInit);
1485
+
1486
  if(page)
1487
  urlAjax += "&ucpage="+page;
1488
 
1536
  * init the globals
1537
  */
1538
  function initGlobals(){
1539
+
1540
  if(typeof g_strFiltersData != "undefined"){
1541
  g_filtersData = JSON.parse(g_strFiltersData);
1542
  }
1660
  }
1661
 
1662
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1663
  /**
1664
  * check and call ajax init filters
1665
  */
1691
  * init
1692
  */
1693
  function init(){
1694
+
1695
  var success = initGlobals();
1696
 
1697
  if(success == false)
assets_libraries/owl-carousel-new/owl.carousel.js CHANGED
@@ -1,139 +1,139 @@
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,
@@ -144,12 +144,12 @@
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: {
@@ -158,70 +158,72 @@
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',
@@ -233,39 +235,39 @@
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() {
@@ -285,58 +287,58 @@
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));
@@ -345,9 +347,9 @@
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
  }
@@ -355,40 +357,40 @@
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)];
@@ -420,79 +422,108 @@
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
@@ -501,66 +532,66 @@
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 {
@@ -569,201 +600,201 @@
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 = {
@@ -774,64 +805,64 @@
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;
@@ -842,81 +873,81 @@
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()])) {
@@ -925,554 +956,554 @@
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)
@@ -1481,1969 +1512,1983 @@
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
 
3210
- $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3211
- };
3212
-
3213
- /**
3214
- * Slides to the previous item or page.
3215
- * @public
3216
- * @param {Number} [speed=false] - The time in milliseconds for the transition.
3217
- */
3218
- Navigation.prototype.prev = function(speed) {
3219
- $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3220
- };
3221
-
3222
- /**
3223
- * Slides to the specified item or page.
3224
- * @public
3225
- * @param {Number} position - The position of the item or page.
3226
- * @param {Number} [speed] - The time in milliseconds for the transition.
3227
- * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3228
- */
3229
- Navigation.prototype.to = function(position, speed, standard) {
3230
- var length;
3231
-
3232
- if (!standard && this._pages.length) {
3233
- length = this._pages.length;
3234
- $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3235
- } else {
3236
- $.proxy(this._overrides.to, this._core)(position, speed);
3237
- }
3238
- };
3239
-
3240
- $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3241
-
3242
- })(window.Zepto || window.jQuery, window, document);
3243
-
3244
- /**
3245
- * Hash Plugin
3246
- * @version 2.3.4
3247
- * @author Artus Kolanowski
3248
- * @author David Deutsch
3249
- * @license The MIT License (MIT)
3250
- */
3251
- ;(function($, window, document, undefined) {
3252
- 'use strict';
3253
-
3254
- /**
3255
- * Creates the hash plugin.
3256
- * @class The Hash Plugin
3257
- * @param {Owl} carousel - The Owl Carousel
3258
- */
3259
- var Hash = function(carousel) {
3260
- /**
3261
- * Reference to the core.
3262
- * @protected
3263
- * @type {Owl}
3264
- */
3265
- this._core = carousel;
3266
-
3267
- /**
3268
- * Hash index for the items.
3269
- * @protected
3270
- * @type {Object}
3271
- */
3272
- this._hashes = {};
3273
-
3274
- /**
3275
- * The carousel element.
3276
- * @type {jQuery}
3277
- */
3278
- this.$element = this._core.$element;
3279
-
3280
- /**
3281
- * All event handlers.
3282
- * @protected
3283
- * @type {Object}
3284
- */
3285
- this._handlers = {
3286
- 'initialized.owl.carousel': $.proxy(function(e) {
3287
- if (e.namespace && this._core.settings.startPosition === 'URLHash') {
3288
- $(window).trigger('hashchange.owl.navigation');
3289
- }
3290
- }, this),
3291
- 'prepared.owl.carousel': $.proxy(function(e) {
3292
- if (e.namespace) {
3293
- var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
3294
-
3295
- if (!hash) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3296
  return;
3297
  }
3298
-
3299
- this._hashes[hash] = e.content;
3300
- }
3301
- }, this),
3302
- 'changed.owl.carousel': $.proxy(function(e) {
3303
- if (e.namespace && e.property.name === 'position') {
3304
- var current = this._core.items(this._core.relative(this._core.current())),
3305
- hash = $.map(this._hashes, function(item, hash) {
3306
- return item === current ? hash : null;
3307
- }).join();
3308
-
3309
- if (!hash || window.location.hash.slice(1) === hash) {
3310
  return;
3311
  }
3312
-
3313
- window.location.hash = hash;
3314
- }
3315
- }, this)
3316
- };
3317
-
3318
- // set default options
3319
- this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3320
-
3321
- // register the event handlers
3322
- this.$element.on(this._handlers);
3323
-
3324
- // register event listener for hash navigation
3325
- $(window).on('hashchange.owl.navigation', $.proxy(function(e) {
3326
- var hash = window.location.hash.substring(1),
3327
- items = this._core.$stage.children(),
3328
- position = this._hashes[hash] && items.index(this._hashes[hash]);
3329
-
3330
- if (position === undefined || position === this._core.current()) {
3331
- return;
3332
- }
3333
-
3334
- this._core.to(this._core.relative(position), false, true);
3335
- }, this));
3336
- };
3337
-
3338
- /**
3339
- * Default options.
3340
- * @public
3341
- */
3342
- Hash.Defaults = {
3343
- URLhashListener: false
3344
- };
3345
-
3346
- /**
3347
- * Destroys the plugin.
3348
- * @public
3349
- */
3350
- Hash.prototype.destroy = function() {
3351
- var handler, property;
3352
-
3353
- $(window).off('hashchange.owl.navigation');
3354
-
3355
- for (handler in this._handlers) {
3356
- this._core.$element.off(handler, this._handlers[handler]);
3357
- }
3358
- for (property in Object.getOwnPropertyNames(this)) {
3359
- typeof this[property] != 'function' && (this[property] = null);
3360
- }
3361
- };
3362
-
3363
- $.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3364
-
3365
- })(window.Zepto || window.jQuery, window, document);
3366
-
3367
- /**
3368
- * Support Plugin
3369
- *
3370
- * @version 2.3.4
3371
- * @author Vivid Planet Software GmbH
3372
- * @author Artus Kolanowski
3373
- * @author David Deutsch
3374
- * @license The MIT License (MIT)
3375
- */
3376
- ;(function($, window, document, undefined) {
3377
-
3378
- var style = $('<support>').get(0).style,
3379
- prefixes = 'Webkit Moz O ms'.split(' '),
3380
- events = {
3381
- transition: {
3382
- end: {
3383
- WebkitTransition: 'webkitTransitionEnd',
3384
- MozTransition: 'transitionend',
3385
- OTransition: 'oTransitionEnd',
3386
- transition: 'transitionend'
3387
- }
3388
- },
3389
- animation: {
3390
- end: {
3391
- WebkitAnimation: 'webkitAnimationEnd',
3392
- MozAnimation: 'animationend',
3393
- OAnimation: 'oAnimationEnd',
3394
- animation: 'animationend'
3395
- }
3396
- }
3397
- },
3398
- tests = {
3399
- csstransforms: function() {
3400
- return !!test('transform');
3401
- },
3402
- csstransforms3d: function() {
3403
- return !!test('perspective');
3404
- },
3405
- csstransitions: function() {
3406
- return !!test('transition');
3407
- },
3408
- cssanimations: function() {
3409
- return !!test('animation');
3410
- }
3411
- };
3412
-
3413
- function test(property, prefixed) {
3414
- var result = false,
3415
- upper = property.charAt(0).toUpperCase() + property.slice(1);
3416
-
3417
- $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
3418
- if (style[property] !== undefined) {
3419
- result = prefixed ? property : true;
3420
- return false;
3421
- }
3422
- });
3423
-
3424
- return result;
3425
- }
3426
-
3427
- function prefixed(property) {
3428
- return test(property, true);
3429
- }
3430
-
3431
- if (tests.csstransitions()) {
3432
- /* jshint -W053 */
3433
- $.support.transition = new String(prefixed('transition'))
3434
- $.support.transition.end = events.transition.end[ $.support.transition ];
3435
- }
3436
-
3437
- if (tests.cssanimations()) {
3438
- /* jshint -W053 */
3439
- $.support.animation = new String(prefixed('animation'))
3440
- $.support.animation.end = events.animation.end[ $.support.animation ];
3441
- }
3442
-
3443
- if (tests.csstransforms()) {
3444
- /* jshint -W053 */
3445
- $.support.transform = new String(prefixed('transform'));
3446
- $.support.transform3d = tests.csstransforms3d();
3447
- }
3448
-
3449
- })(window.Zepto || window.jQuery, window, document);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /**
2
+ * Owl Carousel v2.3.4 - UE3
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,
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: {
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
+ setActiveClass: true,
193
+ setActiveClassOnMobile: true,
194
+
195
  mouseDrag: true,
196
  touchDrag: true,
197
  pullDrag: true,
198
  freeDrag: false,
199
+
200
  margin: 0,
201
  stagePadding: 0,
202
+
203
  merge: false,
204
  mergeFit: true,
205
  autoWidth: false,
206
+
207
  startPosition: 0,
208
  rtl: false,
209
+
210
  smartSpeed: 250,
211
  fluidSpeed: false,
212
  dragEndSpeed: false,
213
+
214
  responsive: {},
215
  responsiveRefreshRate: 200,
216
  responsiveBaseElement: window,
217
+
218
  fallbackEasing: 'swing',
219
  slideTransition: '',
220
+
221
  info: false,
222
+
223
  nestedItemSelector: false,
224
  itemElement: 'div',
225
  stageElement: 'div',
226
+
227
  refreshClass: 'owl-refresh',
228
  loadedClass: 'owl-loaded',
229
  loadingClass: 'owl-loading',
235
  stageOuterClass: 'owl-stage-outer',
236
  grabClass: 'owl-grab'
237
  };
238
+
239
  /**
240
+ * Enumeration for width.
241
+ * @public
242
+ * @readonly
243
+ * @enum {String}
244
+ */
245
  Owl.Width = {
246
  Default: 'default',
247
  Inner: 'inner',
248
  Outer: 'outer'
249
  };
250
+
251
  /**
252
+ * Enumeration for types.
253
+ * @public
254
+ * @readonly
255
+ * @enum {String}
256
+ */
257
  Owl.Type = {
258
  Event: 'event',
259
  State: 'state'
260
  };
261
+
262
  /**
263
+ * Contains all registered plugins.
264
+ * @public
265
+ */
266
  Owl.Plugins = {};
267
+
268
  /**
269
+ * List of workers involved in the update process.
270
+ */
271
  Owl.Workers = [ {
272
  filter: [ 'width', 'settings' ],
273
  run: function() {
287
  filter: [ 'width', 'items', 'settings' ],
288
  run: function(cache) {
289
  var margin = this.settings.margin || '',
290
+ grid = !this.settings.autoWidth,
291
+ rtl = this.settings.rtl,
292
+ css = {
293
+ 'width': 'auto',
294
+ 'margin-left': rtl ? margin : '',
295
+ 'margin-right': rtl ? '' : margin
296
+ };
297
+
298
  !grid && this.$stage.children().css(css);
299
+
300
  cache.css = css;
301
  }
302
  }, {
303
  filter: [ 'width', 'items', 'settings' ],
304
  run: function(cache) {
305
  var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
306
+ merge = null,
307
+ iterator = this._items.length,
308
+ grid = !this.settings.autoWidth,
309
+ widths = [];
310
+
311
  cache.items = {
312
  merge: false,
313
  width: width
314
  };
315
+
316
  while (iterator--) {
317
  merge = this._mergers[iterator];
318
  merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
319
+
320
  cache.items.merge = merge > 1 || cache.items.merge;
321
+
322
  widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
323
  }
324
+
325
  this._widths = widths;
326
  }
327
  }, {
328
  filter: [ 'items', 'settings' ],
329
  run: function() {
330
  var clones = [],
331
+ items = this._items,
332
+ settings = this.settings,
333
+ // TODO: Should be computed from number of min width items in stage
334
+ view = Math.max(settings.items * 2, 4),
335
+ size = Math.ceil(items.length / 2) * 2,
336
+ repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
337
+ append = '',
338
+ prepend = '';
339
+
340
  repeat /= 2;
341
+
342
  while (repeat > 0) {
343
  // Switch to only using appended clones
344
  clones.push(this.normalize(clones.length / 2, true));
347
  prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
348
  repeat -= 1;
349
  }
350
+
351
  this._clones = clones;
352
+
353
  $(append).addClass('cloned').appendTo(this.$stage);
354
  $(prepend).addClass('cloned').prependTo(this.$stage);
355
  }
357
  filter: [ 'width', 'items', 'settings' ],
358
  run: function() {
359
  var rtl = this.settings.rtl ? 1 : -1,
360
+ size = this._clones.length + this._items.length,
361
+ iterator = -1,
362
+ previous = 0,
363
+ current = 0,
364
+ coordinates = [];
365
+
366
  while (++iterator < size) {
367
  previous = coordinates[iterator - 1] || 0;
368
  current = this._widths[this.relative(iterator)] + this.settings.margin;
369
  coordinates.push(previous + current * rtl);
370
  }
371
+
372
  this._coordinates = coordinates;
373
  }
374
  }, {
375
  filter: [ 'width', 'items', 'settings' ],
376
  run: function() {
377
  var padding = this.settings.stagePadding,
378
+ coordinates = this._coordinates,
379
+ css = {
380
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
381
+ 'padding-left': padding || '',
382
+ 'padding-right': padding || ''
383
+ };
384
+
385
  this.$stage.css(css);
386
  }
387
  }, {
388
  filter: [ 'width', 'items', 'settings' ],
389
  run: function(cache) {
390
  var iterator = this._coordinates.length,
391
+ grid = !this.settings.autoWidth,
392
+ items = this.$stage.children();
393
+
394
  if (grid && cache.items.merge) {
395
  while (iterator--) {
396
  cache.css.width = this._widths[this.relative(iterator)];
422
  filter: [ 'width', 'position', 'items', 'settings' ],
423
  run: function() {
424
  var rtl = this.settings.rtl ? 1 : -1,
425
+ padding = this.settings.stagePadding * 2,
426
+ begin = this.coordinates(this.current()) + padding,
427
+ end = begin + this.width() * rtl,
428
+ inner, outer, matches = [], i, n;
429
+
430
  for (i = 0, n = this._coordinates.length; i < n; i++) {
431
  inner = this._coordinates[i - 1] || 0;
432
  outer = Math.abs(this._coordinates[i]) + padding * rtl;
433
+
434
  if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
435
+ || (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
436
  matches.push(i);
437
  }
438
  }
439
+
440
  this.$stage.children('.active').removeClass('active');
441
  this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
442
+
443
  this.$stage.children('.center').removeClass('center');
444
  if (this.settings.center) {
445
  this.$stage.children().eq(this.current()).addClass('center');
446
  }
447
  }
448
+ }, {
449
+ filter: [ 'width', 'position', 'items', 'settings' ],
450
+ run: function() {
451
+
452
+ if(!this.settings.setActiveClass){
453
+ return;
454
+ }
455
 
456
+ if (this.settings.setActiveClass) {
457
+ var $setClass = true;
458
+
459
+ if (this.settings.setActiveClassOnMobile) {
460
+ if(this.$stage.children(".active").length == 1){
461
+ $setClass = true;
462
+ }
463
+ }else if(!this.settings.setActiveClassOnMobile){
464
+ if(this.$stage.children(".active").length == 1){
465
+ $setClass = false;
466
+ }
467
+ }
468
+
469
+ if($setClass == true){
470
+ this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item");
471
+ }else if ($setClass == false){
472
+ this.$stage.children().removeClass("uc-active-item");
473
+ }
474
+
475
+ }
476
+ }
477
+ }];
478
+
479
  /**
480
+ * Create the stage DOM element
481
+ */
482
  Owl.prototype.initializeStage = function() {
483
  this.$stage = this.$element.find('.' + this.settings.stageClass);
484
+
485
  // if the stage is already in the DOM, grab it and skip stage initialization
486
  if (this.$stage.length) {
487
  return;
488
  }
489
+
490
  this.$element.addClass(this.options.loadingClass);
491
+
492
  // create stage
493
  this.$stage = $('<' + this.settings.stageElement + '>', {
494
  "class": this.settings.stageClass
495
  }).wrap( $( '<div/>', {
496
  "class": this.settings.stageOuterClass
497
  }));
498
+
499
  // append stage
500
  this.$element.append(this.$stage.parent());
501
  };
502
+
503
  /**
504
+ * Create item DOM elements
505
+ */
506
  Owl.prototype.initializeItems = function() {
507
  var $items = this.$element.find('.owl-item');
508
+
509
  // if the items are already in the DOM, grab them and skip item initialization
510
  if ($items.length) {
511
  this._items = $items.get().map(function(item) {
512
  return $(item);
513
  });
514
+
515
  this._mergers = this._items.map(function() {
516
  return 1;
517
  });
518
+
519
  this.refresh();
520
+
521
  return;
522
  }
523
+
524
  // append content
525
  this.replace(this.$element.children().not(this.$stage.parent()));
526
+
527
  // check visibility
528
  if (this.isVisible()) {
529
  // update view
532
  // invalidate width
533
  this.invalidate('width');
534
  }
535
+
536
  this.$element
537
+ .removeClass(this.options.loadingClass)
538
+ .addClass(this.options.loadedClass);
539
  };
540
+
541
  /**
542
+ * Initializes the carousel.
543
+ * @protected
544
+ */
545
  Owl.prototype.initialize = function() {
546
  this.enter('initializing');
547
  this.trigger('initialize');
548
+
549
  this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
550
+
551
  if (this.settings.autoWidth && !this.is('pre-loading')) {
552
  var imgs, nestedSelector, width;
553
  imgs = this.$element.find('img');
554
  nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
555
  width = this.$element.children(nestedSelector).width();
556
+
557
  if (imgs.length && width <= 0) {
558
  this.preloadAutoWidthImages(imgs);
559
  }
560
  }
561
+
562
  this.initializeStage();
563
  this.initializeItems();
564
+
565
  // register event handlers
566
  this.registerEventHandlers();
567
+
568
  this.leave('initializing');
569
  this.trigger('initialized');
570
  };
571
+
572
  /**
573
+ * @returns {Boolean} visibility of $element
574
+ * if you know the carousel will always be visible you can set `checkVisibility` to `false` to
575
+ * prevent the expensive browser layout forced reflow the $element.is(':visible') does
576
+ */
577
  Owl.prototype.isVisible = function() {
578
  return this.settings.checkVisibility
579
+ ? this.$element.is(':visible')
580
+ : true;
581
  };
582
+
583
  /**
584
+ * Setups the current settings.
585
+ * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
586
+ * @todo Support for media queries by using `matchMedia` would be nice.
587
+ * @public
588
+ */
589
  Owl.prototype.setup = function() {
590
  var viewport = this.viewport(),
591
+ overwrites = this.options.responsive,
592
+ match = -1,
593
+ settings = null;
594
+
595
  if (!overwrites) {
596
  settings = $.extend({}, this.options);
597
  } else {
600
  match = Number(breakpoint);
601
  }
602
  });
603
+
604
  settings = $.extend({}, this.options, overwrites[match]);
605
  if (typeof settings.stagePadding === 'function') {
606
  settings.stagePadding = settings.stagePadding();
607
  }
608
  delete settings.responsive;
609
+
610
  // responsive class
611
  if (settings.responsiveClass) {
612
  this.$element.attr('class',
613
+ this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
614
  );
615
  }
616
  }
617
+
618
  this.trigger('change', { property: { name: 'settings', value: settings } });
619
  this._breakpoint = match;
620
  this.settings = settings;
621
  this.invalidate('settings');
622
  this.trigger('changed', { property: { name: 'settings', value: this.settings } });
623
  };
624
+
625
  /**
626
+ * Updates option logic if necessery.
627
+ * @protected
628
+ */
629
  Owl.prototype.optionsLogic = function() {
630
  if (this.settings.autoWidth) {
631
  this.settings.stagePadding = false;
632
  this.settings.merge = false;
633
  }
634
  };
635
+
636
  /**
637
+ * Prepares an item before add.
638
+ * @todo Rename event parameter `content` to `item`.
639
+ * @protected
640
+ * @returns {jQuery|HTMLElement} - The item container.
641
+ */
642
  Owl.prototype.prepare = function(item) {
643
  var event = this.trigger('prepare', { content: item });
644
+
645
  if (!event.data) {
646
  event.data = $('<' + this.settings.itemElement + '/>')
647
+ .addClass(this.options.itemClass).append(item)
648
  }
649
+
650
  this.trigger('prepared', { content: event.data });
651
+
652
  return event.data;
653
  };
654
+
655
  /**
656
+ * Updates the view.
657
+ * @public
658
+ */
659
  Owl.prototype.update = function() {
660
  var i = 0,
661
+ n = this._pipe.length,
662
+ filter = $.proxy(function(p) { return this[p] }, this._invalidated),
663
+ cache = {};
664
+
665
  while (i < n) {
666
  if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
667
  this._pipe[i].run(cache);
668
  }
669
  i++;
670
  }
671
+
672
  this._invalidated = {};
673
+
674
  !this.is('valid') && this.enter('valid');
675
  };
676
+
677
  /**
678
+ * Gets the width of the view.
679
+ * @public
680
+ * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
681
+ * @returns {Number} - The width of the view in pixel.
682
+ */
683
  Owl.prototype.width = function(dimension) {
684
  dimension = dimension || Owl.Width.Default;
685
  switch (dimension) {
686
  case Owl.Width.Inner:
687
  case Owl.Width.Outer:
688
+ return this._width;
689
  default:
690
+ return this._width - this.settings.stagePadding * 2 + this.settings.margin;
691
  }
692
  };
693
+
694
  /**
695
+ * Refreshes the carousel primarily for adaptive purposes.
696
+ * @public
697
+ */
698
  Owl.prototype.refresh = function() {
699
  this.enter('refreshing');
700
  this.trigger('refresh');
701
+
702
  this.setup();
703
+
704
  this.optionsLogic();
705
+
706
  this.$element.addClass(this.options.refreshClass);
707
+
708
  this.update();
709
+
710
  this.$element.removeClass(this.options.refreshClass);
711
+
712
  this.leave('refreshing');
713
  this.trigger('refreshed');
714
  };
715
+
716
  /**
717
+ * Checks window `resize` event.
718
+ * @protected
719
+ */
720
  Owl.prototype.onThrottledResize = function() {
721
  window.clearTimeout(this.resizeTimer);
722
  this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
723
  };
724
+
725
  /**
726
+ * Checks window `resize` event.
727
+ * @protected
728
+ */
729
  Owl.prototype.onResize = function() {
730
  if (!this._items.length) {
731
  return false;
732
  }
733
+
734
  if (this._width === this.$element.width()) {
735
  return false;
736
  }
737
+
738
  if (!this.isVisible()) {
739
  return false;
740
  }
741
+
742
  this.enter('resizing');
743
+
744
  if (this.trigger('resize').isDefaultPrevented()) {
745
  this.leave('resizing');
746
  return false;
747
  }
748
+
749
  this.invalidate('width');
750
+
751
  this.refresh();
752
+
753
  this.leave('resizing');
754
  this.trigger('resized');
755
  };
756
+
757
  /**
758
+ * Registers event handlers.
759
+ * @todo Check `msPointerEnabled`
760
+ * @todo #261
761
+ * @protected
762
+ */
763
  Owl.prototype.registerEventHandlers = function() {
764
  if ($.support.transition) {
765
  this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
766
  }
767
+
768
  if (this.settings.responsive !== false) {
769
  this.on(window, 'resize', this._handlers.onThrottledResize);
770
  }
771
+
772
  if (this.settings.mouseDrag) {
773
  this.$element.addClass(this.options.dragClass);
774
  this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
775
  this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
776
  }
777
+
778
  if (this.settings.touchDrag){
779
  this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
780
  this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
781
  }
782
  };
783
+
784
  /**
785
+ * Handles `touchstart` and `mousedown` events.
786
+ * @todo Horizontal swipe threshold as option
787
+ * @todo #261
788
+ * @protected
789
+ * @param {Event} event - The event arguments.
790
+ */
791
  Owl.prototype.onDragStart = function(event) {
792
  var stage = null;
793
+
794
  if (event.which === 3) {
795
  return;
796
  }
797
+
798
  if ($.support.transform) {
799
  stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
800
  stage = {
805
  stage = this.$stage.position();
806
  stage = {
807
  x: this.settings.rtl ?
808
+ stage.left + this.$stage.width() - this.width() + this.settings.margin :
809
+ stage.left,
810
  y: stage.top
811
  };
812
  }
813
+
814
  if (this.is('animating')) {
815
  $.support.transform ? this.animate(stage.x) : this.$stage.stop()
816
  this.invalidate('position');
817
  }
818
+
819
  this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
820
+
821
  this.speed(0);
822
+
823
  this._drag.time = new Date().getTime();
824
  this._drag.target = $(event.target);
825
  this._drag.stage.start = stage;
826
  this._drag.stage.current = stage;
827
  this._drag.pointer = this.pointer(event);
828
+
829
  $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
830
+
831
  $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
832
  var delta = this.difference(this._drag.pointer, this.pointer(event));
833
+
834
  $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
835
+
836
  if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
837
  return;
838
  }
839
+
840
  event.preventDefault();
841
+
842
  this.enter('dragging');
843
  this.trigger('drag');
844
  }, this));
845
  };
846
+
847
  /**
848
+ * Handles the `touchmove` and `mousemove` events.
849
+ * @todo #261
850
+ * @protected
851
+ * @param {Event} event - The event arguments.
852
+ */
853
  Owl.prototype.onDragMove = function(event) {
854
  var minimum = null,
855
+ maximum = null,
856
+ pull = null,
857
+ delta = this.difference(this._drag.pointer, this.pointer(event)),
858
+ stage = this.difference(this._drag.stage.start, delta);
859
+
860
  if (!this.is('dragging')) {
861
  return;
862
  }
863
+
864
  event.preventDefault();
865
+
866
  if (this.settings.loop) {
867
  minimum = this.coordinates(this.minimum());
868
  maximum = this.coordinates(this.maximum() + 1) - minimum;
873
  pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
874
  stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
875
  }
876
+
877
  this._drag.stage.current = stage;
878
+
879
  this.animate(stage.x);
880
  };
881
+
882
  /**
883
+ * Handles the `touchend` and `mouseup` events.
884
+ * @todo #261
885
+ * @todo Threshold for click event
886
+ * @protected
887
+ * @param {Event} event - The event arguments.
888
+ */
889
  Owl.prototype.onDragEnd = function(event) {
890
  var delta = this.difference(this._drag.pointer, this.pointer(event)),
891
+ stage = this._drag.stage.current,
892
+ direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
893
+
894
  $(document).off('.owl.core');
895
+
896
  this.$element.removeClass(this.options.grabClass);
897
+
898
  if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
899
  this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
900
  this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
901
  this.invalidate('position');
902
  this.update();
903
+
904
  this._drag.direction = direction;
905
+
906
  if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
907
  this._drag.target.one('click.owl.core', function() { return false; });
908
  }
909
  }
910
+
911
  if (!this.is('dragging')) {
912
  return;
913
  }
914
+
915
  this.leave('dragging');
916
  this.trigger('dragged');
917
  };
918
+
919
  /**
920
+ * Gets absolute position of the closest item for a coordinate.
921
+ * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
922
+ * @protected
923
+ * @param {Number} coordinate - The coordinate in pixel.
924
+ * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
925
+ * @return {Number} - The absolute position of the closest item.
926
+ */
927
  Owl.prototype.closest = function(coordinate, direction) {
928
  var position = -1,
929
+ pull = 30,
930
+ width = this.width(),
931
+ coordinates = this.coordinates();
932
+
933
  if (!this.settings.freeDrag) {
934
  // check closest item
935
  $.each(coordinates, $.proxy(function(index, value) {
936
  // on a left pull, check on current index
937
  if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
938
  position = index;
939
+ // on a right pull, check on previous index
940
+ // to do so, subtract width from value and set position = index + 1
941
  } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
942
  position = index + 1;
943
  } else if (this.op(coordinate, '<', value)
944
+ && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
945
  position = direction === 'left' ? index + 1 : index;
946
  }
947
  return position === -1;
948
  }, this));
949
  }
950
+
951
  if (!this.settings.loop) {
952
  // non loop boundries
953
  if (this.op(coordinate, '>', coordinates[this.minimum()])) {
956
  position = coordinate = this.maximum();
957
  }
958
  }
959
+
960
  return position;
961
  };
962
+
963
  /**
964
+ * Animates the stage.
965
+ * @todo #270
966
+ * @public
967
+ * @param {Number} coordinate - The coordinate in pixels.
968
+ */
969
  Owl.prototype.animate = function(coordinate) {
970
  var animate = this.speed() > 0;
971
+
972
  this.is('animating') && this.onTransitionEnd();
973
+
974
  if (animate) {
975
  this.enter('animating');
976
  this.trigger('translate');
977
  }
978
+
979
  if ($.support.transform3d && $.support.transition) {
980
  this.$stage.css({
981
  transform: 'translate3d(' + coordinate + 'px,0px,0px)',
982
  transition: (this.speed() / 1000) + 's' + (
983
  this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
984
+ )
985
+ });
986
+ } else if (animate) {
987
+ this.$stage.animate({
988
+ left: coordinate + 'px'
989
+ }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
990
+ } else {
991
+ this.$stage.css({
992
+ left: coordinate + 'px'
993
+ });
994
+ }
995
+ };
996
+
997
+ /**
998
+ * Checks whether the carousel is in a specific state or not.
999
+ * @param {String} state - The state to check.
1000
+ * @returns {Boolean} - The flag which indicates if the carousel is busy.
1001
+ */
1002
+ Owl.prototype.is = function(state) {
1003
+ return this._states.current[state] && this._states.current[state] > 0;
1004
+ };
1005
+
1006
+ /**
1007
+ * Sets the absolute position of the current item.
1008
+ * @public
1009
+ * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1010
+ * @returns {Number} - The absolute position of the current item.
1011
+ */
1012
+ Owl.prototype.current = function(position) {
1013
+ if (position === undefined) {
1014
+ return this._current;
1015
+ }
1016
+
1017
+ if (this._items.length === 0) {
1018
+ return undefined;
1019
+ }
1020
+
1021
+ position = this.normalize(position);
1022
+
1023
+ if (this._current !== position) {
1024
+ var event = this.trigger('change', { property: { name: 'position', value: position } });
1025
+
1026
+ if (event.data !== undefined) {
1027
+ position = this.normalize(event.data);
1028
+ }
1029
+
1030
+ this._current = position;
1031
+
1032
+ this.invalidate('position');
1033
+
1034
+ this.trigger('changed', { property: { name: 'position', value: this._current } });
1035
+ }
1036
+
1037
  return this._current;
1038
+ };
1039
+
1040
+ /**
1041
+ * Invalidates the given part of the update routine.
1042
+ * @param {String} [part] - The part to invalidate.
1043
+ * @returns {Array.<String>} - The invalidated parts.
1044
+ */
1045
+ Owl.prototype.invalidate = function(part) {
1046
+ if ($.type(part) === 'string') {
1047
+ this._invalidated[part] = true;
1048
+ this.is('valid') && this.leave('valid');
 
 
1049
  }
1050
+ return $.map(this._invalidated, function(v, i) { return i });
1051
+ };
1052
+
1053
+ /**
1054
+ * Resets the absolute position of the current item.
1055
+ * @public
1056
+ * @param {Number} position - The absolute position of the new item.
1057
+ */
1058
+ Owl.prototype.reset = function(position) {
1059
+ position = this.normalize(position);
1060
+
1061
+ if (position === undefined) {
1062
+ return;
1063
+ }
1064
+
1065
+ this._speed = 0;
1066
  this._current = position;
1067
+
1068
+ this.suppress([ 'translate', 'translated' ]);
1069
+
1070
+ this.animate(this.coordinates(position));
1071
+
1072
+ this.release([ 'translate', 'translated' ]);
1073
+ };
1074
+
1075
+ /**
1076
+ * Normalizes an absolute or a relative position of an item.
1077
+ * @public
1078
+ * @param {Number} position - The absolute or relative position to normalize.
1079
+ * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1080
+ * @returns {Number} - The normalized position.
1081
+ */
1082
+ Owl.prototype.normalize = function(position, relative) {
1083
+ var n = this._items.length,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1084
  m = relative ? 0 : this._clones.length;
1085
+
1086
+ if (!this.isNumeric(position) || n < 1) {
1087
+ position = undefined;
1088
+ } else if (position < 0 || position >= n + m) {
1089
+ position = ((position - m / 2) % n + n) % n + m / 2;
1090
+ }
1091
+
1092
+ return position;
1093
+ };
1094
+
1095
+ /**
1096
+ * Converts an absolute position of an item into a relative one.
1097
+ * @public
1098
+ * @param {Number} position - The absolute position to convert.
1099
+ * @returns {Number} - The converted position.
1100
+ */
1101
+ Owl.prototype.relative = function(position) {
1102
+ position -= this._clones.length / 2;
1103
+ return this.normalize(position, true);
1104
+ };
1105
+
1106
+ /**
1107
+ * Gets the maximum position for the current item.
1108
+ * @public
1109
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1110
+ * @returns {Number}
1111
+ */
1112
+ Owl.prototype.maximum = function(relative) {
1113
+ var settings = this.settings,
1114
  maximum = this._coordinates.length,
1115
  iterator,
1116
  reciprocalItemsWidth,
1117
  elementWidth;
1118
+
1119
+ if (settings.loop) {
1120
+ maximum = this._clones.length / 2 + this._items.length - 1;
1121
+ } else if (settings.autoWidth || settings.merge) {
1122
+ iterator = this._items.length;
1123
+ if (iterator) {
1124
+ reciprocalItemsWidth = this._items[--iterator].width();
1125
+ elementWidth = this.$element.width();
1126
+ while (iterator--) {
1127
+ reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
1128
+ if (reciprocalItemsWidth > elementWidth) {
1129
+ break;
1130
+ }
1131
  }
1132
  }
1133
+ maximum = iterator + 1;
1134
+ } else if (settings.center) {
1135
+ maximum = this._items.length - 1;
1136
+ } else {
1137
+ maximum = this._items.length - settings.items;
1138
  }
1139
+
1140
+ if (relative) {
1141
+ maximum -= this._clones.length / 2;
1142
+ }
1143
+
1144
+ return Math.max(maximum, 0);
1145
+ };
1146
+
1147
+ /**
1148
+ * Gets the minimum position for the current item.
1149
+ * @public
1150
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1151
+ * @returns {Number}
1152
+ */
1153
+ Owl.prototype.minimum = function(relative) {
1154
+ return relative ? 0 : this._clones.length / 2;
1155
+ };
1156
+
1157
+ /**
1158
+ * Gets an item at the specified relative position.
1159
+ * @public
1160
+ * @param {Number} [position] - The relative position of the item.
1161
+ * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1162
+ */
1163
+ Owl.prototype.items = function(position) {
1164
+ if (position === undefined) {
1165
+ return this._items.slice();
1166
+ }
1167
+
1168
+ position = this.normalize(position, true);
1169
+ return this._items[position];
1170
+ };
1171
+
1172
+ /**
1173
+ * Gets an item at the specified relative position.
1174
+ * @public
1175
+ * @param {Number} [position] - The relative position of the item.
1176
+ * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1177
+ */
1178
+ Owl.prototype.mergers = function(position) {
1179
+ if (position === undefined) {
1180
+ return this._mergers.slice();
1181
+ }
1182
+
1183
+ position = this.normalize(position, true);
1184
+ return this._mergers[position];
1185
+ };
1186
+
1187
+ /**
1188
+ * Gets the absolute positions of clones for an item.
1189
+ * @public
1190
+ * @param {Number} [position] - The relative position of the item.
1191
+ * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1192
+ */
1193
+ Owl.prototype.clones = function(position) {
1194
+ var odd = this._clones.length / 2,
 
 
 
 
 
 
1195
  even = odd + this._items.length,
1196
  map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
1197
+
1198
+ if (position === undefined) {
1199
+ return $.map(this._clones, function(v, i) { return map(i) });
1200
+ }
1201
+
1202
+ return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1203
+ };
1204
+
1205
+ /**
1206
+ * Sets the current animation speed.
1207
+ * @public
1208
+ * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1209
+ * @returns {Number} - The current animation speed in milliseconds.
1210
+ */
1211
+ Owl.prototype.speed = function(speed) {
1212
+ if (speed !== undefined) {
1213
+ this._speed = speed;
1214
+ }
1215
+
1216
+ return this._speed;
1217
+ };
1218
+
1219
+ /**
1220
+ * Gets the coordinate of an item.
1221
+ * @todo The name of this method is missleanding.
1222
+ * @public
1223
+ * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1224
+ * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1225
+ */
1226
+ Owl.prototype.coordinates = function(position) {
1227
+ var multiplier = 1,
1228
  newPosition = position - 1,
1229
  coordinate;
1230
+
1231
+ if (position === undefined) {
1232
+ return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1233
+ return this.coordinates(index);
1234
+ }, this));
 
 
 
 
 
 
1235
  }
1236
+
1237
+ if (this.settings.center) {
1238
+ if (this.settings.rtl) {
1239
+ multiplier = -1;
1240
+ newPosition = position + 1;
1241
+ }
1242
+
1243
+ coordinate = this._coordinates[position];
1244
+ coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
1245
+ } else {
1246
+ coordinate = this._coordinates[newPosition] || 0;
1247
+ }
1248
+
1249
+ coordinate = Math.ceil(coordinate);
1250
+
1251
+ return coordinate;
1252
+ };
1253
+
1254
+ /**
1255
+ * Calculates the speed for a translation.
1256
+ * @protected
1257
+ * @param {Number} from - The absolute position of the start item.
1258
+ * @param {Number} to - The absolute position of the target item.
1259
+ * @param {Number} [factor=undefined] - The time factor in milliseconds.
1260
+ * @returns {Number} - The time in milliseconds for the translation.
1261
+ */
1262
+ Owl.prototype.duration = function(from, to, factor) {
1263
+ if (factor === 0) {
1264
+ return 0;
1265
+ }
1266
+
1267
+ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1268
+ };
1269
+
1270
+ /**
1271
+ * Slides to the specified item.
1272
+ * @public
1273
+ * @param {Number} position - The position of the item.
1274
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1275
+ */
1276
+ Owl.prototype.to = function(position, speed) {
1277
+ var current = this.current(),
1278
  revert = null,
1279
  distance = position - this.relative(current),
1280
  direction = (distance > 0) - (distance < 0),
1281
  items = this._items.length,
1282
  minimum = this.minimum(),
1283
  maximum = this.maximum();
1284
+
1285
+ if (this.settings.loop) {
1286
+ if (!this.settings.rewind && Math.abs(distance) > items / 2) {
1287
+ distance += direction * -1 * items;
1288
+ }
1289
+
1290
+ position = current + distance;
1291
+ revert = ((position - minimum) % items + items) % items + minimum;
1292
+
1293
+ if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
1294
+ current = revert - distance;
1295
+ position = revert;
1296
+ this.reset(current);
1297
+ }
1298
+ } else if (this.settings.rewind) {
1299
+ maximum += 1;
1300
+ position = (position % maximum + maximum) % maximum;
1301
+ } else {
1302
+ position = Math.max(minimum, Math.min(maximum, position));
1303
  }
1304
+
1305
+ this.speed(this.duration(current, position, speed));
1306
+ this.current(position);
1307
+
1308
+ if (this.isVisible()) {
1309
+ this.update();
 
 
1310
  }
1311
+ };
1312
+
1313
+ /**
1314
+ * Slides to the next item.
1315
+ * @public
1316
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1317
+ */
1318
+ Owl.prototype.next = function(speed) {
1319
+ speed = speed || false;
1320
+ this.to(this.relative(this.current()) + 1, speed);
1321
+ };
1322
+
1323
+ /**
1324
+ * Slides to the previous item.
1325
+ * @public
1326
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1327
+ */
1328
+ Owl.prototype.prev = function(speed) {
1329
+ speed = speed || false;
1330
+ this.to(this.relative(this.current()) - 1, speed);
1331
+ };
1332
+
1333
+ /**
1334
+ * Handles the end of an animation.
1335
+ * @protected
1336
+ * @param {Event} event - The event arguments.
1337
+ */
1338
+ Owl.prototype.onTransitionEnd = function(event) {
1339
+
1340
+ // if css2 animation then event object is undefined
1341
+ if (event !== undefined) {
1342
+ event.stopPropagation();
1343
+
1344
+ // Catch only owl-stage transitionEnd event
1345
+ if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1346
+ return false;
1347
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1348
  }
1349
+
1350
+ this.leave('animating');
1351
+ this.trigger('translated');
1352
+ };
1353
+
1354
+ /**
1355
+ * Gets viewport width.
1356
+ * @protected
1357
+ * @return {Number} - The width in pixel.
1358
+ */
1359
+ Owl.prototype.viewport = function() {
1360
+ var width;
1361
+ if (this.options.responsiveBaseElement !== window) {
1362
+ width = $(this.options.responsiveBaseElement).width();
1363
+ } else if (window.innerWidth) {
1364
+ width = window.innerWidth;
1365
+ } else if (document.documentElement && document.documentElement.clientWidth) {
1366
+ width = document.documentElement.clientWidth;
1367
+ } else {
1368
+ console.warn('Can not detect viewport width.');
1369
+ }
1370
+ return width;
1371
+ };
1372
+
1373
+ /**
1374
+ * Replaces the current content.
1375
+ * @public
1376
+ * @param {HTMLElement|jQuery|String} content - The new content.
1377
+ */
1378
+ Owl.prototype.replace = function(content) {
1379
+ this.$stage.empty();
1380
+ this._items = [];
1381
+
1382
+ if (content) {
1383
+ content = (content instanceof jQuery) ? content : $(content);
1384
+ }
1385
+
1386
+ if (this.settings.nestedItemSelector) {
1387
+ content = content.find('.' + this.settings.nestedItemSelector);
1388
+ }
1389
+
1390
+ content.filter(function() {
1391
+ return this.nodeType === 1;
1392
+ }).each($.proxy(function(index, item) {
1393
+ item = this.prepare(item);
1394
+ this.$stage.append(item);
1395
+ this._items.push(item);
1396
+ this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1397
+ }, this));
1398
+
1399
+ this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1400
+
1401
+ this.invalidate('items');
1402
+ };
1403
+
1404
+ /**
1405
+ * Adds an item.
1406
+ * @todo Use `item` instead of `content` for the event arguments.
1407
+ * @public
1408
+ * @param {HTMLElement|jQuery|String} content - The item content to add.
1409
+ * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1410
+ */
1411
+ Owl.prototype.add = function(content, position) {
1412
+ var current = this.relative(this._current);
1413
+
1414
+ position = position === undefined ? this._items.length : this.normalize(position, true);
1415
+ content = content instanceof jQuery ? content : $(content);
1416
+
1417
+ this.trigger('add', { content: content, position: position });
1418
+
1419
+ content = this.prepare(content);
1420
+
1421
+ if (this._items.length === 0 || position === this._items.length) {
1422
+ this._items.length === 0 && this.$stage.append(content);
1423
+ this._items.length !== 0 && this._items[position - 1].after(content);
1424
+ this._items.push(content);
1425
+ this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1426
+ } else {
1427
+ this._items[position].before(content);
1428
+ this._items.splice(position, 0, content);
1429
+ this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1430
+ }
1431
+
1432
+ this._items[current] && this.reset(this._items[current].index());
1433
+
1434
+ this.invalidate('items');
1435
+
1436
+ this.trigger('added', { content: content, position: position });
1437
+ };
1438
+
1439
+ /**
1440
+ * Removes an item by its position.
1441
+ * @todo Use `item` instead of `content` for the event arguments.
1442
+ * @public
1443
+ * @param {Number} position - The relative position of the item to remove.
1444
+ */
1445
+ Owl.prototype.remove = function(position) {
1446
+ position = this.normalize(position, true);
1447
+
1448
+ if (position === undefined) {
1449
+ return;
1450
+ }
1451
+
1452
+ this.trigger('remove', { content: this._items[position], position: position });
1453
+
1454
+ this._items[position].remove();
1455
+ this._items.splice(position, 1);
1456
+ this._mergers.splice(position, 1);
1457
+
1458
+ this.invalidate('items');
1459
+
1460
+ this.trigger('removed', { content: null, position: position });
1461
+ };
1462
+
1463
+ /**
1464
+ * Preloads images with auto width.
1465
+ * @todo Replace by a more generic approach
1466
+ * @protected
1467
+ */
1468
+ Owl.prototype.preloadAutoWidthImages = function(images) {
1469
+ images.each($.proxy(function(i, element) {
1470
+ this.enter('pre-loading');
1471
+ element = $(element);
1472
+ $(new Image()).one('load', $.proxy(function(e) {
1473
+ element.attr('src', e.target.src);
1474
+ element.css('opacity', 1);
1475
+ this.leave('pre-loading');
1476
+ !this.is('pre-loading') && !this.is('initializing') && this.refresh();
1477
+ }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
1478
+ }, this));
1479
+ };
1480
+
1481
+ /**
1482
+ * Destroys the carousel.
1483
+ * @public
1484
+ */
1485
+ Owl.prototype.destroy = function() {
1486
+
1487
+ this.$element.off('.owl.core');
1488
+ this.$stage.off('.owl.core');
1489
+ $(document).off('.owl.core');
1490
+
1491
+ if (this.settings.responsive !== false) {
1492
+ window.clearTimeout(this.resizeTimer);
1493
+ this.off(window, 'resize', this._handlers.onThrottledResize);
1494
+ }
1495
+
1496
+ for (var i in this._plugins) {
1497
+ this._plugins[i].destroy();
1498
+ }
1499
+
1500
+ this.$stage.children('.cloned').remove();
1501
+
1502
+ this.$stage.unwrap();
1503
+ this.$stage.children().contents().unwrap();
1504
+ this.$stage.children().unwrap();
1505
+ this.$stage.remove();
1506
+ this.$element
 
1507
  .removeClass(this.options.refreshClass)
1508
  .removeClass(this.options.loadingClass)
1509
  .removeClass(this.options.loadedClass)
1512
  .removeClass(this.options.grabClass)
1513
  .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
1514
  .removeData('owl.carousel');
1515
+ };
1516
+
1517
+ /**
1518
+ * Operators to calculate right-to-left and left-to-right.
1519
+ * @protected
1520
+ * @param {Number} [a] - The left side operand.
1521
+ * @param {String} [o] - The operator.
1522
+ * @param {Number} [b] - The right side operand.
1523
+ */
1524
+ Owl.prototype.op = function(a, o, b) {
1525
+ var rtl = this.settings.rtl;
1526
+ switch (o) {
1527
+ case '<':
1528
  return rtl ? a > b : a < b;
1529
+ case '>':
1530
  return rtl ? a < b : a > b;
1531
+ case '>=':
1532
  return rtl ? a <= b : a >= b;
1533
+ case '<=':
1534
  return rtl ? a >= b : a <= b;
1535
+ default:
1536
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1537
  }
1538
+ };
1539
+
1540
+ /**
1541
+ * Attaches to an internal event.
1542
+ * @protected
1543
+ * @param {HTMLElement} element - The event source.
1544
+ * @param {String} event - The event name.
1545
+ * @param {Function} listener - The event handler to attach.
1546
+ * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
1547
+ */
1548
+ Owl.prototype.on = function(element, event, listener, capture) {
1549
+ if (element.addEventListener) {
1550
+ element.addEventListener(event, listener, capture);
1551
+ } else if (element.attachEvent) {
1552
+ element.attachEvent('on' + event, listener);
1553
  }
1554
+ };
1555
+
1556
+ /**
1557
+ * Detaches from an internal event.
1558
+ * @protected
1559
+ * @param {HTMLElement} element - The event source.
1560
+ * @param {String} event - The event name.
1561
+ * @param {Function} listener - The attached event handler to detach.
1562
+ * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1563
+ */
1564
+ Owl.prototype.off = function(element, event, listener, capture) {
1565
+ if (element.removeEventListener) {
1566
+ element.removeEventListener(event, listener, capture);
1567
+ } else if (element.detachEvent) {
1568
+ element.detachEvent('on' + event, listener);
 
 
 
 
 
 
 
 
 
1569
  }
1570
+ };
1571
+
1572
+ /**
1573
+ * Triggers a public event.
1574
+ * @todo Remove `status`, `relatedTarget` should be used instead.
1575
+ * @protected
1576
+ * @param {String} name - The event name.
1577
+ * @param {*} [data=null] - The event data.
1578
+ * @param {String} [namespace=carousel] - The event namespace.
1579
+ * @param {String} [state] - The state which is associated with the event.
1580
+ * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
1581
+ * @returns {Event} - The event arguments.
1582
+ */
1583
+ Owl.prototype.trigger = function(name, data, namespace, state, enter) {
1584
+ var status = {
1585
+ item: { count: this._items.length, index: this.current() }
1586
+ }, handler = $.camelCase(
1587
+ $.grep([ 'on', name, namespace ], function(v) { return v })
1588
+ .join('-').toLowerCase()
1589
+ ), event = $.Event(
1590
+ [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1591
+ $.extend({ relatedTarget: this }, status, data)
1592
+ );
1593
+
1594
+ if (!this._supress[name]) {
1595
+ $.each(this._plugins, function(name, plugin) {
1596
+ if (plugin.onTrigger) {
1597
+ plugin.onTrigger(event);
1598
+ }
1599
+ });
1600
+
1601
+ this.register({ type: Owl.Type.Event, name: name });
1602
+ this.$element.trigger(event);
1603
+
1604
+ if (this.settings && typeof this.settings[handler] === 'function') {
1605
+ this.settings[handler].call(this, event);
1606
+ }
1607
  }
1608
+
1609
+ return event;
1610
  };
1611
+
1612
+ /**
1613
+ * Enters a state.
1614
+ * @param name - The state name.
1615
+ */
1616
+ Owl.prototype.enter = function(name) {
1617
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1618
+ if (this._states.current[name] === undefined) {
1619
+ this._states.current[name] = 0;
1620
+ }
1621
+
1622
+ this._states.current[name]++;
1623
+ }, this));
1624
+ };
1625
+
1626
+ /**
1627
+ * Leaves a state.
1628
+ * @param name - The state name.
1629
+ */
1630
+ Owl.prototype.leave = function(name) {
1631
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1632
+ this._states.current[name]--;
1633
+ }, this));
1634
+ };
1635
+
1636
+ /**
1637
+ * Registers an event or state.
1638
+ * @public
1639
+ * @param {Object} object - The event or state to register.
1640
+ */
1641
+ Owl.prototype.register = function(object) {
1642
+ if (object.type === Owl.Type.Event) {
1643
+ if (!$.event.special[object.name]) {
1644
+ $.event.special[object.name] = {};
1645
+ }
1646
+
1647
+ if (!$.event.special[object.name].owl) {
1648
+ var _default = $.event.special[object.name]._default;
1649
+ $.event.special[object.name]._default = function(e) {
1650
+ if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
1651
+ return _default.apply(this, arguments);
1652
+ }
1653
+ return e.namespace && e.namespace.indexOf('owl') > -1;
1654
+ };
1655
+ $.event.special[object.name].owl = true;
1656
+ }
1657
+ } else if (object.type === Owl.Type.State) {
1658
+ if (!this._states.tags[object.name]) {
1659
+ this._states.tags[object.name] = object.tags;
1660
+ } else {
1661
+ this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
1662
+ }
1663
+
1664
+ this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
1665
+ return $.inArray(tag, this._states.tags[object.name]) === i;
1666
+ }, this));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1667
  }
1668
+ };
1669
+
1670
+ /**
1671
+ * Suppresses events.
1672
+ * @protected
1673
+ * @param {Array.<String>} events - The events to suppress.
1674
+ */
1675
+ Owl.prototype.suppress = function(events) {
1676
+ $.each(events, $.proxy(function(index, event) {
1677
+ this._supress[event] = true;
1678
+ }, this));
1679
+ };
1680
+
1681
+ /**
1682
+ * Releases suppressed events.
1683
+ * @protected
1684
+ * @param {Array.<String>} events - The events to release.
1685
+ */
1686
+ Owl.prototype.release = function(events) {
1687
+ $.each(events, $.proxy(function(index, event) {
1688
+ delete this._supress[event];
1689
+ }, this));
1690
+ };
1691
+
1692
+ /**
1693
+ * Gets unified pointer coordinates from event.
1694
+ * @todo #261
1695
+ * @protected
1696
+ * @param {Event} - The `mousedown` or `touchstart` event.
1697
+ * @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
1698
+ */
1699
+ Owl.prototype.pointer = function(event) {
1700
+ var result = { x: null, y: null };
1701
+
1702
+ event = event.originalEvent || event || window.event;
1703
+
1704
+ event = event.touches && event.touches.length ?
1705
+ event.touches[0] : event.changedTouches && event.changedTouches.length ?
1706
+ event.changedTouches[0] : event;
1707
+
1708
+ if (event.pageX) {
1709
+ result.x = event.pageX;
1710
+ result.y = event.pageY;
1711
+ } else {
1712
+ result.x = event.clientX;
1713
+ result.y = event.clientY;
1714
+ }
1715
+
1716
+ return result;
1717
+ };
1718
+
1719
+ /**
1720
+ * Determines if the input is a Number or something that can be coerced to a Number
1721
+ * @protected
1722
+ * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
1723
+ * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
1724
+ */
1725
+ Owl.prototype.isNumeric = function(number) {
1726
+ return !isNaN(parseFloat(number));
1727
+ };
1728
+
1729
+ /**
1730
+ * Gets the difference of two vectors.
1731
+ * @todo #261
1732
+ * @protected
1733
+ * @param {Object} - The first vector.
1734
+ * @param {Object} - The second vector.
1735
+ * @returns {Object} - The difference.
1736
+ */
1737
+ Owl.prototype.difference = function(first, second) {
1738
+ return {
1739
+ x: first.x - second.x,
1740
+ y: first.y - second.y
1741
+ };
1742
+ };
1743
+
1744
+ /**
1745
+ * The jQuery Plugin for the Owl Carousel
1746
+ * @todo Navigation plugin `next` and `prev`
1747
+ * @public
1748
+ */
1749
+ $.fn.owlCarousel = function(option) {
1750
+ var args = Array.prototype.slice.call(arguments, 1);
1751
+
1752
+ return this.each(function() {
1753
+ var $this = $(this),
1754
+ data = $this.data('owl.carousel');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1755
 
1756
+ if (!data) {
1757
+ data = new Owl(this, typeof option == 'object' && option);
1758
+ $this.data('owl.carousel', data);
1759
+
1760
+ $.each([
1761
+ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
1762
+ ], function(i, event) {
1763
+ data.register({ type: Owl.Type.Event, name: event });
1764
+ data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
1765
+ if (e.namespace && e.relatedTarget !== this) {
1766
+ this.suppress([ event ]);
1767
+ data[event].apply(this, [].slice.call(arguments, 1));
1768
+ this.release([ event ]);
1769
+ }
1770
+ }, data));
1771
+ });
1772
+ }
1773
+
1774
+ if (typeof option == 'string' && option.charAt(0) !== '_') {
1775
+ data[option].apply(data, args);
1776
+ }
1777
+ });
1778
+ };
1779
+
1780
+ /**
1781
+ * The constructor for the jQuery Plugin
1782
+ * @public
1783
+ */
1784
+ $.fn.owlCarousel.Constructor = Owl;
1785
+
1786
+ })(window.Zepto || window.jQuery, window, document);
1787
+
1788
+ /**
1789
+ * AutoRefresh Plugin
1790
+ * @version 2.3.4
1791
+ * @author Artus Kolanowski
1792
+ * @author David Deutsch
1793
+ * @license The MIT License (MIT)
1794
+ */
1795
+ ;(function($, window, document, undefined) {
1796
+
1797
+ /**
1798
+ * Creates the auto refresh plugin.
1799
+ * @class The Auto Refresh Plugin
1800
+ * @param {Owl} carousel - The Owl Carousel
1801
+ */
1802
+ var AutoRefresh = function(carousel) {
1803
+ /**
1804
+ * Reference to the core.
1805
+ * @protected
1806
+ * @type {Owl}
1807
+ */
1808
+ this._core = carousel;
1809
+
1810
+ /**
1811
+ * Refresh interval.
1812
+ * @protected
1813
+ * @type {number}
1814
+ */
1815
+ this._interval = null;
1816
+
1817
+ /**
1818
+ * Whether the element is currently visible or not.
1819
+ * @protected
1820
+ * @type {Boolean}
1821
+ */
1822
+ this._visible = null;
1823
+
1824
+ /**
1825
+ * All event handlers.
1826
+ * @protected
1827
+ * @type {Object}
1828
+ */
1829
+ this._handlers = {
1830
+ 'initialized.owl.carousel': $.proxy(function(e) {
1831
+ if (e.namespace && this._core.settings.autoRefresh) {
1832
+ this.watch();
1833
+ }
1834
+ }, this)
1835
+ };
1836
+
1837
+ // set default options
1838
+ this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
1839
+
1840
+ // register event handlers
1841
+ this._core.$element.on(this._handlers);
1842
+ };
1843
+
1844
+ /**
1845
+ * Default options.
1846
+ * @public
1847
+ */
1848
+ AutoRefresh.Defaults = {
1849
+ autoRefresh: true,
1850
+ autoRefreshInterval: 500
1851
+ };
1852
+
1853
+ /**
1854
+ * Watches the element.
1855
+ */
1856
+ AutoRefresh.prototype.watch = function() {
1857
+ if (this._interval) {
1858
  return;
1859
  }
1860
+
1861
+ this._visible = this._core.isVisible();
1862
+ this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
1863
+ };
1864
+
1865
+ /**
1866
+ * Refreshes the element.
1867
+ */
1868
+ AutoRefresh.prototype.refresh = function() {
1869
+ if (this._core.isVisible() === this._visible) {
 
 
1870
  return;
1871
  }
1872
+
1873
+ this._visible = !this._visible;
1874
+
1875
+ this._core.$element.toggleClass('owl-hidden', !this._visible);
1876
+
1877
+ this._visible && (this._core.invalidate('width') && this._core.refresh());
1878
+ };
1879
+
1880
+ /**
1881
+ * Destroys the plugin.
1882
+ */
1883
+ AutoRefresh.prototype.destroy = function() {
1884
+ var handler, property;
1885
+
1886
+ window.clearInterval(this._interval);
1887
+
1888
+ for (handler in this._handlers) {
1889
+ this._core.$element.off(handler, this._handlers[handler]);
1890
+ }
1891
+ for (property in Object.getOwnPropertyNames(this)) {
1892
+ typeof this[property] != 'function' && (this[property] = null);
1893
+ }
1894
+ };
1895
+
1896
+ $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
1897
+
1898
+ })(window.Zepto || window.jQuery, window, document);
1899
+
1900
+ /**
1901
+ * Lazy Plugin
1902
+ * @version 2.3.4
1903
+ * @author Bartosz Wojciechowski
1904
+ * @author David Deutsch
1905
+ * @license The MIT License (MIT)
1906
+ */
1907
+ ;(function($, window, document, undefined) {
1908
+
1909
+ /**
1910
+ * Creates the lazy plugin.
1911
+ * @class The Lazy Plugin
1912
+ * @param {Owl} carousel - The Owl Carousel
1913
+ */
1914
+ var Lazy = function(carousel) {
1915
+
1916
+ /**
1917
+ * Reference to the core.
1918
+ * @protected
1919
+ * @type {Owl}
1920
+ */
1921
+ this._core = carousel;
1922
+
1923
+ /**
1924
+ * Already loaded items.
1925
+ * @protected
1926
+ * @type {Array.<jQuery>}
1927
+ */
1928
+ this._loaded = [];
1929
+
1930
+ /**
1931
+ * Event handlers.
1932
+ * @protected
1933
+ * @type {Object}
1934
+ */
1935
+ this._handlers = {
1936
+ 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
1937
+ if (!e.namespace) {
1938
+ return;
1939
+ }
1940
+
1941
+ if (!this._core.settings || !this._core.settings.lazyLoad) {
1942
+ return;
1943
+ }
1944
+
1945
+ if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1946
+ var settings = this._core.settings,
1947
+ n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
1948
+ i = ((settings.center && n * -1) || 0),
1949
+ position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
1950
+ clones = this._core.clones().length,
1951
+ load = $.proxy(function(i, v) { this.load(v) }, this);
1952
+ //TODO: Need documentation for this new option
1953
+ if (settings.lazyLoadEager > 0) {
1954
+ n += settings.lazyLoadEager;
1955
+ // If the carousel is looping also preload images that are to the "left"
1956
+ if (settings.loop) {
1957
+ position -= settings.lazyLoadEager;
1958
+ n++;
1959
+ }
1960
+ }
1961
+
1962
+ while (i++ < n) {
1963
+ this.load(clones / 2 + this._core.relative(position));
1964
+ clones && $.each(this._core.clones(this._core.relative(position)), load);
1965
+ position++;
1966
+ }
1967
+ }
1968
+ }, this)
1969
+ };
1970
+
1971
+ // set the default options
1972
+ this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
1973
+
1974
+ // register event handler
1975
+ this._core.$element.on(this._handlers);
1976
+ };
1977
+
1978
+ /**
1979
+ * Default options.
1980
+ * @public
1981
+ */
1982
+ Lazy.Defaults = {
1983
+ lazyLoad: false,
1984
+ lazyLoadEager: 0
1985
+ };
1986
+
1987
+ /**
1988
+ * Loads all resources of an item at the specified position.
1989
+ * @param {Number} position - The absolute position of the item.
1990
+ * @protected
1991
+ */
1992
+ Lazy.prototype.load = function(position) {
1993
+ var $item = this._core.$stage.children().eq(position),
1994
+ $elements = $item && $item.find('.owl-lazy');
1995
+
1996
+ if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
1997
+ return;
1998
+ }
1999
+
2000
+ $elements.each($.proxy(function(index, element) {
2001
+ var $element = $(element), image,
2002
+ url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
2003
+
2004
+ this._core.trigger('load', { element: $element, url: url }, 'lazy');
2005
+
2006
+ if ($element.is('img')) {
2007
+ $element.one('load.owl.lazy', $.proxy(function() {
2008
+ $element.css('opacity', 1);
2009
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2010
+ }, this)).attr('src', url);
2011
+ } else if ($element.is('source')) {
2012
+ $element.one('load.owl.lazy', $.proxy(function() {
2013
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2014
+ }, this)).attr('srcset', url);
2015
+ } else {
2016
+ image = new Image();
2017
+ image.onload = $.proxy(function() {
2018
+ $element.css({
2019
+ 'background-image': 'url("' + url + '")',
2020
+ 'opacity': '1'
2021
+ });
2022
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2023
+ }, this);
2024
+ image.src = url;
2025
+ }
2026
+ }, this));
2027
+
2028
+ this._loaded.push($item.get(0));
2029
+ };
2030
+
2031
+ /**
2032
+ * Destroys the plugin.
2033
+ * @public
2034
+ */
2035
+ Lazy.prototype.destroy = function() {
2036
+ var handler, property;
2037
+
2038
+ for (handler in this.handlers) {
2039
+ this._core.$element.off(handler, this.handlers[handler]);
2040
+ }
2041
+ for (property in Object.getOwnPropertyNames(this)) {
2042
+ typeof this[property] != 'function' && (this[property] = null);
2043
+ }
2044
+ };
2045
+
2046
+ $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
2047
+
2048
+ })(window.Zepto || window.jQuery, window, document);
2049
+
2050
+ /**
2051
+ * AutoHeight Plugin
2052
+ * @version 2.3.4
2053
+ * @author Bartosz Wojciechowski
2054
+ * @author David Deutsch
2055
+ * @license The MIT License (MIT)
2056
+ */
2057
+ ;(function($, window, document, undefined) {
2058
+
2059
+ /**
2060
+ * Creates the auto height plugin.
2061
+ * @class The Auto Height Plugin
2062
+ * @param {Owl} carousel - The Owl Carousel
2063
+ */
2064
+ var AutoHeight = function(carousel) {
2065
+ /**
2066
+ * Reference to the core.
2067
+ * @protected
2068
+ * @type {Owl}
2069
+ */
2070
+ this._core = carousel;
2071
+
2072
+ this._previousHeight = null;
2073
+
2074
+ /**
2075
+ * All event handlers.
2076
+ * @protected
2077
+ * @type {Object}
2078
+ */
2079
+ this._handlers = {
2080
+ 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
2081
+ if (e.namespace && this._core.settings.autoHeight) {
2082
+ this.update();
2083
+ }
2084
+ }, this),
2085
+ 'changed.owl.carousel': $.proxy(function(e) {
2086
+ if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
2087
+ this.update();
2088
+ }
2089
+ }, this),
2090
+ 'loaded.owl.lazy': $.proxy(function(e) {
2091
+ if (e.namespace && this._core.settings.autoHeight
2092
+ && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
2093
+ this.update();
2094
+ }
2095
+ }, this)
2096
+ };
2097
+
2098
+ // set default options
2099
+ this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2100
+
2101
+ // register event handlers
2102
+ this._core.$element.on(this._handlers);
2103
+ this._intervalId = null;
2104
+ var refThis = this;
2105
+
2106
+ // These changes have been taken from a PR by gavrochelegnou proposed in #1575
2107
+ // and have been made compatible with the latest jQuery version
2108
+ $(window).on('load', function() {
2109
+ if (refThis._core.settings.autoHeight) {
2110
+ refThis.update();
2111
+ }
2112
+ });
2113
+
2114
+ // Autoresize the height of the carousel when window is resized
2115
+ // When carousel has images, the height is dependent on the width
2116
+ // and should also change on resize
2117
+ $(window).resize(function() {
2118
+ if (refThis._core.settings.autoHeight) {
2119
+ if (refThis._intervalId != null) {
2120
+ clearTimeout(refThis._intervalId);
2121
+ }
2122
+
2123
+ refThis._intervalId = setTimeout(function() {
2124
+ refThis.update();
2125
+ }, 250);
2126
+ }
2127
+ });
2128
+
2129
+ };
2130
+
2131
+ /**
2132
+ * Default options.
2133
+ * @public
2134
+ */
2135
+ AutoHeight.Defaults = {
2136
+ autoHeight: false,
2137
+ autoHeightClass: 'owl-height'
2138
+ };
2139
+
2140
+ /**
2141
+ * Updates the view.
2142
+ */
2143
+ AutoHeight.prototype.update = function() {
2144
+ var start = this._core._current,
2145
+ end = start + this._core.settings.items,
2146
+ lazyLoadEnabled = this._core.settings.lazyLoad,
2147
+ visible = this._core.$stage.children().toArray().slice(start, end),
2148
+ heights = [],
2149
+ maxheight = 0;
2150
+
2151
+ $.each(visible, function(index, item) {
2152
+ heights.push($(item).height());
2153
+ });
2154
+
2155
+ maxheight = Math.max.apply(null, heights);
2156
+
2157
+ if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
2158
+ maxheight = this._previousHeight;
2159
+ }
2160
+
2161
+ this._previousHeight = maxheight;
2162
+
2163
+ this._core.$stage.parent()
2164
+ .height(maxheight)
2165
+ .addClass(this._core.settings.autoHeightClass);
2166
+ };
2167
+
2168
+ AutoHeight.prototype.destroy = function() {
2169
+ var handler, property;
2170
+
2171
+ for (handler in this._handlers) {
2172
+ this._core.$element.off(handler, this._handlers[handler]);
2173
+ }
2174
+ for (property in Object.getOwnPropertyNames(this)) {
2175
+ typeof this[property] !== 'function' && (this[property] = null);
2176
+ }
2177
+ };
2178
+
2179
+ $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2180
+
2181
+ })(window.Zepto || window.jQuery, window, document);
2182
+
2183
+ /**
2184
+ * Video Plugin
2185
+ * @version 2.3.4
2186
+ * @author Bartosz Wojciechowski
2187
+ * @author David Deutsch
2188
+ * @license The MIT License (MIT)
2189
+ */
2190
+ ;(function($, window, document, undefined) {
2191
+
2192
+ /**
2193
+ * Creates the video plugin.
2194
+ * @class The Video Plugin
2195
+ * @param {Owl} carousel - The Owl Carousel
2196
+ */
2197
+ var Video = function(carousel) {
2198
+ /**
2199
+ * Reference to the core.
2200
+ * @protected
2201
+ * @type {Owl}
2202
+ */
2203
+ this._core = carousel;
2204
+
2205
+ /**
2206
+ * Cache all video URLs.
2207
+ * @protected
2208
+ * @type {Object}
2209
+ */
2210
+ this._videos = {};
2211
+
2212
+ /**
2213
+ * Current playing item.
2214
+ * @protected
2215
+ * @type {jQuery}
2216
+ */
2217
+ this._playing = null;
2218
+
2219
+ /**
2220
+ * All event handlers.
2221
+ * @todo The cloned content removale is too late
2222
+ * @protected
2223
+ * @type {Object}
2224
+ */
2225
+ this._handlers = {
2226
+ 'initialized.owl.carousel': $.proxy(function(e) {
2227
+ if (e.namespace) {
2228
+ this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
2229
+ }
2230
+ }, this),
2231
+ 'resize.owl.carousel': $.proxy(function(e) {
2232
+ if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
2233
+ e.preventDefault();
2234
+ }
2235
+ }, this),
2236
+ 'refreshed.owl.carousel': $.proxy(function(e) {
2237
+ if (e.namespace && this._core.is('resizing')) {
2238
+ this._core.$stage.find('.cloned .owl-video-frame').remove();
2239
+ }
2240
+ }, this),
2241
+ 'changed.owl.carousel': $.proxy(function(e) {
2242
+ if (e.namespace && e.property.name === 'position' && this._playing) {
2243
+ this.stop();
2244
+ }
2245
+ }, this),
2246
+ 'prepared.owl.carousel': $.proxy(function(e) {
2247
+ if (!e.namespace) {
2248
+ return;
2249
+ }
2250
+
2251
+ var $element = $(e.content).find('.owl-video');
2252
+
2253
+ if ($element.length) {
2254
+ $element.css('display', 'none');
2255
+ this.fetch($element, $(e.content));
2256
+ }
2257
+ }, this)
2258
+ };
2259
+
2260
+ // set default options
2261
+ this._core.options = $.extend({}, Video.Defaults, this._core.options);
2262
+
2263
+ // register event handlers
2264
+ this._core.$element.on(this._handlers);
2265
+
2266
+ this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2267
+ this.play(e);
2268
+ }, this));
2269
+ };
2270
+
2271
+ /**
2272
+ * Default options.
2273
+ * @public
2274
+ */
2275
+ Video.Defaults = {
2276
+ video: false,
2277
+ videoHeight: false,
2278
+ videoWidth: false
2279
+ };
2280
+
2281
+ /**
2282
+ * Gets the video ID and the type (YouTube/Vimeo/vzaar only).
2283
+ * @protected
2284
+ * @param {jQuery} target - The target containing the video data.
2285
+ * @param {jQuery} item - The item containing the video.
2286
+ */
2287
+ Video.prototype.fetch = function(target, item) {
2288
+ var type = (function() {
2289
+ if (target.attr('data-vimeo-id')) {
2290
+ return 'vimeo';
2291
+ } else if (target.attr('data-vzaar-id')) {
2292
+ return 'vzaar'
2293
+ } else {
2294
+ return 'youtube';
2295
+ }
2296
+ })(),
2297
+ id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
2298
+ width = target.attr('data-width') || this._core.settings.videoWidth,
2299
+ height = target.attr('data-height') || this._core.settings.videoHeight,
2300
+ url = target.attr('href');
2301
+
2302
+ if (url) {
2303
+
2304
+ /*
2305
+ Parses the id's out of the following urls (and probably more):
2306
+ https://www.youtube.com/watch?v=:id
2307
+ https://youtu.be/:id
2308
+ https://vimeo.com/:id
2309
+ https://vimeo.com/channels/:channel/:id
2310
+ https://vimeo.com/groups/:group/videos/:id
2311
+ https://app.vzaar.com/videos/:id
2312
+
2313
+ 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
2314
+ */
2315
+
2316
+ 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+)?/);
2317
+
2318
+ if (id[3].indexOf('youtu') > -1) {
2319
+ type = 'youtube';
2320
+ } else if (id[3].indexOf('vimeo') > -1) {
2321
+ type = 'vimeo';
2322
+ } else if (id[3].indexOf('vzaar') > -1) {
2323
+ type = 'vzaar';
2324
+ } else {
2325
+ throw new Error('Video URL not supported.');
2326
+ }
2327
+ id = id[6];
2328
+ } else {
2329
+ throw new Error('Missing video URL.');
2330
+ }
2331
+
2332
+ this._videos[url] = {
2333
+ type: type,
2334
+ id: id,
2335
+ width: width,
2336
+ height: height
2337
+ };
2338
+
2339
+ item.attr('data-video', url);
2340
+
2341
+ this.thumbnail(target, this._videos[url]);
2342
+ };
2343
+
2344
+ /**
2345
+ * Creates video thumbnail.
2346
+ * @protected
2347
+ * @param {jQuery} target - The target containing the video data.
2348
+ * @param {Object} info - The video info object.
2349
+ * @see `fetch`
2350
+ */
2351
+ Video.prototype.thumbnail = function(target, video) {
2352
+ var tnLink,
2353
+ icon,
2354
+ path,
2355
+ dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
2356
+ customTn = target.find('img'),
2357
+ srcType = 'src',
2358
+ lazyClass = '',
2359
+ settings = this._core.settings,
2360
+ create = function(path) {
2361
+ icon = '<div class="owl-video-play-icon"></div>';
2362
+
2363
+ if (settings.lazyLoad) {
2364
+ tnLink = $('<div/>',{
2365
+ "class": 'owl-video-tn ' + lazyClass,
2366
+ "srcType": path
2367
+ });
2368
+ } else {
2369
+ tnLink = $( '<div/>', {
2370
+ "class": "owl-video-tn",
2371
+ "style": 'opacity:1;background-image:url(' + path + ')'
2372
+ });
2373
+ }
2374
+ target.after(tnLink);
2375
+ target.after(icon);
2376
+ };
2377
+
2378
+ // wrap video content into owl-video-wrapper div
2379
+ target.wrap( $( '<div/>', {
2380
+ "class": "owl-video-wrapper",
2381
+ "style": dimensions
2382
+ }));
2383
+
2384
+ if (this._core.settings.lazyLoad) {
2385
+ srcType = 'data-src';
2386
+ lazyClass = 'owl-lazy';
2387
+ }
2388
+
2389
+ // custom thumbnail
2390
+ if (customTn.length) {
2391
+ create(customTn.attr(srcType));
2392
+ customTn.remove();
2393
+ return false;
2394
+ }
2395
+
2396
+ if (video.type === 'youtube') {
2397
+ path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2398
+ create(path);
2399
+ } else if (video.type === 'vimeo') {
2400
+ $.ajax({
2401
+ type: 'GET',
2402
+ url: '//vimeo.com/api/v2/video/' + video.id + '.json',
2403
+ jsonp: 'callback',
2404
+ dataType: 'jsonp',
2405
+ success: function(data) {
2406
+ path = data[0].thumbnail_large;
2407
+ create(path);
2408
+ }
2409
+ });
2410
+ } else if (video.type === 'vzaar') {
2411
+ $.ajax({
2412
+ type: 'GET',
2413
+ url: '//vzaar.com/api/videos/' + video.id + '.json',
2414
+ jsonp: 'callback',
2415
+ dataType: 'jsonp',
2416
+ success: function(data) {
2417
+ path = data.framegrab_url;
2418
+ create(path);
2419
+ }
2420
+ });
2421
+ }
2422
+ };
2423
+
2424
+ /**
2425
+ * Stops the current video.
2426
+ * @public
2427
+ */
2428
+ Video.prototype.stop = function() {
2429
+ this._core.trigger('stop', null, 'video');
2430
+ this._playing.find('.owl-video-frame').remove();
2431
+ this._playing.removeClass('owl-video-playing');
2432
+ this._playing = null;
2433
+ this._core.leave('playing');
2434
+ this._core.trigger('stopped', null, 'video');
2435
+ };
2436
+
2437
+ /**
2438
+ * Starts the current video.
2439
+ * @public
2440
+ * @param {Event} event - The event arguments.
2441
+ */
2442
+ Video.prototype.play = function(event) {
2443
+ var target = $(event.target),
2444
+ item = target.closest('.' + this._core.settings.itemClass),
2445
+ video = this._videos[item.attr('data-video')],
2446
+ width = video.width || '100%',
2447
+ height = video.height || this._core.$stage.height(),
2448
+ html,
2449
+ iframe;
2450
+
2451
+ if (this._playing) {
2452
+ return;
2453
+ }
2454
+
2455
+ this._core.enter('playing');
2456
+ this._core.trigger('play', null, 'video');
2457
+
2458
+ item = this._core.items(this._core.relative(item.index()));
2459
+
2460
+ this._core.reset(item.index());
2461
+
2462
+ html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
2463
+ html.attr( 'height', height );
2464
+ html.attr( 'width', width );
2465
+ if (video.type === 'youtube') {
2466
+ html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
2467
+ } else if (video.type === 'vimeo') {
2468
+ html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
2469
+ } else if (video.type === 'vzaar') {
2470
+ html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
2471
+ }
2472
+
2473
+ iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
2474
+
2475
+ this._playing = item.addClass('owl-video-playing');
2476
+ };
2477
+
2478
+ /**
2479
+ * Checks whether an video is currently in full screen mode or not.
2480
+ * @todo Bad style because looks like a readonly method but changes members.
2481
+ * @protected
2482
+ * @returns {Boolean}
2483
+ */
2484
+ Video.prototype.isInFullScreen = function() {
2485
+ var element = document.fullscreenElement || document.mozFullScreenElement ||
2486
+ document.webkitFullscreenElement;
2487
+
2488
+ return element && $(element).parent().hasClass('owl-video-frame');
2489
+ };
2490
+
2491
+ /**
2492
+ * Destroys the plugin.
2493
+ */
2494
+ Video.prototype.destroy = function() {
2495
+ var handler, property;
2496
+
2497
+ this._core.$element.off('click.owl.video');
2498
+
2499
+ for (handler in this._handlers) {
2500
+ this._core.$element.off(handler, this._handlers[handler]);
2501
+ }
2502
+ for (property in Object.getOwnPropertyNames(this)) {
2503
+ typeof this[property] != 'function' && (this[property] = null);
2504
+ }
2505
+ };
2506
+
2507
+ $.fn.owlCarousel.Constructor.Plugins.Video = Video;
2508
+
2509
+ })(window.Zepto || window.jQuery, window, document);
2510
+
2511
+ /**
2512
+ * Animate Plugin
2513
+ * @version 2.3.4
2514
+ * @author Bartosz Wojciechowski
2515
+ * @author David Deutsch
2516
+ * @license The MIT License (MIT)
2517
+ */
2518
+ ;(function($, window, document, undefined) {
2519
+
2520
+ /**
2521
+ * Creates the animate plugin.
2522
+ * @class The Navigation Plugin
2523
+ * @param {Owl} scope - The Owl Carousel
2524
+ */
2525
+ var Animate = function(scope) {
2526
+ this.core = scope;
2527
+ this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2528
+ this.swapping = true;
2529
+ this.previous = undefined;
2530
+ this.next = undefined;
2531
+
2532
+ this.handlers = {
2533
+ 'change.owl.carousel': $.proxy(function(e) {
2534
+ if (e.namespace && e.property.name == 'position') {
2535
+ this.previous = this.core.current();
2536
+ this.next = e.property.value;
2537
+ }
2538
+ }, this),
2539
+ 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2540
+ if (e.namespace) {
2541
+ this.swapping = e.type == 'translated';
2542
+ }
2543
+ }, this),
2544
+ 'translate.owl.carousel': $.proxy(function(e) {
2545
+ if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2546
+ this.swap();
2547
+ }
2548
+ }, this)
2549
+ };
2550
+
2551
+ this.core.$element.on(this.handlers);
2552
+ };
2553
+
2554
+ /**
2555
+ * Default options.
2556
+ * @public
2557
+ */
2558
+ Animate.Defaults = {
2559
+ animateOut: false,
2560
+ animateIn: false
2561
+ };
2562
+
2563
+ /**
2564
+ * Toggles the animation classes whenever an translations starts.
2565
+ * @protected
2566
+ * @returns {Boolean|undefined}
2567
+ */
2568
+ Animate.prototype.swap = function() {
2569
+
2570
+ if (this.core.settings.items !== 1) {
2571
+ return;
2572
+ }
2573
+
2574
+ if (!$.support.animation || !$.support.transition) {
2575
+ return;
2576
+ }
2577
+
2578
+ this.core.speed(0);
2579
+
2580
+ var left,
2581
+ clear = $.proxy(this.clear, this),
2582
+ previous = this.core.$stage.children().eq(this.previous),
2583
+ next = this.core.$stage.children().eq(this.next),
2584
+ incoming = this.core.settings.animateIn,
2585
+ outgoing = this.core.settings.animateOut;
2586
+
2587
+ if (this.core.current() === this.previous) {
2588
+ return;
2589
+ }
2590
+
2591
+ if (outgoing) {
2592
+ left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2593
+ previous.one($.support.animation.end, clear)
2594
+ .css( { 'left': left + 'px' } )
2595
+ .addClass('animated owl-animated-out')
2596
+ .addClass(outgoing);
2597
+ }
2598
+
2599
+ if (incoming) {
2600
+ next.one($.support.animation.end, clear)
2601
+ .addClass('animated owl-animated-in')
2602
+ .addClass(incoming);
2603
+ }
2604
+ };
2605
+
2606
+ Animate.prototype.clear = function(e) {
2607
+ $(e.target).css( { 'left': '' } )
2608
+ .removeClass('animated owl-animated-out owl-animated-in')
2609
+ .removeClass(this.core.settings.animateIn)
2610
+ .removeClass(this.core.settings.animateOut);
2611
+ this.core.onTransitionEnd();
2612
+ };
2613
+
2614
+ /**
2615
+ * Destroys the plugin.
2616
+ * @public
2617
+ */
2618
+ Animate.prototype.destroy = function() {
2619
+ var handler, property;
2620
+
2621
+ for (handler in this.handlers) {
2622
+ this.core.$element.off(handler, this.handlers[handler]);
2623
+ }
2624
+ for (property in Object.getOwnPropertyNames(this)) {
2625
+ typeof this[property] != 'function' && (this[property] = null);
2626
+ }
2627
+ };
2628
+
2629
+ $.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2630
+
2631
+ })(window.Zepto || window.jQuery, window, document);
2632
+
2633
+ /**
2634
+ * Autoplay Plugin
2635
+ * @version 2.3.4
2636
+ * @author Bartosz Wojciechowski
2637
+ * @author Artus Kolanowski
2638
+ * @author David Deutsch
2639
+ * @author Tom De Caluwé
2640
+ * @license The MIT License (MIT)
2641
+ */
2642
+ ;(function($, window, document, undefined) {
2643
+
2644
+ /**
2645
+ * Creates the autoplay plugin.
2646
+ * @class The Autoplay Plugin
2647
+ * @param {Owl} scope - The Owl Carousel
2648
+ */
2649
+ var Autoplay = function(carousel) {
2650
+ /**
2651
+ * Reference to the core.
2652
+ * @protected
2653
+ * @type {Owl}
2654
+ */
2655
+ this._core = carousel;
2656
+
2657
+ /**
2658
+ * The autoplay timeout id.
2659
+ * @type {Number}
2660
+ */
2661
+ this._call = null;
2662
+
2663
+ /**
2664
+ * Depending on the state of the plugin, this variable contains either
2665
+ * the start time of the timer or the current timer value if it's
2666
+ * paused. Since we start in a paused state we initialize the timer
2667
+ * value.
2668
+ * @type {Number}
2669
+ */
2670
+ this._time = 0;
2671
+
2672
+ /**
2673
+ * Stores the timeout currently used.
2674
+ * @type {Number}
2675
+ */
2676
+ this._timeout = 0;
2677
+
2678
+ /**
2679
+ * Indicates whenever the autoplay is paused.
2680
+ * @type {Boolean}
2681
+ */
2682
+ this._paused = true;
2683
+
2684
+ /**
2685
+ * All event handlers.
2686
+ * @protected
2687
+ * @type {Object}
2688
+ */
2689
+ this._handlers = {
2690
+ 'changed.owl.carousel': $.proxy(function(e) {
2691
+ if (e.namespace && e.property.name === 'settings') {
2692
+ if (this._core.settings.autoplay) {
2693
+ this.play();
2694
+ } else {
2695
+ this.stop();
2696
+ }
2697
+ } else if (e.namespace && e.property.name === 'position' && this._paused) {
2698
+ // Reset the timer. This code is triggered when the position
2699
+ // of the carousel was changed through user interaction.
2700
+ this._time = 0;
2701
+ }
2702
+ }, this),
2703
+ 'initialized.owl.carousel': $.proxy(function(e) {
2704
+ if (e.namespace && this._core.settings.autoplay) {
2705
+ this.play();
2706
+ }
2707
+ }, this),
2708
+ 'play.owl.autoplay': $.proxy(function(e, t, s) {
2709
+ if (e.namespace) {
2710
+ this.play(t, s);
2711
+ }
2712
+ }, this),
2713
+ 'stop.owl.autoplay': $.proxy(function(e) {
2714
+ if (e.namespace) {
2715
+ this.stop();
2716
+ }
2717
+ }, this),
2718
+ 'mouseover.owl.autoplay': $.proxy(function() {
2719
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2720
+ this.pause();
2721
+ }
2722
+ }, this),
2723
+ 'mouseleave.owl.autoplay': $.proxy(function() {
2724
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2725
+ this.play();
2726
+ }
2727
+ }, this),
2728
+ 'touchstart.owl.core': $.proxy(function() {
2729
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2730
+ this.pause();
2731
+ }
2732
+ }, this),
2733
+ 'touchend.owl.core': $.proxy(function() {
2734
+ if (this._core.settings.autoplayHoverPause) {
2735
+ this.play();
2736
+ }
2737
+ }, this)
2738
+ };
2739
+
2740
+ // register event handlers
2741
+ this._core.$element.on(this._handlers);
2742
+
2743
+ // set default options
2744
+ this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
2745
+ };
2746
+
2747
+ /**
2748
+ * Default options.
2749
+ * @public
2750
+ */
2751
+ Autoplay.Defaults = {
2752
+ autoplay: false,
2753
+ autoplayTimeout: 5000,
2754
+ autoplayHoverPause: false,
2755
+ autoplaySpeed: false
2756
+ };
2757
+
2758
+ /**
2759
+ * Transition to the next slide and set a timeout for the next transition.
2760
+ * @private
2761
+ * @param {Number} [speed] - The animation speed for the animations.
2762
+ */
2763
+ Autoplay.prototype._next = function(speed) {
2764
+ this._call = window.setTimeout(
2765
+ $.proxy(this._next, this, speed),
2766
+ this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
2767
+ );
2768
+
2769
+ if (this._core.is('interacting') || document.hidden) {
2770
+ return;
2771
+ }
2772
+ this._core.next(speed || this._core.settings.autoplaySpeed);
2773
+ }
2774
+
2775
+ /**
2776
+ * Reads the current timer value when the timer is playing.
2777
+ * @public
2778
+ */
2779
+ Autoplay.prototype.read = function() {
2780
+ return new Date().getTime() - this._time;
2781
+ };
2782
+
2783
+ /**
2784
+ * Starts the autoplay.
2785
+ * @public
2786
+ * @param {Number} [timeout] - The interval before the next animation starts.
2787
+ * @param {Number} [speed] - The animation speed for the animations.
2788
+ */
2789
+ Autoplay.prototype.play = function(timeout, speed) {
2790
+ var elapsed;
2791
+
2792
+ if (!this._core.is('rotating')) {
2793
+ this._core.enter('rotating');
2794
+ }
2795
+
2796
+ timeout = timeout || this._core.settings.autoplayTimeout;
2797
+
2798
+ // Calculate the elapsed time since the last transition. If the carousel
2799
+ // wasn't playing this calculation will yield zero.
2800
+ elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
2801
+
2802
+ if (this._paused) {
2803
+ // Start the clock.
2804
+ this._time = this.read();
2805
+ this._paused = false;
2806
+ } else {
2807
+ // Clear the active timeout to allow replacement.
2808
+ window.clearTimeout(this._call);
2809
+ }
2810
+
2811
+ // Adjust the origin of the timer to match the new timeout value.
2812
+ this._time += this.read() % timeout - elapsed;
2813
+
2814
+ this._timeout = timeout;
2815
+ this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
2816
+ };
2817
+
2818
+ /**
2819
+ * Stops the autoplay.
2820
+ * @public
2821
+ */
2822
+ Autoplay.prototype.stop = function() {
2823
+ if (this._core.is('rotating')) {
2824
+ // Reset the clock.
2825
+ this._time = 0;
2826
+ this._paused = true;
2827
+
2828
+ window.clearTimeout(this._call);
2829
+ this._core.leave('rotating');
2830
+ }
2831
+ };
2832
+
2833
+ /**
2834
+ * Pauses the autoplay.
2835
+ * @public
2836
+ */
2837
+ Autoplay.prototype.pause = function() {
2838
+ if (this._core.is('rotating') && !this._paused) {
2839
+ // Pause the clock.
2840
+ this._time = this.read();
2841
+ this._paused = true;
2842
+
2843
+ window.clearTimeout(this._call);
2844
+ }
2845
+ };
2846
+
2847
+ /**
2848
+ * Destroys the plugin.
2849
+ */
2850
+ Autoplay.prototype.destroy = function() {
2851
+ var handler, property;
2852
+
2853
+ this.stop();
2854
+
2855
+ for (handler in this._handlers) {
2856
+ this._core.$element.off(handler, this._handlers[handler]);
2857
+ }
2858
+ for (property in Object.getOwnPropertyNames(this)) {
2859
+ typeof this[property] != 'function' && (this[property] = null);
2860
+ }
2861
+ };
2862
+
2863
+ $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2864
+
2865
+ })(window.Zepto || window.jQuery, window, document);
2866
+
2867
+ /**
2868
+ * Navigation Plugin
2869
+ * @version 2.3.4
2870
+ * @author Artus Kolanowski
2871
+ * @author David Deutsch
2872
+ * @license The MIT License (MIT)
2873
+ */
2874
+ ;(function($, window, document, undefined) {
2875
+ 'use strict';
2876
+
2877
+ /**
2878
+ * Creates the navigation plugin.
2879
+ * @class The Navigation Plugin
2880
+ * @param {Owl} carousel - The Owl Carousel.
2881
+ */
2882
+ var Navigation = function(carousel) {
2883
+ /**
2884
+ * Reference to the core.
2885
+ * @protected
2886
+ * @type {Owl}
2887
+ */
2888
+ this._core = carousel;
2889
+
2890
+ /**
2891
+ * Indicates whether the plugin is initialized or not.
2892
+ * @protected
2893
+ * @type {Boolean}
2894
+ */
2895
+ this._initialized = false;
2896
+
2897
+ /**
2898
+ * The current paging indexes.
2899
+ * @protected
2900
+ * @type {Array}
2901
+ */
2902
+ this._pages = [];
2903
+
2904
+ /**
2905
+ * All DOM elements of the user interface.
2906
+ * @protected
2907
+ * @type {Object}
2908
+ */
2909
+ this._controls = {};
2910
+
2911
+ /**
2912
+ * Markup for an indicator.
2913
+ * @protected
2914
+ * @type {Array.<String>}
2915
+ */
2916
+ this._templates = [];
2917
+
2918
+ /**
2919
+ * The carousel element.
2920
+ * @type {jQuery}
2921
+ */
2922
+ this.$element = this._core.$element;
2923
+
2924
+ /**
2925
+ * Overridden methods of the carousel.
2926
+ * @protected
2927
+ * @type {Object}
2928
+ */
2929
+ this._overrides = {
2930
+ next: this._core.next,
2931
+ prev: this._core.prev,
2932
+ to: this._core.to
2933
+ };
2934
+
2935
+ /**
2936
+ * All event handlers.
2937
+ * @protected
2938
+ * @type {Object}
2939
+ */
2940
+ this._handlers = {
2941
+ 'prepared.owl.carousel': $.proxy(function(e) {
2942
+ if (e.namespace && this._core.settings.dotsData) {
2943
+ this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
2944
+ $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
2945
+ }
2946
+ }, this),
2947
+ 'added.owl.carousel': $.proxy(function(e) {
2948
+ if (e.namespace && this._core.settings.dotsData) {
2949
+ this._templates.splice(e.position, 0, this._templates.pop());
2950
+ }
2951
+ }, this),
2952
+ 'remove.owl.carousel': $.proxy(function(e) {
2953
+ if (e.namespace && this._core.settings.dotsData) {
2954
+ this._templates.splice(e.position, 1);
2955
+ }
2956
+ }, this),
2957
+ 'changed.owl.carousel': $.proxy(function(e) {
2958
+ if (e.namespace && e.property.name == 'position') {
2959
+ this.draw();
2960
+ }
2961
+ }, this),
2962
+ 'initialized.owl.carousel': $.proxy(function(e) {
2963
+ if (e.namespace && !this._initialized) {
2964
+ this._core.trigger('initialize', null, 'navigation');
2965
+ this.initialize();
2966
+ this.update();
2967
+ this.draw();
2968
+ this._initialized = true;
2969
+ this._core.trigger('initialized', null, 'navigation');
2970
+ }
2971
+ }, this),
2972
+ 'refreshed.owl.carousel': $.proxy(function(e) {
2973
+ if (e.namespace && this._initialized) {
2974
+ this._core.trigger('refresh', null, 'navigation');
2975
+ this.update();
2976
+ this.draw();
2977
+ this._core.trigger('refreshed', null, 'navigation');
2978
+ }
2979
+ }, this)
2980
+ };
2981
+
2982
+ // set default options
2983
+ this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
2984
+
2985
+ // register event handlers
2986
+ this.$element.on(this._handlers);
2987
+ };
2988
+
2989
+ /**
2990
+ * Default options.
2991
+ * @public
2992
+ * @todo Rename `slideBy` to `navBy`
2993
+ */
2994
+ Navigation.Defaults = {
2995
+ nav: false,
2996
+ navText: [
2997
+ '<span aria-label="' + 'Previous' + '">&#x2039;</span>',
2998
+ '<span aria-label="' + 'Next' + '">&#x203a;</span>'
2999
+ ],
3000
+ navSpeed: false,
3001
+ navElement: 'button type="button" role="presentation"',
3002
+ navContainer: false,
3003
+ navContainerClass: 'owl-nav',
3004
+ navClass: [
3005
+ 'owl-prev',
3006
+ 'owl-next'
3007
+ ],
3008
+ slideBy: 1,
3009
+ changeItemOnClick:false,
3010
+ dotClass: 'owl-dot',
3011
+ dotsClass: 'owl-dots',
3012
+ dots: true,
3013
+ dotsEach: false,
3014
+ dotsData: false,
3015
+ dotsSpeed: false,
3016
+ dotsContainer: false
3017
+ };
3018
+
3019
+ /**
3020
+ * Initializes the layout of the plugin and extends the carousel.
3021
+ * @protected
3022
+ */
3023
+ Navigation.prototype.initialize = function() {
3024
+ var override,
3025
+ settings = this._core.settings;
3026
+
3027
+ // create DOM structure for relative navigation
3028
+ this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
3029
+ : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
3030
+
3031
+ this._controls.$previous = $('<' + settings.navElement + '>')
3032
+ .addClass(settings.navClass[0])
3033
+ .html(settings.navText[0])
3034
+ .prependTo(this._controls.$relative)
3035
+ .on('click', $.proxy(function(e) {
3036
+ this.prev(settings.navSpeed);
3037
+ }, this));
3038
+ this._controls.$next = $('<' + settings.navElement + '>')
3039
+ .addClass(settings.navClass[1])
3040
+ .html(settings.navText[1])
3041
+ .appendTo(this._controls.$relative)
3042
+ .on('click', $.proxy(function(e) {
3043
+ this.next(settings.navSpeed);
3044
+ }, this));
3045
+
3046
+ // scroll on item-click function
3047
+ if(settings.changeItemOnClick){
3048
+ var owlItem = this._core.$stage.children();
3049
+ var clonedItems = this._core.clones().length / 2;
3050
+
3051
+ owlItem.on('click', $.proxy(function(e){
3052
+ var index = $(e.currentTarget).index();
3053
+ this.to(index - clonedItems, settings.navSpeed, true);
3054
+ }, this));
3055
+ }
3056
+
3057
+
3058
+
3059
+ // create DOM structure for absolute navigation
3060
+ if (!settings.dotsData) {
3061
+ this._templates = [ $('<button role="button">')
3062
+ .addClass(settings.dotClass)
3063
+ .append($('<span>'))
3064
+ .prop('outerHTML') ];
3065
+ }
3066
+
3067
+ this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
3068
+ : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
3069
+
3070
+ this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
3071
+ var index = $(e.target).parent().is(this._controls.$absolute)
3072
+ ? $(e.target).index() : $(e.target).parent().index();
3073
+ console.log($(e.target).index());
3074
+ e.preventDefault();
3075
+
3076
+ this.to(index, settings.dotsSpeed);
3077
+ }, this));
3078
+
3079
+ /*$el.on('focusin', function() {
3080
+ $(document).off(".carousel");
3081
+
3082
+ $(document).on('keydown.carousel', function(e) {
3083
+ if(e.keyCode == 37) {
3084
+ $el.trigger('prev.owl')
3085
+ }
3086
+ if(e.keyCode == 39) {
3087
+ $el.trigger('next.owl')
3088
+ }
3089
+ });
3090
+ });*/
3091
+
3092
+ // override public methods of the carousel
3093
+ for (override in this._overrides) {
3094
+ this._core[override] = $.proxy(this[override], this);
3095
+ }
3096
+ };
3097
+
3098
+ /**
3099
+ * Destroys the plugin.
3100
+ * @protected
3101
+ */
3102
+ Navigation.prototype.destroy = function() {
3103
+ var handler, control, property, override, settings;
3104
+ settings = this._core.settings;
3105
+
3106
+ for (handler in this._handlers) {
3107
+ this.$element.off(handler, this._handlers[handler]);
3108
+ }
3109
+ for (control in this._controls) {
3110
+ if (control === '$relative' && settings.navContainer) {
3111
+ this._controls[control].html('');
3112
+ } else {
3113
+ this._controls[control].remove();
3114
+ }
3115
+ }
3116
+ for (override in this.overides) {
3117
+ this._core[override] = this._overrides[override];
3118
+ }
3119
+ for (property in Object.getOwnPropertyNames(this)) {
3120
+ typeof this[property] != 'function' && (this[property] = null);
3121
+ }
3122
+ };
3123
+
3124
+ /**
3125
+ * Updates the internal state.
3126
+ * @protected
3127
+ */
3128
+ Navigation.prototype.update = function() {
3129
+ var i, j, k,
3130
+ lower = this._core.clones().length / 2,
3131
+ upper = lower + this._core.items().length,
3132
+ maximum = this._core.maximum(true),
3133
+ settings = this._core.settings,
3134
+ size = settings.center || settings.autoWidth || settings.dotsData
3135
+ ? 1 : settings.dotsEach || settings.items;
3136
+
3137
+ if (settings.slideBy !== 'page') {
3138
+ settings.slideBy = Math.min(settings.slideBy, settings.items);
3139
+ }
3140
+
3141
+ if (settings.dots || settings.slideBy == 'page') {
3142
+ this._pages = [];
3143
+
3144
+ for (i = lower, j = 0, k = 0; i < upper; i++) {
3145
+ if (j >= size || j === 0) {
3146
+ this._pages.push({
3147
+ start: Math.min(maximum, i - lower),
3148
+ end: i - lower + size - 1
3149
+ });
3150
+ if (Math.min(maximum, i - lower) === maximum) {
3151
+ break;
3152
+ }
3153
+ j = 0, ++k;
3154
+ }
3155
+ j += this._core.mergers(this._core.relative(i));
3156
+ }
3157
+ }
3158
+ };
3159
+
3160
+ /**
3161
+ * Draws the user interface.
3162
+ * @todo The option `dotsData` wont work.
3163
+ * @protected
3164
+ */
3165
+ Navigation.prototype.draw = function() {
3166
+ var difference,
3167
+ settings = this._core.settings,
3168
+ disabled = this._core.items().length <= settings.items,
3169
+ index = this._core.relative(this._core.current()),
3170
+ loop = settings.loop || settings.rewind;
3171
+
3172
+ this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
3173
+
3174
+ if (settings.nav) {
3175
+ this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
3176
+ this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
3177
+ }
3178
+
3179
+ this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
3180
+
3181
+ if (settings.dots) {
3182
+ difference = this._pages.length - this._controls.$absolute.children().length;
3183
+
3184
+ if (settings.dotsData && difference !== 0) {
3185
+ this._controls.$absolute.html(this._templates.join(''));
3186
+ } else if (difference > 0) {
3187
+ this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
3188
+ } else if (difference < 0) {
3189
+ this._controls.$absolute.children().slice(difference).remove();
3190
+ }
3191
+
3192
+ this._controls.$absolute.find('.active').removeClass('active');
3193
+ this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
3194
+ }
3195
+ };
3196
+
3197
+ /**
3198
+ * Extends event data.
3199
+ * @protected
3200
+ * @param {Event} event - The event object which gets thrown.
3201
+ */
3202
+ Navigation.prototype.onTrigger = function(event) {
3203
+ var settings = this._core.settings;
3204
+
3205
+ event.page = {
3206
+ index: $.inArray(this.current(), this._pages),
3207
+ count: this._pages.length,
3208
+ size: settings && (settings.center || settings.autoWidth || settings.dotsData
3209
+ ? 1 : settings.dotsEach || settings.items)
3210
+ };
3211
+ };
3212
+
3213
+ /**
3214
+ * Gets the current page position of the carousel.
3215
+ * @protected
3216
+ * @returns {Number}
3217
+ */
3218
+ Navigation.prototype.current = function() {
3219
+ var current = this._core.relative(this._core.current());
3220
+ return $.grep(this._pages, $.proxy(function(page, index) {
3221
+ return page.start <= current && page.end >= current;
3222
+ }, this)).pop();
3223
+ };
3224
+
3225
+ /**
3226
+ * Gets the current succesor/predecessor position.
3227
+ * @protected
3228
+ * @returns {Number}
3229
+ */
3230
+ Navigation.prototype.getPosition = function(successor) {
3231
+ var position, length,
3232
+ settings = this._core.settings;
3233
+
3234
+ if (settings.slideBy == 'page') {
3235
+ position = $.inArray(this.current(), this._pages);
3236
+ length = this._pages.length;
3237
+ successor ? ++position : --position;
3238
+ position = this._pages[((position % length) + length) % length].start;
3239
+ } else {
3240
+ position = this._core.relative(this._core.current());
3241
+ length = this._core.items().length;
3242
+ successor ? position += settings.slideBy : position -= settings.slideBy;
3243
+ }
3244
+
3245
+ return position;
3246
+ };
3247
+
3248
+ /**
3249
+ * Slides to the next item or page.
3250
+ * @public
3251
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3252
+ */
3253
+ Navigation.prototype.next = function(speed) {
3254
+ $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3255
+ };
3256
+
3257
+ /**
3258
+ * Slides to the previous item or page.
3259
+ * @public
3260
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3261
+ */
3262
+ Navigation.prototype.prev = function(speed) {
3263
+ $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3264
+ };
3265
+
3266
+ /**
3267
+ * Slides to the specified item or page.
3268
+ * @public
3269
+ * @param {Number} position - The position of the item or page.
3270
+ * @param {Number} [speed] - The time in milliseconds for the transition.
3271
+ * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3272
+ */
3273
+ Navigation.prototype.to = function(position, speed, standard) {
3274
+ var length;
3275
+
3276
+ if (!standard && this._pages.length) {
3277
+ length = this._pages.length;
3278
+ $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3279
+ } else {
3280
+ $.proxy(this._overrides.to, this._core)(position, speed);
3281
+ }
3282
+ };
3283
+
3284
+ $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3285
+
3286
+ })(window.Zepto || window.jQuery, window, document);
3287
+
3288
+ /**
3289
+ * Hash Plugin
3290
+ * @version 2.3.4
3291
+ * @author Artus Kolanowski
3292
+ * @author David Deutsch
3293
+ * @license The MIT License (MIT)
3294
+ */
3295
+ ;(function($, window, document, undefined) {
3296
+ 'use strict';
3297
+
3298
+ /**
3299
+ * Creates the hash plugin.
3300
+ * @class The Hash Plugin
3301
+ * @param {Owl} carousel - The Owl Carousel
3302
+ */
3303
+ var Hash = function(carousel) {
3304
+ /**
3305
+ * Reference to the core.
3306
+ * @protected
3307
+ * @type {Owl}
3308
+ */
3309
+ this._core = carousel;
3310
+
3311
+ /**
3312
+ * Hash index for the items.
3313
+ * @protected
3314
+ * @type {Object}
3315
+ */
3316
+ this._hashes = {};
3317
+
3318
+ /**
3319
+ * The carousel element.
3320
+ * @type {jQuery}
3321
+ */
3322
+ this.$element = this._core.$element;
3323
+
3324
+ /**
3325
+ * All event handlers.
3326
+ * @protected
3327
+ * @type {Object}
3328
+ */
3329
+ this._handlers = {
3330
+ 'initialized.owl.carousel': $.proxy(function(e) {
3331
+ if (e.namespace && this._core.settings.startPosition === 'URLHash') {
3332
+ $(window).trigger('hashchange.owl.navigation');
3333
+ }
3334
+ }, this),
3335
+ 'prepared.owl.carousel': $.proxy(function(e) {
3336
+ if (e.namespace) {
3337
+ var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
3338
+
3339
+ if (!hash) {
3340
+ return;
3341
+ }
3342
+
3343
+ this._hashes[hash] = e.content;
3344
+ }
3345
+ }, this),
3346
+ 'changed.owl.carousel': $.proxy(function(e) {
3347
+ if (e.namespace && e.property.name === 'position') {
3348
+ var current = this._core.items(this._core.relative(this._core.current())),
3349
+ hash = $.map(this._hashes, function(item, hash) {
3350
+ return item === current ? hash : null;
3351
+ }).join();
3352
+
3353
+ if (!hash || window.location.hash.slice(1) === hash) {
3354
+ return;
3355
+ }
3356
+
3357
+ window.location.hash = hash;
3358
+ }
3359
+ }, this)
3360
+ };
3361
+
3362
+ // set default options
3363
+ this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3364
+
3365
+ // register the event handlers
3366
+ this.$element.on(this._handlers);
3367
+
3368
+ // register event listener for hash navigation
3369
+ $(window).on('hashchange.owl.navigation', $.proxy(function(e) {
3370
+ var hash = window.location.hash.substring(1),
3371
+ items = this._core.$stage.children(),
3372
+ position = this._hashes[hash] && items.index(this._hashes[hash]);
3373
+
3374
+ if (position === undefined || position === this._core.current()) {
3375
+ return;
3376
+ }
3377
+
3378
+ this._core.to(this._core.relative(position), false, true);
3379
+ }, this));
3380
+ };
3381
+
3382
+ /**
3383
+ * Default options.
3384
+ * @public
3385
+ */
3386
+ Hash.Defaults = {
3387
+ URLhashListener: false
3388
+ };
3389
+
3390
+ /**
3391
+ * Destroys the plugin.
3392
+ * @public
3393
+ */
3394
+ Hash.prototype.destroy = function() {
3395
+ var handler, property;
3396
+
3397
+ $(window).off('hashchange.owl.navigation');
3398
+
3399
+ for (handler in this._handlers) {
3400
+ this._core.$element.off(handler, this._handlers[handler]);
3401
+ }
3402
+ for (property in Object.getOwnPropertyNames(this)) {
3403
+ typeof this[property] != 'function' && (this[property] = null);
3404
+ }
3405
+ };
3406
+
3407
+ $.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3408
+
3409
+ })(window.Zepto || window.jQuery, window, document);
3410
+
3411
+ /**
3412
+ * Support Plugin
3413
+ *
3414
+ * @version 2.3.4
3415
+ * @author Vivid Planet Software GmbH
3416
+ * @author Artus Kolanowski
3417
+ * @author David Deutsch
3418
+ * @license The MIT License (MIT)
3419
+ */
3420
+ ;(function($, window, document, undefined) {
3421
+
3422
+ var style = $('<support>').get(0).style,
3423
+ prefixes = 'Webkit Moz O ms'.split(' '),
3424
+ events = {
3425
+ transition: {
3426
+ end: {
3427
+ WebkitTransition: 'webkitTransitionEnd',
3428
+ MozTransition: 'transitionend',
3429
+ OTransition: 'oTransitionEnd',
3430
+ transition: 'transitionend'
3431
+ }
3432
+ },
3433
+ animation: {
3434
+ end: {
3435
+ WebkitAnimation: 'webkitAnimationEnd',
3436
+ MozAnimation: 'animationend',
3437
+ OAnimation: 'oAnimationEnd',
3438
+ animation: 'animationend'
3439
+ }
3440
+ }
3441
+ },
3442
+ tests = {
3443
+ csstransforms: function() {
3444
+ return !!test('transform');
3445
+ },
3446
+ csstransforms3d: function() {
3447
+ return !!test('perspective');
3448
+ },
3449
+ csstransitions: function() {
3450
+ return !!test('transition');
3451
+ },
3452
+ cssanimations: function() {
3453
+ return !!test('animation');
3454
+ }
3455
+ };
3456
+
3457
+ function test(property, prefixed) {
3458
+ var result = false,
3459
+ upper = property.charAt(0).toUpperCase() + property.slice(1);
3460
+
3461
+ $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
3462
+ if (style[property] !== undefined) {
3463
+ result = prefixed ? property : true;
3464
+ return false;
3465
+ }
3466
+ });
3467
+
3468
+ return result;
3469
+ }
3470
+
3471
+ function prefixed(property) {
3472
+ return test(property, true);
3473
+ }
3474
+
3475
+ if (tests.csstransitions()) {
3476
+ /* jshint -W053 */
3477
+ $.support.transition = new String(prefixed('transition'))
3478
+ $.support.transition.end = events.transition.end[ $.support.transition ];
3479
+ }
3480
+
3481
+ if (tests.cssanimations()) {
3482
+ /* jshint -W053 */
3483
+ $.support.animation = new String(prefixed('animation'))
3484
+ $.support.animation.end = events.animation.end[ $.support.animation ];
3485
+ }
3486
+
3487
+ if (tests.csstransforms()) {
3488
+ /* jshint -W053 */
3489
+ $.support.transform = new String(prefixed('transform'));
3490
+ $.support.transform3d = tests.csstransforms3d();
3491
+ }
3492
+
3493
+ })(window.Zepto || window.jQuery, window, document);
3494
+
assets_libraries/owl-carousel-new/owl.carousel.min.js CHANGED
@@ -1,7 +1,19 @@
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);
 
 
 
 
 
 
 
 
 
 
 
 
1
  /**
2
+ * Owl Carousel v2.3.4 - UE3
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
+
19
+ !function(t,e,i,s){function n(e,i){this.settings=null,this.options=t.extend({},n.Defaults,i),this.$element=t(e),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"]}},t.each(["onResize","onThrottledResize"],t.proxy(function(e,i){this._handlers[i]=t.proxy(this[i],this)},this)),t.each(n.Plugins,t.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),t.each(n.Workers,t.proxy(function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})},this)),this.setup(),this.initialize()}n.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,setActiveClass:!0,setActiveClassOnMobile:!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:e,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"},n.Width={Default:"default",Inner:"inner",Outer:"outer"},n.Type={Event:"event",State:"state"},n.Plugins={},n.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.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(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,n={width:"auto","margin-left":s?e:"","margin-right":s?"":e};!i&&this.$stage.children().css(n),t.css=n}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,s=this.settings,n=Math.max(2*s.items,4),o=2*Math.ceil(i.length/2),r=s.loop&&i.length?s.rewind?n:Math.max(n,o):0,a="",h="";for(r/=2;r>0;)e.push(this.normalize(e.length/2,!0)),a+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),h=i[e[e.length-1]][0].outerHTML+h,r-=1;this._clones=e,t(a).addClass("cloned").appendTo(this.$stage),t(h).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=0,n=0,o=[];++i<e;)s=o[i-1]||0,n=this._widths[this.relative(i)]+this.settings.margin,o.push(s+n*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,h=[];for(i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&h.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+h.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}},{filter:["width","position","items","settings"],run:function(){if(this.settings.setActiveClass&&this.settings.setActiveClass){var t=!0;this.settings.setActiveClassOnMobile?1==this.$stage.children(".active").length&&(t=!0):this.settings.setActiveClassOnMobile||1==this.$stage.children(".active").length&&(t=!1),1==t?this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item"):0==t&&this.$stage.children().removeClass("uc-active-item")}}}],n.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(t("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},n.prototype.initializeItems=function(){var e=this.$element.find(".owl-item");if(e.length)return this._items=e.get().map(function(e){return t(e)}),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)},n.prototype.initialize=function(){var t,e,i;(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading"))&&(t=this.$element.find("img"),e=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:void 0,i=this.$element.children(e).width(),t.length&&i<=0&&this.preloadAutoWidthImages(t));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},n.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},n.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,s=-1,n=null;i?(t.each(i,function(t){t<=e&&t>s&&(s=Number(t))}),"function"==typeof(n=t.extend({},this.options,i[s])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+s))):n=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=s,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},n.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},n.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},n.prototype.update=function(){for(var e=0,i=this._pipe.length,s=t.proxy(function(t){return this[t]},this._invalidated),n={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,s).length>0)&&this._pipe[e].run(n),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},n.prototype.width=function(t){switch(t=t||n.Width.Default){case n.Width.Inner:case n.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},n.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")},n.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},n.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")))))},n.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.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",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},n.prototype.onDragStart=function(e){var s=null;3!==e.which&&(t.support.transform?s={x:(s=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===s.length?12:4],y:s[16===s.length?13:5]}:(s=this.$stage.position(),s={x:this.settings.rtl?s.left+this.$stage.width()-this.width()+this.settings.margin:s.left,y:s.top}),this.is("animating")&&(t.support.transform?this.animate(s.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=s,this._drag.stage.current=s,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy(function(e){var s=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(s.x)<Math.abs(s.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},n.prototype.onDragMove=function(t){var e=null,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),s=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,e+s),i+s)),this._drag.stage.current=o,this.animate(o.x))},n.prototype.onDragEnd=function(e){var s=this.difference(this._drag.pointer,this.pointer(e)),n=this._drag.stage.current,o=s.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==s.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(n.x,0!==s.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(s.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"))},n.prototype.closest=function(e,i){var s=-1,n=this.width(),o=this.coordinates();return this.settings.freeDrag||t.each(o,t.proxy(function(t,r){return"left"===i&&e>r-30&&e<r+30?s=t:"right"===i&&e>r-n-30&&e<r-n+30?s=t+1:this.op(e,"<",r)&&this.op(e,">",void 0!==o[t+1]?o[t+1]:r-n)&&(s="left"===i?t+1:t),-1===s},this)),this.settings.loop||(this.op(e,">",o[this.minimum()])?s=e=this.minimum():this.op(e,"<",o[this.maximum()])&&(s=e=this.maximum())),s},n.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+e+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},n.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},n.prototype.current=function(t){if(void 0===t)return this._current;if(0!==this._items.length){if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});void 0!==e.data&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current}},n.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,function(t,e){return e})},n.prototype.reset=function(t){void 0!==(t=this.normalize(t))&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},n.prototype.normalize=function(t,e){var i=this._items.length,s=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=void 0:(t<0||t>=i+s)&&(t=((t-s/2)%i+i)%i+s/2),t},n.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},n.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>s););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},n.prototype.minimum=function(t){return t?0:this._clones.length/2},n.prototype.items=function(t){return void 0===t?this._items.slice():(t=this.normalize(t,!0),this._items[t])},n.prototype.mergers=function(t){return void 0===t?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},n.prototype.clones=function(e){var i=this._clones.length/2,s=i+this._items.length,n=function(t){return t%2==0?s+t/2:i-(t+1)/2};return void 0===e?t.map(this._clones,function(t,e){return n(e)}):t.map(this._clones,function(t,i){return t===e?n(i):null})},n.prototype.speed=function(t){return void 0!==t&&(this._speed=t),this._speed},n.prototype.coordinates=function(e){var i,s=1,n=e-1;return void 0===e?t.map(this._coordinates,t.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(s=-1,n=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[n]||0))/2*s):i=this._coordinates[n]||0,i=Math.ceil(i))},n.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},n.prototype.to=function(t,e){var i=this.current(),s=null,n=t-this.relative(i),o=(n>0)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(s=(((t=i+n)-a)%r+r)%r+a)!==t&&s-n<=h&&s-n>0&&(i=s-n,t=s,this.reset(i))):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},n.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},n.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},n.prototype.onTransitionEnd=function(t){if(void 0!==t&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},n.prototype.viewport=function(){var s;return this.options.responsiveBaseElement!==e?s=t(this.options.responsiveBaseElement).width():e.innerWidth?s=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?s=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),s},n.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter(function(){return 1===this.nodeType}).each(t.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.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")},n.prototype.add=function(e,i){var s=this.relative(this._current);i=void 0===i?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[s]&&this.reset(this._items[s].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},n.prototype.remove=function(t){void 0!==(t=this.normalize(t,!0))&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},n.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy(function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy(function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))},this))},n.prototype.destroy=function(){for(var s in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[s].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")},n.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?t>i:t<i;case">":return s?t<i:t>i;case">=":return s?t<=i:t>=i;case"<=":return s?t>=i:t<=i}},n.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},n.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},n.prototype.trigger=function(e,i,s,o,r){var a={item:{count:this._items.length,index:this.current()}},h=t.camelCase(t.grep(["on",e,s],function(t){return t}).join("-").toLowerCase()),l=t.Event([e,"owl",s||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},a,i));return this._supress[e]||(t.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(l)}),this.register({type:n.Type.Event,name:e}),this.$element.trigger(l),this.settings&&"function"==typeof this.settings[h]&&this.settings[h].call(this,l)),l},n.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){void 0===this._states.current[e]&&(this._states.current[e]=0),this._states.current[e]++},this))},n.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){this._states.current[e]--},this))},n.prototype.register=function(e){if(e.type===n.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===n.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy(function(i,s){return t.inArray(i,this._states.tags[e.name])===s},this)))},n.prototype.suppress=function(e){t.each(e,t.proxy(function(t,e){this._supress[e]=!0},this))},n.prototype.release=function(e){t.each(e,t.proxy(function(t,e){delete this._supress[e]},this))},n.prototype.pointer=function(t){var i={x:null,y:null};return(t=(t=t.originalEvent||t||e.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},n.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var s=t(this),o=s.data("owl.carousel");o||(o=new n(this,"object"==typeof e&&e),s.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(e,i){o.register({type:n.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))},o))})),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)})},t.fn.owlCarousel.Constructor=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.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())},n.prototype.destroy=function(){var t,i;for(t in e.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy(function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type)){var i=this._core.settings,s=i.center&&Math.ceil(i.items/2)||i.items,n=i.center&&-1*s||0,o=(e.property&&void 0!==e.property.value?e.property.value:this._core.current())+n,r=this._core.clones().length,a=t.proxy(function(t,e){this.load(e)},this);for(i.lazyLoadEager>0&&(s+=i.lazyLoadEager,i.loop&&(o-=i.lazyLoadEager,s++));n++<s;)this.load(r/2+this._core.relative(o)),r&&t.each(this._core.clones(this._core.relative(o)),a),o++}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={lazyLoad:!1,lazyLoadEager:0},n.prototype.load=function(i){var s=this._core.$stage.children().eq(i),n=s&&s.find(".owl-lazy");!n||t.inArray(s.get(0),this._loaded)>-1||(n.each(t.proxy(function(i,s){var n,o=t(s),r=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src")||o.attr("data-srcset");this._core.trigger("load",{element:o,url:r},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy(function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("src",r):o.is("source")?o.one("load.owl.lazy",t.proxy(function(){this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("srcset",r):((n=new Image).onload=t.proxy(function(){o.css({"background-image":'url("'+r+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:r},"lazy")},this),n.src=r)},this)),this._loaded.push(s.get(0)))},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(i){this._core=i,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()},this),"loaded.owl.lazy":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var s=this;t(e).on("load",function(){s._core.settings.autoHeight&&s.update()}),t(e).resize(function(){s._core.settings.autoHeight&&(null!=s._intervalId&&clearTimeout(s._intervalId),s._intervalId=setTimeout(function(){s.update()},250))})};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,s=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(e,i),o=[],r=0;t.each(n,function(e,i){o.push(t(i).height())}),(r=Math.max.apply(null,o))<=1&&s&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy(function(t){this.play(t)},this))};n.Defaults={video:!1,videoHeight:!1,videoWidth:!1},n.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if((s=r.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+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(s[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(s[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},n.prototype.thumbnail=function(e,i){var s,n,o=i.width&&i.height?"width:"+i.width+"px;height:"+i.height+"px;":"",r=e.find("img"),a="src",h="",l=this._core.settings,c=function(i){'<div class="owl-video-play-icon"></div>',s=l.lazyLoad?t("<div/>",{class:"owl-video-tn "+h,srcType:i}):t("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+i+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')};if(e.wrap(t("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length)return c(r.attr(a)),r.remove(),!1;"youtube"===i.type?(n="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",c(n)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,c(n)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,c(n)}})},n.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")},n.prototype.play=function(e){var i,s=t(e.target).closest("."+this._core.settings.itemClass),n=this._videos[s.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),s=this._core.items(this._core.relative(s.index())),this._core.reset(s.index()),(i=t('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),i.attr("width",o),"youtube"===n.type?i.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?i.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&i.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),t(i).wrap('<div class="owl-video-frame" />').insertAfter(s.find(".owl-video")),this._playing=s.addClass("owl-video-playing"))},n.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},n.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this.core=e,this.core.options=t.extend({},n.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":t.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};n.Defaults={animateOut:!1,animateIn:!1},n.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),s=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),s.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},n.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":t.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":t.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":t.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},n.Defaults,this._core.options)};n.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},n.prototype._next=function(s){this._call=e.setTimeout(t.proxy(this._next,this,s),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||i.hidden||this._core.next(s||this._core.settings.autoplaySpeed)},n.prototype.read=function(){return(new Date).getTime()-this._time},n.prototype.play=function(i,s){var n;this._core.is("rotating")||this._core.enter("rotating"),i=i||this._core.settings.autoplayTimeout,n=Math.min(this._time%(this._timeout||i),i),this._paused?(this._time=this.read(),this._paused=!1):e.clearTimeout(this._call),this._time+=this.read()%i-n,this._timeout=i,this._call=e.setTimeout(t.proxy(this._next,this,s),i-n)},n.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,e.clearTimeout(this._call),this._core.leave("rotating"))},n.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,e.clearTimeout(this._call))},n.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(e){this._core=e,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":t.proxy(function(e){e.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":t.proxy(function(t){t.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":t.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers)};n.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,changeItemOnClick:!1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},n.prototype.initialize=function(){var e,i=this._core.settings;if(this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=t("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy(function(t){this.next(i.navSpeed)},this)),i.changeItemOnClick){var s=this._core.$stage.children(),n=this._core.clones().length/2;s.on("click",t.proxy(function(e){var s=t(e.currentTarget).index();this.to(s-n,i.navSpeed,!0)},this))}for(e in i.dotsData||(this._templates=[t('<button role="button">').addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",t.proxy(function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();console.log(t(e.target).index()),e.preventDefault(),this.to(s,i.dotsSpeed)},this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s,n;for(t in n=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<s;t++){if(e>=r||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,function(t,e){return t===s?e:null}).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);void 0!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)},this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=t("<support>").get(0).style,o="Webkit Moz O ms".split(" "),r={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},a=function(){return!!c("transform")},h=function(){return!!c("perspective")},l=function(){return!!c("animation")};function c(e,i){var r=!1,a=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+o.join(a+" ")+a).split(" "),function(t,e){if(n[e]!==s)return r=!i||e,!1}),r}function p(t){return c(t,!0)}(function(){return!!c("transition")})()&&(t.support.transition=new String(p("transition")),t.support.transition.end=r.transition.end[t.support.transition]),l()&&(t.support.animation=new String(p("animation")),t.support.animation.end=r.animation.end[t.support.animation]),a()&&(t.support.transform=new String(p("transform")),t.support.transform3d=h())}(window.Zepto||window.jQuery,window,document);
assets_libraries/remote/ue-remote-controls.js CHANGED
@@ -11,7 +11,9 @@ function UERemoteGeneralAPI(){
11
  var g_vars = {
12
  class_items:"",
13
  class_active:"",
14
- selector_item_trigger:""
 
 
15
  };
16
 
17
  var g_temp = {
@@ -172,7 +174,7 @@ function UERemoteGeneralAPI(){
172
  * change item
173
  */
174
  function changeItem(mixed){
175
-
176
  var numItem = getItemNum(mixed);
177
 
178
  var objItem = getItem(numItem);
@@ -265,11 +267,10 @@ this.onEvent = function(name, func){
265
 
266
  }
267
 
268
-
269
  /**
270
- * init obzerver events
271
  */
272
- function initEvents(){
273
 
274
  var objItems = getObjItems();
275
 
@@ -290,6 +291,50 @@ this.onEvent = function(name, func){
290
  observer.observe(item, config);
291
  });
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  }
294
 
295
 
@@ -308,7 +353,7 @@ this.onEvent = function(name, func){
308
  function initByClasses(){
309
 
310
  try{
311
-
312
  var widgetName = g_objParent.data("widgetname");
313
 
314
  g_vars.class_items = getVal(g_options, "class_items");
@@ -322,7 +367,12 @@ this.onEvent = function(name, func){
322
  throw new Error(widgetName +" - missing 'class_active' in options");
323
 
324
  g_vars.selector_item_trigger = getVal(g_options, "selector_item_trigger");
325
-
 
 
 
 
 
326
  }
327
  catch(e){
328
 
@@ -353,14 +403,20 @@ this.onEvent = function(name, func){
353
  g_isTypeEvents = true;
354
 
355
  g_options = options;
356
-
357
  if(g_isTypeEvents == false)
358
  initByClasses();
359
 
360
  g_objParent.data("remote_inited", true);
361
 
362
- if(g_isTypeEvents == false)
363
- setTimeout(initEvents, 1000);
 
 
 
 
 
 
364
 
365
  return(true);
366
  }
@@ -829,9 +885,11 @@ function UESyncObject(){
829
  textWidgets += "<a href='#"+widgetID+"' style='color:green;text-decoration:underline'><b>" + widgetName + "</b></a>";
830
 
831
  }, objElement);
832
-
833
  if(textWidgets)
834
  text += "sync with: " + textWidgets;
 
 
835
 
836
  return(text);
837
  }
@@ -1466,6 +1524,12 @@ function UERemoteWidgets(){
1466
  css["z-index"] = "999998";
1467
  }
1468
 
 
 
 
 
 
 
1469
  objError.css(css);
1470
 
1471
  var objError = objParent.find('.'+className+'');
11
  var g_vars = {
12
  class_items:"",
13
  class_active:"",
14
+ selector_item_trigger:"",
15
+ add_set_active_code:false,
16
+ listen_class_change:true
17
  };
18
 
19
  var g_temp = {
174
  * change item
175
  */
176
  function changeItem(mixed){
177
+
178
  var numItem = getItemNum(mixed);
179
 
180
  var objItem = getItem(numItem);
267
 
268
  }
269
 
 
270
  /**
271
+ * listen to class change
272
  */
273
+ function initEvents_listenClassChange(){
274
 
275
  var objItems = getObjItems();
276
 
291
  observer.observe(item, config);
292
  });
293
 
294
+
295
+ }
296
+
297
+
298
+ /**
299
+ * add set active events
300
+ */
301
+ function initEvents_setActive(){
302
+
303
+ var objItems = getObjItems();
304
+
305
+ if(objItems.length == 0)
306
+ return(false);
307
+
308
+ //activate first item
309
+
310
+ var objFirstItem = getItem(0);
311
+ objFirstItem.addClass(g_vars.class_active);
312
+
313
+ objItems.on("click", function(){
314
+
315
+ var objItem = jQuery(this);
316
+ objItems.not(objItem).removeClass(g_vars.class_active);
317
+
318
+ objItem.addClass(g_vars.class_active);
319
+
320
+ g_objParent.trigger("uc_change");
321
+
322
+ });
323
+
324
+
325
+ }
326
+
327
+ /**
328
+ * init obzerver events
329
+ */
330
+ function initEvents(){
331
+
332
+ if(g_vars.listen_class_change == true)
333
+ initEvents_listenClassChange();
334
+
335
+ if(g_vars.add_set_active_code == true)
336
+ initEvents_setActive();
337
+
338
  }
339
 
340
 
353
  function initByClasses(){
354
 
355
  try{
356
+
357
  var widgetName = g_objParent.data("widgetname");
358
 
359
  g_vars.class_items = getVal(g_options, "class_items");
367
  throw new Error(widgetName +" - missing 'class_active' in options");
368
 
369
  g_vars.selector_item_trigger = getVal(g_options, "selector_item_trigger");
370
+
371
+ g_vars.add_set_active_code = getVal(g_options, "add_set_active_code");
372
+
373
+ if(g_vars.add_set_active_code === true)
374
+ g_vars.listen_class_change = false;
375
+
376
  }
377
  catch(e){
378
 
403
  g_isTypeEvents = true;
404
 
405
  g_options = options;
406
+
407
  if(g_isTypeEvents == false)
408
  initByClasses();
409
 
410
  g_objParent.data("remote_inited", true);
411
 
412
+ if(g_isTypeEvents == false){
413
+
414
+ if(g_vars.listen_class_change == true)
415
+ setTimeout(initEvents, 1000);
416
+ else
417
+ initEvents();
418
+ }
419
+
420
 
421
  return(true);
422
  }
885
  textWidgets += "<a href='#"+widgetID+"' style='color:green;text-decoration:underline'><b>" + widgetName + "</b></a>";
886
 
887
  }, objElement);
888
+
889
  if(textWidgets)
890
  text += "sync with: " + textWidgets;
891
+
892
+ //TODO: add debug remote id
893
 
894
  return(text);
895
  }
1524
  css["z-index"] = "999998";
1525
  }
1526
 
1527
+ //fix position for bg
1528
+ var objParentsBG = objParent.parents(".unlimited-elements-background-overlay");
1529
+ if(objParentsBG.length){
1530
+ css["top"] = "0px";
1531
+ }
1532
+
1533
  objError.css(css);
1534
 
1535
  var objError = objParent.find('.'+className+'');
inc_php/unitecreator_filters_process.class.php CHANGED
@@ -472,17 +472,49 @@ class UniteCreatorFiltersProcess{
472
  return($arrQuery);
473
  }
474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
 
476
  /**
477
  * process request filters
478
  */
479
  public function processRequestFilters($args){
480
-
481
  $isUnderAjax = $this->isUnderAjax();
482
 
483
  if($isUnderAjax == false)
484
  return($args);
485
-
486
  $arrFilters = $this->getRequestFilters();
487
 
488
  //---- set offset and count ----
@@ -497,10 +529,12 @@ class UniteCreatorFiltersProcess{
497
  $arrTerms = UniteFunctionsUC::getVal($arrFilters, "terms");
498
  if(!empty($arrTerms)){
499
 
 
500
  $arrTaxQuery = $this->getTaxQuery($arrTerms);
501
 
502
  if(!empty($arrTaxQuery))
503
- $args["tax_query"] = $arrTaxQuery;
 
504
  }
505
 
506
  if(self::DEBUG_FILTER == true){
@@ -689,6 +723,147 @@ class UniteCreatorFiltersProcess{
689
 
690
  return($arrHTML);
691
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
 
693
  /**
694
  * get widget ajax data
@@ -710,7 +885,18 @@ class UniteCreatorFiltersProcess{
710
  $elementID = UniteFunctionsUC::getPostGetVariable("elid","",UniteFunctionsUC::SANITIZE_KEY);
711
 
712
  $addElIDs = UniteFunctionsUC::getPostGetVariable("addelids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
713
-
 
 
 
 
 
 
 
 
 
 
 
714
  $arrContent = HelperProviderCoreUC_EL::getElementorContentByPostID($layoutID);
715
 
716
  if(empty($arrContent))
@@ -718,22 +904,61 @@ class UniteCreatorFiltersProcess{
718
 
719
  $arrHtmlWidget = $this->getContentWidgetHtml($arrContent, $elementID);
720
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
722
  $htmlDebug = UniteFunctionsUC::getVal($arrHtmlWidget, "html_debug");
723
 
724
  $addWidgetsHTML = $this->getContentWidgetsHTML($arrContent, $addElIDs);
725
-
726
  //output the html
727
  $outputData = array();
728
 
729
  if(!empty($htmlDebug))
730
  $outputData["html_debug"] = $htmlDebug;
731
-
732
- $outputData["html_items"] = $htmlGridItems;
 
733
 
734
  if(!empty($addWidgetsHTML))
735
  $outputData["html_widgets"] = $addWidgetsHTML;
736
-
737
  HelperUC::ajaxResponseData($outputData);
738
 
739
  }
@@ -772,7 +997,7 @@ class UniteCreatorFiltersProcess{
772
  $strData = UniteFunctionsUC::jsonEncodeForClientSide($arrData);
773
 
774
  $script = "//Unlimited Elements Filters \n";
775
- $script .= "var g_strFiltersData = {$strData};";
776
 
777
  UniteProviderFunctionsUC::printCustomScript($script);
778
  }
@@ -811,50 +1036,6 @@ class UniteCreatorFiltersProcess{
811
  }
812
 
813
 
814
- /**
815
- * put terms checkboxes
816
- */
817
- private function getHtml_termsCheckboxes($terms, $arrActiveFilters,$taxonomy){
818
-
819
- $html = "";
820
- foreach($terms as $term){
821
-
822
- $arrTerm = (array)$term;
823
-
824
- $termID = UniteFunctionsUC::getVal($arrTerm, "term_id");
825
- $name = UniteFunctionsUC::getVal($arrTerm, "name");
826
- $slug = UniteFunctionsUC::getVal($arrTerm, "slug");
827
- $count = UniteFunctionsUC::getVal($arrTerm, "count");
828
-
829
- $activeKey = "term_{$taxonomy}_{$slug}";
830
-
831
- $addAttr = "";
832
-
833
- if(isset($arrActiveFilters[$activeKey])){
834
- $addAttr = " checked='checked' data-active='yes'";
835
- }
836
-
837
- $slug = htmlspecialchars($slug);
838
-
839
- $checkboxName = "ucfilter_term__{$taxonomy}--{$slug}";
840
-
841
- $html .= "<label class='ucfilters-label-checkbox'>$name ($count)
842
- <input type='checkbox' class='uc-grid-filter uc-filter-checkbox'
843
- name='{$checkboxName}'
844
- data-type='term'
845
- data-taxonomy='{$taxonomy}'
846
- data-term='{$slug}'
847
- {$addAttr}
848
- >
849
- </label>";
850
-
851
- }
852
-
853
- return($html);
854
-
855
- }
856
-
857
-
858
  /**
859
  * get active archive terms
860
  */
@@ -942,7 +1123,6 @@ class UniteCreatorFiltersProcess{
942
  $data["uc_filtering_attributes"] = $strAttributes;
943
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
944
 
945
-
946
  return($data);
947
  }
948
 
@@ -963,7 +1143,8 @@ class UniteCreatorFiltersProcess{
963
  return($arrData);
964
  }
965
 
966
- private function _______EDITOR_ARGUMENTS__________(){}
 
967
 
968
  /**
969
  * get editor filter arguments
@@ -972,19 +1153,77 @@ class UniteCreatorFiltersProcess{
972
 
973
  $arguments = "";
974
  $style = "";
 
 
 
 
975
 
976
  if($isInitAfter == true){
977
  $arguments = " data-initafter=\"true\"";
978
- $style = " xvisibility:hidden;background-color:green;";
 
 
 
 
 
979
  }
980
 
 
981
  $data["filter_arguments"] = $arguments;
982
  $data["filter_style"] = $style;
 
 
983
 
984
  return($data);
985
  }
986
 
987
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
988
  private function _______ARCHIVE_QUERY__________(){}
989
 
990
 
472
  return($arrQuery);
473
  }
474
 
475
+ /**
476
+ * set arguments tax query, merge with existing if avaliable
477
+ * Enter description here ...
478
+ * @param unknown_type $arrTaxQuery
479
+ */
480
+ private function setArgsTaxQuery($args, $arrTaxQuery){
481
+
482
+ if(empty($arrTaxQuery))
483
+ return($args);
484
+
485
+ $existingTaxQuery = UniteFunctionsUC::getVal($args, "tax_query");
486
+
487
+ if(empty($existingTaxQuery)){
488
+
489
+ $args["tax_query"] = $arrTaxQuery;
490
+
491
+ return($args);
492
+ }
493
+
494
+ foreach($arrTaxQuery as $key => $item){
495
+
496
+ if(is_numeric($key) == false)
497
+ $existingTaxQuery[$key] = $item;
498
+ else
499
+ $existingTaxQuery[] = $item;
500
+ }
501
+
502
+ $args["tax_query"] = $existingTaxQuery;
503
+
504
+ return($args);
505
+ }
506
+
507
 
508
  /**
509
  * process request filters
510
  */
511
  public function processRequestFilters($args){
512
+
513
  $isUnderAjax = $this->isUnderAjax();
514
 
515
  if($isUnderAjax == false)
516
  return($args);
517
+
518
  $arrFilters = $this->getRequestFilters();
519
 
520
  //---- set offset and count ----
529
  $arrTerms = UniteFunctionsUC::getVal($arrFilters, "terms");
530
  if(!empty($arrTerms)){
531
 
532
+ //combine the tax queries
533
  $arrTaxQuery = $this->getTaxQuery($arrTerms);
534
 
535
  if(!empty($arrTaxQuery))
536
+ $args = $this->setArgsTaxQuery($args, $arrTaxQuery);
537
+
538
  }
539
 
540
  if(self::DEBUG_FILTER == true){
723
 
724
  return($arrHTML);
725
  }
726
+
727
+ /**
728
+ * get init filtres taxonomy request
729
+ */
730
+ private function getInitFiltersTaxRequest_new($request, $strTestIDs){
731
+
732
+ $posLimit = strpos($request, "LIMIT");
733
+
734
+ if($posLimit){
735
+ $request = substr($request, 0, $posLimit-1);
736
+ $request = trim($request);
737
+ }
738
+
739
+ //remove the calc found rows
740
+
741
+ $request = str_replace("SQL_CALC_FOUND_ROWS", "", $request);
742
+
743
+ //wrap it in get term id's request
744
+
745
+ $prefix = UniteProviderFunctionsUC::$tablePrefix;
746
+
747
+ $arrTaxIDs = explode(",", $strTestIDs);
748
+
749
+ $parentID = 17;
750
+
751
+ $selectTerms = "";
752
+ $queryTerms = "";
753
+
754
+ $arrTaxIDs = array($parentID);
755
+
756
+ foreach($arrTaxIDs as $taxID){
757
+
758
+ if(!empty($selectTerms))
759
+ $selectTerms .= ",";
760
+
761
+ if(!empty($queryTerms))
762
+ $queryTerms .= ",";
763
+
764
+ $termKey = "term_$taxID";
765
+
766
+ $selectTerms .= "SELECT SUM(if(clothing > 0, 1, 0)) as $termKey";
767
+
768
+ $queryTerms .= "SUM(if(tt.`parent` = $taxID OR tt.`term_id` = $taxID, 1, 0)) AS $termKey";
769
+ }
770
+
771
+
772
+ $query3 = "SELECT SUM(if(clothing > 0, 1, 0)) as clothing FROM (
773
+
774
+ SELECT SUM(if(tt.`parent` = $parentID OR tt.`term_id` = $parentID, 1, 0)) AS clothing
775
+
776
+ FROM `wp_posts` p
777
+ LEFT JOIN `wp_term_relationships` rl ON rl.`object_id` = p.`id`
778
+ LEFT JOIN `wp_term_taxonomy` tt ON tt.`term_taxonomy_id` = rl.`term_taxonomy_id`
779
+ WHERE rl.`term_taxonomy_id` IS NOT NULL AND p.`id` IN
780
+ ({$request})
781
+ GROUP BY p.`id`
782
+ ) as sum_table";
783
+
784
+ //AND p.`id` IN ({$request})
785
+
786
+
787
+ dmp($query3);
788
+
789
+ return($query3);
790
+
791
+ /*
792
+ $query3 = "SELECT SUM(red_cars) as red_cars, SUM(green_cars) as green_cars, SUM(if(colored_cars > 0, 1, 0)) as colored_cars FROM (
793
+ SELECT SUM(if(tt.`term_id` = 8, 1, 0)) AS red_cars, SUM(if(tt.`term_id` = 7, 1, 0)) AS green_cars, SUM(if(tt.`parent` = 9 OR tt.`term_id` = 9, 1, 0)) AS colored_cars
794
+ FROM `wp_posts` p
795
+ LEFT JOIN `wp_term_relationships` rl ON rl.`object_id` = p.`id`
796
+ LEFT JOIN `wp_term_taxonomy` tt ON tt.`term_taxonomy_id` = rl.`term_taxonomy_id`
797
+ WHERE `post_type` = 'post' AND rl.`term_taxonomy_id` IS NOT NULL AND p.`id` IN (
798
+ SELECT wp_posts.ID
799
+ FROM wp_posts
800
+ LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
801
+ WHERE 1=1 AND (wp_term_relationships.term_taxonomy_id IN (4))
802
+ AND wp_posts.post_type = 'post'
803
+ AND ((wp_posts.post_status = 'publish'))
804
+ GROUP BY wp_posts.ID ORDER BY wp_posts.post_date
805
+ ) GROUP BY p.`id`
806
+ ) as sum_table";
807
+ */
808
+
809
+ dmp($arrTaxIDs);
810
+ dmp("get tax request");
811
+
812
+ dmp($request);
813
+ exit();
814
+
815
+ }
816
+
817
+ /**
818
+ * get init filtres taxonomy request
819
+ */
820
+ private function getInitFiltersTaxRequest($request, $strTestIDs){
821
+
822
+ //cut the limit
823
+
824
+ $posLimit = strpos($request, "LIMIT");
825
+
826
+ if($posLimit){
827
+ $request = substr($request, 0, $posLimit-1);
828
+ $request = trim($request);
829
+ }
830
+
831
+ //remove the calc found rows
832
+
833
+ $request = str_replace("SQL_CALC_FOUND_ROWS", "", $request);
834
+
835
+ //wrap it in get term id's request
836
+
837
+ $prefix = UniteProviderFunctionsUC::$tablePrefix;
838
+
839
+ $request = "select term_taxonomy_id from {$prefix}term_relationships as t where t.object_id in ($request)";
840
+
841
+ //add the specific terms to test
842
+
843
+ if(!empty($strTestIDs))
844
+ $request .= " and t.term_taxonomy_id in ($strTestIDs)";
845
+
846
+ return($request);
847
+ }
848
+
849
+ /**
850
+ * modify test term id's
851
+ */
852
+ private function modifyFoundTermsIDs($arrFoundTermIDs){
853
+
854
+ $arrTermsAssoc = array();
855
+
856
+ foreach($arrFoundTermIDs as $id){
857
+
858
+ if(isset($arrTermsAssoc[$id]) == false)
859
+ $arrTermsAssoc[$id] = 1;
860
+ else
861
+ $arrTermsAssoc[$id]++;
862
+ }
863
+
864
+ return($arrTermsAssoc);
865
+ }
866
+
867
 
868
  /**
869
  * get widget ajax data
885
  $elementID = UniteFunctionsUC::getPostGetVariable("elid","",UniteFunctionsUC::SANITIZE_KEY);
886
 
887
  $addElIDs = UniteFunctionsUC::getPostGetVariable("addelids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
888
+
889
+ $isModeFiltersInit = UniteFunctionsUC::getPostGetVariable("modeinit","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
890
+ $isModeFiltersInit = UniteFunctionsUC::strToBool($isModeFiltersInit);
891
+
892
+ if($isModeFiltersInit == true){
893
+
894
+ $initTermIDs = UniteFunctionsUC::getPostGetVariable("inittermids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
895
+ UniteFunctionsUC::validateIDsList($initTermIDs);
896
+
897
+ GlobalsProviderUC::$skipRunPostQueryOnce = true;
898
+ }
899
+
900
  $arrContent = HelperProviderCoreUC_EL::getElementorContentByPostID($layoutID);
901
 
902
  if(empty($arrContent))
904
 
905
  $arrHtmlWidget = $this->getContentWidgetHtml($arrContent, $elementID);
906
 
907
+ if($isModeFiltersInit){
908
+
909
+ $args = GlobalsProviderUC::$lastQueryArgs;
910
+
911
+ $query = new WP_Query($args);
912
+
913
+ $request = $query->request;
914
+
915
+
916
+ $taxRequest = $this->getInitFiltersTaxRequest($request, $initTermIDs);
917
+
918
+ //$taxRequest = $this->getInitFiltersTaxRequest_new($request, $initTermIDs);
919
+
920
+
921
+ //remove me
922
+ /*
923
+ $postSQL = "SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'product' AND ((wp_posts.post_status = 'publish')) ORDER BY wp_posts.post_date DESC";
924
+ $sql = "select term_taxonomy_id, count(*) from wp_term_relationships as t where t.object_id in ({$postSQL}) and t.term_taxonomy_id in (16,17,20,48,49,50)";
925
+ dmp($sql);
926
+ dmp($taxRequest);
927
+ exit();
928
+ */
929
+
930
+ //$db = HelperUC::getDB();
931
+ //$response = $db->fetchSql($taxRequest);
932
+
933
+ //dmp($response);
934
+ global $wpdb;
935
+ $arrFoundTermIDs = $wpdb->get_col( $taxRequest);
936
+
937
+ $arrFoundTermIDs = $this->modifyFoundTermsIDs($arrFoundTermIDs);
938
+
939
+ //set the test term id's for the output
940
+ GlobalsProviderUC::$arrTestTermIDs = $arrFoundTermIDs;
941
+
942
+ }
943
+
944
+
945
  $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
946
  $htmlDebug = UniteFunctionsUC::getVal($arrHtmlWidget, "html_debug");
947
 
948
  $addWidgetsHTML = $this->getContentWidgetsHTML($arrContent, $addElIDs);
949
+
950
  //output the html
951
  $outputData = array();
952
 
953
  if(!empty($htmlDebug))
954
  $outputData["html_debug"] = $htmlDebug;
955
+
956
+ if($isModeFiltersInit == false)
957
+ $outputData["html_items"] = $htmlGridItems;
958
 
959
  if(!empty($addWidgetsHTML))
960
  $outputData["html_widgets"] = $addWidgetsHTML;
961
+
962
  HelperUC::ajaxResponseData($outputData);
963
 
964
  }
997
  $strData = UniteFunctionsUC::jsonEncodeForClientSide($arrData);
998
 
999
  $script = "//Unlimited Elements Filters \n";
1000
+ $script .= "window.g_strFiltersData = {$strData};";
1001
 
1002
  UniteProviderFunctionsUC::printCustomScript($script);
1003
  }
1036
  }
1037
 
1038
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1039
  /**
1040
  * get active archive terms
1041
  */
1123
  $data["uc_filtering_attributes"] = $strAttributes;
1124
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
1125
 
 
1126
  return($data);
1127
  }
1128
 
1143
  return($arrData);
1144
  }
1145
 
1146
+ private function _____MODIFY_PARAMS_PROCESS_TERMS_______(){}
1147
+
1148
 
1149
  /**
1150
  * get editor filter arguments
1153
 
1154
  $arguments = "";
1155
  $style = "";
1156
+ $addClass = " uc-grid-filter";
1157
+ $addClassItem = "";
1158
+
1159
+ $isUnderAjax = $this->isUnderAjax();
1160
 
1161
  if($isInitAfter == true){
1162
  $arguments = " data-initafter=\"true\"";
1163
+
1164
+ if($isUnderAjax == false){
1165
+ $addClassItem = " uc-filter-item-hidden";
1166
+ $addClass .= " uc-filter-initing";
1167
+ }
1168
+
1169
  }
1170
 
1171
+ $data["filter_isajax"] = $isUnderAjax?"yes":"no";
1172
  $data["filter_arguments"] = $arguments;
1173
  $data["filter_style"] = $style;
1174
+ $data["filter_addclass"] = $addClass;
1175
+ $data["filter_addclass_item"] = $addClassItem;
1176
 
1177
  return($data);
1178
  }
1179
 
1180
 
1181
+ /**
1182
+ * modify the terms for init after
1183
+ */
1184
+ public function modifyOutputTermsForInitAfter($arrTerms){
1185
+
1186
+ if(GlobalsProviderUC::$arrTestTermIDs === null)
1187
+ return($arrTerms);
1188
+
1189
+ $arrParentNumPosts = array();
1190
+
1191
+ $arrPostNums = GlobalsProviderUC::$arrTestTermIDs;
1192
+
1193
+ foreach($arrTerms as $key => $term){
1194
+
1195
+ $termID = UniteFunctionsUC::getVal($term, "id");
1196
+
1197
+ $termFound = array_key_exists($termID, $arrPostNums);
1198
+
1199
+ $numPosts = 0;
1200
+
1201
+ if($termFound)
1202
+ $numPosts = $arrPostNums[$termID];
1203
+
1204
+ //add parent id if exists
1205
+ $parentID = UniteFunctionsUC::getVal($term, "parent_id");
1206
+
1207
+ //set the number of posts
1208
+ $term["num_posts"] = $numPosts;
1209
+
1210
+ $isHidden = !$termFound;
1211
+ $htmlAttributes = "";
1212
+
1213
+ if($isHidden == true)
1214
+ $htmlAttributes = "style='display:none'";
1215
+
1216
+ $term["hidden"] = $isHidden;
1217
+ $term["html_attributes"] = $htmlAttributes;
1218
+
1219
+ $arrTerms[$key] = $term;
1220
+ }
1221
+
1222
+
1223
+ return($arrTerms);
1224
+ }
1225
+
1226
+
1227
  private function _______ARCHIVE_QUERY__________(){}
1228
 
1229
 
inc_php/unitecreator_output.class.php CHANGED
@@ -1201,7 +1201,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1201
 
1202
  if($isDynamicAddon == false)
1203
  return(false);
1204
-
1205
  $postID = $this->getDynamicPostID();
1206
 
1207
  if(!empty($postID)){
1201
 
1202
  if($isDynamicAddon == false)
1203
  return(false);
1204
+
1205
  $postID = $this->getDynamicPostID();
1206
 
1207
  if(!empty($postID)){
inc_php/unitecreator_template_engine.class.php CHANGED
@@ -880,6 +880,15 @@ class UniteCreatorTemplateEngineWork{
880
  HelperHtmlUC::putRemoteParentJS($arg1, $arg2);
881
 
882
  break;
 
 
 
 
 
 
 
 
 
883
  default:
884
 
885
  $type = UniteFunctionsUC::sanitizeAttr($type);
@@ -927,6 +936,7 @@ class UniteCreatorTemplateEngineWork{
927
  $printPostMetaFunction = new Twig_SimpleFunction('printPostMeta', array($this,"printPostMeta"));
928
 
929
  $putACFFieldFunction = new Twig_SimpleFunction('putAcfField', array($this,"putAcfField"));
 
930
  $putShowFunction = new Twig_SimpleFunction('show', array($this,"showItem"));
931
  $putPostDateFunction = new Twig_SimpleFunction('putPostDate', array($this,"putPostDate"));
932
  $putPostGetVar = new Twig_SimpleFunction('putPostGetVar', array($this,"putPostGetVar"));
880
  HelperHtmlUC::putRemoteParentJS($arg1, $arg2);
881
 
882
  break;
883
+ case "get_post_custom_field":
884
+
885
+ $postID = $arg1;
886
+ $fieldname = $arg2;
887
+
888
+ $value = UniteFunctionsWPUC::getPostCustomField($postID, $fieldname);
889
+
890
+ return($value);
891
+ break;
892
  default:
893
 
894
  $type = UniteFunctionsUC::sanitizeAttr($type);
936
  $printPostMetaFunction = new Twig_SimpleFunction('printPostMeta', array($this,"printPostMeta"));
937
 
938
  $putACFFieldFunction = new Twig_SimpleFunction('putAcfField', array($this,"putAcfField"));
939
+
940
  $putShowFunction = new Twig_SimpleFunction('show', array($this,"showItem"));
941
  $putPostDateFunction = new Twig_SimpleFunction('putPostDate', array($this,"putPostDate"));
942
  $putPostGetVar = new Twig_SimpleFunction('putPostGetVar', array($this,"putPostGetVar"));
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.96");
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.98");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
provider/acf_integrate.class.php CHANGED
@@ -507,7 +507,6 @@ class UniteCreatorAcfIntegrate{
507
  return($arrTypes);
508
  }
509
 
510
-
511
  /**
512
  * modify get fields data, consolidate all clones
513
  * clone is array inside array
@@ -520,7 +519,7 @@ class UniteCreatorAcfIntegrate{
520
  $arrOutput = array();
521
 
522
  foreach($arrData as $key => $item){
523
-
524
  //simple value
525
  if(is_array($item) == false){
526
 
@@ -533,7 +532,7 @@ class UniteCreatorAcfIntegrate{
533
  $arrOutput[$key] = $item;
534
  continue;
535
  }
536
-
537
  $isAssocArray = UniteFunctionsUC::isAssocArray($item);
538
 
539
  $firstItem = UniteFunctionsUC::getArrFirstValue($item);
@@ -558,6 +557,39 @@ class UniteCreatorAcfIntegrate{
558
  return($arrOutput);
559
  }
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
 
562
  /**
563
  * get acf post fields
507
  return($arrTypes);
508
  }
509
 
 
510
  /**
511
  * modify get fields data, consolidate all clones
512
  * clone is array inside array
519
  $arrOutput = array();
520
 
521
  foreach($arrData as $key => $item){
522
+
523
  //simple value
524
  if(is_array($item) == false){
525
 
532
  $arrOutput[$key] = $item;
533
  continue;
534
  }
535
+
536
  $isAssocArray = UniteFunctionsUC::isAssocArray($item);
537
 
538
  $firstItem = UniteFunctionsUC::getArrFirstValue($item);
557
  return($arrOutput);
558
  }
559
 
560
+ /**
561
+ * get single acf field
562
+ */
563
+ public function getAcfFieldValue($fieldName, $objID, $objName = "post"){
564
+
565
+ switch($objName){
566
+ case "post":
567
+
568
+ $value = get_field($fieldName, $objID);
569
+
570
+ break;
571
+ case "term":
572
+
573
+ $termID = "term_".$postID;
574
+
575
+ $value = get_field($fieldName, $objID);
576
+
577
+ break;
578
+ default:
579
+ UniteFunctionsUC::throwError("get acf fields function works only for post and term right now");
580
+ break;
581
+ }
582
+
583
+ $arrDataOutput = array();
584
+ $arrDataOutput = $this->addAcfValues($arrDataOutput, $fieldName, $value);
585
+
586
+ $value = UniteFunctionsUC::getVal($arrDataOutput, $fieldName);
587
+
588
+
589
+ return($value);
590
+
591
+ }
592
+
593
 
594
  /**
595
  * get acf post fields
provider/core/plugins/unlimited_elements/elementor/elementor_layout_exporter.class.php CHANGED
@@ -501,7 +501,7 @@ class UniteCreatorLayoutsExporterElementor extends UniteCreatorLayoutsExporter{
501
  $arrPageLayout = $this->getElementorPostOriginalLayout($targetPostID);
502
 
503
  if(empty($arrPageLayout) || is_array($arrPageLayout) == false)
504
- UniteFunctionsUC::throwError("No page elementor layout found");
505
 
506
  //insert the section
507
 
501
  $arrPageLayout = $this->getElementorPostOriginalLayout($targetPostID);
502
 
503
  if(empty($arrPageLayout) || is_array($arrPageLayout) == false)
504
+ UniteFunctionsUC::throwError("No elementor page layout found");
505
 
506
  //insert the section
507
 
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php CHANGED
@@ -2911,14 +2911,21 @@ class UniteCreatorElementorWidget extends Widget_Base {
2911
 
2912
  if(isset($plugin) == false)
2913
  return(false);
 
 
 
 
 
 
 
2914
 
2915
- if(isset($plugin->data_manager) == false)
2916
  return(false);
2917
 
2918
- if(method_exists($plugin->data_manager,"run") == false)
2919
  return(false);
2920
 
2921
- $arrColors = $plugin->data_manager->run("globals/colors");
2922
 
2923
  if(empty($arrColors))
2924
  return(false);
2911
 
2912
  if(isset($plugin) == false)
2913
  return(false);
2914
+
2915
+ $dataManager = null;
2916
+ if(isset($plugin->data_manager))
2917
+ $dataManager = $plugin->data_manager;
2918
+
2919
+ if(empty($dataManager) && isset($plugin->data_manager_v2))
2920
+ $dataManager = $plugin->data_manager_v2;
2921
 
2922
+ if(empty($dataManager))
2923
  return(false);
2924
 
2925
+ if(method_exists($dataManager,"run") == false)
2926
  return(false);
2927
 
2928
+ $arrColors = $dataManager->run("globals/colors");
2929
 
2930
  if(empty($arrColors))
2931
  return(false);
provider/core/plugins/unlimited_elements/helper_provider_core.class.php CHANGED
@@ -563,7 +563,6 @@ class HelperProviderCoreUC_EL{
563
  $templateID = UniteFunctionsUC::getVal(GlobalsUnlimitedElements::$renderingDynamicData, "template_id");
564
  $widgetID = UniteFunctionsUC::getVal(GlobalsUnlimitedElements::$renderingDynamicData, "widget_id");
565
 
566
-
567
  if(empty($postID))
568
  return(false);
569
 
@@ -572,7 +571,7 @@ class HelperProviderCoreUC_EL{
572
 
573
  $elementID = $element->get_ID();
574
  $dynamicSettings = $element->get_settings( '__dynamic__' );
575
-
576
  if(empty($dynamicSettings))
577
  return(false);
578
 
@@ -603,9 +602,14 @@ class HelperProviderCoreUC_EL{
603
  if(empty($arrValues))
604
  continue;
605
 
606
- $url = UniteFunctionsUC::getVal($arrValues, "url");
607
-
608
- if(empty($url))
 
 
 
 
 
609
  continue;
610
 
611
  $arrSelectors = UniteFunctionsUC::getVal($control, "selectors");
@@ -615,19 +619,23 @@ class HelperProviderCoreUC_EL{
615
  //modify the selectors
616
 
617
  foreach($arrSelectors as $cssKey=>$cssValue){
618
-
619
- if(strpos($cssValue, "{{URL}}") === false)
620
- continue;
621
-
622
  $cssKey = str_replace("{{WRAPPER}}", $wrapperCssKey, $cssKey);
623
 
624
- $cssValue = str_replace("{{URL}}", $url, $cssValue);
 
 
 
 
 
 
 
 
625
 
626
  //clear other placeholders
627
 
628
- $cssValue = str_replace("{{VALUE}}", "", $cssValue);
629
  $cssValue = str_replace("{{UNIT}}", "", $cssValue);
630
-
631
  if(!empty($strStyle))
632
  $strStyle .= "\n";
633
 
@@ -636,6 +644,7 @@ class HelperProviderCoreUC_EL{
636
  }
637
 
638
  }
 
639
 
640
  if(empty($strStyle))
641
  return(false);
563
  $templateID = UniteFunctionsUC::getVal(GlobalsUnlimitedElements::$renderingDynamicData, "template_id");
564
  $widgetID = UniteFunctionsUC::getVal(GlobalsUnlimitedElements::$renderingDynamicData, "widget_id");
565
 
 
566
  if(empty($postID))
567
  return(false);
568
 
571
 
572
  $elementID = $element->get_ID();
573
  $dynamicSettings = $element->get_settings( '__dynamic__' );
574
+
575
  if(empty($dynamicSettings))
576
  return(false);
577
 
602
  if(empty($arrValues))
603
  continue;
604
 
605
+ if(is_string($arrValues))
606
+ $value = $arrValues;
607
+ else{
608
+
609
+ $value = UniteFunctionsUC::getVal($arrValues, "url");
610
+ }
611
+
612
+ if(empty($value))
613
  continue;
614
 
615
  $arrSelectors = UniteFunctionsUC::getVal($control, "selectors");
619
  //modify the selectors
620
 
621
  foreach($arrSelectors as $cssKey=>$cssValue){
622
+
 
 
 
623
  $cssKey = str_replace("{{WRAPPER}}", $wrapperCssKey, $cssKey);
624
 
625
+ if(strpos($cssValue, "{{URL}}") !== false){
626
+ $cssValue = str_replace("{{URL}}", $value, $cssValue);
627
+
628
+ $cssValue = str_replace("{{VALUE}}", "", $cssValue);
629
+
630
+ }else{
631
+
632
+ $cssValue = str_replace("{{VALUE}}", $value, $cssValue);
633
+ }
634
 
635
  //clear other placeholders
636
 
 
637
  $cssValue = str_replace("{{UNIT}}", "", $cssValue);
638
+
639
  if(!empty($strStyle))
640
  $strStyle .= "\n";
641
 
644
  }
645
 
646
  }
647
+
648
 
649
  if(empty($strStyle))
650
  return(false);
provider/functions_wordpress.class.php CHANGED
@@ -1133,6 +1133,38 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1133
  return($arrCustomFields);
1134
  }
1135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1136
 
1137
  /**
1138
  * get post custom fields
@@ -1146,7 +1178,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1146
 
1147
  $isAcfActive = UniteCreatorAcfIntegrate::isAcfActive();
1148
 
1149
-
1150
  //get acf
1151
  if($isAcfActive){
1152
  $objAcf = self::getObjAcfIntegrate();
1133
  return($arrCustomFields);
1134
  }
1135
 
1136
+ /**
1137
+ * get post custom field
1138
+ */
1139
+ public static function getPostCustomField($postID, $name){
1140
+
1141
+ if(empty($name))
1142
+ return("");
1143
+
1144
+ $isAcfActive = UniteCreatorAcfIntegrate::isAcfActive();
1145
+
1146
+ $value = "";
1147
+
1148
+ if($isAcfActive == true){
1149
+
1150
+ $objAcf = self::getObjAcfIntegrate();
1151
+ $value = $objAcf->getAcfFieldValue($name, $postID);
1152
+
1153
+ if(empty($value))
1154
+ $value = get_post_meta($postID, $name, true);
1155
+
1156
+ return($value);
1157
+ }
1158
+
1159
+ if(empty($value))
1160
+ $value = get_post_meta($postID, $name, true);
1161
+
1162
+ if(is_array($value));
1163
+ $value = json_encode($value);
1164
+
1165
+ return($value);
1166
+ }
1167
+
1168
 
1169
  /**
1170
  * get post custom fields
1178
 
1179
  $isAcfActive = UniteCreatorAcfIntegrate::isAcfActive();
1180
 
 
1181
  //get acf
1182
  if($isAcfActive){
1183
  $objAcf = self::getObjAcfIntegrate();
provider/provider_db.class.php CHANGED
@@ -72,7 +72,7 @@ class UniteProviderDBUC{
72
  $this->wpdb->suppress_errors($supressErrors);
73
 
74
  $rows = $this->wpdb->get_results($query, ARRAY_A);
75
-
76
  return($rows);
77
  }
78
 
72
  $this->wpdb->suppress_errors($supressErrors);
73
 
74
  $rows = $this->wpdb->get_results($query, ARRAY_A);
75
+
76
  return($rows);
77
  }
78
 
provider/provider_globals.class.php CHANGED
@@ -30,7 +30,10 @@ class GlobalsProviderUC{
30
  public static $lastPostQuery_page = null;
31
  public static $lastPostQuery_type = null;
32
  public static $lastPostQuery_paginationType = null;
 
 
33
 
 
34
 
35
  const QUERY_TYPE_CURRENT = "current";
36
  const QUERY_TYPE_CUSTOM = "custom";
30
  public static $lastPostQuery_page = null;
31
  public static $lastPostQuery_type = null;
32
  public static $lastPostQuery_paginationType = null;
33
+ public static $skipRunPostQueryOnce = false;
34
+ public static $lastQueryArgs = null;
35
 
36
+ public static $arrTestTermIDs = null; //test term id's for render taxonomies under ajax
37
 
38
  const QUERY_TYPE_CURRENT = "current";
39
  const QUERY_TYPE_CUSTOM = "custom";
provider/provider_params_processor.class.php CHANGED
@@ -1647,8 +1647,17 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1647
  dmp($args);
1648
  }
1649
 
1650
- $query = new WP_Query($args);
 
1651
 
 
 
 
 
 
 
 
 
1652
  if($showDebugQuery == true && $debugType == "show_query"){
1653
 
1654
  $originalQueryVars = $query->query_vars;
@@ -1837,14 +1846,32 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1837
  }
1838
 
1839
  $query = $wp_query;
1840
-
 
 
 
1841
  if($currentQueryVars !== $wp_query->query_vars){
1842
 
1843
  HelperUC::addDebug("New Query", $currentQueryVars);
1844
-
 
 
 
 
 
 
 
 
1845
  $query = new WP_Query( $currentQueryVars );
1846
  }
1847
-
 
 
 
 
 
 
 
1848
 
1849
  HelperUC::addDebug("Query Vars", $currentQueryVars);
1850
 
@@ -1931,7 +1958,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1931
  dmp("Manual Selection. The Query Is:");
1932
  dmp($args);
1933
  }
1934
-
 
 
1935
  $query = new WP_Query($args);
1936
  $arrPosts = $query->posts;
1937
 
@@ -2562,9 +2591,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2562
  }
2563
 
2564
  HelperUC::addRemoteControlsScript();
2565
-
2566
- $attributes = "";
2567
-
2568
  //get the name
2569
  if($isEnable == true){
2570
 
@@ -2617,7 +2644,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2617
  */
2618
  private function getRemoteBackgroundData($value, $name, $processType, $param, $data){
2619
 
2620
-
2621
  $isSync = UniteFunctionsUC::getVal($value, $name."_sync");
2622
  $isSync = UniteFunctionsUC::strToBool($isSync);
2623
 
@@ -2632,6 +2658,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2632
  }
2633
 
2634
  $syncParentName = UniteFunctionsUC::getVal($value, $name."_sync_name");
 
2635
 
2636
  $isDebug = UniteFunctionsUC::getVal($value, $name."_debug");
2637
  $isDebug = UniteFunctionsUC::strToBool($isDebug);
@@ -2639,7 +2666,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2639
  HelperUC::addRemoteControlsScript();
2640
 
2641
  $attributes = "";
2642
- $attributes .= " data-sync='true' data-syncid='$syncParentName'";
2643
 
2644
  if($isDebug == true)
2645
  $attributes .= " data-debug='true'";
@@ -2651,7 +2678,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2651
  $attributes .= " data-widgetname='$widgetName'";
2652
 
2653
 
2654
- $class = " uc-remote-parent";
2655
 
2656
  $arrOutput["attributes"] = $attributes;
2657
  $arrOutput["class"] = $class;
@@ -3330,19 +3357,24 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3330
  }
3331
 
3332
  $arrTerms = $this->getWPTermsData($value, $name, $processType, $param);
 
 
 
 
 
 
 
3333
 
3334
  $data[$name] = $arrTerms;
3335
 
3336
  if($filterExists == true){
 
3337
  $data["is_filter"] = $isFilter?"true":"false";
 
 
 
3338
  }
3339
 
3340
- //add fitler arguments
3341
- $objFilters = new UniteCreatorFiltersProcess();
3342
- $data = $objFilters->addEditorFilterArguments($data, $isInitAfter);
3343
-
3344
-
3345
-
3346
  return($data);
3347
  }
3348
 
1647
  dmp($args);
1648
  }
1649
 
1650
+ //remember last args
1651
+ GlobalsProviderUC::$lastQueryArgs = $args;
1652
 
1653
+ //skip run
1654
+ if(GlobalsProviderUC::$skipRunPostQueryOnce == true){
1655
+ GlobalsProviderUC::$skipRunPostQueryOnce = false;
1656
+ return(array());
1657
+ }
1658
+
1659
+ $query = new WP_Query($args);
1660
+
1661
  if($showDebugQuery == true && $debugType == "show_query"){
1662
 
1663
  $originalQueryVars = $query->query_vars;
1846
  }
1847
 
1848
  $query = $wp_query;
1849
+
1850
+ //remember last args
1851
+ GlobalsProviderUC::$lastQueryArgs = $wp_query->query_vars;
1852
+
1853
  if($currentQueryVars !== $wp_query->query_vars){
1854
 
1855
  HelperUC::addDebug("New Query", $currentQueryVars);
1856
+
1857
+ //skip run
1858
+ GlobalsProviderUC::$lastQueryArgs = $wp_query->query_vars;
1859
+
1860
+ if(GlobalsProviderUC::$skipRunPostQueryOnce == true){
1861
+ GlobalsProviderUC::$skipRunPostQueryOnce = false;
1862
+ return(array());
1863
+ }
1864
+
1865
  $query = new WP_Query( $currentQueryVars );
1866
  }
1867
+
1868
+
1869
+ //skip run
1870
+ if(GlobalsProviderUC::$skipRunPostQueryOnce == true){
1871
+ GlobalsProviderUC::$skipRunPostQueryOnce = false;
1872
+ return(array());
1873
+ }
1874
+
1875
 
1876
  HelperUC::addDebug("Query Vars", $currentQueryVars);
1877
 
1958
  dmp("Manual Selection. The Query Is:");
1959
  dmp($args);
1960
  }
1961
+
1962
+ GlobalsProviderUC::$lastQueryArgs = $args;
1963
+
1964
  $query = new WP_Query($args);
1965
  $arrPosts = $query->posts;
1966
 
2591
  }
2592
 
2593
  HelperUC::addRemoteControlsScript();
2594
+
 
 
2595
  //get the name
2596
  if($isEnable == true){
2597
 
2644
  */
2645
  private function getRemoteBackgroundData($value, $name, $processType, $param, $data){
2646
 
 
2647
  $isSync = UniteFunctionsUC::getVal($value, $name."_sync");
2648
  $isSync = UniteFunctionsUC::strToBool($isSync);
2649
 
2658
  }
2659
 
2660
  $syncParentName = UniteFunctionsUC::getVal($value, $name."_sync_name");
2661
+ $remoteParentName = UniteFunctionsUC::getVal($value, $name."_remote_name");
2662
 
2663
  $isDebug = UniteFunctionsUC::getVal($value, $name."_debug");
2664
  $isDebug = UniteFunctionsUC::strToBool($isDebug);
2666
  HelperUC::addRemoteControlsScript();
2667
 
2668
  $attributes = "";
2669
+ $attributes .= " data-sync='true' data-syncid='$syncParentName' data-remoteid='$remoteParentName'";
2670
 
2671
  if($isDebug == true)
2672
  $attributes .= " data-debug='true'";
2678
  $attributes .= " data-widgetname='$widgetName'";
2679
 
2680
 
2681
+ $class = " uc-remote-parent ";
2682
 
2683
  $arrOutput["attributes"] = $attributes;
2684
  $arrOutput["class"] = $class;
3357
  }
3358
 
3359
  $arrTerms = $this->getWPTermsData($value, $name, $processType, $param);
3360
+
3361
+ //add filter arguments
3362
+
3363
+ $objFilters = new UniteCreatorFiltersProcess();
3364
+
3365
+ if($isFilter == true && $isInitAfter == true)
3366
+ $arrTerms = $objFilters->modifyOutputTermsForInitAfter($arrTerms);
3367
 
3368
  $data[$name] = $arrTerms;
3369
 
3370
  if($filterExists == true){
3371
+
3372
  $data["is_filter"] = $isFilter?"true":"false";
3373
+
3374
+ if($isFilter == true)
3375
+ $data = $objFilters->addEditorFilterArguments($data, $isInitAfter);
3376
  }
3377
 
 
 
 
 
 
 
3378
  return($data);
3379
  }
3380
 
provider/provider_settings.class.php CHANGED
@@ -2219,7 +2219,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2219
  $condition = UniteFunctionsUC::getVal($param, "elementor_condition");
2220
  $params["elementor_condition"] = $condition;
2221
 
2222
- $this->addRadioBoolean($prefix."sync", __("Enable Sync", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
2223
 
2224
  // --- sync name ----
2225
 
@@ -2237,6 +2237,22 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2237
  $this->addSelect($prefix."sync_name", $arrNames, __("Sync Group", "unlimited-elements-for-elementor"), "group1", $params);
2238
 
2239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2240
  // --- debug ---
2241
 
2242
  $params = array();
2219
  $condition = UniteFunctionsUC::getVal($param, "elementor_condition");
2220
  $params["elementor_condition"] = $condition;
2221
 
2222
+ $this->addRadioBoolean($prefix."sync", __("Enable Sync and Remote", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
2223
 
2224
  // --- sync name ----
2225
 
2237
  $this->addSelect($prefix."sync_name", $arrNames, __("Sync Group", "unlimited-elements-for-elementor"), "group1", $params);
2238
 
2239
 
2240
+ // --- remote name ----
2241
+
2242
+ $arrNames = HelperProviderUC::getArrRemoteParentNames();
2243
+ $arrNames = array_flip($arrNames);
2244
+
2245
+ $conditionSync = $condition;
2246
+ $conditionSync[$prefix."sync"] = "true";
2247
+
2248
+ $params = array(
2249
+ "origtype" => UniteCreatorDialogParam::PARAM_DROPDOWN,
2250
+ "elementor_condition" => $conditionSync
2251
+ );
2252
+
2253
+ $this->addSelect($prefix."remote_name", $arrNames, __("Remote Parent Name", "unlimited-elements-for-elementor"), "auto", $params);
2254
+
2255
+
2256
  // --- debug ---
2257
 
2258
  $params = array();
provider/provider_template_engine.class.php CHANGED
@@ -151,8 +151,8 @@ class UniteCreatorTemplateEngine extends UniteCreatorTemplateEngineWork{
151
 
152
  if(is_string($value) == false)
153
  return(true);
154
-
155
- echo UniteProviderFunctionsUC::escCombinedHtml($value);
156
  }
157
 
158
 
151
 
152
  if(is_string($value) == false)
153
  return(true);
154
+
155
+ echo $value;
156
  }
157
 
158
 
readme.txt CHANGED
@@ -476,6 +476,23 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
476
 
477
  == Changelog ==
478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  version 1.4.96 = 2021-12-29:
480
 
481
  * Feature: use yoast main category feature to determine post main category
476
 
477
  == Changelog ==
478
 
479
+ version 1.4.98:
480
+
481
+ * Feature: modified remote general js api to fit more types of widgets
482
+ * Feature: added support for put meta field in post list
483
+ * Fix: fixed some small php notices output in post query
484
+
485
+
486
+ version 1.4.97 = 2022-01-06:
487
+
488
+ * Feature: add code base for the taxonomy filter
489
+ * Feature: added option to highlight all carousel items
490
+ * Feature: added active class to new owl carousel
491
+ * Feature: added scroll on click functionality to new owl carousel
492
+ * Fix: added support for acf fields styles in dynamic grid
493
+ * Fix: fixed some wp-rocket and filters related bug
494
+
495
+
496
  version 1.4.96 = 2021-12-29:
497
 
498
  * Feature: use yoast main category feature to determine post main category
release_log.txt CHANGED
@@ -1,5 +1,22 @@
1
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  version 1.4.96:
4
 
5
  -bug fix: fixed some filters related issue
1
 
2
 
3
+ version 1.4.98:
4
+
5
+ -feature: modified remote general js api to fit more types of widgets
6
+ -bug fix: fixed some small php notices output in post query
7
+ -feature: added support for put meta field in post list
8
+
9
+
10
+ version 1.4.97:
11
+
12
+ -feature: add code base for the taxonomy filter
13
+ -feature: added option to highlight all carousel items
14
+ -bug fix: added support for acf fields styles in dynamic grid
15
+ -bug fix: fixed some wp-rocket and filters related bug
16
+ -feature: added active class to new owl carousel
17
+ -feature: added scroll on click functionality to new owl carousel
18
+
19
+
20
  version 1.4.96:
21
 
22
  -bug fix: fixed some filters related issue
unlimited_elements.php CHANGED
@@ -4,7 +4,7 @@
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.96
8
  * Author URI: http://unlimited-elements.com
9
  * Text Domain: unlimited-elements-for-elementor
10
  * Domain Path: /languages
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.98
8
  * Author URI: http://unlimited-elements.com
9
  * Text Domain: unlimited-elements-for-elementor
10
  * Domain Path: /languages