j1m_gallery 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +21 -0
  3. data/README.md +41 -0
  4. data/_data/modules/default/j1_gallery-0.0.1/j1_justified_gallery.yml +285 -0
  5. data/_data/resources/default/j1_gallery-0.0.1/resource.yml +24 -0
  6. data/assets/images/gallery/down_the_water/1-1600.jpg +0 -0
  7. data/assets/images/gallery/down_the_water/2-1600.jpg +0 -0
  8. data/assets/images/gallery/down_the_water/3-1600.jpg +0 -0
  9. data/assets/images/gallery/justified_gallery/13824322785_104dc0968c_b.jpg +0 -0
  10. data/assets/images/gallery/justified_gallery/13824322785_104dc0968c_m.jpg +0 -0
  11. data/assets/images/gallery/justified_gallery/13824674674_ca1e482394_b.jpg +0 -0
  12. data/assets/images/gallery/justified_gallery/13824674674_ca1e482394_m.jpg +0 -0
  13. data/assets/images/gallery/justified_gallery/16961685188_f130144d60_b.jpg +0 -0
  14. data/assets/images/gallery/justified_gallery/16961685188_f130144d60_m.jpg +0 -0
  15. data/assets/images/gallery/justified_gallery/23753792354_bd75d8dabc_b.jpg +0 -0
  16. data/assets/images/gallery/justified_gallery/23753792354_bd75d8dabc_m.jpg +0 -0
  17. data/assets/images/gallery/justified_gallery/24014174029_2cfa940264_b.jpg +0 -0
  18. data/assets/images/gallery/justified_gallery/24014174029_2cfa940264_m.jpg +0 -0
  19. data/assets/images/gallery/justified_gallery/24096687789_c37d45712f_b.jpg +0 -0
  20. data/assets/images/gallery/justified_gallery/24096687789_c37d45712f_m.jpg +0 -0
  21. data/assets/images/gallery/justified_gallery/6791628438_affaa19e10_b.jpg +0 -0
  22. data/assets/images/gallery/justified_gallery/6791628438_affaa19e10_m.jpg +0 -0
  23. data/assets/images/gallery/justified_gallery/6798453217_72dea2d06e_b.jpg +0 -0
  24. data/assets/images/gallery/justified_gallery/6798453217_72dea2d06e_m.jpg +0 -0
  25. data/assets/images/gallery/justified_gallery/6806687375_07d2b7a1f9_b.jpg +0 -0
  26. data/assets/images/gallery/justified_gallery/6806687375_07d2b7a1f9_m.jpg +0 -0
  27. data/assets/images/gallery/justified_gallery/6812090617_5fd5bbdda0_b.jpg +0 -0
  28. data/assets/images/gallery/justified_gallery/6812090617_5fd5bbdda0_m.jpg +0 -0
  29. data/assets/images/gallery/justified_gallery/6840627709_92ed52fb41_b.jpg +0 -0
  30. data/assets/images/gallery/justified_gallery/6840627709_92ed52fb41_m.jpg +0 -0
  31. data/assets/images/gallery/justified_gallery/6841267340_855273fd7e_b.jpg +0 -0
  32. data/assets/images/gallery/justified_gallery/6841267340_855273fd7e_m.jpg +0 -0
  33. data/assets/images/gallery/justified_gallery/6876412479_6268c6e2aa_b.jpg +0 -0
  34. data/assets/images/gallery/justified_gallery/6876412479_6268c6e2aa_m.jpg +0 -0
  35. data/assets/images/gallery/justified_gallery/6880502467_d4b3c4b2a8_b.jpg +0 -0
  36. data/assets/images/gallery/justified_gallery/6880502467_d4b3c4b2a8_m.jpg +0 -0
  37. data/assets/images/gallery/justified_gallery/6916180091_9c9559e463_b.jpg +0 -0
  38. data/assets/images/gallery/justified_gallery/6916180091_9c9559e463_m.jpg +0 -0
  39. data/assets/images/gallery/justified_gallery/7002395006_29fdc85f7a_b.jpg +0 -0
  40. data/assets/images/gallery/justified_gallery/7002395006_29fdc85f7a_m.jpg +0 -0
  41. data/assets/images/gallery/justified_gallery/7062575651_b23918b11a_b.jpg +0 -0
  42. data/assets/images/gallery/justified_gallery/7062575651_b23918b11a_m.jpg +0 -0
  43. data/assets/images/gallery/justified_gallery/7822678460_ee98ff1f69_b.jpg +0 -0
  44. data/assets/images/gallery/justified_gallery/7822678460_ee98ff1f69_m.jpg +0 -0
  45. data/assets/images/gallery/justified_gallery/7948632554_01f6ae6b6f_b.jpg +0 -0
  46. data/assets/images/gallery/justified_gallery/7948632554_01f6ae6b6f_m.jpg +0 -0
  47. data/assets/images/gallery/justified_gallery/8157236803_78aa1698b6_b.jpg +0 -0
  48. data/assets/images/gallery/justified_gallery/8157236803_78aa1698b6_m.jpg +0 -0
  49. data/assets/images/gallery/justified_gallery/8400794773_932654a20e_b.jpg +0 -0
  50. data/assets/images/gallery/justified_gallery/8400794773_932654a20e_m.jpg +0 -0
  51. data/assets/images/gallery/justified_gallery/8811828736_88392f614a_b.jpg +0 -0
  52. data/assets/images/gallery/justified_gallery/8811828736_88392f614a_m.jpg +0 -0
  53. data/assets/images/gallery/justified_gallery/8842312290_f310d491f4_b.jpg +0 -0
  54. data/assets/images/gallery/justified_gallery/8842312290_f310d491f4_m.jpg +0 -0
  55. data/assets/images/gallery/old_times/image_01.jpg +0 -0
  56. data/assets/images/gallery/old_times/image_02.jpg +0 -0
  57. data/assets/images/gallery/old_times/image_03.jpg +0 -0
  58. data/assets/images/gallery/old_times/image_04.jpg +0 -0
  59. data/assets/themes/j1/j1/js/adapters/owl_carousel.js +206 -0
  60. data/assets/themes/j1/owl_carousel/LICENSE +20 -0
  61. data/assets/themes/j1/owl_carousel/README.md +74 -0
  62. data/assets/themes/j1/owl_carousel/bower.json +14 -0
  63. data/assets/themes/j1/owl_carousel/changelog.html +278 -0
  64. data/assets/themes/j1/owl_carousel/css/owl_carousel.css +86 -0
  65. data/assets/themes/j1/owl_carousel/css/owl_carousel.min.css +21 -0
  66. data/assets/themes/j1/owl_carousel/css/owl_transitions.css +178 -0
  67. data/assets/themes/j1/owl_carousel/css/owl_transitions.min.css +21 -0
  68. data/assets/themes/j1/owl_carousel/css/themes/j1_template.css +168 -0
  69. data/assets/themes/j1/owl_carousel/css/themes/sample/j1_sample.less +184 -0
  70. data/assets/themes/j1/owl_carousel/css/themes/sample/j1_samples.css +523 -0
  71. data/assets/themes/j1/owl_carousel/demo/assets/fullimage1.jpg +0 -0
  72. data/assets/themes/j1/owl_carousel/demo/assets/fullimage2.jpg +0 -0
  73. data/assets/themes/j1/owl_carousel/demo/assets/fullimage3.jpg +0 -0
  74. data/assets/themes/j1/owl_carousel/demo/assets/fullimage4.jpg +0 -0
  75. data/assets/themes/j1/owl_carousel/demo/assets/fullimage5.jpg +0 -0
  76. data/assets/themes/j1/owl_carousel/demo/assets/fullimage6.jpg +0 -0
  77. data/assets/themes/j1/owl_carousel/demo/assets/fullimage7.jpg +0 -0
  78. data/assets/themes/j1/owl_carousel/demo/assets/owl1.jpg +0 -0
  79. data/assets/themes/j1/owl_carousel/demo/assets/owl2.jpg +0 -0
  80. data/assets/themes/j1/owl_carousel/demo/assets/owl3.jpg +0 -0
  81. data/assets/themes/j1/owl_carousel/demo/assets/owl4.jpg +0 -0
  82. data/assets/themes/j1/owl_carousel/demo/assets/owl5.jpg +0 -0
  83. data/assets/themes/j1/owl_carousel/demo/assets/owl6.jpg +0 -0
  84. data/assets/themes/j1/owl_carousel/demo/assets/owl7.jpg +0 -0
  85. data/assets/themes/j1/owl_carousel/demo/assets/owl8.jpg +0 -0
  86. data/assets/themes/j1/owl_carousel/demo/autoHeight.html +335 -0
  87. data/assets/themes/j1/owl_carousel/demo/click.html +365 -0
  88. data/assets/themes/j1/owl_carousel/demo/custom.html +417 -0
  89. data/assets/themes/j1/owl_carousel/demo/customJson.html +358 -0
  90. data/assets/themes/j1/owl_carousel/demo/full.html +321 -0
  91. data/assets/themes/j1/owl_carousel/demo/images.html +325 -0
  92. data/assets/themes/j1/owl_carousel/demo/itemsCustom.html +372 -0
  93. data/assets/themes/j1/owl_carousel/demo/json.html +336 -0
  94. data/assets/themes/j1/owl_carousel/demo/json/customData.json +28 -0
  95. data/assets/themes/j1/owl_carousel/demo/json/data.json +18 -0
  96. data/assets/themes/j1/owl_carousel/demo/lazyLoad.html +338 -0
  97. data/assets/themes/j1/owl_carousel/demo/manipulations.html +515 -0
  98. data/assets/themes/j1/owl_carousel/demo/navOnTop.html +395 -0
  99. data/assets/themes/j1/owl_carousel/demo/navOnTop2.html +325 -0
  100. data/assets/themes/j1/owl_carousel/demo/one.html +318 -0
  101. data/assets/themes/j1/owl_carousel/demo/owlStatus.html +461 -0
  102. data/assets/themes/j1/owl_carousel/demo/progressBar.html +471 -0
  103. data/assets/themes/j1/owl_carousel/demo/randomOrder.html +416 -0
  104. data/assets/themes/j1/owl_carousel/demo/scaleup.html +328 -0
  105. data/assets/themes/j1/owl_carousel/demo/sync.html +569 -0
  106. data/assets/themes/j1/owl_carousel/demo/transitions.html +330 -0
  107. data/assets/themes/j1/owl_carousel/images/ajax-loader.gif +0 -0
  108. data/assets/themes/j1/owl_carousel/images/apple-touch-icon-114-precomposed.png +0 -0
  109. data/assets/themes/j1/owl_carousel/images/apple-touch-icon-144-precomposed.png +0 -0
  110. data/assets/themes/j1/owl_carousel/images/apple-touch-icon-57-precomposed.png +0 -0
  111. data/assets/themes/j1/owl_carousel/images/apple-touch-icon-72-precomposed.png +0 -0
  112. data/assets/themes/j1/owl_carousel/images/demo-slides/controls.png +0 -0
  113. data/assets/themes/j1/owl_carousel/images/demo-slides/css3.png +0 -0
  114. data/assets/themes/j1/owl_carousel/images/demo-slides/feather.png +0 -0
  115. data/assets/themes/j1/owl_carousel/images/demo-slides/grab.png +0 -0
  116. data/assets/themes/j1/owl_carousel/images/demo-slides/modern.png +0 -0
  117. data/assets/themes/j1/owl_carousel/images/demo-slides/multi.png +0 -0
  118. data/assets/themes/j1/owl_carousel/images/demo-slides/responsive.png +0 -0
  119. data/assets/themes/j1/owl_carousel/images/demo-slides/tons.png +0 -0
  120. data/assets/themes/j1/owl_carousel/images/demo-slides/touch.png +0 -0
  121. data/assets/themes/j1/owl_carousel/images/demo-slides/zombie.png +0 -0
  122. data/assets/themes/j1/owl_carousel/images/favicon.png +0 -0
  123. data/assets/themes/j1/owl_carousel/images/glyphicons-halflings-green.png +0 -0
  124. data/assets/themes/j1/owl_carousel/images/glyphicons-halflings-white.png +0 -0
  125. data/assets/themes/j1/owl_carousel/images/glyphicons-halflings.png +0 -0
  126. data/assets/themes/j1/owl_carousel/images/grabbing.png +0 -0
  127. data/assets/themes/j1/owl_carousel/images/owl-logo.png +0 -0
  128. data/assets/themes/j1/owl_carousel/images/owl.video.play.png +0 -0
  129. data/assets/themes/j1/owl_carousel/index.html +912 -0
  130. data/assets/themes/j1/owl_carousel/js/owl_carousel.js +1517 -0
  131. data/assets/themes/j1/owl_carousel/js/owl_carousel.min.js +57 -0
  132. data/assets/videos/gallery/example/video1-poster.jpg +0 -0
  133. data/assets/videos/gallery/example/video1-thumb.jpg +0 -0
  134. data/assets/videos/gallery/example/video1.mp4 +0 -0
  135. data/assets/videos/gallery/example/video2-poster.jpg +0 -0
  136. data/assets/videos/gallery/example/video2-thumb.jpg +0 -0
  137. data/assets/videos/gallery/example/video2.mp4 +0 -0
  138. data/assets/videos/gallery/example/video3-poster.jpg +0 -0
  139. data/assets/videos/gallery/example/video3-thumb.jpg +0 -0
  140. data/assets/videos/gallery/example/video3.mp4 +0 -0
  141. data/assets/videos/gallery/example/video4-poster.jpg +0 -0
  142. data/assets/videos/gallery/example/video4-thumb.jpg +0 -0
  143. data/assets/videos/gallery/example/video4.mp4 +0 -0
  144. data/exe/console +14 -0
  145. data/exe/setup +8 -0
  146. data/lib/j1m_gallery.rb +5 -0
  147. data/lib/j1m_gallery/version.rb +3 -0
  148. metadata +236 -0
@@ -0,0 +1,1517 @@
1
+ /*
2
+ * jQuery OwlCarousel v1.3.3
3
+ *
4
+ * Copyright (c) 2013-2016 Bartosz Wojciechowski
5
+ * http://jekyll.one/owlcarousel/
6
+ *
7
+ * Licensed under MIT
8
+ *
9
+ */
10
+
11
+ /*JS Lint helpers: */
12
+ /*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */
13
+ /*jslint nomen: true, continue:true */
14
+
15
+ if (typeof Object.create !== "function") {
16
+ Object.create = function (obj) {
17
+ function F() {}
18
+ F.prototype = obj;
19
+ return new F();
20
+ };
21
+ }
22
+ (function ($, window, document) {
23
+
24
+ var Carousel = {
25
+ init : function (options, el) {
26
+ var base = this;
27
+
28
+ base.$elem = $(el);
29
+ base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options);
30
+
31
+ base.userOptions = options;
32
+ base.loadContent();
33
+ },
34
+
35
+ loadContent : function () {
36
+ var base = this, url;
37
+
38
+ function getData(data) {
39
+ var i, content = "";
40
+ if (typeof base.options.jsonSuccess === "function") {
41
+ base.options.jsonSuccess.apply(this, [data]);
42
+ } else {
43
+ for (i in data.owl) {
44
+ if (data.owl.hasOwnProperty(i)) {
45
+ content += data.owl[i].item;
46
+ }
47
+ }
48
+ base.$elem.html(content);
49
+ }
50
+ base.logIn();
51
+ }
52
+
53
+ if (typeof base.options.beforeInit === "function") {
54
+ base.options.beforeInit.apply(this, [base.$elem]);
55
+ }
56
+
57
+ if (typeof base.options.jsonPath === "string") {
58
+ url = base.options.jsonPath;
59
+ $.getJSON(url, getData);
60
+ } else {
61
+ base.logIn();
62
+ }
63
+ },
64
+
65
+ logIn : function () {
66
+ var base = this;
67
+
68
+ base.$elem.data({
69
+ "owl-originalStyles": base.$elem.attr("style"),
70
+ "owl-originalClasses": base.$elem.attr("class")
71
+ });
72
+
73
+ base.$elem.css({opacity: 0});
74
+ base.orignalItems = base.options.items;
75
+ base.checkBrowser();
76
+ base.wrapperWidth = 0;
77
+ base.checkVisible = null;
78
+ base.setVars();
79
+ },
80
+
81
+ setVars : function () {
82
+ var base = this;
83
+ if (base.$elem.children().length === 0) {return false; }
84
+ base.baseClass();
85
+ base.eventTypes();
86
+ base.$userItems = base.$elem.children();
87
+ base.itemsAmount = base.$userItems.length;
88
+ base.wrapItems();
89
+ base.$owlItems = base.$elem.find(".owl-item");
90
+ base.$owlWrapper = base.$elem.find(".owl-wrapper");
91
+ base.playDirection = "next";
92
+ base.prevItem = 0;
93
+ base.prevArr = [0];
94
+ base.currentItem = 0;
95
+ base.customEvents();
96
+ base.onStartup();
97
+ },
98
+
99
+ onStartup : function () {
100
+ var base = this;
101
+ base.updateItems();
102
+ base.calculateAll();
103
+ base.buildControls();
104
+ base.updateControls();
105
+ base.response();
106
+ base.moveEvents();
107
+ base.stopOnHover();
108
+ base.owlStatus();
109
+
110
+ if (base.options.transitionStyle !== false) {
111
+ base.transitionTypes(base.options.transitionStyle);
112
+ }
113
+ if (base.options.autoPlay === true) {
114
+ base.options.autoPlay = 5000;
115
+ }
116
+ base.play();
117
+
118
+ base.$elem.find(".owl-wrapper").css("display", "block");
119
+
120
+ if (!base.$elem.is(":visible")) {
121
+ base.watchVisibility();
122
+ } else {
123
+ base.$elem.css("opacity", 1);
124
+ }
125
+ base.onstartup = false;
126
+ base.eachMoveUpdate();
127
+ if (typeof base.options.afterInit === "function") {
128
+ base.options.afterInit.apply(this, [base.$elem]);
129
+ }
130
+ },
131
+
132
+ eachMoveUpdate : function () {
133
+ var base = this;
134
+
135
+ if (base.options.lazyLoad === true) {
136
+ base.lazyLoad();
137
+ }
138
+ if (base.options.autoHeight === true) {
139
+ base.autoHeight();
140
+ }
141
+ base.onVisibleItems();
142
+
143
+ if (typeof base.options.afterAction === "function") {
144
+ base.options.afterAction.apply(this, [base.$elem]);
145
+ }
146
+ },
147
+
148
+ updateVars : function () {
149
+ var base = this;
150
+ if (typeof base.options.beforeUpdate === "function") {
151
+ base.options.beforeUpdate.apply(this, [base.$elem]);
152
+ }
153
+ base.watchVisibility();
154
+ base.updateItems();
155
+ base.calculateAll();
156
+ base.updatePosition();
157
+ base.updateControls();
158
+ base.eachMoveUpdate();
159
+ if (typeof base.options.afterUpdate === "function") {
160
+ base.options.afterUpdate.apply(this, [base.$elem]);
161
+ }
162
+ },
163
+
164
+ reload : function () {
165
+ var base = this;
166
+ window.setTimeout(function () {
167
+ base.updateVars();
168
+ }, 0);
169
+ },
170
+
171
+ watchVisibility : function () {
172
+ var base = this;
173
+
174
+ if (base.$elem.is(":visible") === false) {
175
+ base.$elem.css({opacity: 0});
176
+ window.clearInterval(base.autoPlayInterval);
177
+ window.clearInterval(base.checkVisible);
178
+ } else {
179
+ return false;
180
+ }
181
+ base.checkVisible = window.setInterval(function () {
182
+ if (base.$elem.is(":visible")) {
183
+ base.reload();
184
+ base.$elem.animate({opacity: 1}, 200);
185
+ window.clearInterval(base.checkVisible);
186
+ }
187
+ }, 500);
188
+ },
189
+
190
+ wrapItems : function () {
191
+ var base = this;
192
+ base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>");
193
+ base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">");
194
+ base.wrapperOuter = base.$elem.find(".owl-wrapper-outer");
195
+ base.$elem.css("display", "block");
196
+ },
197
+
198
+ baseClass : function () {
199
+ var base = this,
200
+ hasBaseClass = base.$elem.hasClass(base.options.baseClass),
201
+ hasThemeClass = base.$elem.hasClass(base.options.theme);
202
+
203
+ if (!hasBaseClass) {
204
+ base.$elem.addClass(base.options.baseClass);
205
+ }
206
+
207
+ if (!hasThemeClass) {
208
+ base.$elem.addClass(base.options.theme);
209
+ }
210
+ },
211
+
212
+ updateItems : function () {
213
+ var base = this, width, i;
214
+
215
+ if (base.options.responsive === false) {
216
+ return false;
217
+ }
218
+ if (base.options.singleItem === true) {
219
+ base.options.items = base.orignalItems = 1;
220
+ base.options.itemsCustom = false;
221
+ base.options.itemsDesktop = false;
222
+ base.options.itemsDesktopSmall = false;
223
+ base.options.itemsTablet = false;
224
+ base.options.itemsTabletSmall = false;
225
+ base.options.itemsMobile = false;
226
+ return false;
227
+ }
228
+
229
+ width = $(base.options.responsiveBaseWidth).width();
230
+
231
+ if (width > (base.options.itemsDesktop[0] || base.orignalItems)) {
232
+ base.options.items = base.orignalItems;
233
+ }
234
+ if (base.options.itemsCustom !== false) {
235
+ //Reorder array by screen size
236
+ base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; });
237
+
238
+ for (i = 0; i < base.options.itemsCustom.length; i += 1) {
239
+ if (base.options.itemsCustom[i][0] <= width) {
240
+ base.options.items = base.options.itemsCustom[i][1];
241
+ }
242
+ }
243
+
244
+ } else {
245
+
246
+ if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) {
247
+ base.options.items = base.options.itemsDesktop[1];
248
+ }
249
+
250
+ if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) {
251
+ base.options.items = base.options.itemsDesktopSmall[1];
252
+ }
253
+
254
+ if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) {
255
+ base.options.items = base.options.itemsTablet[1];
256
+ }
257
+
258
+ if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) {
259
+ base.options.items = base.options.itemsTabletSmall[1];
260
+ }
261
+
262
+ if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) {
263
+ base.options.items = base.options.itemsMobile[1];
264
+ }
265
+ }
266
+
267
+ //if number of items is less than declared
268
+ if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) {
269
+ base.options.items = base.itemsAmount;
270
+ }
271
+ },
272
+
273
+ response : function () {
274
+ var base = this,
275
+ smallDelay,
276
+ lastWindowWidth;
277
+
278
+ if (base.options.responsive !== true) {
279
+ return false;
280
+ }
281
+ lastWindowWidth = $(window).width();
282
+
283
+ base.resizer = function () {
284
+ if ($(window).width() !== lastWindowWidth) {
285
+ if (base.options.autoPlay !== false) {
286
+ window.clearInterval(base.autoPlayInterval);
287
+ }
288
+ window.clearTimeout(smallDelay);
289
+ smallDelay = window.setTimeout(function () {
290
+ lastWindowWidth = $(window).width();
291
+ base.updateVars();
292
+ }, base.options.responsiveRefreshRate);
293
+ }
294
+ };
295
+ $(window).resize(base.resizer);
296
+ },
297
+
298
+ updatePosition : function () {
299
+ var base = this;
300
+ base.jumpTo(base.currentItem);
301
+ if (base.options.autoPlay !== false) {
302
+ base.checkAp();
303
+ }
304
+ },
305
+
306
+ appendItemsSizes : function () {
307
+ var base = this,
308
+ roundPages = 0,
309
+ lastItem = base.itemsAmount - base.options.items;
310
+
311
+ base.$owlItems.each(function (index) {
312
+ var $this = $(this);
313
+ $this
314
+ .css({"width": base.itemWidth})
315
+ .data("owl-item", Number(index));
316
+
317
+ if (index % base.options.items === 0 || index === lastItem) {
318
+ if (!(index > lastItem)) {
319
+ roundPages += 1;
320
+ }
321
+ }
322
+ $this.data("owl-roundPages", roundPages);
323
+ });
324
+ },
325
+
326
+ appendWrapperSizes : function () {
327
+ var base = this,
328
+ width = base.$owlItems.length * base.itemWidth;
329
+
330
+ base.$owlWrapper.css({
331
+ "width": width * 2,
332
+ "left": 0
333
+ });
334
+ base.appendItemsSizes();
335
+ },
336
+
337
+ calculateAll : function () {
338
+ var base = this;
339
+ base.calculateWidth();
340
+ base.appendWrapperSizes();
341
+ base.loops();
342
+ base.max();
343
+ },
344
+
345
+ calculateWidth : function () {
346
+ var base = this;
347
+ base.itemWidth = Math.round(base.$elem.width() / base.options.items);
348
+ },
349
+
350
+ max : function () {
351
+ var base = this,
352
+ maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1;
353
+ if (base.options.items > base.itemsAmount) {
354
+ base.maximumItem = 0;
355
+ maximum = 0;
356
+ base.maximumPixels = 0;
357
+ } else {
358
+ base.maximumItem = base.itemsAmount - base.options.items;
359
+ base.maximumPixels = maximum;
360
+ }
361
+ return maximum;
362
+ },
363
+
364
+ min : function () {
365
+ return 0;
366
+ },
367
+
368
+ loops : function () {
369
+ var base = this,
370
+ prev = 0,
371
+ elWidth = 0,
372
+ i,
373
+ item,
374
+ roundPageNum;
375
+
376
+ base.positionsInArray = [0];
377
+ base.pagesInArray = [];
378
+
379
+ for (i = 0; i < base.itemsAmount; i += 1) {
380
+ elWidth += base.itemWidth;
381
+ base.positionsInArray.push(-elWidth);
382
+
383
+ if (base.options.scrollPerPage === true) {
384
+ item = $(base.$owlItems[i]);
385
+ roundPageNum = item.data("owl-roundPages");
386
+ if (roundPageNum !== prev) {
387
+ base.pagesInArray[prev] = base.positionsInArray[i];
388
+ prev = roundPageNum;
389
+ }
390
+ }
391
+ }
392
+ },
393
+
394
+ buildControls : function () {
395
+ var base = this;
396
+ if (base.options.navigation === true || base.options.pagination === true) {
397
+ base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem);
398
+ }
399
+ if (base.options.pagination === true) {
400
+ base.buildPagination();
401
+ }
402
+ if (base.options.navigation === true) {
403
+ base.buildButtons();
404
+ }
405
+ },
406
+
407
+ buildButtons : function () {
408
+ var base = this,
409
+ buttonsWrapper = $("<div class=\"owl-buttons\"/>");
410
+ base.owlControls.append(buttonsWrapper);
411
+
412
+ base.buttonPrev = $("<div/>", {
413
+ "class" : "owl-prev",
414
+ "html" : base.options.navigationText[0] || ""
415
+ });
416
+
417
+ base.buttonNext = $("<div/>", {
418
+ "class" : "owl-next",
419
+ "html" : base.options.navigationText[1] || ""
420
+ });
421
+
422
+ buttonsWrapper
423
+ .append(base.buttonPrev)
424
+ .append(base.buttonNext);
425
+
426
+ buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) {
427
+ event.preventDefault();
428
+ });
429
+
430
+ buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) {
431
+ event.preventDefault();
432
+ if ($(this).hasClass("owl-next")) {
433
+ base.next();
434
+ } else {
435
+ base.prev();
436
+ }
437
+ });
438
+ },
439
+
440
+ buildPagination : function () {
441
+ var base = this;
442
+
443
+ base.paginationWrapper = $("<div class=\"owl-pagination\"/>");
444
+ base.owlControls.append(base.paginationWrapper);
445
+
446
+ base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) {
447
+ event.preventDefault();
448
+ if (Number($(this).data("owl-page")) !== base.currentItem) {
449
+ base.goTo(Number($(this).data("owl-page")), true);
450
+ }
451
+ });
452
+ },
453
+
454
+ updatePagination : function () {
455
+ var base = this,
456
+ counter,
457
+ lastPage,
458
+ lastItem,
459
+ i,
460
+ paginationButton,
461
+ paginationButtonInner;
462
+
463
+ if (base.options.pagination === false) {
464
+ return false;
465
+ }
466
+
467
+ base.paginationWrapper.html("");
468
+
469
+ counter = 0;
470
+ lastPage = base.itemsAmount - base.itemsAmount % base.options.items;
471
+
472
+ for (i = 0; i < base.itemsAmount; i += 1) {
473
+ if (i % base.options.items === 0) {
474
+ counter += 1;
475
+ if (lastPage === i) {
476
+ lastItem = base.itemsAmount - base.options.items;
477
+ }
478
+ paginationButton = $("<div/>", {
479
+ "class" : "owl-page"
480
+ });
481
+ paginationButtonInner = $("<span></span>", {
482
+ "text": base.options.paginationNumbers === true ? counter : "",
483
+ "class": base.options.paginationNumbers === true ? "owl-numbers" : ""
484
+ });
485
+ paginationButton.append(paginationButtonInner);
486
+
487
+ paginationButton.data("owl-page", lastPage === i ? lastItem : i);
488
+ paginationButton.data("owl-roundPages", counter);
489
+
490
+ base.paginationWrapper.append(paginationButton);
491
+ }
492
+ }
493
+ base.checkPagination();
494
+ },
495
+ checkPagination : function () {
496
+ var base = this;
497
+ if (base.options.pagination === false) {
498
+ return false;
499
+ }
500
+ base.paginationWrapper.find(".owl-page").each(function () {
501
+ if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) {
502
+ base.paginationWrapper
503
+ .find(".owl-page")
504
+ .removeClass("active");
505
+ $(this).addClass("active");
506
+ }
507
+ });
508
+ },
509
+
510
+ checkNavigation : function () {
511
+ var base = this;
512
+
513
+ if (base.options.navigation === false) {
514
+ return false;
515
+ }
516
+ if (base.options.rewindNav === false) {
517
+ if (base.currentItem === 0 && base.maximumItem === 0) {
518
+ base.buttonPrev.addClass("disabled");
519
+ base.buttonNext.addClass("disabled");
520
+ } else if (base.currentItem === 0 && base.maximumItem !== 0) {
521
+ base.buttonPrev.addClass("disabled");
522
+ base.buttonNext.removeClass("disabled");
523
+ } else if (base.currentItem === base.maximumItem) {
524
+ base.buttonPrev.removeClass("disabled");
525
+ base.buttonNext.addClass("disabled");
526
+ } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) {
527
+ base.buttonPrev.removeClass("disabled");
528
+ base.buttonNext.removeClass("disabled");
529
+ }
530
+ }
531
+ },
532
+
533
+ updateControls : function () {
534
+ var base = this;
535
+ base.updatePagination();
536
+ base.checkNavigation();
537
+ if (base.owlControls) {
538
+ if (base.options.items >= base.itemsAmount) {
539
+ base.owlControls.hide();
540
+ } else {
541
+ base.owlControls.show();
542
+ }
543
+ }
544
+ },
545
+
546
+ destroyControls : function () {
547
+ var base = this;
548
+ if (base.owlControls) {
549
+ base.owlControls.remove();
550
+ }
551
+ },
552
+
553
+ next : function (speed) {
554
+ var base = this;
555
+
556
+ if (base.isTransition) {
557
+ return false;
558
+ }
559
+
560
+ base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1;
561
+ if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) {
562
+ if (base.options.rewindNav === true) {
563
+ base.currentItem = 0;
564
+ speed = "rewind";
565
+ } else {
566
+ base.currentItem = base.maximumItem;
567
+ return false;
568
+ }
569
+ }
570
+ base.goTo(base.currentItem, speed);
571
+ },
572
+
573
+ prev : function (speed) {
574
+ var base = this;
575
+
576
+ if (base.isTransition) {
577
+ return false;
578
+ }
579
+
580
+ if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) {
581
+ base.currentItem = 0;
582
+ } else {
583
+ base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1;
584
+ }
585
+ if (base.currentItem < 0) {
586
+ if (base.options.rewindNav === true) {
587
+ base.currentItem = base.maximumItem;
588
+ speed = "rewind";
589
+ } else {
590
+ base.currentItem = 0;
591
+ return false;
592
+ }
593
+ }
594
+ base.goTo(base.currentItem, speed);
595
+ },
596
+
597
+ goTo : function (position, speed, drag) {
598
+ var base = this,
599
+ goToPixel;
600
+
601
+ if (base.isTransition) {
602
+ return false;
603
+ }
604
+ if (typeof base.options.beforeMove === "function") {
605
+ base.options.beforeMove.apply(this, [base.$elem]);
606
+ }
607
+ if (position >= base.maximumItem) {
608
+ position = base.maximumItem;
609
+ } else if (position <= 0) {
610
+ position = 0;
611
+ }
612
+
613
+ base.currentItem = base.owl.currentItem = position;
614
+ if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) {
615
+ base.swapSpeed(0);
616
+ if (base.browser.support3d === true) {
617
+ base.transition3d(base.positionsInArray[position]);
618
+ } else {
619
+ base.css2slide(base.positionsInArray[position], 1);
620
+ }
621
+ base.afterGo();
622
+ base.singleItemTransition();
623
+ return false;
624
+ }
625
+ goToPixel = base.positionsInArray[position];
626
+
627
+ if (base.browser.support3d === true) {
628
+ base.isCss3Finish = false;
629
+
630
+ if (speed === true) {
631
+ base.swapSpeed("paginationSpeed");
632
+ window.setTimeout(function () {
633
+ base.isCss3Finish = true;
634
+ }, base.options.paginationSpeed);
635
+
636
+ } else if (speed === "rewind") {
637
+ base.swapSpeed(base.options.rewindSpeed);
638
+ window.setTimeout(function () {
639
+ base.isCss3Finish = true;
640
+ }, base.options.rewindSpeed);
641
+
642
+ } else {
643
+ base.swapSpeed("slideSpeed");
644
+ window.setTimeout(function () {
645
+ base.isCss3Finish = true;
646
+ }, base.options.slideSpeed);
647
+ }
648
+ base.transition3d(goToPixel);
649
+ } else {
650
+ if (speed === true) {
651
+ base.css2slide(goToPixel, base.options.paginationSpeed);
652
+ } else if (speed === "rewind") {
653
+ base.css2slide(goToPixel, base.options.rewindSpeed);
654
+ } else {
655
+ base.css2slide(goToPixel, base.options.slideSpeed);
656
+ }
657
+ }
658
+ base.afterGo();
659
+ },
660
+
661
+ jumpTo : function (position) {
662
+ var base = this;
663
+ if (typeof base.options.beforeMove === "function") {
664
+ base.options.beforeMove.apply(this, [base.$elem]);
665
+ }
666
+ if (position >= base.maximumItem || position === -1) {
667
+ position = base.maximumItem;
668
+ } else if (position <= 0) {
669
+ position = 0;
670
+ }
671
+ base.swapSpeed(0);
672
+ if (base.browser.support3d === true) {
673
+ base.transition3d(base.positionsInArray[position]);
674
+ } else {
675
+ base.css2slide(base.positionsInArray[position], 1);
676
+ }
677
+ base.currentItem = base.owl.currentItem = position;
678
+ base.afterGo();
679
+ },
680
+
681
+ afterGo : function () {
682
+ var base = this;
683
+
684
+ base.prevArr.push(base.currentItem);
685
+ base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2];
686
+ base.prevArr.shift(0);
687
+
688
+ if (base.prevItem !== base.currentItem) {
689
+ base.checkPagination();
690
+ base.checkNavigation();
691
+ base.eachMoveUpdate();
692
+
693
+ if (base.options.autoPlay !== false) {
694
+ base.checkAp();
695
+ }
696
+ }
697
+ if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) {
698
+ base.options.afterMove.apply(this, [base.$elem]);
699
+ }
700
+ },
701
+
702
+ stop : function () {
703
+ var base = this;
704
+ base.apStatus = "stop";
705
+ window.clearInterval(base.autoPlayInterval);
706
+ },
707
+
708
+ checkAp : function () {
709
+ var base = this;
710
+ if (base.apStatus !== "stop") {
711
+ base.play();
712
+ }
713
+ },
714
+
715
+ play : function () {
716
+ var base = this;
717
+ base.apStatus = "play";
718
+ if (base.options.autoPlay === false) {
719
+ return false;
720
+ }
721
+ window.clearInterval(base.autoPlayInterval);
722
+ base.autoPlayInterval = window.setInterval(function () {
723
+ base.next(true);
724
+ }, base.options.autoPlay);
725
+ },
726
+
727
+ swapSpeed : function (action) {
728
+ var base = this;
729
+ if (action === "slideSpeed") {
730
+ base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));
731
+ } else if (action === "paginationSpeed") {
732
+ base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));
733
+ } else if (typeof action !== "string") {
734
+ base.$owlWrapper.css(base.addCssSpeed(action));
735
+ }
736
+ },
737
+
738
+ addCssSpeed : function (speed) {
739
+ return {
740
+ "-webkit-transition": "all " + speed + "ms ease",
741
+ "-moz-transition": "all " + speed + "ms ease",
742
+ "-o-transition": "all " + speed + "ms ease",
743
+ "transition": "all " + speed + "ms ease"
744
+ };
745
+ },
746
+
747
+ removeTransition : function () {
748
+ return {
749
+ "-webkit-transition": "",
750
+ "-moz-transition": "",
751
+ "-o-transition": "",
752
+ "transition": ""
753
+ };
754
+ },
755
+
756
+ doTranslate : function (pixels) {
757
+ return {
758
+ "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)",
759
+ "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)",
760
+ "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)",
761
+ "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)",
762
+ "transform": "translate3d(" + pixels + "px, 0px,0px)"
763
+ };
764
+ },
765
+
766
+ transition3d : function (value) {
767
+ var base = this;
768
+ base.$owlWrapper.css(base.doTranslate(value));
769
+ },
770
+
771
+ css2move : function (value) {
772
+ var base = this;
773
+ base.$owlWrapper.css({"left" : value});
774
+ },
775
+
776
+ css2slide : function (value, speed) {
777
+ var base = this;
778
+
779
+ base.isCssFinish = false;
780
+ base.$owlWrapper.stop(true, true).animate({
781
+ "left" : value
782
+ }, {
783
+ duration : speed || base.options.slideSpeed,
784
+ complete : function () {
785
+ base.isCssFinish = true;
786
+ }
787
+ });
788
+ },
789
+
790
+ checkBrowser : function () {
791
+ var base = this,
792
+ translate3D = "translate3d(0px, 0px, 0px)",
793
+ tempElem = document.createElement("div"),
794
+ regex,
795
+ asSupport,
796
+ support3d,
797
+ isTouch;
798
+
799
+ tempElem.style.cssText = " -moz-transform:" + translate3D +
800
+ "; -ms-transform:" + translate3D +
801
+ "; -o-transform:" + translate3D +
802
+ "; -webkit-transform:" + translate3D +
803
+ "; transform:" + translate3D;
804
+ regex = /translate3d\(0px, 0px, 0px\)/g;
805
+ asSupport = tempElem.style.cssText.match(regex);
806
+ support3d = (asSupport !== null && asSupport.length === 1);
807
+
808
+ isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints;
809
+
810
+ base.browser = {
811
+ "support3d" : support3d,
812
+ "isTouch" : isTouch
813
+ };
814
+ },
815
+
816
+ moveEvents : function () {
817
+ var base = this;
818
+ if (base.options.mouseDrag !== false || base.options.touchDrag !== false) {
819
+ base.gestures();
820
+ base.disabledEvents();
821
+ }
822
+ },
823
+
824
+ eventTypes : function () {
825
+ var base = this,
826
+ types = ["s", "e", "x"];
827
+
828
+ base.ev_types = {};
829
+
830
+ if (base.options.mouseDrag === true && base.options.touchDrag === true) {
831
+ types = [
832
+ "touchstart.owl mousedown.owl",
833
+ "touchmove.owl mousemove.owl",
834
+ "touchend.owl touchcancel.owl mouseup.owl"
835
+ ];
836
+ } else if (base.options.mouseDrag === false && base.options.touchDrag === true) {
837
+ types = [
838
+ "touchstart.owl",
839
+ "touchmove.owl",
840
+ "touchend.owl touchcancel.owl"
841
+ ];
842
+ } else if (base.options.mouseDrag === true && base.options.touchDrag === false) {
843
+ types = [
844
+ "mousedown.owl",
845
+ "mousemove.owl",
846
+ "mouseup.owl"
847
+ ];
848
+ }
849
+
850
+ base.ev_types.start = types[0];
851
+ base.ev_types.move = types[1];
852
+ base.ev_types.end = types[2];
853
+ },
854
+
855
+ disabledEvents : function () {
856
+ var base = this;
857
+ base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); });
858
+ base.$elem.on("mousedown.disableTextSelect", function (e) {
859
+ return $(e.target).is('input, textarea, select, option');
860
+ });
861
+ },
862
+
863
+ gestures : function () {
864
+ /*jslint unparam: true*/
865
+ var base = this,
866
+ locals = {
867
+ offsetX : 0,
868
+ offsetY : 0,
869
+ baseElWidth : 0,
870
+ relativePos : 0,
871
+ position: null,
872
+ minSwipe : null,
873
+ maxSwipe: null,
874
+ sliding : null,
875
+ dargging: null,
876
+ targetElement : null
877
+ };
878
+
879
+ base.isCssFinish = true;
880
+
881
+ function getTouches(event) {
882
+ if (event.touches !== undefined) {
883
+ return {
884
+ x : event.touches[0].pageX,
885
+ y : event.touches[0].pageY
886
+ };
887
+ }
888
+
889
+ if (event.touches === undefined) {
890
+ if (event.pageX !== undefined) {
891
+ return {
892
+ x : event.pageX,
893
+ y : event.pageY
894
+ };
895
+ }
896
+ if (event.pageX === undefined) {
897
+ return {
898
+ x : event.clientX,
899
+ y : event.clientY
900
+ };
901
+ }
902
+ }
903
+ }
904
+
905
+ function swapEvents(type) {
906
+ if (type === "on") {
907
+ $(document).on(base.ev_types.move, dragMove);
908
+ $(document).on(base.ev_types.end, dragEnd);
909
+ } else if (type === "off") {
910
+ $(document).off(base.ev_types.move);
911
+ $(document).off(base.ev_types.end);
912
+ }
913
+ }
914
+
915
+ function dragStart(event) {
916
+ var ev = event.originalEvent || event || window.event,
917
+ position;
918
+
919
+ if (ev.which === 3) {
920
+ return false;
921
+ }
922
+ if (base.itemsAmount <= base.options.items) {
923
+ return;
924
+ }
925
+ if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) {
926
+ return false;
927
+ }
928
+ if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) {
929
+ return false;
930
+ }
931
+
932
+ if (base.options.autoPlay !== false) {
933
+ window.clearInterval(base.autoPlayInterval);
934
+ }
935
+
936
+ if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) {
937
+ base.$owlWrapper.addClass("grabbing");
938
+ }
939
+
940
+ base.newPosX = 0;
941
+ base.newRelativeX = 0;
942
+
943
+ $(this).css(base.removeTransition());
944
+
945
+ position = $(this).position();
946
+ locals.relativePos = position.left;
947
+
948
+ locals.offsetX = getTouches(ev).x - position.left;
949
+ locals.offsetY = getTouches(ev).y - position.top;
950
+
951
+ swapEvents("on");
952
+
953
+ locals.sliding = false;
954
+ locals.targetElement = ev.target || ev.srcElement;
955
+ }
956
+
957
+ function dragMove(event) {
958
+ var ev = event.originalEvent || event || window.event,
959
+ minSwipe,
960
+ maxSwipe;
961
+
962
+ base.newPosX = getTouches(ev).x - locals.offsetX;
963
+ base.newPosY = getTouches(ev).y - locals.offsetY;
964
+ base.newRelativeX = base.newPosX - locals.relativePos;
965
+
966
+ if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) {
967
+ locals.dragging = true;
968
+ base.options.startDragging.apply(base, [base.$elem]);
969
+ }
970
+
971
+ if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) {
972
+ if (ev.preventDefault !== undefined) {
973
+ ev.preventDefault();
974
+ } else {
975
+ ev.returnValue = false;
976
+ }
977
+ locals.sliding = true;
978
+ }
979
+
980
+ if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) {
981
+ $(document).off("touchmove.owl");
982
+ }
983
+
984
+ minSwipe = function () {
985
+ return base.newRelativeX / 5;
986
+ };
987
+
988
+ maxSwipe = function () {
989
+ return base.maximumPixels + base.newRelativeX / 5;
990
+ };
991
+
992
+ base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe());
993
+ if (base.browser.support3d === true) {
994
+ base.transition3d(base.newPosX);
995
+ } else {
996
+ base.css2move(base.newPosX);
997
+ }
998
+ }
999
+
1000
+ function dragEnd(event) {
1001
+ var ev = event.originalEvent || event || window.event,
1002
+ newPosition,
1003
+ handlers,
1004
+ owlStopEvent;
1005
+
1006
+ ev.target = ev.target || ev.srcElement;
1007
+
1008
+ locals.dragging = false;
1009
+
1010
+ if (base.browser.isTouch !== true) {
1011
+ base.$owlWrapper.removeClass("grabbing");
1012
+ }
1013
+
1014
+ if (base.newRelativeX < 0) {
1015
+ base.dragDirection = base.owl.dragDirection = "left";
1016
+ } else {
1017
+ base.dragDirection = base.owl.dragDirection = "right";
1018
+ }
1019
+
1020
+ if (base.newRelativeX !== 0) {
1021
+ newPosition = base.getNewPosition();
1022
+ base.goTo(newPosition, false, "drag");
1023
+ if (locals.targetElement === ev.target && base.browser.isTouch !== true) {
1024
+ $(ev.target).on("click.disable", function (ev) {
1025
+ ev.stopImmediatePropagation();
1026
+ ev.stopPropagation();
1027
+ ev.preventDefault();
1028
+ $(ev.target).off("click.disable");
1029
+ });
1030
+ handlers = $._data(ev.target, "events").click;
1031
+ owlStopEvent = handlers.pop();
1032
+ handlers.splice(0, 0, owlStopEvent);
1033
+ }
1034
+ }
1035
+ swapEvents("off");
1036
+ }
1037
+ base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart);
1038
+ },
1039
+
1040
+ getNewPosition : function () {
1041
+ var base = this,
1042
+ newPosition = base.closestItem();
1043
+
1044
+ if (newPosition > base.maximumItem) {
1045
+ base.currentItem = base.maximumItem;
1046
+ newPosition = base.maximumItem;
1047
+ } else if (base.newPosX >= 0) {
1048
+ newPosition = 0;
1049
+ base.currentItem = 0;
1050
+ }
1051
+ return newPosition;
1052
+ },
1053
+ closestItem : function () {
1054
+ var base = this,
1055
+ array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray,
1056
+ goal = base.newPosX,
1057
+ closest = null;
1058
+
1059
+ $.each(array, function (i, v) {
1060
+ if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") {
1061
+ closest = v;
1062
+ if (base.options.scrollPerPage === true) {
1063
+ base.currentItem = $.inArray(closest, base.positionsInArray);
1064
+ } else {
1065
+ base.currentItem = i;
1066
+ }
1067
+ } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") {
1068
+ if (base.options.scrollPerPage === true) {
1069
+ closest = array[i + 1] || array[array.length - 1];
1070
+ base.currentItem = $.inArray(closest, base.positionsInArray);
1071
+ } else {
1072
+ closest = array[i + 1];
1073
+ base.currentItem = i + 1;
1074
+ }
1075
+ }
1076
+ });
1077
+ return base.currentItem;
1078
+ },
1079
+
1080
+ moveDirection : function () {
1081
+ var base = this,
1082
+ direction;
1083
+ if (base.newRelativeX < 0) {
1084
+ direction = "right";
1085
+ base.playDirection = "next";
1086
+ } else {
1087
+ direction = "left";
1088
+ base.playDirection = "prev";
1089
+ }
1090
+ return direction;
1091
+ },
1092
+
1093
+ customEvents : function () {
1094
+ /*jslint unparam: true*/
1095
+ var base = this;
1096
+ base.$elem.on("owl.next", function () {
1097
+ base.next();
1098
+ });
1099
+ base.$elem.on("owl.prev", function () {
1100
+ base.prev();
1101
+ });
1102
+ base.$elem.on("owl.play", function (event, speed) {
1103
+ base.options.autoPlay = speed;
1104
+ base.play();
1105
+ base.hoverStatus = "play";
1106
+ });
1107
+ base.$elem.on("owl.stop", function () {
1108
+ base.stop();
1109
+ base.hoverStatus = "stop";
1110
+ });
1111
+ base.$elem.on("owl.goTo", function (event, item) {
1112
+ base.goTo(item);
1113
+ });
1114
+ base.$elem.on("owl.jumpTo", function (event, item) {
1115
+ base.jumpTo(item);
1116
+ });
1117
+ },
1118
+
1119
+ stopOnHover : function () {
1120
+ var base = this;
1121
+ if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) {
1122
+ base.$elem.on("mouseover", function () {
1123
+ base.stop();
1124
+ });
1125
+ base.$elem.on("mouseout", function () {
1126
+ if (base.hoverStatus !== "stop") {
1127
+ base.play();
1128
+ }
1129
+ });
1130
+ }
1131
+ },
1132
+
1133
+ lazyLoad : function () {
1134
+ var base = this,
1135
+ i,
1136
+ $item,
1137
+ itemNumber,
1138
+ $lazyImg,
1139
+ follow;
1140
+
1141
+ if (base.options.lazyLoad === false) {
1142
+ return false;
1143
+ }
1144
+ for (i = 0; i < base.itemsAmount; i += 1) {
1145
+ $item = $(base.$owlItems[i]);
1146
+
1147
+ if ($item.data("owl-loaded") === "loaded") {
1148
+ continue;
1149
+ }
1150
+
1151
+ itemNumber = $item.data("owl-item");
1152
+ $lazyImg = $item.find(".lazyOwl");
1153
+
1154
+ if (typeof $lazyImg.data("src") !== "string") {
1155
+ $item.data("owl-loaded", "loaded");
1156
+ continue;
1157
+ }
1158
+ if ($item.data("owl-loaded") === undefined) {
1159
+ $lazyImg.hide();
1160
+ $item.addClass("loading").data("owl-loaded", "checked");
1161
+ }
1162
+ if (base.options.lazyFollow === true) {
1163
+ follow = itemNumber >= base.currentItem;
1164
+ } else {
1165
+ follow = true;
1166
+ }
1167
+ if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) {
1168
+ $lazyImg.each(function() {
1169
+ base.lazyPreload($item, $(this));
1170
+ });
1171
+ }
1172
+ }
1173
+ },
1174
+
1175
+ lazyPreload : function ($item, $lazyImg) {
1176
+ var base = this,
1177
+ iterations = 0,
1178
+ isBackgroundImg;
1179
+
1180
+ if ($lazyImg.prop("tagName") === "DIV") {
1181
+ $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")");
1182
+ isBackgroundImg = true;
1183
+ } else {
1184
+ $lazyImg[0].src = $lazyImg.data("src");
1185
+ }
1186
+
1187
+ function showImage() {
1188
+ $item.data("owl-loaded", "loaded").removeClass("loading");
1189
+ $lazyImg.removeAttr("data-src");
1190
+ if (base.options.lazyEffect === "fade") {
1191
+ $lazyImg.fadeIn(400);
1192
+ } else {
1193
+ $lazyImg.show();
1194
+ }
1195
+ if (typeof base.options.afterLazyLoad === "function") {
1196
+ base.options.afterLazyLoad.apply(this, [base.$elem]);
1197
+ }
1198
+ }
1199
+
1200
+ function checkLazyImage() {
1201
+ iterations += 1;
1202
+ if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) {
1203
+ showImage();
1204
+ } else if (iterations <= 100) {//if image loads in less than 10 seconds
1205
+ window.setTimeout(checkLazyImage, 100);
1206
+ } else {
1207
+ showImage();
1208
+ }
1209
+ }
1210
+
1211
+ checkLazyImage();
1212
+ },
1213
+
1214
+ autoHeight : function () {
1215
+ var base = this,
1216
+ $currentimg = $(base.$owlItems[base.currentItem]).find("img"),
1217
+ iterations;
1218
+
1219
+ function addHeight() {
1220
+ var $currentItem = $(base.$owlItems[base.currentItem]).height();
1221
+ base.wrapperOuter.css("height", $currentItem + "px");
1222
+ if (!base.wrapperOuter.hasClass("autoHeight")) {
1223
+ window.setTimeout(function () {
1224
+ base.wrapperOuter.addClass("autoHeight");
1225
+ }, 0);
1226
+ }
1227
+ }
1228
+
1229
+ function checkImage() {
1230
+ iterations += 1;
1231
+ if (base.completeImg($currentimg.get(0))) {
1232
+ addHeight();
1233
+ } else if (iterations <= 100) { //if image loads in less than 10 seconds
1234
+ window.setTimeout(checkImage, 100);
1235
+ } else {
1236
+ base.wrapperOuter.css("height", ""); //Else remove height attribute
1237
+ }
1238
+ }
1239
+
1240
+ if ($currentimg.get(0) !== undefined) {
1241
+ iterations = 0;
1242
+ checkImage();
1243
+ } else {
1244
+ addHeight();
1245
+ }
1246
+ },
1247
+
1248
+ completeImg : function (img) {
1249
+ var naturalWidthType;
1250
+
1251
+ if (!img.complete) {
1252
+ return false;
1253
+ }
1254
+ naturalWidthType = typeof img.naturalWidth;
1255
+ if (naturalWidthType !== "undefined" && img.naturalWidth === 0) {
1256
+ return false;
1257
+ }
1258
+ return true;
1259
+ },
1260
+
1261
+ onVisibleItems : function () {
1262
+ var base = this,
1263
+ i;
1264
+
1265
+ if (base.options.addClassActive === true) {
1266
+ base.$owlItems.removeClass("active");
1267
+ }
1268
+ base.visibleItems = [];
1269
+ for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) {
1270
+ base.visibleItems.push(i);
1271
+
1272
+ if (base.options.addClassActive === true) {
1273
+ $(base.$owlItems[i]).addClass("active");
1274
+ }
1275
+ }
1276
+ base.owl.visibleItems = base.visibleItems;
1277
+ },
1278
+
1279
+ transitionTypes : function (className) {
1280
+ var base = this;
1281
+ //Currently available: "fade", "backSlide", "goDown", "fadeUp"
1282
+ base.outClass = "owl-" + className + "-out";
1283
+ base.inClass = "owl-" + className + "-in";
1284
+ },
1285
+
1286
+ singleItemTransition : function () {
1287
+ var base = this,
1288
+ outClass = base.outClass,
1289
+ inClass = base.inClass,
1290
+ $currentItem = base.$owlItems.eq(base.currentItem),
1291
+ $prevItem = base.$owlItems.eq(base.prevItem),
1292
+ prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
1293
+ origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2,
1294
+ animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
1295
+
1296
+ base.isTransition = true;
1297
+
1298
+ base.$owlWrapper
1299
+ .addClass('owl-origin')
1300
+ .css({
1301
+ "-webkit-transform-origin" : origin + "px",
1302
+ "-moz-perspective-origin" : origin + "px",
1303
+ "perspective-origin" : origin + "px"
1304
+ });
1305
+ function transStyles(prevPos) {
1306
+ return {
1307
+ "position" : "relative",
1308
+ "left" : prevPos + "px"
1309
+ };
1310
+ }
1311
+
1312
+ $prevItem
1313
+ .css(transStyles(prevPos, 10))
1314
+ .addClass(outClass)
1315
+ .on(animEnd, function () {
1316
+ base.endPrev = true;
1317
+ $prevItem.off(animEnd);
1318
+ base.clearTransStyle($prevItem, outClass);
1319
+ });
1320
+
1321
+ $currentItem
1322
+ .addClass(inClass)
1323
+ .on(animEnd, function () {
1324
+ base.endCurrent = true;
1325
+ $currentItem.off(animEnd);
1326
+ base.clearTransStyle($currentItem, inClass);
1327
+ });
1328
+ },
1329
+
1330
+ clearTransStyle : function (item, classToRemove) {
1331
+ var base = this;
1332
+ item.css({
1333
+ "position" : "",
1334
+ "left" : ""
1335
+ }).removeClass(classToRemove);
1336
+
1337
+ if (base.endPrev && base.endCurrent) {
1338
+ base.$owlWrapper.removeClass('owl-origin');
1339
+ base.endPrev = false;
1340
+ base.endCurrent = false;
1341
+ base.isTransition = false;
1342
+ }
1343
+ },
1344
+
1345
+ owlStatus : function () {
1346
+ var base = this;
1347
+ base.owl = {
1348
+ "userOptions" : base.userOptions,
1349
+ "baseElement" : base.$elem,
1350
+ "userItems" : base.$userItems,
1351
+ "owlItems" : base.$owlItems,
1352
+ "currentItem" : base.currentItem,
1353
+ "prevItem" : base.prevItem,
1354
+ "visibleItems" : base.visibleItems,
1355
+ "isTouch" : base.browser.isTouch,
1356
+ "browser" : base.browser,
1357
+ "dragDirection" : base.dragDirection
1358
+ };
1359
+ },
1360
+
1361
+ clearEvents : function () {
1362
+ var base = this;
1363
+ base.$elem.off(".owl owl mousedown.disableTextSelect");
1364
+ $(document).off(".owl owl");
1365
+ $(window).off("resize", base.resizer);
1366
+ },
1367
+
1368
+ unWrap : function () {
1369
+ var base = this;
1370
+ if (base.$elem.children().length !== 0) {
1371
+ base.$owlWrapper.unwrap();
1372
+ base.$userItems.unwrap().unwrap();
1373
+ if (base.owlControls) {
1374
+ base.owlControls.remove();
1375
+ }
1376
+ }
1377
+ base.clearEvents();
1378
+ base.$elem.attr({
1379
+ style: base.$elem.data("owl-originalStyles") || "",
1380
+ class: base.$elem.data("owl-originalClasses")
1381
+ });
1382
+ },
1383
+
1384
+ destroy : function () {
1385
+ var base = this;
1386
+ base.stop();
1387
+ window.clearInterval(base.checkVisible);
1388
+ base.unWrap();
1389
+ base.$elem.removeData();
1390
+ },
1391
+
1392
+ reinit : function (newOptions) {
1393
+ var base = this,
1394
+ options = $.extend({}, base.userOptions, newOptions);
1395
+ base.unWrap();
1396
+ base.init(options, base.$elem);
1397
+ },
1398
+
1399
+ addItem : function (htmlString, targetPosition) {
1400
+ var base = this,
1401
+ position;
1402
+
1403
+ if (!htmlString) {return false; }
1404
+
1405
+ if (base.$elem.children().length === 0) {
1406
+ base.$elem.append(htmlString);
1407
+ base.setVars();
1408
+ return false;
1409
+ }
1410
+ base.unWrap();
1411
+ if (targetPosition === undefined || targetPosition === -1) {
1412
+ position = -1;
1413
+ } else {
1414
+ position = targetPosition;
1415
+ }
1416
+ if (position >= base.$userItems.length || position === -1) {
1417
+ base.$userItems.eq(-1).after(htmlString);
1418
+ } else {
1419
+ base.$userItems.eq(position).before(htmlString);
1420
+ }
1421
+
1422
+ base.setVars();
1423
+ },
1424
+
1425
+ removeItem : function (targetPosition) {
1426
+ var base = this,
1427
+ position;
1428
+
1429
+ if (base.$elem.children().length === 0) {
1430
+ return false;
1431
+ }
1432
+ if (targetPosition === undefined || targetPosition === -1) {
1433
+ position = -1;
1434
+ } else {
1435
+ position = targetPosition;
1436
+ }
1437
+
1438
+ base.unWrap();
1439
+ base.$userItems.eq(position).remove();
1440
+ base.setVars();
1441
+ }
1442
+
1443
+ };
1444
+
1445
+ $.fn.owlCarousel = function (options) {
1446
+ return this.each(function () {
1447
+ if ($(this).data("owl-init") === true) {
1448
+ return false;
1449
+ }
1450
+ $(this).data("owl-init", true);
1451
+ var carousel = Object.create(Carousel);
1452
+ carousel.init(options, this);
1453
+ $.data(this, "owlCarousel", carousel);
1454
+ });
1455
+ };
1456
+
1457
+ $.fn.owlCarousel.options = {
1458
+
1459
+ items : 5,
1460
+ itemsCustom : false,
1461
+ itemsDesktop : [1199, 4],
1462
+ itemsDesktopSmall : [979, 3],
1463
+ itemsTablet : [768, 2],
1464
+ itemsTabletSmall : false,
1465
+ itemsMobile : [479, 1],
1466
+ singleItem : false,
1467
+ itemsScaleUp : false,
1468
+
1469
+ slideSpeed : 200,
1470
+ paginationSpeed : 800,
1471
+ rewindSpeed : 1000,
1472
+
1473
+ autoPlay : false,
1474
+ stopOnHover : false,
1475
+
1476
+ navigation : false,
1477
+ navigationText : ["prev", "next"],
1478
+ rewindNav : true,
1479
+ scrollPerPage : false,
1480
+
1481
+ pagination : true,
1482
+ paginationNumbers : false,
1483
+
1484
+ responsive : true,
1485
+ responsiveRefreshRate : 200,
1486
+ responsiveBaseWidth : window,
1487
+
1488
+ baseClass : "owl-carousel",
1489
+ theme : "owl-theme",
1490
+
1491
+ lazyLoad : false,
1492
+ lazyFollow : true,
1493
+ lazyEffect : "fade",
1494
+
1495
+ autoHeight : false,
1496
+
1497
+ jsonPath : false,
1498
+ jsonSuccess : false,
1499
+
1500
+ dragBeforeAnimFinish : true,
1501
+ mouseDrag : true,
1502
+ touchDrag : true,
1503
+
1504
+ addClassActive : false,
1505
+ transitionStyle : false,
1506
+
1507
+ beforeUpdate : false,
1508
+ afterUpdate : false,
1509
+ beforeInit : false,
1510
+ afterInit : false,
1511
+ beforeMove : false,
1512
+ afterMove : false,
1513
+ afterAction : false,
1514
+ startDragging : false,
1515
+ afterLazyLoad: false
1516
+ };
1517
+ }(jQuery, window, document));