Galleries by Angie Makes - Version 1.12

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Galleries by Angie Makes
Version 1.12
Comparing to
See all releases

Code changes from version 1.11 to 1.12

README.md CHANGED
@@ -46,6 +46,15 @@ Insert a gallery through your dashboard. You will see extra dropdown settings wh
46
 
47
  ## Changelog ##
48
 
 
 
 
 
 
 
 
 
 
49
  ### Version 1.11
50
 
51
  * Fixed a very obscure bug that kept image sizes from displaying.
46
 
47
  ## Changelog ##
48
 
49
+ ### Version 1.12
50
+
51
+ * Use masonry library provided by WordPress
52
+ * loading jquery before masonry
53
+ * Added image sizes
54
+ * Replaced percentage gutter width with pixel value.
55
+ * Added Owl Carousel
56
+ * Added 2 more slider displays
57
+
58
  ### Version 1.11
59
 
60
  * Fixed a very obscure bug that kept image sizes from displaying.
includes/css/style.css CHANGED
@@ -1,9 +1,17 @@
 
 
 
 
 
 
 
 
1
  /**
2
  * [gallery]
3
  * ----------------------------------------------------------------------------
4
  */
5
  .wc-gallery .gallery {
6
- margin-bottom: 20px;
7
  margin-left: 0px;
8
  margin-right: 0px;
9
  }
@@ -15,13 +23,16 @@
15
  /* margin-right: -5px; */
16
  }
17
 
18
- .wc-gallery .gallery.wc-gallery-bottomspace-ten {
 
 
 
19
  margin-bottom: 10px;
20
  }
21
- .wc-gallery .gallery.wc-gallery-bottomspace-five {
22
  margin-bottom: 5px;
23
  }
24
- .wc-gallery .gallery.wc-gallery-bottomspace-none {
25
  margin-bottom: 0;
26
  }
27
 
@@ -36,15 +47,11 @@
36
  .wc-gallery .gallery-item {
37
  float: left; /* added this so images don't stack before masonry kicks in */
38
  margin: 0;
39
- overflow: hidden;
40
  position: relative;
41
  /* margin-bottom: 5px; */
42
  max-width: none !important;
43
  }
44
- .wc-gallery .gallery-item .gallery-icon,
45
- .wc-gallery .gallery-item .gallery-caption {
46
- /* margin-right: 5px; */
47
- }
48
 
49
  .wc-gallery .gallery .gallery-icon a {
50
  display: block;
@@ -77,6 +84,7 @@
77
  hyphens: auto;
78
 
79
  width: auto;
 
80
  }
81
  .wc-gallery .gallery-caption h2,
82
  .wc-gallery .gallery-caption h3,
@@ -93,6 +101,10 @@
93
  text-align: left;
94
  }
95
 
 
 
 
 
96
  .wc-gallery-captions-onhover .gallery-caption,
97
  .wc-gallery-captions-showon .gallery-caption {
98
  max-height: 50%;
@@ -106,9 +118,11 @@
106
  left: 0;
107
  right: 0;
108
  }
 
 
109
  .wc-gallery-captions-onhover .gallery-caption:after,
110
- .wc-gallery-captions-showon .gallery-caption:after,
111
  .wc-gallery-captions-onhover .gallery-caption:before,
 
112
  .wc-gallery-captions-showon .gallery-caption:before {
113
  box-shadow: none;
114
  min-height: 0;
@@ -116,6 +130,7 @@
116
  display: none;
117
  }
118
 
 
119
  .wc-gallery-captions-showon .gallery-caption,
120
  .wc-gallery-captions-onhover .gallery-caption {
121
  background: rgba(255, 255, 255, .8);
@@ -123,15 +138,111 @@
123
  display: none;
124
  }
125
 
 
126
  .wc-gallery-captions-showon .gallery-caption,
127
  .wc-gallery-captions-onhover .gallery-item:hover .gallery-caption {
128
  display: block;
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  /**
132
  * [gallery flexslider]
133
  * ----------------------------------------------------------------------------
134
  */
 
 
 
135
  .wc-gallery .gallery.wcflexslider {
136
  line-height: 1;
137
  border-width: 0;
@@ -145,6 +256,9 @@
145
  box-shadow: none;
146
  }
147
 
 
 
 
148
  .wc-gallery .gallery.wcflexslider .wcflex-control-paging li a {
149
  background-color: #eeeeee;
150
  box-shadow: none;
@@ -168,7 +282,7 @@
168
  margin-right: auto;
169
  }
170
  .wc-gallery .gallery.wcflexslider .wcflex-slide-item .wp-caption-text {
171
- padding: 0 10px;
172
  opacity: 0.7;
173
  position: absolute;
174
  bottom: 0;
1
+ .wc-gallery-clear:before,
2
+ .wc-gallery-clear:after {
3
+ content: '';
4
+ display: table;
5
+ }
6
+ .wc-gallery-clear:after {
7
+ clear: both;
8
+ }
9
  /**
10
  * [gallery]
11
  * ----------------------------------------------------------------------------
12
  */
13
  .wc-gallery .gallery {
14
+ margin-bottom: 0px;
15
  margin-left: 0px;
16
  margin-right: 0px;
17
  }
23
  /* margin-right: -5px; */
24
  }
25
 
26
+ .wc-gallery .wc-gallery-bottomspace-default {
27
+ margin-bottom: 20px;
28
+ }
29
+ .wc-gallery .wc-gallery-bottomspace-ten {
30
  margin-bottom: 10px;
31
  }
32
+ .wc-gallery .wc-gallery-bottomspace-five {
33
  margin-bottom: 5px;
34
  }
35
+ .wc-gallery .wc-gallery-bottomspace-none {
36
  margin-bottom: 0;
37
  }
38
 
47
  .wc-gallery .gallery-item {
48
  float: left; /* added this so images don't stack before masonry kicks in */
49
  margin: 0;
50
+ /* overflow: hidden; */
51
  position: relative;
52
  /* margin-bottom: 5px; */
53
  max-width: none !important;
54
  }
 
 
 
 
55
 
56
  .wc-gallery .gallery .gallery-icon a {
57
  display: block;
84
  hyphens: auto;
85
 
86
  width: auto;
87
+ padding: 5px 10px;
88
  }
89
  .wc-gallery .gallery-caption h2,
90
  .wc-gallery .gallery-caption h3,
101
  text-align: left;
102
  }
103
 
104
+ .wc-gallery-captions-show .gallery-caption {
105
+ background-color: #f5f5f5;
106
+ }
107
+ .wc-image-links .gallery-caption,
108
  .wc-gallery-captions-onhover .gallery-caption,
109
  .wc-gallery-captions-showon .gallery-caption {
110
  max-height: 50%;
118
  left: 0;
119
  right: 0;
120
  }
121
+ .wc-image-links .gallery-caption:after,
122
+ .wc-image-links .gallery-caption:before,
123
  .wc-gallery-captions-onhover .gallery-caption:after,
 
124
  .wc-gallery-captions-onhover .gallery-caption:before,
125
+ .wc-gallery-captions-showon .gallery-caption:after,
126
  .wc-gallery-captions-showon .gallery-caption:before {
127
  box-shadow: none;
128
  min-height: 0;
130
  display: none;
131
  }
132
 
133
+ .wc-image-links .gallery-caption,
134
  .wc-gallery-captions-showon .gallery-caption,
135
  .wc-gallery-captions-onhover .gallery-caption {
136
  background: rgba(255, 255, 255, .8);
138
  display: none;
139
  }
140
 
141
+ .wc-image-links .gallery-caption,
142
  .wc-gallery-captions-showon .gallery-caption,
143
  .wc-gallery-captions-onhover .gallery-item:hover .gallery-caption {
144
  display: block;
145
  }
146
 
147
+ @media screen and (max-width: 568px) {
148
+ body .wc-gallery .gallery-caption {
149
+ display: none;
150
+ }
151
+ }
152
+ /**
153
+ * Image Links
154
+ * ----------------------------------------------------------------------------
155
+ */
156
+ .wc-gallery .gallery-item .gallery-block {
157
+ position: relative;
158
+ }
159
+ .wc-image-links-slider3bottomlinks .gallery-item {
160
+ width: 33.3333%;
161
+ float: left;
162
+ }
163
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-0 { margin-right: 0px; }
164
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-0 .gallery-block { margin-top: 0px; margin-right: 0px; }
165
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-1 { margin-right: -1px; }
166
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-1 .gallery-block { margin-top: 1px; margin-right: 1px; }
167
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-2 { margin-right: -2px; }
168
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-2 .gallery-block { margin-top: 2px; margin-right: 2px; }
169
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-3 { margin-right: -3px; }
170
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-3 .gallery-block { margin-top: 3px; margin-right: 3px; }
171
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-4 { margin-right: -4px; }
172
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-4 .gallery-block { margin-top: 4px; margin-right: 4px; }
173
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-5 { margin-right: -5px; }
174
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-5 .gallery-block { margin-top: 5px; margin-right: 5px; }
175
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-6 { margin-right: -6px; }
176
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-6 .gallery-block { margin-top: 6px; margin-right: 6px; }
177
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-7 { margin-right: -7px; }
178
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-7 .gallery-block { margin-top: 7px; margin-right: 7px; }
179
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-8 { margin-right: -8px; }
180
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-8 .gallery-block { margin-top: 8px; margin-right: 8px; }
181
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-9 { margin-right: -9px; }
182
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-9 .gallery-block { margin-top: 9px; margin-right: 9px; }
183
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-10 { margin-right: -10px; }
184
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-10 .gallery-block { margin-top: 10px; margin-right: 10px; }
185
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-11 { margin-right: -11px; }
186
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-11 .gallery-block { margin-top: 11px; margin-right: 11px; }
187
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-12 { margin-right: -12px; }
188
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-12 .gallery-block { margin-top: 12px; margin-right: 12px; }
189
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-13 { margin-right: -13px; }
190
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-13 .gallery-block { margin-top: 13px; margin-right: 13px; }
191
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-14 { margin-right: -14px; }
192
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-14 .gallery-block { margin-top: 14px; margin-right: 14px; }
193
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-15 { margin-right: -15px; }
194
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-15 .gallery-block { margin-top: 15px; margin-right: 15px; }
195
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-16 { margin-right: -16px; }
196
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-16 .gallery-block { margin-top: 16px; margin-right: 16px; }
197
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-17 { margin-right: -17px; }
198
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-17 .gallery-block { margin-top: 17px; margin-right: 17px; }
199
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-18 { margin-right: -18px; }
200
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-18 .gallery-block { margin-top: 18px; margin-right: 18px; }
201
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-19 { margin-right: -19px; }
202
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-19 .gallery-block { margin-top: 19px; margin-right: 19px; }
203
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-20 { margin-right: -20px; }
204
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-20 .gallery-block { margin-top: 20px; margin-right: 20px; }
205
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-21 { margin-right: -21px; }
206
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-21 .gallery-block { margin-top: 21px; margin-right: 21px; }
207
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-22 { margin-right: -22px; }
208
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-22 .gallery-block { margin-top: 22px; margin-right: 22px; }
209
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-23 { margin-right: -23px; }
210
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-23 .gallery-block { margin-top: 23px; margin-right: 23px; }
211
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-24 { margin-right: -24px; }
212
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-24 .gallery-block { margin-top: 24px; margin-right: 24px; }
213
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-25 { margin-right: -25px; }
214
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-25 .gallery-block { margin-top: 25px; margin-right: 25px; }
215
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-26 { margin-right: -26px; }
216
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-26 .gallery-block { margin-top: 26px; margin-right: 26px; }
217
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-27 { margin-right: -27px; }
218
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-27 .gallery-block { margin-top: 27px; margin-right: 27px; }
219
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-28 { margin-right: -28px; }
220
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-28 .gallery-block { margin-top: 28px; margin-right: 28px; }
221
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-29 { margin-right: -29px; }
222
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-29 .gallery-block { margin-top: 29px; margin-right: 29px; }
223
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-30 { margin-right: -30px; }
224
+ .wc-image-links-bottomlinks.wc-image-links-gutter-space-30 .gallery-block { margin-top: 30px; margin-right: 30px; }
225
+
226
+ .wc-image-links-slider3bottomlinks .gallery-item.gallery-item-3 {
227
+ width: 33.3334%;
228
+ float: right;
229
+ }
230
+ .wc-image-links-slider4bottomlinks .gallery-item {
231
+ width: 25%;
232
+ float: left;
233
+ }
234
+ .wc-image-links-slider4bottomlinks .gallery-item.gallery-item-4 {
235
+ width: 25%;
236
+ float: right;
237
+ }
238
+
239
  /**
240
  * [gallery flexslider]
241
  * ----------------------------------------------------------------------------
242
  */
243
+ .wcflexslider-container {
244
+ overflow: hidden;
245
+ }
246
  .wc-gallery .gallery.wcflexslider {
247
  line-height: 1;
248
  border-width: 0;
256
  box-shadow: none;
257
  }
258
 
259
+ .wc-gallery .gallery.wcflexslider .wcflex-control-paging {
260
+ display: none;
261
+ }
262
  .wc-gallery .gallery.wcflexslider .wcflex-control-paging li a {
263
  background-color: #eeeeee;
264
  box-shadow: none;
282
  margin-right: auto;
283
  }
284
  .wc-gallery .gallery.wcflexslider .wcflex-slide-item .wp-caption-text {
285
+ padding: 5px 10px;
286
  opacity: 0.7;
287
  position: absolute;
288
  bottom: 0;
includes/functions.php CHANGED
@@ -1,4 +1,19 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * The Gallery shortcode.
4
  *
@@ -30,7 +45,7 @@ function wc_gallery_shortcode($blank, $attr) {
30
  'captions' => 'show',
31
  'captiontype' => 'p',
32
  'columns' => 3,
33
- 'gutterwidth' => '0.005',
34
  'link' => 'post',
35
  'size' => 'thumbnail',
36
  'targetsize' => 'large',
@@ -78,11 +93,11 @@ function wc_gallery_shortcode($blank, $attr) {
78
  $columns = intval($columns);
79
 
80
  if ( ! is_numeric( $gutterwidth ) ) {
81
- $gutterwidth = 0.005;
82
  }
83
- $gutterwidth = number_format( $gutterwidth, 3 );
84
- if ( $gutterwidth > 0.05 || $gutterwidth < 0.000 ) {
85
- $gutterwidth = 0.005;
86
  }
87
 
88
  $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
@@ -96,12 +111,19 @@ function wc_gallery_shortcode($blank, $attr) {
96
  $customlink = 'true' == $customlink ? true : false;
97
  $class = array();
98
  $class[] = 'gallery';
99
- $class[] = 'wc-gallery-bottomspace-' . $bottomspace;
100
  $class[] = 'wc-gallery-captions-' . $captions;
101
  if ( ! empty( $custom_class ) )
102
  $class[] = esc_attr( $custom_class );
 
 
 
103
 
104
- $sliders = array( 'slider', 'slider2', 'carousel' );
 
 
 
 
 
105
 
106
  if ( in_array( $display, $sliders ) ) {
107
  wp_enqueue_script( 'wc-gallery-flexslider' );
@@ -112,10 +134,19 @@ function wc_gallery_shortcode($blank, $attr) {
112
  if ( 'true' == $hidecontrols )
113
  $class[] = 'wcflexslider-hidecontrols';
114
 
115
- $output = "<div class='".implode( ' ', $class )."'>";
116
- $output .= "<ul id='$selector' class='slides'>";
 
 
 
 
 
 
 
 
 
 
117
 
118
- $i = 0;
119
  foreach ( $attachments as $id => $attachment ) {
120
  if ( ! $img = wp_get_attachment_image_src( $id, $size ) )
121
  continue;
@@ -146,8 +177,10 @@ function wc_gallery_shortcode($blank, $attr) {
146
  $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
147
 
148
  $output .= "
149
- <li class='wcflex-slide-item'>
150
- $image_output";
 
 
151
  if ( $showcaptions && trim($attachment->post_excerpt) ) {
152
  $output .= "
153
  <div class='wp-caption-text gallery-caption'>
@@ -158,13 +191,124 @@ function wc_gallery_shortcode($blank, $attr) {
158
  }
159
  $output .= "</li>";
160
  }
161
-
162
  $output .= "</ul></div>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
- else {
165
- if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) ) {
166
- wp_enqueue_script( 'wc-gallery-popup' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  }
 
 
 
 
168
  wp_enqueue_script( 'wc-gallery' );
169
 
170
  // getting rid of float
@@ -174,9 +318,8 @@ function wc_gallery_shortcode($blank, $attr) {
174
  $class[] = "galleryid-{$id}";
175
  $class[] = "gallery-columns-{$columns}";
176
  $class[] = "gallery-size-{$size_class}";
177
- // custom links should not call popup
178
- if ( ! $customlink )
179
- $class[] = "gallery-link-{$link}";
180
 
181
  $class = implode( ' ', $class );
182
 
@@ -224,6 +367,34 @@ function wc_gallery_shortcode($blank, $attr) {
224
  }
225
  add_filter( 'post_gallery', 'wc_gallery_shortcode', 10, 2 );
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
 
228
  /**
229
  * Retrieve an attachment page link using an image or icon, if possible.
@@ -280,7 +451,12 @@ function wc_gallery_print_media_templates() {
280
  'masonry' => __( 'Masonry', 'wc_gallery' ),
281
  'slider' => __( 'Slider (Fade)', 'wc_gallery' ),
282
  'slider2' => __( 'Slider (Slide)', 'wc_gallery' ),
283
- 'carousel' => __( 'Carousel', 'wc_gallery' ),
 
 
 
 
 
284
  );
285
  ?>
286
  <script type="text/html" id="tmpl-wc-gallery-settings">
@@ -363,15 +539,15 @@ function wc_gallery_print_media_templates() {
363
 
364
  <?php
365
  $gutterwidth = array();
366
- for ( $i = 0; $i <= 50; $i++ ) {
367
- $gutterwidth[ $i ] = number_format( ( $i / 1000 ), 3 );
368
  }
369
  ?>
370
  <label class="setting">
371
  <span><?php _e( 'Gutter Width', 'wc_gallery' ); ?></span>
372
  <select class="gutterwidth" name="gutterwidth" data-setting="gutterwidth">
373
  <?php foreach ( $gutterwidth as $key => $value ) : ?>
374
- <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $key, '5' ); ?>><?php echo esc_html( $value ); ?>%</option>
375
  <?php endforeach; ?>
376
  </select>
377
  </label>
@@ -445,3 +621,74 @@ add_filter( "attachment_fields_to_save", "wc_gallery_attachment_fields_to_save",
445
 
446
  // This theme uses its own gallery styles.
447
  add_filter( 'use_default_gallery_style', '__return_false' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ function wc_gallery_check_supports() {
3
+ global $wc_gallery_theme_support;
4
+
5
+ if ( current_theme_supports( 'wpc-gallery' ) ) {
6
+ $supports = get_theme_support( 'wpc-gallery' );
7
+
8
+ if ( isset( $supports[0] ) && is_array( $supports[0] ) ) {
9
+ foreach ( $supports[0] as $key => $value ) {
10
+ $wc_gallery_theme_support[ $key ] = $value;
11
+ }
12
+ }
13
+ }
14
+ }
15
+ add_action( 'init', 'wc_gallery_check_supports' );
16
+
17
  /**
18
  * The Gallery shortcode.
19
  *
45
  'captions' => 'show',
46
  'captiontype' => 'p',
47
  'columns' => 3,
48
+ 'gutterwidth' => '5',
49
  'link' => 'post',
50
  'size' => 'thumbnail',
51
  'targetsize' => 'large',
93
  $columns = intval($columns);
94
 
95
  if ( ! is_numeric( $gutterwidth ) ) {
96
+ $gutterwidth = 5;
97
  }
98
+ $gutterwidth = (int) $gutterwidth;
99
+ if ( $gutterwidth > 30 || $gutterwidth < 0 ) {
100
+ $gutterwidth = 5;
101
  }
102
 
103
  $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
111
  $customlink = 'true' == $customlink ? true : false;
112
  $class = array();
113
  $class[] = 'gallery';
 
114
  $class[] = 'wc-gallery-captions-' . $captions;
115
  if ( ! empty( $custom_class ) )
116
  $class[] = esc_attr( $custom_class );
117
+ // custom links should not call popup
118
+ if ( ! $customlink )
119
+ $class[] = "gallery-link-{$link}";
120
 
121
+ $sliders = array( 'slider', 'slider2', 'sliderauto', 'carousel', 'slider3bottomlinks', 'slider4bottomlinks' );
122
+ $owlcarousel = array( 'owlautowidth', 'owlcolumns', 'owlslider' );
123
+
124
+ if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) && 'file' == $link ) {
125
+ wp_enqueue_script( 'wc-gallery-popup' );
126
+ }
127
 
128
  if ( in_array( $display, $sliders ) ) {
129
  wp_enqueue_script( 'wc-gallery-flexslider' );
134
  if ( 'true' == $hidecontrols )
135
  $class[] = 'wcflexslider-hidecontrols';
136
 
137
+ $wrap_class = array();
138
+ $wrap_class[] = 'wcflexslider-container';
139
+ $wrap_class[] = 'wc-gallery-bottomspace-' . $bottomspace;
140
+ $wrap_class[] = 'wc-gallery-clear';
141
+
142
+ $output = "";
143
+
144
+ $output .= "<div class='".implode( ' ', $wrap_class )."'>";
145
+ $output .= "<div id='$selector' class='".implode( ' ', $class )."' data-gutter-width='".$gutterwidth."' data-columns='".$columns."' data-hide-controls='".$hidecontrols."'>";
146
+ $output .= "<ul class='slides'>";
147
+
148
+ list( $attachments, $links ) = wc_gallery_seperate_attachments_links( $attachments, $display );
149
 
 
150
  foreach ( $attachments as $id => $attachment ) {
151
  if ( ! $img = wp_get_attachment_image_src( $id, $size ) )
152
  continue;
177
  $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
178
 
179
  $output .= "
180
+ <li class='gallery-item wcflex-slide-item'>
181
+ <div class='gallery-icon {$orientation}'>
182
+ $image_output
183
+ </div>";
184
  if ( $showcaptions && trim($attachment->post_excerpt) ) {
185
  $output .= "
186
  <div class='wp-caption-text gallery-caption'>
191
  }
192
  $output .= "</li>";
193
  }
 
194
  $output .= "</ul></div>\n";
195
+ // End of Flex Slider
196
+
197
+ // Begin Links
198
+ $size = 'wccarousel';
199
+ $size_class = sanitize_html_class( $size );
200
+
201
+ $class = array();
202
+ $class[] = 'wc-image-links';
203
+ $class[] = 'wc-gallery-clear';
204
+ $class[] = 'wc-image-links-' . str_replace( array( 'slider3', 'slider4' ), '', $display );
205
+ $class[] = 'wc-image-links-' . $display;
206
+ $class[] = 'wc-image-links-gutter-space-' . $gutterwidth;
207
+
208
+ $output .= "<div class='".implode( ' ', $class )."'>";
209
+
210
+ $i = 1;
211
+ foreach ( $links as $key => $attachment ) {
212
+ $id = $attachment->ID;
213
+ $image_output = wc_gallery_get_attachment_link( $id, $size, false, false, false, $targetsize, true );
214
+
215
+ $image_meta = wp_get_attachment_metadata( $id );
216
+
217
+ $orientation = '';
218
+ if ( isset( $image_meta['height'], $image_meta['width'] ) )
219
+ $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
220
+
221
+ $output .= "<div class='gallery-item gallery-item-".$i."'>";
222
+ $output .= "<div class='gallery-block'>";
223
+ $output .= "
224
+ <div class='gallery-icon {$orientation}'>
225
+ $image_output
226
+ </div>";
227
+ $caption_text = trim($attachment->post_excerpt);
228
+
229
+ if ( ! empty( $caption_text ) ) {
230
+ $output .= "
231
+ <div class='wp-caption-text gallery-caption'>
232
+ <h3>
233
+ " . wptexturize($caption_text) . "
234
+ <h3>
235
+ </div>";
236
+ }
237
+ $output .= "</div>";
238
+ $output .= "</div>";
239
+ $i++;
240
+ }
241
+
242
+ $output .= "</div>\n";
243
+ // End of Links
244
+
245
+ $output .= "</div>\n";
246
  }
247
+ else if ( in_array( $display, $owlcarousel ) ) {
248
+ wp_enqueue_script( 'wc-gallery-owlcarousel' );
249
+ wp_enqueue_script( 'wc-gallery' );
250
+
251
+ $class[] = 'wc' . $display;
252
+ $class[] = 'wcowlcarousel';
253
+ $class[] = 'wc-gallery-bottomspace-' . $bottomspace;
254
+ $class[] = 'wc-gallery-clear';
255
+
256
+ $output = "<div class='".implode( ' ', $class )."'>";
257
+ $output .= "<div id='$selector' class='owl-carousel' data-gutter-width='".$gutterwidth."' data-columns='".$columns."' data-hide-controls='".$hidecontrols."'>";
258
+
259
+ $i = 0;
260
+ foreach ( $attachments as $id => $attachment ) {
261
+ if ( ! $img = wp_get_attachment_image_src( $id, $size ) )
262
+ continue;
263
+
264
+ list($src, $width, $height) = $img;
265
+ $alt = trim( strip_tags( get_post_meta($id, '_wp_attachment_image_alt', true) ) ); // Use Alt field first
266
+ $image_output = "<img src='{$src}' width='{$width}' height='{$height}' alt='{$alt}' />";
267
+
268
+ if ( ! empty( $link ) ) {
269
+ if ( $customlink ) {
270
+ $url = get_post_meta( $id, _WC_GALLERY_PREFIX . 'custom_image_link', true );
271
+ $image_output = '<a href="'.$url.'">' . $image_output . '</a>';
272
+ }
273
+ else if ( 'post' === $link ) {
274
+ $url = get_attachment_link( $id );
275
+ $image_output = '<a href="'.$url.'">' . $image_output . '</a>';
276
+ }
277
+ else if ( 'file' === $link ) {
278
+ $url = wp_get_attachment_url( $id );
279
+ $image_output = '<a href="'.$url.'">' . $image_output . '</a>';
280
+ }
281
+ }
282
+
283
+ $image_meta = wp_get_attachment_metadata( $id );
284
+
285
+ $orientation = '';
286
+ if ( isset( $image_meta['height'], $image_meta['width'] ) )
287
+ $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
288
+
289
+ if ( 'owlautowidth' == $display ) {
290
+ $output .= "<div class='gallery-item item' style='width:".$width."px'>";
291
+ }
292
+ else {
293
+ $output .= "<div class='gallery-item item'>";
294
+ }
295
+
296
+ $output .= "<div class='gallery-icon {$orientation}'>$image_output</div>";
297
+
298
+ if ( $showcaptions && trim($attachment->post_excerpt) ) {
299
+ $output .= "
300
+ <div class='wp-caption-text gallery-caption'>
301
+ <{$captiontype}>
302
+ " . wptexturize($attachment->post_excerpt) . "
303
+ </{$captiontype}>
304
+ </div>";
305
+ }
306
+ $output .= "</div>";
307
  }
308
+
309
+ $output .= "</div></div>\n";
310
+ }
311
+ else {
312
  wp_enqueue_script( 'wc-gallery' );
313
 
314
  // getting rid of float
318
  $class[] = "galleryid-{$id}";
319
  $class[] = "gallery-columns-{$columns}";
320
  $class[] = "gallery-size-{$size_class}";
321
+ $class[] = 'wc-gallery-bottomspace-' . $bottomspace;
322
+ $class[] = 'wc-gallery-clear';
 
323
 
324
  $class = implode( ' ', $class );
325
 
367
  }
368
  add_filter( 'post_gallery', 'wc_gallery_shortcode', 10, 2 );
369
 
370
+ function wc_gallery_seperate_attachments_links( $attachments, $display ) {
371
+ $links = array();
372
+
373
+ switch ( $display ) {
374
+ case 'slider3rightlinks' :
375
+ case 'slider3bottomlinks' :
376
+ $i = 3;
377
+ $links[] = array_pop( $attachments );
378
+ $links[] = array_pop( $attachments );
379
+ $links[] = array_pop( $attachments );
380
+ break;
381
+ case 'slider4rightlinks' :
382
+ case 'slider4bottomlinks' :
383
+ $links[] = array_pop( $attachments );
384
+ $links[] = array_pop( $attachments );
385
+ $links[] = array_pop( $attachments );
386
+ $links[] = array_pop( $attachments );
387
+ break;
388
+ }
389
+
390
+ if ( empty( $links ) ) {
391
+ return array( $attachments, $links );
392
+ }
393
+
394
+ $links = array_reverse( $links );
395
+
396
+ return array( $attachments, $links );
397
+ }
398
 
399
  /**
400
  * Retrieve an attachment page link using an image or icon, if possible.
451
  'masonry' => __( 'Masonry', 'wc_gallery' ),
452
  'slider' => __( 'Slider (Fade)', 'wc_gallery' ),
453
  'slider2' => __( 'Slider (Slide)', 'wc_gallery' ),
454
+ 'sliderauto' => __( 'Slider (Auto Start)', 'wc_gallery' ),
455
+ 'owlautowidth' => __( 'Owl Carousel (Auto Width)', 'wc_gallery' ),
456
+ 'owlcolumns' => __( 'Owl Carousel (Columns)', 'wc_gallery' ),
457
+ 'carousel' => __( 'Carousel (Deprecated)', 'wc_gallery' ),
458
+ 'slider3bottomlinks' => __( 'Slider + 3 Bottom Links', 'wc_gallery' ),
459
+ 'slider4bottomlinks' => __( 'Slider + 4 Bottom Links', 'wc_gallery' ),
460
  );
461
  ?>
462
  <script type="text/html" id="tmpl-wc-gallery-settings">
539
 
540
  <?php
541
  $gutterwidth = array();
542
+ for ( $i = 0; $i <= 30; $i++ ) {
543
+ $gutterwidth[ $i ] = $i;
544
  }
545
  ?>
546
  <label class="setting">
547
  <span><?php _e( 'Gutter Width', 'wc_gallery' ); ?></span>
548
  <select class="gutterwidth" name="gutterwidth" data-setting="gutterwidth">
549
  <?php foreach ( $gutterwidth as $key => $value ) : ?>
550
+ <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $key, '5' ); ?>><?php echo esc_html( $value ); ?>px</option>
551
  <?php endforeach; ?>
552
  </select>
553
  </label>
621
 
622
  // This theme uses its own gallery styles.
623
  add_filter( 'use_default_gallery_style', '__return_false' );
624
+
625
+ function wc_gallery_after_setup_theme() {
626
+ global $wc_gallery_theme_support;
627
+
628
+ $defined_sizes = get_intermediate_image_sizes();
629
+
630
+ foreach ( $wc_gallery_theme_support as $size => $value ) {
631
+ if ( in_array( $size, $defined_sizes ) ) {
632
+ continue;
633
+ }
634
+ $name_w = $size . '_size_w';
635
+ $name_h = $size . '_size_h';
636
+ $name_crop = $size . '_crop';
637
+
638
+ $width = get_option( WC_GALLERY_PREFIX . $name_w );
639
+ $height = get_option( WC_GALLERY_PREFIX . $name_h );
640
+ $crop = get_option( WC_GALLERY_PREFIX . $name_crop );
641
+ if ( $width && $height ) {
642
+ $crop = $crop ? true : false;
643
+ add_image_size( 'wc' . $size, $width, $height, $crop );
644
+ }
645
+ }
646
+ }
647
+ add_action( 'after_setup_theme', 'wc_gallery_after_setup_theme', 99 );
648
+
649
+ /**
650
+ * Allow users to select our custom image sizes
651
+ *
652
+ * @since 3.6.1
653
+ * @access public
654
+ *
655
+ * @param array $sizes
656
+ * @return array
657
+ */
658
+ function wc_gallery_image_size_names_choose( $sizes ) {
659
+ global $wc_gallery_theme_support;
660
+
661
+ foreach ( $wc_gallery_theme_support as $size => $value ) {
662
+ $name_w = $size . '_size_w';
663
+ $name_h = $size . '_size_h';
664
+
665
+ $width = get_option( WC_GALLERY_PREFIX . $name_w );
666
+ $height = get_option( WC_GALLERY_PREFIX . $name_h );
667
+ if ( $width && $height ) {
668
+ $name = 'wc' . $size;
669
+ if ( ! array_key_exists( $name, $sizes ) ) {
670
+ $sizes[ $name ] = wc_gallery_return_proper_size_name( $size );
671
+ }
672
+ }
673
+ }
674
+
675
+ return $sizes;
676
+ }
677
+ add_filter( 'image_size_names_choose', 'wc_gallery_image_size_names_choose', 99 );
678
+
679
+ function wc_gallery_return_proper_size_name( $key ) {
680
+ switch ( $key ) {
681
+ case 'fixedheightsmall' :
682
+ return 'Fixed Height (Small)';
683
+ case 'fixedheightmedium' :
684
+ return 'Fixed Height (Medium)';
685
+ case 'fixedheight' :
686
+ return 'Fixed Height (Large)';
687
+ case 'carouselsmall' :
688
+ return 'Carousel (Small)';
689
+ case 'carousel' :
690
+ return 'Carousel (Large)';
691
+ }
692
+
693
+ return ucwords( $key );
694
+ }
includes/img/slide-arrows.png ADDED
Binary file
includes/js/flexslider/flexslider.css CHANGED
@@ -61,13 +61,13 @@ html[xmlns] .slides {display: block;}
61
 
62
  /* Direction Nav */
63
  .wcflex-direction-nav {*height: 0;}
64
- .wcflex-direction-nav a { display: block; width: 100px; height: 100px; margin: -66px 0 0; position: absolute; top: 50%; z-index: 10; overflow: hidden; opacity: 0; cursor: pointer; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; }
65
- .wcflex-direction-nav .wcflex-prev { background: url("images/slide-arrows.png") no-repeat 0 0; left: 0; }
66
- .wcflex-direction-nav .wcflex-next { background: url("images/slide-arrows.png") no-repeat 0 -100px; right: 0; text-align: right; }
67
  .wcflexslider:hover .wcflex-prev { opacity: 1; left: 0px; }
68
  .wcflexslider:hover .wcflex-next { opacity: 1; right: 0px; }
69
  .wcflexslider:hover .wcflex-next:hover, .wcflexslider:hover .wcflex-prev:hover { opacity: 1; }
70
- .wcflex-direction-nav .wcflex-disabled { opacity: 0!important; filter:alpha(opacity=0); cursor: default; }
71
  /* .wcflex-direction-nav a:before { display: inline-block; background-image:url("images/leftarrow.png"); } */
72
  /* .wcflex-direction-nav a.wcflex-next:before { background-image:url("images/rightarrow.png"); } */
73
 
@@ -94,14 +94,14 @@ html[xmlns] .slides {display: block;}
94
  display: none;
95
  }
96
  .wcflexslider-hidecontrols .wcflex-direction-nav a {
97
- margin-top: -50px;
98
  }
99
 
100
  /* @media screen and (max-width: 860px) {
101
  .wcflex-direction-nav .wcflex-prev { opacity: 1; left: 10px;}
102
  .wcflex-direction-nav .wcflex-next { opacity: 1; right: 10px;}
103
  } */
104
- @media screen and (max-width: 480px) {
105
  .wcflex-direction-nav .wcflex-prev { background: none; }
106
  .wcflex-direction-nav .wcflex-next { background: none; }
107
- }
61
 
62
  /* Direction Nav */
63
  .wcflex-direction-nav {*height: 0;}
64
+ .wcflex-direction-nav a { display: block; width: 50px; height: 50px; margin: -25px 0 0; position: absolute; top: 50%; z-index: 10; overflow: hidden; opacity: 0; cursor: pointer; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; }
65
+ .wcflex-direction-nav .wcflex-prev { background: url("images/slide-arrow-left.png") no-repeat center center !important; left: 0; }
66
+ .wcflex-direction-nav .wcflex-next { background: url("images/slide-arrow-right.png") no-repeat center center !important; right: 0; text-align: right; }
67
  .wcflexslider:hover .wcflex-prev { opacity: 1; left: 0px; }
68
  .wcflexslider:hover .wcflex-next { opacity: 1; right: 0px; }
69
  .wcflexslider:hover .wcflex-next:hover, .wcflexslider:hover .wcflex-prev:hover { opacity: 1; }
70
+ .wcflex-direction-nav .wcflex-disabled { /*opacity: 0!important; filter:alpha(opacity=0); cursor: default;*/ }
71
  /* .wcflex-direction-nav a:before { display: inline-block; background-image:url("images/leftarrow.png"); } */
72
  /* .wcflex-direction-nav a.wcflex-next:before { background-image:url("images/rightarrow.png"); } */
73
 
94
  display: none;
95
  }
96
  .wcflexslider-hidecontrols .wcflex-direction-nav a {
97
+ margin-top: -25px;
98
  }
99
 
100
  /* @media screen and (max-width: 860px) {
101
  .wcflex-direction-nav .wcflex-prev { opacity: 1; left: 10px;}
102
  .wcflex-direction-nav .wcflex-next { opacity: 1; right: 10px;}
103
  } */
104
+ /* @media screen and (max-width: 480px) {
105
  .wcflex-direction-nav .wcflex-prev { background: none; }
106
  .wcflex-direction-nav .wcflex-next { background: none; }
107
+ } */
includes/js/flexslider/images/slide-arrow-left.png ADDED
Binary file
includes/js/flexslider/images/slide-arrow-right.png ADDED
Binary file
includes/js/gallery.js CHANGED
@@ -16,10 +16,10 @@
16
  var containerWidth = $container.width();
17
 
18
  if ( isNaN( gutterWidth ) ) {
19
- gutterWidth = .020;
20
  }
21
- else if ( gutterWidth > 0.05 || gutterWidth < 0 ) {
22
- gutterWidth = .020;
23
  }
24
 
25
  if ( columns > 1 ) {
@@ -38,7 +38,7 @@
38
  }
39
  }
40
 
41
- var gutterWidth = Math.floor( containerWidth * gutterWidth );
42
 
43
  var allGutters = gutterWidth * ( columns - 1 );
44
  var contentWidth = containerWidth - allGutters;
@@ -99,31 +99,141 @@
99
 
100
  if( jQuery().wcflexslider) {
101
  $(window).load(function() {
102
- $('.gallery.wcslider.wcflexslider').wcflexslider({
103
- prevText: "",
104
- nextText: "",
105
- smoothHeight: false,
106
- slideshow: false,
107
- animation:"fade"
108
- });
109
- $('.gallery.wcslider2.wcflexslider').wcflexslider({
110
- prevText: "",
111
- nextText: "",
112
- smoothHeight: true,
113
- slideshow: false,
114
- animation:"slide"
115
- });
116
- $('.gallery.wccarousel.wcflexslider').wcflexslider({
117
- prevText: "",
118
- nextText: "",
119
- smoothHeight: false,
120
- slideshow: false,
121
- animation: "slide",
122
- animationLoop: false,
123
- itemWidth: 270,
124
- itemMargin: 5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  });
126
  });
127
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  });
129
  } )( jQuery );
16
  var containerWidth = $container.width();
17
 
18
  if ( isNaN( gutterWidth ) ) {
19
+ gutterWidth = 5;
20
  }
21
+ else if ( gutterWidth > 30 || gutterWidth < 0 ) {
22
+ gutterWidth = 5;
23
  }
24
 
25
  if ( columns > 1 ) {
38
  }
39
  }
40
 
41
+ gutterWidth = parseInt( gutterWidth );
42
 
43
  var allGutters = gutterWidth * ( columns - 1 );
44
  var contentWidth = containerWidth - allGutters;
99
 
100
  if( jQuery().wcflexslider) {
101
  $(window).load(function() {
102
+ $('.wcflexslider-container').each( function() {
103
+ var $this = $(this);
104
+ var $flex = $(this).children('.gallery.wcflexslider');
105
+ var columns = parseInt( $flex.data('columns') );
106
+ var columnsTablet = columns - 1;
107
+ var columnsPhone = columns - 2;
108
+ var gutterWidth = $flex.data('gutterWidth');
109
+ var hideControls = $flex.data('hideControls');
110
+ var showNav = hideControls ? false : true;
111
+ var containerWidth = $this.width();
112
+
113
+ gutterWidth = parseInt( gutterWidth );
114
+
115
+ if ( $flex.hasClass('wcslider') ) {
116
+ $flex.wcflexslider({
117
+ prevText: "",
118
+ nextText: "",
119
+ smoothHeight: false,
120
+ slideshow: false,
121
+ animation:"fade"
122
+ });
123
+ }
124
+ else if ( $flex.hasClass('wcslider2') ) {
125
+ $flex.wcflexslider({
126
+ prevText: "",
127
+ nextText: "",
128
+ smoothHeight: true,
129
+ slideshow: false,
130
+ animation:"slide"
131
+ });
132
+ }
133
+ else if ( $flex.hasClass('wcsliderauto') ) {
134
+ $flex.wcflexslider({
135
+ prevText: "",
136
+ nextText: "",
137
+ smoothHeight: true,
138
+ slideshow: true,
139
+ animation:"slide"
140
+ });
141
+ }
142
+ else if ( $flex.hasClass('wccarousel') ) {
143
+ $flex.wcflexslider({
144
+ prevText: "",
145
+ nextText: "",
146
+ smoothHeight: false,
147
+ slideshow: false,
148
+ animation: "slide",
149
+ animationLoop: false,
150
+ itemWidth: 270,
151
+ itemMargin: gutterWidth
152
+ });
153
+ }
154
+ else if ( $flex.hasClass('wcslider3bottomlinks') || $flex.hasClass('wcslider4bottomlinks') ) {
155
+ $flex.wcflexslider({
156
+ prevText: "",
157
+ nextText: "",
158
+ smoothHeight: false,
159
+ slideshow: true,
160
+ animation:"slide"
161
+ });
162
+ }
163
  });
164
  });
165
  }
166
+ if( jQuery().owlCarousel) {
167
+ $('.wcowlcarousel').each( function() {
168
+ var $this = $(this);
169
+ var $owl = $this.children('.owl-carousel');
170
+ var columns = parseInt( $owl.data('columns') );
171
+ var columnsTablet = columns - 1;
172
+ var columnsPhone = columns - 2;
173
+ var gutterWidth = $owl.data('gutterWidth');
174
+ var hideControls = $owl.data('hideControls');
175
+ var showNav = hideControls ? false : true;
176
+ var containerWidth = $this.width();
177
+
178
+ gutterWidth = parseInt( gutterWidth );
179
+ if ( 1 > columnsTablet ) {
180
+ columnsTablet = 1;
181
+ }
182
+ if ( 1 > columnsPhone ) {
183
+ columnsPhone = 1;
184
+ }
185
+
186
+ if ( $this.hasClass('wcowlautowidth') ) {
187
+ $owl.owlCarousel({
188
+ margin: gutterWidth,
189
+ loop: false,
190
+ dots: false,
191
+ autoWidth: true,
192
+ responsive: {
193
+ 0:{
194
+ nav: false,
195
+ },
196
+ 569:{
197
+ nav: showNav,
198
+ }
199
+ }
200
+ });
201
+ }
202
+ else if ( $this.hasClass('wcowlcolumns') ) {
203
+ $owl.owlCarousel({
204
+ margin: gutterWidth,
205
+ loop: false,
206
+ dots: false,
207
+ items: columns,
208
+ responsive: {
209
+ 0:{
210
+ nav: false
211
+ },
212
+ 569:{
213
+ nav: showNav
214
+ }
215
+ }
216
+ });
217
+ }
218
+ else if ( $this.hasClass('wcowlslider') ) {
219
+ $owl.owlCarousel({
220
+ margin: 0,
221
+ loop: false,
222
+ dots: false,
223
+ items: 1,
224
+ autoHeight:true,
225
+ responsive: {
226
+ 0:{
227
+ nav: false
228
+ },
229
+ 569:{
230
+ nav: showNav
231
+ }
232
+ }
233
+ });
234
+ }
235
+ });
236
+
237
+ }
238
  });
239
  } )( jQuery );
includes/js/owlcarousel/LICENSE-MIT ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2014 Owl
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
includes/js/owlcarousel/README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Owl Carousel 2
2
+ version 2.0.0-beta.2.4
3
+
4
+ Touch enabled jQuery plugin that lets you create beautiful responsive carousel slider.
5
+
6
+ ####[Visit Owl Carousel landing page for full documentation and demos ](http://owlcarousel.owlgraphic.com)
7
+
8
+
9
+ ## Installation
10
+
11
+
12
+ ### Include CSS
13
+ First include two CSS files into your HTML head:
14
+ ```
15
+ <link rel="stylesheet" href="owlcarousel/owl.carousel.min.css">
16
+ <link rel="stylesheet" href="owlcarousel/owl.theme.default.min.css">
17
+ ```
18
+ > `owl.carousel.css` file is required and its good when inculded in head before *.js
19
+
20
+
21
+ ### Include JS
22
+
23
+ Yep, include jQuery and `owl.carousel.min.js` into footer.
24
+ ```
25
+ <script src="jquery.min.js"></script>
26
+ <script src="owlcarousel/owl.carousel.min.js"></script>
27
+ ```
28
+
29
+
30
+ ### Set HTML
31
+
32
+ You don't need any special markup. All you need is to wrap your divs(owl works with any type element a/img/span..) inside the container element `<div class="owl-carousel">`.
33
+ Class "owl-carousel" is mandatory to apply proper styles that come from owl.carousel.css file.
34
+
35
+ ```
36
+ <!-- Set up your HTML -->
37
+ <div class="owl-carousel">
38
+ <div> Your Content </div>
39
+ <div> Your Content </div>
40
+ <div> Your Content </div>
41
+ <div> Your Content </div>
42
+ <div> Your Content </div>
43
+ <div> Your Content </div>
44
+ <div> Your Content </div>
45
+ </div>
46
+ ```
47
+
48
+ ### Call the plugin
49
+
50
+ Now call the Owl initializer function and your carousel is ready.
51
+
52
+ ```
53
+ $(document).ready(function(){
54
+ $(".owl-carousel").owlCarousel();
55
+ });
56
+ ```
57
+ > See [demos](http://owlcarousel.owlgraphic.com/demos/demos.html) for customisation and options usage.
includes/js/owlcarousel/assets/ajax-loader.gif ADDED
Binary file
includes/js/owlcarousel/assets/owl.carousel.css ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Owl Carousel - Animate Plugin
3
+ */
4
+ .owl-carousel .animated {
5
+ -webkit-animation-duration: 1000ms;
6
+ animation-duration: 1000ms;
7
+ -webkit-animation-fill-mode: both;
8
+ animation-fill-mode: both;
9
+ }
10
+ .owl-carousel .owl-animated-in {
11
+ z-index: 0;
12
+ }
13
+ .owl-carousel .owl-animated-out {
14
+ z-index: 1;
15
+ }
16
+ .owl-carousel .fadeOut {
17
+ -webkit-animation-name: fadeOut;
18
+ animation-name: fadeOut;
19
+ }
20
+
21
+ @-webkit-keyframes fadeOut {
22
+ 0% {
23
+ opacity: 1;
24
+ }
25
+
26
+ 100% {
27
+ opacity: 0;
28
+ }
29
+ }
30
+ @keyframes fadeOut {
31
+ 0% {
32
+ opacity: 1;
33
+ }
34
+
35
+ 100% {
36
+ opacity: 0;
37
+ }
38
+ }
39
+
40
+ /*
41
+ * Owl Carousel - Auto Height Plugin
42
+ */
43
+ .owl-height {
44
+ -webkit-transition: height 500ms ease-in-out;
45
+ -moz-transition: height 500ms ease-in-out;
46
+ -ms-transition: height 500ms ease-in-out;
47
+ -o-transition: height 500ms ease-in-out;
48
+ transition: height 500ms ease-in-out;
49
+ }
50
+
51
+ /*
52
+ * Core Owl Carousel CSS File
53
+ */
54
+ .owl-carousel {
55
+ display: none;
56
+ width: 100%;
57
+ -webkit-tap-highlight-color: transparent;
58
+ /* position relative and z-index fix webkit rendering fonts issue */
59
+ position: relative;
60
+ z-index: 1;
61
+ }
62
+ .owl-carousel .owl-stage {
63
+ position: relative;
64
+ -ms-touch-action: pan-Y;
65
+ }
66
+ .owl-carousel .owl-stage:after {
67
+ content: ".";
68
+ display: block;
69
+ clear: both;
70
+ visibility: hidden;
71
+ line-height: 0;
72
+ height: 0;
73
+ }
74
+ .owl-carousel .owl-stage-outer {
75
+ position: relative;
76
+ overflow: hidden;
77
+ /* fix for flashing background */
78
+ -webkit-transform: translate3d(0px, 0px, 0px);
79
+ }
80
+ .owl-carousel .owl-controls .owl-nav .owl-prev,
81
+ .owl-carousel .owl-controls .owl-nav .owl-next,
82
+ .owl-carousel .owl-controls .owl-dot {
83
+ cursor: pointer;
84
+ cursor: hand;
85
+ -webkit-user-select: none;
86
+ -khtml-user-select: none;
87
+ -moz-user-select: none;
88
+ -ms-user-select: none;
89
+ user-select: none;
90
+ }
91
+ .owl-carousel.owl-loaded {
92
+ display: block;
93
+ }
94
+ .owl-carousel.owl-loading {
95
+ opacity: 0;
96
+ display: block;
97
+ }
98
+ .owl-carousel.owl-hidden {
99
+ opacity: 0;
100
+ }
101
+ .owl-carousel .owl-refresh .owl-item {
102
+ display: none;
103
+ }
104
+ .owl-carousel .owl-item {
105
+ position: relative;
106
+ min-height: 1px;
107
+ float: left;
108
+ -webkit-backface-visibility: hidden;
109
+ -webkit-tap-highlight-color: transparent;
110
+ -webkit-touch-callout: none;
111
+ -webkit-user-select: none;
112
+ -moz-user-select: none;
113
+ -ms-user-select: none;
114
+ user-select: none;
115
+ }
116
+ .owl-carousel .owl-item img {
117
+ display: block;
118
+ width: 100%;
119
+ -webkit-transform-style: preserve-3d;
120
+ }
121
+ .owl-carousel.owl-text-select-on .owl-item {
122
+ -webkit-user-select: auto;
123
+ -moz-user-select: auto;
124
+ -ms-user-select: auto;
125
+ user-select: auto;
126
+ }
127
+ .owl-carousel .owl-grab {
128
+ cursor: move;
129
+ cursor: -webkit-grab;
130
+ cursor: -o-grab;
131
+ cursor: -ms-grab;
132
+ cursor: grab;
133
+ }
134
+ .owl-carousel .owl-rtl {
135
+ direction: rtl;
136
+ }
137
+ .owl-carousel .owl-rtl .owl-item {
138
+ float: right;
139
+ }
140
+
141
+ /* No Js */
142
+ .no-js .owl-carousel {
143
+ display: block;
144
+ }
145
+
146
+ /*
147
+ * Owl Carousel - Lazy Load Plugin
148
+ */
149
+ .owl-carousel .owl-item .owl-lazy {
150
+ opacity: 0;
151
+ -webkit-transition: opacity 400ms ease;
152
+ -moz-transition: opacity 400ms ease;
153
+ -ms-transition: opacity 400ms ease;
154
+ -o-transition: opacity 400ms ease;
155
+ transition: opacity 400ms ease;
156
+ }
157
+ .owl-carousel .owl-item img {
158
+ transform-style: preserve-3d;
159
+ }
160
+
161
+ /*
162
+ * Owl Carousel - Video Plugin
163
+ */
164
+ .owl-carousel .owl-video-wrapper {
165
+ position: relative;
166
+ height: 100%;
167
+ background: #000;
168
+ }
169
+ .owl-carousel .owl-video-play-icon {
170
+ position: absolute;
171
+ height: 80px;
172
+ width: 80px;
173
+ left: 50%;
174
+ top: 50%;
175
+ margin-left: -40px;
176
+ margin-top: -40px;
177
+ background: url("owl.video.play.png") no-repeat;
178
+ cursor: pointer;
179
+ z-index: 1;
180
+ -webkit-backface-visibility: hidden;
181
+ -webkit-transition: scale 100ms ease;
182
+ -moz-transition: scale 100ms ease;
183
+ -ms-transition: scale 100ms ease;
184
+ -o-transition: scale 100ms ease;
185
+ transition: scale 100ms ease;
186
+ }
187
+ .owl-carousel .owl-video-play-icon:hover {
188
+ -webkit-transition: scale(1.3, 1.3);
189
+ -moz-transition: scale(1.3, 1.3);
190
+ -ms-transition: scale(1.3, 1.3);
191
+ -o-transition: scale(1.3, 1.3);
192
+ transition: scale(1.3, 1.3);
193
+ }
194
+ .owl-carousel .owl-video-playing .owl-video-tn,
195
+ .owl-carousel .owl-video-playing .owl-video-play-icon {
196
+ display: none;
197
+ }
198
+ .owl-carousel .owl-video-tn {
199
+ opacity: 0;
200
+ height: 100%;
201
+ background-position: center center;
202
+ background-repeat: no-repeat;
203
+ -webkit-background-size: contain;
204
+ -moz-background-size: contain;
205
+ -o-background-size: contain;
206
+ background-size: contain;
207
+ -webkit-transition: opacity 400ms ease;
208
+ -moz-transition: opacity 400ms ease;
209
+ -ms-transition: opacity 400ms ease;
210
+ -o-transition: opacity 400ms ease;
211
+ transition: opacity 400ms ease;
212
+ }
213
+ .owl-carousel .owl-video-frame {
214
+ position: relative;
215
+ z-index: 1;
216
+ }
includes/js/owlcarousel/assets/owl.carousel.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .owl-carousel .animated{-webkit-animation-duration:1000ms;animation-duration:1000ms;-webkit-animation-fill-mode:both;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{-webkit-transition:height 500ms ease-in-out;-moz-transition:height 500ms ease-in-out;-ms-transition:height 500ms ease-in-out;-o-transition:height 500ms ease-in-out;transition:height 500ms ease-in-out}.owl-carousel{display:none;width:100%;-webkit-tap-highlight-color:transparent;position:relative;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0px,0,0)}.owl-carousel .owl-controls .owl-dot,.owl-carousel .owl-controls .owl-nav .owl-next,.owl-carousel .owl-controls .owl-nav .owl-prev{cursor:pointer;cursor:hand;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-loaded{display:block}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel .owl-refresh .owl-item{display:none}.owl-carousel .owl-item{position:relative;min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel .owl-item img{display:block;width:100%;-webkit-transform-style:preserve-3d}.owl-carousel.owl-text-select-on .owl-item{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.owl-carousel .owl-grab{cursor:move;cursor:-webkit-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.owl-carousel .owl-rtl{direction:rtl}.owl-carousel .owl-rtl .owl-item{float:right}.no-js .owl-carousel{display:block}.owl-carousel .owl-item .owl-lazy{opacity:0;-webkit-transition:opacity 400ms ease;-moz-transition:opacity 400ms ease;-ms-transition:opacity 400ms ease;-o-transition:opacity 400ms ease;transition:opacity 400ms ease}.owl-carousel .owl-item img{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;-webkit-transition:scale 100ms ease;-moz-transition:scale 100ms ease;-ms-transition:scale 100ms ease;-o-transition:scale 100ms ease;transition:scale 100ms ease}.owl-carousel .owl-video-play-icon:hover{-webkit-transition:scale(1.3,1.3);-moz-transition:scale(1.3,1.3);-ms-transition:scale(1.3,1.3);-o-transition:scale(1.3,1.3);transition:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;-webkit-background-size:contain;-moz-background-size:contain;-o-background-size:contain;background-size:contain;-webkit-transition:opacity 400ms ease;-moz-transition:opacity 400ms ease;-ms-transition:opacity 400ms ease;-o-transition:opacity 400ms ease;transition:opacity 400ms ease}.owl-carousel .owl-video-frame{position:relative;z-index:1}
includes/js/owlcarousel/assets/owl.theme.default.css ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Default theme - Owl Carousel CSS File
3
+ */
4
+ .owl-theme .owl-controls {
5
+ margin-top: 0px;
6
+ text-align: center;
7
+ -webkit-tap-highlight-color: transparent;
8
+ }
9
+ .owl-theme .owl-controls .owl-nav [class*='owl-'] {
10
+ color: transparent;
11
+ font-size: 14px;
12
+ margin: 0;
13
+ padding: 0;
14
+ display: inline-block;
15
+ cursor: pointer;
16
+ -webkit-border-radius: 0;
17
+ -moz-border-radius: 0;
18
+ border-radius: 0;
19
+ width: 50px;
20
+ height: 50px;
21
+ }
22
+ .owl-theme .owl-controls .owl-nav .owl-next,
23
+ .owl-theme .owl-controls .owl-nav .owl-prev {
24
+ background-position: center center;
25
+ background-repeat: no-repeat;
26
+ position: absolute;
27
+ top: 50%;
28
+ margin-top: -25px;
29
+ opacity: 0;
30
+ cursor: pointer;
31
+ -webkit-transition: all .3s ease;
32
+ -moz-transition: all .3s ease;
33
+ transition: all .3s ease;
34
+ }
35
+ .owl-theme:hover .owl-controls .owl-nav .owl-next,
36
+ .owl-theme:hover .owl-controls .owl-nav .owl-prev {
37
+ opacity: 1;
38
+ }
39
+ .owl-theme .owl-controls .owl-nav .owl-next {
40
+ right: 0;
41
+ background-image: url('slide-arrow-right.png');
42
+ }
43
+ .owl-theme .owl-controls .owl-nav .owl-prev {
44
+ left: 0;
45
+ background-image: url('slide-arrow-left.png');
46
+ }
47
+ .owl-theme .owl-controls .owl-nav [class*='owl-']:hover {
48
+ text-decoration: none;
49
+ }
50
+ .owl-theme .owl-controls .owl-nav .disabled {
51
+ opacity: 0.5;
52
+ cursor: default;
53
+ }
54
+
55
+ .owl-theme .owl-dots .owl-dot {
56
+ display: inline-block;
57
+ zoom: 1;
58
+ *display: inline;
59
+ }
60
+ .owl-theme .owl-dots .owl-dot span {
61
+ width: 10px;
62
+ height: 10px;
63
+ margin: 5px 7px;
64
+ background: #d6d6d6;
65
+ display: block;
66
+ -webkit-backface-visibility: visible;
67
+ -webkit-transition: opacity 200ms ease;
68
+ -moz-transition: opacity 200ms ease;
69
+ -ms-transition: opacity 200ms ease;
70
+ -o-transition: opacity 200ms ease;
71
+ transition: opacity 200ms ease;
72
+ -webkit-border-radius: 30px;
73
+ -moz-border-radius: 30px;
74
+ border-radius: 30px;
75
+ }
76
+ .owl-theme .owl-dots .owl-dot.active span, .owl-theme .owl-dots .owl-dot:hover span {
77
+ background: #869791;
78
+ }
includes/js/owlcarousel/assets/owl.theme.default.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .owl-theme .owl-controls{margin-top:10px;text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-controls .owl-nav [class*=owl-]{color:#fff;font-size:14px;margin:5px;padding:4px 7px;background:#d6d6d6;display:inline-block;cursor:pointer;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.owl-theme .owl-controls .owl-nav [class*=owl-]:hover{background:#869791;color:#fff;text-decoration:none}.owl-theme .owl-controls .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1;*display:inline}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#d6d6d6;display:block;-webkit-backface-visibility:visible;-webkit-transition:opacity 200ms ease;-moz-transition:opacity 200ms ease;-ms-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#869791}
includes/js/owlcarousel/assets/owl.theme.green.css ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Green theme - Owl Carousel CSS File
3
+ */
4
+ .owl-theme .owl-controls {
5
+ margin-top: 10px;
6
+ text-align: center;
7
+ -webkit-tap-highlight-color: transparent;
8
+ }
9
+ .owl-theme .owl-controls .owl-nav [class*='owl-'] {
10
+ color: white;
11
+ font-size: 14px;
12
+ margin: 5px;
13
+ padding: 4px 7px;
14
+ background: #d6d6d6;
15
+ display: inline-block;
16
+ cursor: pointer;
17
+ -webkit-border-radius: 3px;
18
+ -moz-border-radius: 3px;
19
+ border-radius: 3px;
20
+ }
21
+ .owl-theme .owl-controls .owl-nav [class*='owl-']:hover {
22
+ background: #4dc7a0;
23
+ color: white;
24
+ text-decoration: none;
25
+ }
26
+ .owl-theme .owl-controls .owl-nav .disabled {
27
+ opacity: 0.5;
28
+ cursor: default;
29
+ }
30
+ .owl-theme .owl-dots .owl-dot {
31
+ display: inline-block;
32
+ zoom: 1;
33
+ *display: inline;
34
+ }
35
+ .owl-theme .owl-dots .owl-dot span {
36
+ width: 10px;
37
+ height: 10px;
38
+ margin: 5px 7px;
39
+ background: #d6d6d6;
40
+ display: block;
41
+ -webkit-backface-visibility: visible;
42
+ -webkit-transition: opacity 200ms ease;
43
+ -moz-transition: opacity 200ms ease;
44
+ -ms-transition: opacity 200ms ease;
45
+ -o-transition: opacity 200ms ease;
46
+ transition: opacity 200ms ease;
47
+ -webkit-border-radius: 30px;
48
+ -moz-border-radius: 30px;
49
+ border-radius: 30px;
50
+ }
51
+ .owl-theme .owl-dots .owl-dot.active span, .owl-theme .owl-dots .owl-dot:hover span {
52
+ background: #4dc7a0;
53
+ }
includes/js/owlcarousel/assets/owl.theme.green.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .owl-theme .owl-controls{margin-top:10px;text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-controls .owl-nav [class*=owl-]{color:#fff;font-size:14px;margin:5px;padding:4px 7px;background:#d6d6d6;display:inline-block;cursor:pointer;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.owl-theme .owl-controls .owl-nav [class*=owl-]:hover{background:#4dc7a0;color:#fff;text-decoration:none}.owl-theme .owl-controls .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1;*display:inline}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#d6d6d6;display:block;-webkit-backface-visibility:visible;-webkit-transition:opacity 200ms ease;-moz-transition:opacity 200ms ease;-ms-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#4dc7a0}
includes/js/owlcarousel/assets/owl.video.play.png ADDED
Binary file
includes/js/owlcarousel/assets/slide-arrow-left.png ADDED
Binary file
includes/js/owlcarousel/assets/slide-arrow-right.png ADDED
Binary file
includes/js/owlcarousel/owl.carousel.js ADDED
@@ -0,0 +1,3225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Owl carousel
3
+ * @version 2.0.0
4
+ * @author Bartosz Wojciechowski
5
+ * @license The MIT License (MIT)
6
+ * @todo Lazy Load Icon
7
+ * @todo prevent animationend bubling
8
+ * @todo itemsScaleUp
9
+ * @todo Test Zepto
10
+ * @todo stagePadding calculate wrong active classes
11
+ */
12
+ ;(function($, window, document, undefined) {
13
+
14
+ var item, dom, width, num, pos, drag, speed, state, e;
15
+
16
+ /**
17
+ * Template for the data of each item respectively its DOM element.
18
+ * @private
19
+ */
20
+ item = {
21
+ index: false,
22
+ indexAbs: false,
23
+ posLeft: false,
24
+ clone: false,
25
+ active: false,
26
+ loaded: false,
27
+ lazyLoad: false,
28
+ current: false,
29
+ width: false,
30
+ center: false,
31
+ page: false,
32
+ hasVideo: false,
33
+ playVideo: false
34
+ };
35
+
36
+ /**
37
+ * Template for the references to DOM elements, those with `$` sign are `jQuery` objects.
38
+ * @private
39
+ */
40
+ dom = {
41
+ el: null, // main element
42
+ $el: null, // jQuery main element
43
+ stage: null, // stage
44
+ $stage: null, // jQuery stage
45
+ oStage: null, // outer stage
46
+ $oStage: null, // $ outer stage
47
+ $items: null, // all items, clones and originals included
48
+ $oItems: null, // original items
49
+ $cItems: null, // cloned items only
50
+ $content: null
51
+ };
52
+
53
+ /**
54
+ * Template for the widths of some elements.
55
+ * @private
56
+ */
57
+ width = {
58
+ el: 0,
59
+ stage: 0,
60
+ item: 0,
61
+ prevWindow: 0,
62
+ cloneLast: 0
63
+ };
64
+
65
+ /**
66
+ * Template for counting to some properties.
67
+ * @private
68
+ */
69
+ num = {
70
+ items: 0,
71
+ oItems: 0,
72
+ cItems: 0,
73
+ active: 0,
74
+ merged: []
75
+ };
76
+
77
+ /**
78
+ * Template for status information about drag and touch events.
79
+ * @private
80
+ */
81
+ drag = {
82
+ start: 0,
83
+ startX: 0,
84
+ startY: 0,
85
+ current: 0,
86
+ currentX: 0,
87
+ currentY: 0,
88
+ offsetX: 0,
89
+ offsetY: 0,
90
+ distance: null,
91
+ startTime: 0,
92
+ endTime: 0,
93
+ updatedX: 0,
94
+ targetEl: null
95
+ };
96
+
97
+ /**
98
+ * Template for some status informations.
99
+ * @private
100
+ */
101
+ state = {
102
+ isTouch: false,
103
+ isScrolling: false,
104
+ isSwiping: false,
105
+ direction: false,
106
+ inMotion: false
107
+ };
108
+
109
+ /**
110
+ * Event functions references.
111
+ * @private
112
+ */
113
+ e = {
114
+ _onDragStart: null,
115
+ _onDragMove: null,
116
+ _onDragEnd: null,
117
+ _transitionEnd: null,
118
+ _resizer: null,
119
+ _responsiveCall: null,
120
+ _goToLoop: null,
121
+ _checkVisibile: null
122
+ };
123
+
124
+ /**
125
+ * Creates a carousel.
126
+ * @class The Owl Carousel.
127
+ * @public
128
+ * @param {HTMLElement|jQuery} element - The element to create the carousel for.
129
+ * @param {Object} [options] - The options
130
+ */
131
+ function Owl(element, options) {
132
+
133
+ // add basic Owl information to dom element
134
+ element.owlCarousel = {
135
+ 'name': 'Owl Carousel',
136
+ 'author': 'Bartosz Wojciechowski',
137
+ 'version': '2.0.0-beta.2.1'
138
+ };
139
+
140
+ /**
141
+ * Current settings for the carousel.
142
+ * @protected
143
+ */
144
+ this.settings = null;
145
+
146
+ /**
147
+ *
148
+ * @protected
149
+ * @todo Must be dosumented.
150
+ */
151
+ this.options = $.extend({}, Owl.Defaults, options);
152
+
153
+ /**
154
+ * Template for the data of each item.
155
+ * @protected
156
+ */
157
+ this.itemData = $.extend({}, item);
158
+
159
+ /**
160
+ * Contains references to DOM elements, those with `$` sign are `jQuery` objects.
161
+ * @protected
162
+ */
163
+ this.dom = $.extend({}, dom);
164
+
165
+ /**
166
+ * Caches the widths of some elements.
167
+ * @protected
168
+ */
169
+ this.width = $.extend({}, width);
170
+
171
+ /**
172
+ * Caches some count informations.
173
+ * @protected
174
+ */
175
+ this.num = $.extend({}, num);
176
+
177
+ /**
178
+ * Caches informations about drag and touch events.
179
+ */
180
+ this.drag = $.extend({}, drag);
181
+
182
+ /**
183
+ * Caches some status informations.
184
+ * @protected
185
+ */
186
+ this.state = $.extend({}, state);
187
+
188
+ /**
189
+ * @protected
190
+ * @todo Must be documented
191
+ */
192
+ this.e = $.extend({}, e);
193
+
194
+ /**
195
+ * References to the running plugins of this carousel.
196
+ * @protected
197
+ */
198
+ this.plugins = {};
199
+
200
+ /**
201
+ * Currently suppressed events to prevent them from beeing retriggered.
202
+ * @protected
203
+ */
204
+ this._supress = {};
205
+
206
+ /**
207
+ * The absolute current position.
208
+ * @protected
209
+ */
210
+ this._current = null;
211
+
212
+ /**
213
+ * The animation speed in milliseconds.
214
+ * @protected
215
+ */
216
+ this._speed = null;
217
+
218
+ /**
219
+ * The coordinates of all items in pixel.
220
+ */
221
+ this._coordinates = null;
222
+
223
+ this.dom.el = element;
224
+ this.dom.$el = $(element);
225
+
226
+ for (var plugin in Owl.Plugins) {
227
+ this.plugins[plugin[0].toLowerCase() + plugin.slice(1)]
228
+ = new Owl.Plugins[plugin](this);
229
+ }
230
+
231
+ this.init();
232
+ }
233
+
234
+ /**
235
+ * Default options for the carousel.
236
+ * @public
237
+ */
238
+ Owl.Defaults = {
239
+ items: 3,
240
+ loop: false,
241
+ center: false,
242
+
243
+ mouseDrag: true,
244
+ touchDrag: true,
245
+ pullDrag: true,
246
+ freeDrag: false,
247
+
248
+ margin: 0,
249
+ stagePadding: 0,
250
+
251
+ merge: false,
252
+ mergeFit: true,
253
+ autoWidth: false,
254
+
255
+ startPosition: 0,
256
+
257
+ smartSpeed: 250,
258
+ fluidSpeed: false,
259
+ dragEndSpeed: false,
260
+
261
+ responsive: {},
262
+ responsiveRefreshRate: 200,
263
+ responsiveBaseElement: window,
264
+ responsiveClass: false,
265
+
266
+ fallbackEasing: 'swing',
267
+
268
+ info: false,
269
+
270
+ nestedItemSelector: false,
271
+ itemElement: 'div',
272
+ stageElement: 'div',
273
+
274
+ // Classes and Names
275
+ themeClass: 'owl-theme',
276
+ baseClass: 'owl-carousel',
277
+ itemClass: 'owl-item',
278
+ centerClass: 'center',
279
+ activeClass: 'active'
280
+ };
281
+
282
+ /**
283
+ * Contains all registered plugins.
284
+ * @public
285
+ */
286
+ Owl.Plugins = {};
287
+
288
+ /**
289
+ * Initializes the carousel.
290
+ * @protected
291
+ */
292
+ Owl.prototype.init = function() {
293
+
294
+ // Update options.items on given size
295
+ this.setResponsiveOptions();
296
+
297
+ this.trigger('initialize');
298
+
299
+ // Add base class
300
+ if (!this.dom.$el.hasClass(this.settings.baseClass)) {
301
+ this.dom.$el.addClass(this.settings.baseClass);
302
+ }
303
+
304
+ // Add theme class
305
+ if (!this.dom.$el.hasClass(this.settings.themeClass)) {
306
+ this.dom.$el.addClass(this.settings.themeClass);
307
+ }
308
+
309
+ // Add theme class
310
+ if (this.settings.rtl) {
311
+ this.dom.$el.addClass('owl-rtl');
312
+ }
313
+
314
+ // Check support
315
+ this.browserSupport();
316
+
317
+ if (this.settings.autoWidth && this.state.imagesLoaded !== true) {
318
+ var imgs, nestedSelector, width;
319
+ imgs = this.dom.$el.find('img');
320
+ nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
321
+ width = this.dom.$el.children(nestedSelector).width();
322
+
323
+ if (imgs.length && width <= 0) {
324
+ this.preloadAutoWidthImages(imgs);
325
+ return false;
326
+ }
327
+ }
328
+
329
+ // Get and store window width
330
+ // iOS safari likes to trigger unnecessary resize event
331
+ this.width.prevWindow = this.viewport();
332
+
333
+ // create stage object
334
+ this.createStage();
335
+
336
+ // Append local content
337
+ this.fetchContent();
338
+
339
+ // attach generic events
340
+ this.eventsCall();
341
+
342
+ // attach generic events
343
+ this.internalEvents();
344
+
345
+ this.dom.$el.addClass('owl-loading');
346
+ this.refresh(true);
347
+ this.dom.$el.removeClass('owl-loading').addClass('owl-loaded');
348
+
349
+ this.trigger('initialized');
350
+
351
+ // attach custom control events
352
+ this.addTriggerableEvents();
353
+ };
354
+
355
+ /**
356
+ * Sets responsive options.
357
+ * @protected
358
+ */
359
+ Owl.prototype.setResponsiveOptions = function() {
360
+ if (!this.options.responsive) {
361
+ this.settings = $.extend({}, this.options);
362
+ } else {
363
+ var viewport = this.viewport(),
364
+ overwrites = this.options.responsive,
365
+ match = -1;
366
+
367
+ $.each(overwrites, function(breakpoint) {
368
+ if (breakpoint <= viewport && breakpoint > match) {
369
+ match = Number(breakpoint);
370
+ }
371
+ });
372
+
373
+ this.settings = $.extend({}, this.options, overwrites[match]);
374
+ delete this.settings.responsive;
375
+
376
+ // Responsive Class
377
+ if (this.settings.responsiveClass) {
378
+ this.dom.$el.attr('class', function(i, c) {
379
+ return c.replace(/\b owl-responsive-\S+/g, '');
380
+ }).addClass('owl-responsive-' + match);
381
+ }
382
+ }
383
+ };
384
+
385
+ /**
386
+ * Updates option logic if necessery.
387
+ * @protected
388
+ */
389
+ Owl.prototype.optionsLogic = function() {
390
+ // Toggle Center class
391
+ this.dom.$el.toggleClass('owl-center', this.settings.center);
392
+
393
+ // if items number is less than in body
394
+ if (this.settings.loop && this.num.oItems < this.settings.items) {
395
+ this.settings.loop = false;
396
+ }
397
+
398
+ if (this.settings.autoWidth) {
399
+ this.settings.stagePadding = false;
400
+ this.settings.merge = false;
401
+ }
402
+ };
403
+
404
+ /**
405
+ * Creates stage and outer-stage elements.
406
+ * @protected
407
+ */
408
+ Owl.prototype.createStage = function() {
409
+ var oStage = document.createElement('div'),
410
+ stage = document.createElement(this.settings.stageElement);
411
+
412
+ oStage.className = 'owl-stage-outer';
413
+ stage.className = 'owl-stage';
414
+
415
+ oStage.appendChild(stage);
416
+ this.dom.el.appendChild(oStage);
417
+
418
+ this.dom.oStage = oStage;
419
+ this.dom.$oStage = $(oStage);
420
+ this.dom.stage = stage;
421
+ this.dom.$stage = $(stage);
422
+
423
+ oStage = null;
424
+ stage = null;
425
+ };
426
+
427
+ /**
428
+ * Creates an item container.
429
+ * @protected
430
+ * @returns {jQuery} - The item container.
431
+ */
432
+ Owl.prototype.createItemContainer = function() {
433
+ var item = document.createElement(this.settings.itemElement);
434
+ item.className = this.settings.itemClass;
435
+ return $(item);
436
+ };
437
+
438
+ /**
439
+ * Fetches the content.
440
+ * @protected
441
+ */
442
+ Owl.prototype.fetchContent = function(extContent) {
443
+ if (extContent) {
444
+ this.dom.$content = (extContent instanceof jQuery) ? extContent : $(extContent);
445
+ } else if (this.settings.nestedItemSelector) {
446
+ this.dom.$content = this.dom.$el.find('.' + this.settings.nestedItemSelector).not('.owl-stage-outer');
447
+ } else {
448
+ this.dom.$content = this.dom.$el.children().not('.owl-stage-outer');
449
+ }
450
+ // content length
451
+ this.num.oItems = this.dom.$content.length;
452
+
453
+ // init Structure
454
+ if (this.num.oItems !== 0) {
455
+ this.initStructure();
456
+ }
457
+ };
458
+
459
+ /**
460
+ * Initializes the content struture.
461
+ * @protected
462
+ */
463
+ Owl.prototype.initStructure = function() {
464
+ this.createNormalStructure();
465
+ };
466
+
467
+ /**
468
+ * Creates small/mid weight content structure.
469
+ * @protected
470
+ * @todo This results in a poor performance,
471
+ * but this is due to the approach of completely
472
+ * rebuild the existing DOM tree from scratch,
473
+ * rather to use them. The effort to implement
474
+ * this with a good performance, while maintaining
475
+ * the original approach is disproportionate.
476
+ */
477
+ Owl.prototype.createNormalStructure = function() {
478
+ var i, $item;
479
+ for (i = 0; i < this.num.oItems; i++) {
480
+ $item = this.createItemContainer();
481
+ this.initializeItemContainer($item, this.dom.$content[i]);
482
+ this.dom.$stage.append($item);
483
+ }
484
+ this.dom.$content = null;
485
+ };
486
+
487
+ /**
488
+ * Creates custom content structure.
489
+ * @protected
490
+ */
491
+ Owl.prototype.createCustomStructure = function(howManyItems) {
492
+ var i, $item;
493
+ for (i = 0; i < howManyItems; i++) {
494
+ $item = this.createItemContainer();
495
+ this.createItemContainerData($item);
496
+ this.dom.$stage.append($item);
497
+ }
498
+ };
499
+
500
+ /**
501
+ * Initializes item container with provided content.
502
+ * @protected
503
+ * @param {jQuery} item - The item that has to be filled.
504
+ * @param {HTMLElement|jQuery|string} content - The content that fills the item.
505
+ */
506
+ Owl.prototype.initializeItemContainer = function(item, content) {
507
+ this.trigger('change', { property: { name: 'item', value: item } });
508
+
509
+ this.createItemContainerData(item);
510
+ item.append(content);
511
+
512
+ this.trigger('changed', { property: { name: 'item', value: item } });
513
+ };
514
+
515
+ /**
516
+ * Creates item container data.
517
+ * @protected
518
+ * @param {jQuery} item - The item for which the data are to be set.
519
+ * @param {jQuery} [source] - The item whose data are to be copied.
520
+ */
521
+ Owl.prototype.createItemContainerData = function(item, source) {
522
+ var data = $.extend({}, this.itemData);
523
+
524
+ if (source) {
525
+ $.extend(data, source.data('owl-item'));
526
+ }
527
+
528
+ item.data('owl-item', data);
529
+ };
530
+
531
+ /**
532
+ * Clones an item container.
533
+ * @protected
534
+ * @param {jQuery} item - The item to clone.
535
+ * @returns {jQuery} - The cloned item.
536
+ */
537
+ Owl.prototype.cloneItemContainer = function(item) {
538
+ var $clone = item.clone(true, true).addClass('cloned');
539
+ // somehow data references the same object
540
+ this.createItemContainerData($clone, $clone);
541
+ $clone.data('owl-item').clone = true;
542
+ return $clone;
543
+ };
544
+
545
+ /**
546
+ * Updates original items index data.
547
+ * @protected
548
+ */
549
+ Owl.prototype.updateLocalContent = function() {
550
+
551
+ var k, item;
552
+
553
+ this.dom.$oItems = this.dom.$stage.find('.' + this.settings.itemClass).filter(function() {
554
+ return $(this).data('owl-item').clone === false;
555
+ });
556
+
557
+ this.num.oItems = this.dom.$oItems.length;
558
+ // update index on original items
559
+
560
+ for (k = 0; k < this.num.oItems; k++) {
561
+ item = this.dom.$oItems.eq(k);
562
+ item.data('owl-item').index = k;
563
+ }
564
+ };
565
+
566
+ /**
567
+ * Creates clones for infinity loop.
568
+ * @protected
569
+ */
570
+ Owl.prototype.loopClone = function() {
571
+ if (!this.settings.loop || this.num.oItems < this.settings.items) {
572
+ return false;
573
+ }
574
+
575
+ var append, prepend, i,
576
+ items = this.settings.items,
577
+ last = this.num.oItems - 1;
578
+
579
+ // if neighbour margin then add one more duplicat
580
+ if (this.settings.stagePadding && this.settings.items === 1) {
581
+ items += 1;
582
+ }
583
+ this.num.cItems = items * 2;
584
+
585
+ for (i = 0; i < items; i++) {
586
+ append = this.cloneItemContainer(this.dom.$oItems.eq(i));
587
+ prepend = this.cloneItemContainer(this.dom.$oItems.eq(last - i));
588
+
589
+ this.dom.$stage.append(append);
590
+ this.dom.$stage.prepend(prepend);
591
+ }
592
+
593
+ this.dom.$cItems = this.dom.$stage.find('.' + this.settings.itemClass).filter(function() {
594
+ return $(this).data('owl-item').clone === true;
595
+ });
596
+ };
597
+
598
+ /**
599
+ * Update cloned elements.
600
+ * @protected
601
+ */
602
+ Owl.prototype.reClone = function() {
603
+ // remove cloned items
604
+ if (this.dom.$cItems !== null) { // && (this.num.oItems !== 0 &&
605
+ // this.num.oItems <=
606
+ // this.settings.items)){
607
+ this.dom.$cItems.remove();
608
+ this.dom.$cItems = null;
609
+ this.num.cItems = 0;
610
+ }
611
+
612
+ if (!this.settings.loop) {
613
+ return;
614
+ }
615
+ // generete new elements
616
+ this.loopClone();
617
+ };
618
+
619
+ /**
620
+ * Updates all items index data.
621
+ * @protected
622
+ */
623
+ Owl.prototype.calculate = function() {
624
+
625
+ var i, j, elMinusMargin, dist, allItems, iWidth, mergeNumber, posLeft = 0, fullWidth = 0;
626
+
627
+ // element width minus neighbour
628
+ this.width.el = this.dom.$el.width() - (this.settings.stagePadding * 2);
629
+
630
+ // to check
631
+ this.width.view = this.dom.$el.width();
632
+
633
+ // calculate width minus addition margins
634
+ elMinusMargin = this.width.el - (this.settings.margin * (this.settings.items === 1 ? 0 : this.settings.items - 1));
635
+
636
+ // calculate element width and item width
637
+ this.width.el = this.width.el + this.settings.margin;
638
+ this.width.item = ((elMinusMargin / this.settings.items) + this.settings.margin).toFixed(3);
639
+
640
+ this.dom.$items = this.dom.$stage.find('.owl-item');
641
+ this.num.items = this.dom.$items.length;
642
+
643
+ // change to autoWidths
644
+ if (this.settings.autoWidth) {
645
+ this.dom.$items.css('width', '');
646
+ }
647
+
648
+ // Set grid array
649
+ this._coordinates = [];
650
+ this.num.merged = [];
651
+
652
+ // item distances
653
+ if (this.settings.rtl) {
654
+ dist = this.settings.center ? -((this.width.el) / 2) : 0;
655
+ } else {
656
+ dist = this.settings.center ? (this.width.el) / 2 : 0;
657
+ }
658
+
659
+ this.width.mergeStage = 0;
660
+
661
+ // Calculate items positions
662
+ for (i = 0; i < this.num.items; i++) {
663
+
664
+ // check merged items
665
+
666
+ if (this.settings.merge) {
667
+ mergeNumber = this.dom.$items.eq(i).find('[data-merge]').attr('data-merge') || 1;
668
+ if (this.settings.mergeFit && mergeNumber > this.settings.items) {
669
+ mergeNumber = this.settings.items;
670
+ }
671
+ this.num.merged.push(parseInt(mergeNumber));
672
+ this.width.mergeStage += this.width.item * this.num.merged[i];
673
+ } else {
674
+ this.num.merged.push(1);
675
+ }
676
+
677
+ iWidth = this.width.item * this.num.merged[i];
678
+
679
+ // autoWidth item size
680
+ if (this.settings.autoWidth) {
681
+ iWidth = this.dom.$items.eq(i).width() + this.settings.margin;
682
+ if (this.settings.rtl) {
683
+ this.dom.$items[i].style.marginLeft = this.settings.margin + 'px';
684
+ } else {
685
+ this.dom.$items[i].style.marginRight = this.settings.margin + 'px';
686
+ }
687
+
688
+ }
689
+ // push item position into array
690
+ this._coordinates.push(dist);
691
+
692
+ // update item data
693
+ this.dom.$items.eq(i).data('owl-item').posLeft = posLeft;
694
+ this.dom.$items.eq(i).data('owl-item').width = iWidth;
695
+
696
+ // dist starts from middle of stage if center
697
+ // posLeft always starts from 0
698
+ if (this.settings.rtl) {
699
+ dist += iWidth;
700
+ posLeft += iWidth;
701
+ } else {
702
+ dist -= iWidth;
703
+ posLeft -= iWidth;
704
+ }
705
+
706
+ fullWidth -= Math.abs(iWidth);
707
+
708
+ // update position if center
709
+ if (this.settings.center) {
710
+ this._coordinates[i] = !this.settings.rtl ? this._coordinates[i] - (iWidth / 2) : this._coordinates[i]
711
+ + (iWidth / 2);
712
+ }
713
+ }
714
+
715
+ if (this.settings.autoWidth) {
716
+ this.width.stage = this.settings.center ? Math.abs(fullWidth) : Math.abs(dist);
717
+ } else {
718
+ this.width.stage = Math.abs(fullWidth);
719
+ }
720
+
721
+ // update indexAbs on all items
722
+ allItems = this.num.oItems + this.num.cItems;
723
+
724
+ for (j = 0; j < allItems; j++) {
725
+ this.dom.$items.eq(j).data('owl-item').indexAbs = j;
726
+ }
727
+
728
+ // Recalculate grid
729
+ this.setSizes();
730
+ };
731
+
732
+ /**
733
+ * Set sizes on elements from `collectData`.
734
+ * @protected
735
+ * @todo CRAZY FIX!!! Doublecheck this!
736
+ */
737
+ Owl.prototype.setSizes = function() {
738
+
739
+ // show neighbours
740
+ if (this.settings.stagePadding !== false) {
741
+ this.dom.oStage.style.paddingLeft = this.settings.stagePadding + 'px';
742
+ this.dom.oStage.style.paddingRight = this.settings.stagePadding + 'px';
743
+ }
744
+
745
+ // if(this.width.stagePrev > this.width.stage){
746
+ if (this.settings.rtl) {
747
+ window.setTimeout($.proxy(function() {
748
+ this.dom.stage.style.width = this.width.stage + 'px';
749
+ }, this), 0);
750
+ } else {
751
+ this.dom.stage.style.width = this.width.stage + 'px';
752
+ }
753
+
754
+ for (var i = 0; i < this.num.items; i++) {
755
+
756
+ // Set items width
757
+ if (!this.settings.autoWidth) {
758
+ this.dom.$items[i].style.width = this.width.item - (this.settings.margin) + 'px';
759
+ }
760
+ // add margin
761
+ if (this.settings.rtl) {
762
+ this.dom.$items[i].style.marginLeft = this.settings.margin + 'px';
763
+ } else {
764
+ this.dom.$items[i].style.marginRight = this.settings.margin + 'px';
765
+ }
766
+
767
+ if (this.num.merged[i] !== 1 && !this.settings.autoWidth) {
768
+ this.dom.$items[i].style.width = (this.width.item * this.num.merged[i]) - (this.settings.margin) + 'px';
769
+ }
770
+ }
771
+
772
+ // save prev stage size
773
+ this.width.stagePrev = this.width.stage;
774
+ };
775
+
776
+ /**
777
+ * Updates all data by calling `refresh`.
778
+ * @protected
779
+ */
780
+ Owl.prototype.responsive = function() {
781
+
782
+ if (!this.num.oItems) {
783
+ return false;
784
+ }
785
+ // If El width hasnt change then stop responsive
786
+ var elChanged = this.isElWidthChanged();
787
+ if (!elChanged) {
788
+ return false;
789
+ }
790
+
791
+ if (this.trigger('resize').isDefaultPrevented()) {
792
+ return false;
793
+ }
794
+
795
+ this.state.responsive = true;
796
+ this.refresh();
797
+ this.state.responsive = false;
798
+
799
+ this.trigger('resized');
800
+ };
801
+
802
+ /**
803
+ * Refreshes the carousel primarily for adaptive purposes.
804
+ * @public
805
+ */
806
+ Owl.prototype.refresh = function() {
807
+ var current = this.dom.$oItems && this.dom.$oItems.eq(this.normalize(this.current(), true));
808
+
809
+ this.trigger('refresh');
810
+
811
+ // Update Options for given width
812
+ this.setResponsiveOptions();
813
+
814
+ // update info about local content
815
+ this.updateLocalContent();
816
+
817
+ // udpate options
818
+ this.optionsLogic();
819
+
820
+ // if no items then stop
821
+ if (this.num.oItems === 0) {
822
+ return false;
823
+ }
824
+
825
+ // Hide and Show methods helps here to set a proper widths.
826
+ // This prevents Scrollbar to be calculated in stage width
827
+ this.dom.$stage.addClass('owl-refresh');
828
+
829
+ // Remove clones and generate new ones
830
+ this.reClone();
831
+
832
+ // calculate
833
+ this.calculate();
834
+
835
+ // aaaand show.
836
+ this.dom.$stage.removeClass('owl-refresh');
837
+
838
+ if (!current) {
839
+ this.dom.oStage.scrollLeft = 0;
840
+ this.reset(this.dom.$oItems.eq(0).data('owl-item').indexAbs);
841
+ } else {
842
+ this.reset(current.data('owl-item').indexAbs); // fix that
843
+ }
844
+
845
+ this.state.orientation = window.orientation;
846
+
847
+ this.watchVisibility();
848
+
849
+ this.trigger('refreshed');
850
+ };
851
+
852
+ /**
853
+ * Updates information about current state of items (visibile, hidden, active, etc.).
854
+ * @protected
855
+ */
856
+ Owl.prototype.updateActiveItems = function() {
857
+ this.trigger('change', { property: { name: 'items', value: this.dom.$items } });
858
+
859
+ var i, j, item, ipos, iwidth, outsideView;
860
+
861
+ // clear states
862
+ for (i = 0; i < this.num.items; i++) {
863
+ this.dom.$items.eq(i).data('owl-item').active = false;
864
+ this.dom.$items.eq(i).data('owl-item').current = false;
865
+ this.dom.$items.eq(i).removeClass(this.settings.activeClass).removeClass(this.settings.centerClass);
866
+ }
867
+
868
+ this.num.active = 0;
869
+ padding = this.settings.stagePadding * 2;
870
+ stageX = this.coordinates(this.current()) + padding;
871
+ view = this.settings.rtl ? this.width.view : -this.width.view;
872
+
873
+ for (j = 0; j < this.num.items; j++) {
874
+
875
+ item = this.dom.$items.eq(j);
876
+ ipos = item.data('owl-item').posLeft;
877
+ iwidth = item.data('owl-item').width;
878
+ outsideView = this.settings.rtl ? ipos - iwidth - padding : ipos - iwidth + padding;
879
+
880
+ if ((this.op(ipos, '<=', stageX) && (this.op(ipos, '>', stageX + view)))
881
+ || (this.op(outsideView, '<', stageX) && this.op(outsideView, '>', stageX + view))) {
882
+
883
+ this.num.active++;
884
+
885
+ item.data('owl-item').active = true;
886
+ item.data('owl-item').current = true;
887
+ item.addClass(this.settings.activeClass);
888
+
889
+ if (!this.settings.lazyLoad) {
890
+ item.data('owl-item').loaded = true;
891
+ }
892
+ if (this.settings.loop) {
893
+ this.updateClonedItemsState(item.data('owl-item').index);
894
+ }
895
+ }
896
+ }
897
+
898
+ if (this.settings.center) {
899
+ this.dom.$items.eq(this.current()).addClass(this.settings.centerClass).data('owl-item').center = true;
900
+ }
901
+ this.trigger('changed', { property: { name: 'items', value: this.dom.$items } });
902
+ };
903
+
904
+ /**
905
+ * Sets current state on sibilings items for center.
906
+ * @protected
907
+ */
908
+ Owl.prototype.updateClonedItemsState = function(activeIndex) {
909
+
910
+ // find cloned center
911
+ var center, $el, i;
912
+ if (this.settings.center) {
913
+ center = this.dom.$items.eq(this.current()).data('owl-item').index;
914
+ }
915
+
916
+ for (i = 0; i < this.num.items; i++) {
917
+ $el = this.dom.$items.eq(i);
918
+ if ($el.data('owl-item').index === activeIndex) {
919
+ $el.data('owl-item').current = true;
920
+ if ($el.data('owl-item').index === center) {
921
+ $el.addClass(this.settings.centerClass);
922
+ }
923
+ }
924
+ }
925
+ };
926
+
927
+ /**
928
+ * Save internal event references and add event based functions.
929
+ * @protected
930
+ */
931
+ Owl.prototype.eventsCall = function() {
932
+ // Save events references
933
+ this.e._onDragStart = $.proxy(function(e) {
934
+ this.onDragStart(e);
935
+ }, this);
936
+ this.e._onDragMove = $.proxy(function(e) {
937
+ this.onDragMove(e);
938
+ }, this);
939
+ this.e._onDragEnd = $.proxy(function(e) {
940
+ this.onDragEnd(e);
941
+ }, this);
942
+ this.e._transitionEnd = $.proxy(function(e) {
943
+ this.transitionEnd(e);
944
+ }, this);
945
+ this.e._resizer = $.proxy(function() {
946
+ this.responsiveTimer();
947
+ }, this);
948
+ this.e._responsiveCall = $.proxy(function() {
949
+ this.responsive();
950
+ }, this);
951
+ this.e._preventClick = $.proxy(function(e) {
952
+ this.preventClick(e);
953
+ }, this);
954
+ };
955
+
956
+ /**
957
+ * Checks window `resize` event.
958
+ * @protected
959
+ */
960
+ Owl.prototype.responsiveTimer = function() {
961
+ if (this.viewport() === this.width.prevWindow) {
962
+ return false;
963
+ }
964
+ window.clearTimeout(this.resizeTimer);
965
+
966
+ this.resizeTimer = window.setTimeout(this.e._responsiveCall, this.settings.responsiveRefreshRate);
967
+ this.width.prevWindow = this.viewport();
968
+ };
969
+
970
+ /**
971
+ * Checks for touch/mouse drag options and add necessery event handlers.
972
+ * @protected
973
+ */
974
+ Owl.prototype.internalEvents = function() {
975
+ var isTouch = isTouchSupport(),
976
+ isTouchIE = isTouchSupportIE();
977
+
978
+ if (isTouch && !isTouchIE) {
979
+ this.dragType = [ 'touchstart', 'touchmove', 'touchend', 'touchcancel' ];
980
+ } else if (isTouch && isTouchIE) {
981
+ this.dragType = [ 'MSPointerDown', 'MSPointerMove', 'MSPointerUp', 'MSPointerCancel' ];
982
+ } else {
983
+ this.dragType = [ 'mousedown', 'mousemove', 'mouseup' ];
984
+ }
985
+
986
+ if ((isTouch || isTouchIE) && this.settings.touchDrag) {
987
+ // touch cancel event
988
+ this.on(document, this.dragType[3], this.e._onDragEnd);
989
+
990
+ } else {
991
+ // firefox startdrag fix - addeventlistener doesnt work here :/
992
+ this.dom.$stage.on('dragstart', function() {
993
+ return false;
994
+ });
995
+
996
+ if (this.settings.mouseDrag) {
997
+ // disable text select
998
+ this.dom.stage.onselectstart = function() {
999
+ return false;
1000
+ };
1001
+ } else {
1002
+ // enable text select
1003
+ this.dom.$el.addClass('owl-text-select-on');
1004
+ }
1005
+ }
1006
+
1007
+ // Catch transitionEnd event
1008
+ if (this.transitionEndVendor) {
1009
+ this.on(this.dom.stage, this.transitionEndVendor, this.e._transitionEnd, false);
1010
+ }
1011
+
1012
+ // Responsive
1013
+ if (this.settings.responsive !== false) {
1014
+ this.on(window, 'resize', this.e._resizer, false);
1015
+ }
1016
+
1017
+ this.dragEvents();
1018
+ };
1019
+
1020
+ /**
1021
+ * Triggers event handlers for drag events.
1022
+ * @protected
1023
+ */
1024
+ Owl.prototype.dragEvents = function() {
1025
+
1026
+ if (this.settings.touchDrag && (this.dragType[0] === 'touchstart' || this.dragType[0] === 'MSPointerDown')) {
1027
+ this.on(this.dom.stage, this.dragType[0], this.e._onDragStart, false);
1028
+ } else if (this.settings.mouseDrag && this.dragType[0] === 'mousedown') {
1029
+ this.on(this.dom.stage, this.dragType[0], this.e._onDragStart, false);
1030
+ } else {
1031
+ this.off(this.dom.stage, this.dragType[0], this.e._onDragStart);
1032
+ }
1033
+ };
1034
+
1035
+ /**
1036
+ * Handles touchstart/mousedown event.
1037
+ * @protected
1038
+ * @param {Event} event - The event arguments.
1039
+ */
1040
+ Owl.prototype.onDragStart = function(event) {
1041
+ var ev, isTouchEvent, pageX, pageY, animatedPos;
1042
+
1043
+ ev = event.originalEvent || event || window.event;
1044
+
1045
+ // prevent right click
1046
+ if (ev.which === 3) {
1047
+ return false;
1048
+ }
1049
+
1050
+ if (this.dragType[0] === 'mousedown') {
1051
+ this.dom.$stage.addClass('owl-grab');
1052
+ }
1053
+
1054
+ this.trigger('drag');
1055
+ this.drag.startTime = new Date().getTime();
1056
+ this.speed(0);
1057
+ this.state.isTouch = true;
1058
+ this.state.isScrolling = false;
1059
+ this.state.isSwiping = false;
1060
+ this.drag.distance = 0;
1061
+
1062
+ // if is 'touchstart'
1063
+ isTouchEvent = ev.type === 'touchstart';
1064
+ pageX = isTouchEvent ? event.targetTouches[0].pageX : (ev.pageX || ev.clientX);
1065
+ pageY = isTouchEvent ? event.targetTouches[0].pageY : (ev.pageY || ev.clientY);
1066
+
1067
+ // get stage position left
1068
+ this.drag.offsetX = this.dom.$stage.position().left - this.settings.stagePadding;
1069
+ this.drag.offsetY = this.dom.$stage.position().top;
1070
+
1071
+ if (this.settings.rtl) {
1072
+ this.drag.offsetX = this.dom.$stage.position().left + this.width.stage - this.width.el
1073
+ + this.settings.margin;
1074
+ }
1075
+
1076
+ // catch position // ie to fix
1077
+ if (this.state.inMotion && this.support3d) {
1078
+ animatedPos = this.getTransformProperty();
1079
+ this.drag.offsetX = animatedPos;
1080
+ this.animate(animatedPos);
1081
+ this.state.inMotion = true;
1082
+ } else if (this.state.inMotion && !this.support3d) {
1083
+ this.state.inMotion = false;
1084
+ return false;
1085
+ }
1086
+
1087
+ this.drag.startX = pageX - this.drag.offsetX;
1088
+ this.drag.startY = pageY - this.drag.offsetY;
1089
+
1090
+ this.drag.start = pageX - this.drag.startX;
1091
+ this.drag.targetEl = ev.target || ev.srcElement;
1092
+ this.drag.updatedX = this.drag.start;
1093
+
1094
+ // to do/check
1095
+ // prevent links and images dragging;
1096
+ if (this.drag.targetEl.tagName === "IMG" || this.drag.targetEl.tagName === "A") {
1097
+ this.drag.targetEl.draggable = false;
1098
+ }
1099
+
1100
+ this.on(document, this.dragType[1], this.e._onDragMove, false);
1101
+ this.on(document, this.dragType[2], this.e._onDragEnd, false);
1102
+ };
1103
+
1104
+ /**
1105
+ * Handles the touchmove/mousemove events.
1106
+ * @todo Simplify
1107
+ * @protected
1108
+ * @param {Event} event - The event arguments.
1109
+ */
1110
+ Owl.prototype.onDragMove = function(event) {
1111
+ var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull;
1112
+
1113
+ if (!this.state.isTouch) {
1114
+ return;
1115
+ }
1116
+
1117
+ if (this.state.isScrolling) {
1118
+ return;
1119
+ }
1120
+
1121
+ ev = event.originalEvent || event || window.event;
1122
+
1123
+ // if is 'touchstart'
1124
+ isTouchEvent = ev.type == 'touchmove';
1125
+ pageX = isTouchEvent ? ev.targetTouches[0].pageX : (ev.pageX || ev.clientX);
1126
+ pageY = isTouchEvent ? ev.targetTouches[0].pageY : (ev.pageY || ev.clientY);
1127
+
1128
+ // Drag Direction
1129
+ this.drag.currentX = pageX - this.drag.startX;
1130
+ this.drag.currentY = pageY - this.drag.startY;
1131
+ this.drag.distance = this.drag.currentX - this.drag.offsetX;
1132
+
1133
+ // Check move direction
1134
+ if (this.drag.distance < 0) {
1135
+ this.state.direction = this.settings.rtl ? 'right' : 'left';
1136
+ } else if (this.drag.distance > 0) {
1137
+ this.state.direction = this.settings.rtl ? 'left' : 'right';
1138
+ }
1139
+ // Loop
1140
+ if (this.settings.loop) {
1141
+ if (this.op(this.drag.currentX, '>', this.coordinates(this.minimum())) && this.state.direction === 'right') {
1142
+ this.drag.currentX -= (this.settings.center && this.coordinates(0)) - this.coordinates(this.num.oItems);
1143
+ } else if (this.op(this.drag.currentX, '<', this.coordinates(this.maximum())) && this.state.direction === 'left') {
1144
+ this.drag.currentX += (this.settings.center && this.coordinates(0)) - this.coordinates(this.num.oItems);
1145
+ }
1146
+ } else {
1147
+ // pull
1148
+ minValue = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
1149
+ maxValue = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
1150
+ pull = this.settings.pullDrag ? this.drag.distance / 5 : 0;
1151
+ this.drag.currentX = Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull);
1152
+ }
1153
+
1154
+ // Lock browser if swiping horizontal
1155
+
1156
+ if ((this.drag.distance > 8 || this.drag.distance < -8)) {
1157
+ if (ev.preventDefault !== undefined) {
1158
+ ev.preventDefault();
1159
+ } else {
1160
+ ev.returnValue = false;
1161
+ }
1162
+ this.state.isSwiping = true;
1163
+ }
1164
+
1165
+ this.drag.updatedX = this.drag.currentX;
1166
+
1167
+ // Lock Owl if scrolling
1168
+ if ((this.drag.currentY > 16 || this.drag.currentY < -16) && this.state.isSwiping === false) {
1169
+ this.state.isScrolling = true;
1170
+ this.drag.updatedX = this.drag.start;
1171
+ }
1172
+
1173
+ this.animate(this.drag.updatedX);
1174
+ };
1175
+
1176
+ /**
1177
+ * Handles the touchend/mouseup events.
1178
+ * @protected
1179
+ */
1180
+ Owl.prototype.onDragEnd = function() {
1181
+ var compareTimes, distanceAbs, closest;
1182
+
1183
+ if (!this.state.isTouch) {
1184
+ return;
1185
+ }
1186
+ if (this.dragType[0] === 'mousedown') {
1187
+ this.dom.$stage.removeClass('owl-grab');
1188
+ }
1189
+
1190
+ this.trigger('dragged');
1191
+
1192
+ // prevent links and images dragging;
1193
+ this.drag.targetEl.removeAttribute("draggable");
1194
+
1195
+ // remove drag event listeners
1196
+
1197
+ this.state.isTouch = false;
1198
+ this.state.isScrolling = false;
1199
+ this.state.isSwiping = false;
1200
+
1201
+ // to check
1202
+ if (this.drag.distance === 0 && this.state.inMotion !== true) {
1203
+ this.state.inMotion = false;
1204
+ return false;
1205
+ }
1206
+
1207
+ // prevent clicks while scrolling
1208
+
1209
+ this.drag.endTime = new Date().getTime();
1210
+ compareTimes = this.drag.endTime - this.drag.startTime;
1211
+ distanceAbs = Math.abs(this.drag.distance);
1212
+
1213
+ // to test
1214
+ if (distanceAbs > 3 || compareTimes > 300) {
1215
+ this.removeClick(this.drag.targetEl);
1216
+ }
1217
+
1218
+ closest = this.closest(this.drag.updatedX);
1219
+
1220
+ this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
1221
+ this.current(closest);
1222
+
1223
+ // if pullDrag is off then fire transitionEnd event manually when stick
1224
+ // to border
1225
+ if (!this.settings.pullDrag && this.drag.updatedX === this.coordinates(closest)) {
1226
+ this.transitionEnd();
1227
+ }
1228
+
1229
+ this.drag.distance = 0;
1230
+
1231
+ this.off(document, this.dragType[1], this.e._onDragMove);
1232
+ this.off(document, this.dragType[2], this.e._onDragEnd);
1233
+ };
1234
+
1235
+ /**
1236
+ * Attaches `preventClick` to disable link while swipping.
1237
+ * @protected
1238
+ * @param {HTMLElement} [target] - The target of the `click` event.
1239
+ */
1240
+ Owl.prototype.removeClick = function(target) {
1241
+ this.drag.targetEl = target;
1242
+ $(target).on('click.preventClick', this.e._preventClick);
1243
+ // to make sure click is removed:
1244
+ window.setTimeout(function() {
1245
+ $(target).off('click.preventClick');
1246
+ }, 300);
1247
+ };
1248
+
1249
+ /**
1250
+ * Suppresses click event.
1251
+ * @protected
1252
+ * @param {Event} ev - The event arguments.
1253
+ */
1254
+ Owl.prototype.preventClick = function(ev) {
1255
+ if (ev.preventDefault) {
1256
+ ev.preventDefault();
1257
+ } else {
1258
+ ev.returnValue = false;
1259
+ }
1260
+ if (ev.stopPropagation) {
1261
+ ev.stopPropagation();
1262
+ }
1263
+ $(ev.target).off('click.preventClick');
1264
+ };
1265
+
1266
+ /**
1267
+ * Catches stage position while animate (only CSS3).
1268
+ * @protected
1269
+ * @returns
1270
+ */
1271
+ Owl.prototype.getTransformProperty = function() {
1272
+ var transform, matrix3d;
1273
+
1274
+ transform = window.getComputedStyle(this.dom.stage, null).getPropertyValue(this.vendorName + 'transform');
1275
+ // var transform = this.dom.$stage.css(this.vendorName + 'transform')
1276
+ transform = transform.replace(/matrix(3d)?\(|\)/g, '').split(',');
1277
+ matrix3d = transform.length === 16;
1278
+
1279
+ return matrix3d !== true ? transform[4] : transform[12];
1280
+ };
1281
+
1282
+ /**
1283
+ * Gets absolute position of the closest item for a coordinate.
1284
+ * @protected
1285
+ * @param {Number} coordinate - The coordinate in pixel.
1286
+ * @return {Number} - The absolute position of the closest item.
1287
+ */
1288
+ Owl.prototype.closest = function(coordinate) {
1289
+ var position = 0, pull = 30;
1290
+
1291
+ if (!this.settings.freeDrag) {
1292
+ // check closest item
1293
+ $.each(this.coordinates(), $.proxy(function(index, value) {
1294
+ if (coordinate > value - pull && coordinate < value + pull) {
1295
+ position = index;
1296
+ } else if (this.op(coordinate, '<', value)
1297
+ && this.op(coordinate, '>', this.coordinates(index + 1) || value - this.width.el)) {
1298
+ position = this.state.direction === 'left' ? index + 1 : index;
1299
+ }
1300
+ }, this));
1301
+ }
1302
+
1303
+ if (!this.settings.loop) {
1304
+ // non loop boundries
1305
+ if (this.op(coordinate, '>', this.coordinates(this.minimum()))) {
1306
+ position = coordinate = this.minimum();
1307
+ } else if (this.op(coordinate, '<', this.coordinates(this.maximum()))) {
1308
+ position = coordinate = this.maximum();
1309
+ }
1310
+ }
1311
+
1312
+ return position;
1313
+ };
1314
+
1315
+ /**
1316
+ * Animates the stage.
1317
+ * @public
1318
+ * @param {Number} coordinate - The coordinate in pixels.
1319
+ */
1320
+ Owl.prototype.animate = function(coordinate) {
1321
+ this.trigger('translate');
1322
+ this.state.inMotion = this.speed() > 0;
1323
+
1324
+ if (this.support3d) {
1325
+ this.dom.$stage.css({
1326
+ transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)',
1327
+ transition: (this.speed() / 1000) + 's'
1328
+ });
1329
+ } else if (this.state.isTouch) {
1330
+ this.dom.$stage.css({
1331
+ left: coordinate + 'px'
1332
+ });
1333
+ } else {
1334
+ this.dom.$stage.animate({
1335
+ left: coordinate
1336
+ }, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function() {
1337
+ if (this.state.inMotion) {
1338
+ this.transitionEnd();
1339
+ }
1340
+ }, this));
1341
+ }
1342
+ };
1343
+
1344
+ /**
1345
+ * Sets the absolute position of the current item.
1346
+ * @public
1347
+ * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1348
+ * @returns {Number} - The absolute position of the current item.
1349
+ */
1350
+ Owl.prototype.current = function(position) {
1351
+ if (position === undefined) {
1352
+ return this._current;
1353
+ }
1354
+
1355
+ if (this.num.oItems === 0) {
1356
+ return undefined;
1357
+ }
1358
+
1359
+ position = this.normalize(position);
1360
+
1361
+ if (this._current === position) {
1362
+ this.animate(this.coordinates(this._current));
1363
+ } else {
1364
+ var event = this.trigger('change', { property: { name: 'position', value: position } });
1365
+
1366
+ if (event.data !== undefined) {
1367
+ position = this.normalize(event.data);
1368
+ }
1369
+
1370
+ this._current = position;
1371
+
1372
+ this.animate(this.coordinates(this._current));
1373
+
1374
+ this.updateActiveItems();
1375
+
1376
+ this.trigger('changed', { property: { name: 'position', value: this._current } });
1377
+ }
1378
+
1379
+ return this._current;
1380
+ };
1381
+
1382
+ /**
1383
+ * Resets the absolute position of the current item.
1384
+ * @public
1385
+ * @param {Number} position - The absolute position of the new item.
1386
+ */
1387
+ Owl.prototype.reset = function(position) {
1388
+ this.suppress([ 'change', 'changed' ]);
1389
+ this.speed(0);
1390
+ this.current(position);
1391
+ this.release([ 'change', 'changed' ]);
1392
+ };
1393
+
1394
+ /**
1395
+ * Normalizes an absolute position for an item.
1396
+ * @public
1397
+ * @param {Number} position - The absolute position to normalize.
1398
+ * @param {Boolean} [relative=false] - Whether to return a relative position or not.
1399
+ * @return {Number} - The normalized position.
1400
+ */
1401
+ Owl.prototype.normalize = function(position, relative) {
1402
+ if (position === undefined || !this.dom.$items) {
1403
+ return undefined;
1404
+ }
1405
+
1406
+ if (this.settings.loop) {
1407
+ var n = this.dom.$items.length;
1408
+ position = ((position % n) + n) % n;
1409
+ } else {
1410
+ position = Math.max(this.minimum(), Math.min(this.maximum(), position));
1411
+ }
1412
+
1413
+ return relative ? this.dom.$items.eq(position).data('owl-item').index : position;
1414
+ };
1415
+
1416
+ /**
1417
+ * Gets the absolute maximum position for an item.
1418
+ * @public
1419
+ * @returns {Number}
1420
+ */
1421
+ Owl.prototype.maximum = function() {
1422
+ var maximum, width,
1423
+ settings = this.settings;
1424
+
1425
+ if (!settings.loop && settings.center) {
1426
+ maximum = this.num.oItems - 1;
1427
+ } else if (!settings.loop && !settings.center) {
1428
+ maximum = this.num.oItems - settings.items;
1429
+ } else if (settings.loop || settings.center) {
1430
+ maximum = this.num.oItems + settings.items;
1431
+ } else if (settings.autoWidth || settings.merge) {
1432
+ revert = settings.rtl ? 1 : -1;
1433
+ width = this.dom.$stage.width() - this.$el.width();
1434
+ $.each(this.coordinates(), function(index, coordinate) {
1435
+ if (coordinate * revert >= width) {
1436
+ return false;
1437
+ }
1438
+ maximum = index + 1;
1439
+ });
1440
+ } else {
1441
+ throw 'Can not detect maximum absolute position.'
1442
+ }
1443
+
1444
+ return maximum;
1445
+ };
1446
+
1447
+ /**
1448
+ * Gets the absolute minimum position for an item.
1449
+ * @public
1450
+ * @returns {Number}
1451
+ */
1452
+ Owl.prototype.minimum = function() {
1453
+ return this.dom.$oItems.eq(0).data('owl-item').indexAbs;
1454
+ };
1455
+
1456
+ /**
1457
+ * Sets the current animation speed.
1458
+ * @public
1459
+ * @param {Number} [speed] - The animation speed in millisecondsor nothing to leave it unchanged.
1460
+ * @returns {Number} - The current animation speed in milliseconds.
1461
+ */
1462
+ Owl.prototype.speed = function(speed) {
1463
+ if (speed !== undefined) {
1464
+ this._speed = speed;
1465
+ }
1466
+
1467
+ return this._speed;
1468
+ };
1469
+
1470
+ /**
1471
+ * Gets the coordinate for an item.
1472
+ * @public
1473
+ * @param {Number} [position] - The absolute position of the item.
1474
+ * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1475
+ */
1476
+ Owl.prototype.coordinates = function(position) {
1477
+ return position !== undefined ? this._coordinates[position] : this._coordinates;
1478
+ };
1479
+
1480
+ /**
1481
+ * Calculates the speed for a translation.
1482
+ * @protected
1483
+ * @param {Number} from - The absolute position of the start item.
1484
+ * @param {Number} to - The absolute position of the target item.
1485
+ * @param {Number} [factor=undefined] - The time factor in milliseconds.
1486
+ * @returns {Number} - The time in milliseconds for the translation.
1487
+ */
1488
+ Owl.prototype.duration = function(from, to, factor) {
1489
+ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1490
+ };
1491
+
1492
+ /**
1493
+ * Slides to the specified item.
1494
+ * @public
1495
+ * @param {Number} position - The position of the item.
1496
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1497
+ */
1498
+ Owl.prototype.to = function(position, speed) {
1499
+ if (this.settings.loop) {
1500
+ var distance = position - this.normalize(this.current(), true),
1501
+ revert = this.current(),
1502
+ before = this.current(),
1503
+ after = this.current() + distance,
1504
+ direction = before - after < 0 ? true : false;
1505
+
1506
+ if (after < this.settings.items && direction === false) {
1507
+ revert = this.num.items - (this.settings.items - before) - this.settings.items;
1508
+ this.reset(revert);
1509
+ } else if (after >= this.num.items - this.settings.items && direction === true) {
1510
+ revert = before - this.num.oItems;
1511
+ this.reset(revert);
1512
+ }
1513
+ window.clearTimeout(this.e._goToLoop);
1514
+ this.e._goToLoop = window.setTimeout($.proxy(function() {
1515
+ this.speed(this.duration(this.current(), revert + distance, speed));
1516
+ this.current(revert + distance);
1517
+ }, this), 30);
1518
+ } else {
1519
+ this.speed(this.duration(this.current(), position, speed));
1520
+ this.current(position);
1521
+ }
1522
+ };
1523
+
1524
+ /**
1525
+ * Slides to the next item.
1526
+ * @public
1527
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1528
+ */
1529
+ Owl.prototype.next = function(speed) {
1530
+ speed = speed || false;
1531
+ this.to(this.normalize(this.current(), true) + 1, speed);
1532
+ };
1533
+
1534
+ /**
1535
+ * Slides to the previous item.
1536
+ * @public
1537
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1538
+ */
1539
+ Owl.prototype.prev = function(speed) {
1540
+ speed = speed || false;
1541
+ this.to(this.normalize(this.current(), true) - 1, speed);
1542
+ };
1543
+
1544
+ /**
1545
+ * Handles the end of an animation.
1546
+ * @protected
1547
+ * @param {Event} event - The event arguments.
1548
+ */
1549
+ Owl.prototype.transitionEnd = function(event) {
1550
+
1551
+ // if css2 animation then event object is undefined
1552
+ if (event !== undefined) {
1553
+ event.stopPropagation();
1554
+
1555
+ // Catch only owl-stage transitionEnd event
1556
+ var eventTarget = event.target || event.srcElement || event.originalTarget;
1557
+ if (eventTarget !== this.dom.stage) {
1558
+ return false;
1559
+ }
1560
+ }
1561
+
1562
+ this.state.inMotion = false;
1563
+ this.trigger('translated');
1564
+ };
1565
+
1566
+ /**
1567
+ * Checks if element width has changed
1568
+ * @protected
1569
+ * @returns {Booelan}
1570
+ */
1571
+ Owl.prototype.isElWidthChanged = function() {
1572
+ var newElWidth = this.dom.$el.width() - this.settings.stagePadding, // to
1573
+ // check
1574
+ prevElWidth = this.width.el + this.settings.margin;
1575
+ return newElWidth !== prevElWidth;
1576
+ };
1577
+
1578
+ /**
1579
+ * Gets viewport width.
1580
+ * @protected
1581
+ * @return {Number} - The width in pixel.
1582
+ */
1583
+ Owl.prototype.viewport = function() {
1584
+ var width;
1585
+ if (this.options.responsiveBaseElement !== window) {
1586
+ width = $(this.options.responsiveBaseElement).width();
1587
+ } else if (window.innerWidth) {
1588
+ width = window.innerWidth;
1589
+ } else if (document.documentElement && document.documentElement.clientWidth) {
1590
+ width = document.documentElement.clientWidth;
1591
+ } else {
1592
+ throw 'Can not detect viewport width.';
1593
+ }
1594
+ return width;
1595
+ };
1596
+
1597
+ /**
1598
+ * Replaces the current content.
1599
+ * @public
1600
+ * @param {HTMLElement|jQuery|String} content - The new content.
1601
+ */
1602
+ Owl.prototype.insertContent = function(content) {
1603
+ this.dom.$stage.empty();
1604
+ this.fetchContent(content);
1605
+ this.refresh();
1606
+ };
1607
+
1608
+ /**
1609
+ * Adds an item.
1610
+ * @public
1611
+ * @param {HTMLElement|jQuery|String} content - The item content to add.
1612
+ * @param {Number} [position=0] - The position at which to insert the item.
1613
+ */
1614
+ Owl.prototype.addItem = function(content, position) {
1615
+ var $item = this.createItemContainer();
1616
+
1617
+ position = position || 0;
1618
+ // wrap content
1619
+ this.initializeItemContainer($item, content);
1620
+ // if carousel is empty then append item
1621
+ if (this.dom.$oItems.length === 0) {
1622
+ this.dom.$stage.append($item);
1623
+ } else {
1624
+ // append item
1625
+ if (pos !== -1) {
1626
+ this.dom.$oItems.eq(position).before($item);
1627
+ } else {
1628
+ this.dom.$oItems.eq(position).after($item);
1629
+ }
1630
+ }
1631
+ // update and calculate carousel
1632
+ this.refresh();
1633
+ };
1634
+
1635
+ /**
1636
+ * Removes an item.
1637
+ * @public
1638
+ * @param {Number} pos - The position of the item.
1639
+ */
1640
+ Owl.prototype.removeItem = function(pos) {
1641
+ this.dom.$oItems.eq(pos).remove();
1642
+ this.refresh();
1643
+ };
1644
+
1645
+ /**
1646
+ * Adds triggerable events.
1647
+ * @protected
1648
+ */
1649
+ Owl.prototype.addTriggerableEvents = function() {
1650
+ var handler = $.proxy(function(callback, event) {
1651
+ return $.proxy(function(e) {
1652
+ if (e.relatedTarget !== this) {
1653
+ this.suppress([ event ]);
1654
+ callback.apply(this, [].slice.call(arguments, 1));
1655
+ this.release([ event ]);
1656
+ }
1657
+ }, this);
1658
+ }, this);
1659
+
1660
+ $.each({
1661
+ 'next': this.next,
1662
+ 'prev': this.prev,
1663
+ 'to': this.to,
1664
+ 'destroy': this.destroy,
1665
+ 'refresh': this.refresh,
1666
+ 'replace': this.insertContent,
1667
+ 'add': this.addItem,
1668
+ 'remove': this.removeItem
1669
+ }, $.proxy(function(event, callback) {
1670
+ this.dom.$el.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel'));
1671
+ }, this));
1672
+
1673
+ };
1674
+
1675
+ /**
1676
+ * Watches the visibility of the carousel element.
1677
+ * @protected
1678
+ */
1679
+ Owl.prototype.watchVisibility = function() {
1680
+
1681
+ // test on zepto
1682
+ if (!isElVisible(this.dom.el)) {
1683
+ this.dom.$el.addClass('owl-hidden');
1684
+ window.clearInterval(this.e._checkVisibile);
1685
+ this.e._checkVisibile = window.setInterval($.proxy(checkVisible, this), 500);
1686
+ }
1687
+
1688
+ function isElVisible(el) {
1689
+ return el.offsetWidth > 0 && el.offsetHeight > 0;
1690
+ }
1691
+
1692
+ function checkVisible() {
1693
+ if (isElVisible(this.dom.el)) {
1694
+ this.dom.$el.removeClass('owl-hidden');
1695
+ this.refresh();
1696
+ window.clearInterval(this.e._checkVisibile);
1697
+ }
1698
+ }
1699
+ };
1700
+
1701
+ /**
1702
+ * Preloads images with auto width.
1703
+ * @protected
1704
+ * @todo Still to test
1705
+ */
1706
+ Owl.prototype.preloadAutoWidthImages = function(imgs) {
1707
+ var loaded, that, $el, img;
1708
+
1709
+ loaded = 0;
1710
+ that = this;
1711
+ imgs.each(function(i, el) {
1712
+ $el = $(el);
1713
+ img = new Image();
1714
+
1715
+ img.onload = function() {
1716
+ loaded++;
1717
+ $el.attr('src', img.src);
1718
+ $el.css('opacity', 1);
1719
+ if (loaded >= imgs.length) {
1720
+ that.state.imagesLoaded = true;
1721
+ that.init();
1722
+ }
1723
+ };
1724
+
1725
+ img.src = $el.attr('src') || $el.attr('data-src') || $el.attr('data-src-retina');
1726
+ });
1727
+ };
1728
+
1729
+ /**
1730
+ * Destroys the carousel.
1731
+ * @public
1732
+ */
1733
+ Owl.prototype.destroy = function() {
1734
+
1735
+ if (this.dom.$el.hasClass(this.settings.themeClass)) {
1736
+ this.dom.$el.removeClass(this.settings.themeClass);
1737
+ }
1738
+
1739
+ if (this.settings.responsive !== false) {
1740
+ this.off(window, 'resize', this.e._resizer);
1741
+ }
1742
+
1743
+ if (this.transitionEndVendor) {
1744
+ this.off(this.dom.stage, this.transitionEndVendor, this.e._transitionEnd);
1745
+ }
1746
+
1747
+ for ( var i in this.plugins) {
1748
+ this.plugins[i].destroy();
1749
+ }
1750
+
1751
+ if (this.settings.mouseDrag || this.settings.touchDrag) {
1752
+ this.off(this.dom.stage, this.dragType[0], this.e._onDragStart);
1753
+ if (this.settings.mouseDrag) {
1754
+ this.off(document, this.dragType[3], this.e._onDragStart);
1755
+ }
1756
+ if (this.settings.mouseDrag) {
1757
+ this.dom.$stage.off('dragstart', function() {
1758
+ return false;
1759
+ });
1760
+ this.dom.stage.onselectstart = function() {
1761
+ };
1762
+ }
1763
+ }
1764
+
1765
+ // Remove event handlers in the ".owl.carousel" namespace
1766
+ this.dom.$el.off('.owl');
1767
+
1768
+ if (this.dom.$cItems !== null) {
1769
+ this.dom.$cItems.remove();
1770
+ }
1771
+ this.e = null;
1772
+ this.dom.$el.data('owlCarousel', null);
1773
+ delete this.dom.el.owlCarousel;
1774
+
1775
+ this.dom.$stage.unwrap();
1776
+ this.dom.$items.unwrap();
1777
+ this.dom.$items.contents().unwrap();
1778
+ this.dom = null;
1779
+ };
1780
+
1781
+ /**
1782
+ * Operators to calculate right-to-left and left-to-right.
1783
+ * @protected
1784
+ * @param {Number} [a] - The left side operand.
1785
+ * @param {String} [o] - The operator.
1786
+ * @param {Number} [b] - The right side operand.
1787
+ */
1788
+ Owl.prototype.op = function(a, o, b) {
1789
+ var rtl = this.settings.rtl;
1790
+ switch (o) {
1791
+ case '<':
1792
+ return rtl ? a > b : a < b;
1793
+ case '>':
1794
+ return rtl ? a < b : a > b;
1795
+ case '>=':
1796
+ return rtl ? a <= b : a >= b;
1797
+ case '<=':
1798
+ return rtl ? a >= b : a <= b;
1799
+ default:
1800
+ break;
1801
+ }
1802
+ };
1803
+
1804
+ /**
1805
+ * Attaches to an internal event.
1806
+ * @protected
1807
+ * @param {HTMLElement} element - The event source.
1808
+ * @param {String} event - The event name.
1809
+ * @param {Function} listener - The event handler to attach.
1810
+ * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
1811
+ */
1812
+ Owl.prototype.on = function(element, event, listener, capture) {
1813
+ if (element.addEventListener) {
1814
+ element.addEventListener(event, listener, capture);
1815
+ } else if (element.attachEvent) {
1816
+ element.attachEvent('on' + event, listener);
1817
+ }
1818
+ };
1819
+
1820
+ /**
1821
+ * Detaches from an internal event.
1822
+ * @protected
1823
+ * @param {HTMLElement} element - The event source.
1824
+ * @param {String} event - The event name.
1825
+ * @param {Function} listener - The attached event handler to detach.
1826
+ * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1827
+ */
1828
+ Owl.prototype.off = function(element, event, listener, capture) {
1829
+ if (element.removeEventListener) {
1830
+ element.removeEventListener(event, listener, capture);
1831
+ } else if (element.detachEvent) {
1832
+ element.detachEvent('on' + event, listener);
1833
+ }
1834
+ };
1835
+
1836
+ /**
1837
+ * Triggers an public event.
1838
+ * @protected
1839
+ * @param {String} name - The event name.
1840
+ * @param {*} [data=null] - The event data.
1841
+ * @param {String} [namespace=.owl.carousel] - The event namespace.
1842
+ * @returns {Event} - The event arguments.
1843
+ */
1844
+ Owl.prototype.trigger = function(name, data, namespace) {
1845
+ var status = {
1846
+ item: { count: this.num.oItems, index: this.current() }
1847
+ }, handler = $.camelCase(
1848
+ $.grep([ 'on', name, namespace ], function(v) { return v })
1849
+ .join('-').toLowerCase()
1850
+ ), event = $.Event(
1851
+ [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1852
+ $.extend({ relatedTarget: this }, status, data)
1853
+ );
1854
+
1855
+ if (!this._supress[event.type]) {
1856
+ $.each(this.plugins, function(name, plugin) {
1857
+ if (plugin.onTrigger) {
1858
+ plugin.onTrigger(event);
1859
+ }
1860
+ });
1861
+
1862
+ this.dom.$el.trigger(event);
1863
+
1864
+ if (typeof this.settings[handler] === 'function') {
1865
+ this.settings[handler].apply(this, event);
1866
+ }
1867
+ }
1868
+
1869
+ return event;
1870
+ };
1871
+
1872
+ /**
1873
+ * Suppresses events.
1874
+ * @protected
1875
+ * @param {Array.<String>} events - The events to suppress.
1876
+ */
1877
+ Owl.prototype.suppress = function(events) {
1878
+ $.each(events, $.proxy(function(index, event) {
1879
+ this._supress[event] = true;
1880
+ }, this));
1881
+ }
1882
+
1883
+ /**
1884
+ * Releases suppressed events.
1885
+ * @protected
1886
+ * @param {Array.<String>} events - The events to release.
1887
+ */
1888
+ Owl.prototype.release = function(events) {
1889
+ $.each(events, $.proxy(function(index, event) {
1890
+ delete this._supress[event];
1891
+ }, this));
1892
+ }
1893
+
1894
+ /**
1895
+ * Checks the availability of some browser features.
1896
+ * @protected
1897
+ */
1898
+ Owl.prototype.browserSupport = function() {
1899
+ this.support3d = isPerspective();
1900
+
1901
+ if (this.support3d) {
1902
+ this.transformVendor = isTransform();
1903
+
1904
+ // take transitionend event name by detecting transition
1905
+ var endVendors = [ 'transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd' ];
1906
+ this.transitionEndVendor = endVendors[isTransition()];
1907
+
1908
+ // take vendor name from transform name
1909
+ this.vendorName = this.transformVendor.replace(/Transform/i, '');
1910
+ this.vendorName = this.vendorName !== '' ? '-' + this.vendorName.toLowerCase() + '-' : '';
1911
+ }
1912
+
1913
+ this.state.orientation = window.orientation;
1914
+ };
1915
+
1916
+ /**
1917
+ * Checks for CSS support.
1918
+ * @private
1919
+ * @param {Array} array - The CSS properties to check for.
1920
+ * @returns {Array} - Contains the supported CSS property name and its index or `false`.
1921
+ */
1922
+ function isStyleSupported(array) {
1923
+ var p, s, fake = document.createElement('div'), list = array;
1924
+ for (p in list) {
1925
+ s = list[p];
1926
+ if (typeof fake.style[s] !== 'undefined') {
1927
+ fake = null;
1928
+ return [ s, p ];
1929
+ }
1930
+ }
1931
+ return [ false ];
1932
+ }
1933
+
1934
+ /**
1935
+ * Checks for CSS transition support.
1936
+ * @private
1937
+ * @todo Realy bad design
1938
+ * @returns {Number}
1939
+ */
1940
+ function isTransition() {
1941
+ return isStyleSupported([ 'transition', 'WebkitTransition', 'MozTransition', 'OTransition' ])[1];
1942
+ }
1943
+
1944
+ /**
1945
+ * Checks for CSS transform support.
1946
+ * @private
1947
+ * @returns {String} The supported property name or false.
1948
+ */
1949
+ function isTransform() {
1950
+ return isStyleSupported([ 'transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ])[0];
1951
+ }
1952
+
1953
+ /**
1954
+ * Checks for CSS perspective support.
1955
+ * @private
1956
+ * @returns {String} The supported property name or false.
1957
+ */
1958
+ function isPerspective() {
1959
+ return isStyleSupported([ 'perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective' ])[0];
1960
+ }
1961
+
1962
+ /**
1963
+ * Checks wether touch is supported or not.
1964
+ * @private
1965
+ * @returns {Boolean}
1966
+ */
1967
+ function isTouchSupport() {
1968
+ return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints);
1969
+ }
1970
+
1971
+ /**
1972
+ * Checks wether touch is supported or not for IE.
1973
+ * @private
1974
+ * @returns {Boolean}
1975
+ */
1976
+ function isTouchSupportIE() {
1977
+ return window.navigator.msPointerEnabled;
1978
+ }
1979
+
1980
+ /**
1981
+ * The jQuery Plugin for the Owl Carousel
1982
+ * @public
1983
+ */
1984
+ $.fn.owlCarousel = function(options) {
1985
+ return this.each(function() {
1986
+ if (!$(this).data('owlCarousel')) {
1987
+ $(this).data('owlCarousel', new Owl(this, options));
1988
+ }
1989
+ });
1990
+ };
1991
+
1992
+ /**
1993
+ * The constructor for the jQuery Plugin
1994
+ * @public
1995
+ */
1996
+ $.fn.owlCarousel.Constructor = Owl;
1997
+
1998
+ })(window.Zepto || window.jQuery, window, document);
1999
+
2000
+ /**
2001
+ * LazyLoad Plugin
2002
+ * @version 2.0.0
2003
+ * @author Bartosz Wojciechowski
2004
+ * @license The MIT License (MIT)
2005
+ */
2006
+ ;(function($, window, document, undefined) {
2007
+
2008
+ /**
2009
+ * Creates the lazy load plugin.
2010
+ * @class The Lazy Load Plugin
2011
+ * @param {Owl} scope - The Owl Carousel
2012
+ */
2013
+ LazyLoad = function(scope) {
2014
+ this.owl = scope;
2015
+ this.owl.options = $.extend({}, LazyLoad.Defaults, this.owl.options);
2016
+
2017
+ this.handlers = {
2018
+ 'changed.owl.carousel': $.proxy(function(e) {
2019
+ if (e.property.name == 'items' && e.property.value && !e.property.value.is(':empty')) {
2020
+ this.check();
2021
+ }
2022
+ }, this)
2023
+ };
2024
+
2025
+ this.owl.dom.$el.on(this.handlers);
2026
+ };
2027
+
2028
+ /**
2029
+ * Default options.
2030
+ * @public
2031
+ */
2032
+ LazyLoad.Defaults = {
2033
+ lazyLoad: false
2034
+ };
2035
+
2036
+ /**
2037
+ * Checks all items and if necessary, calls `preload`.
2038
+ * @protected
2039
+ */
2040
+ LazyLoad.prototype.check = function() {
2041
+ var attr = window.devicePixelRatio > 1 ? 'data-src-retina' : 'data-src',
2042
+ src, img, i, $item;
2043
+
2044
+ for (i = 0; i < this.owl.num.items; i++) {
2045
+ $item = this.owl.dom.$items.eq(i);
2046
+
2047
+ if ($item.data('owl-item').current === true && $item.data('owl-item').loaded === false) {
2048
+ img = $item.find('.owl-lazy');
2049
+ src = img.attr(attr);
2050
+ src = src || img.attr('data-src');
2051
+ if (src) {
2052
+ img.css('opacity', '0');
2053
+ this.preload(img, $item);
2054
+ }
2055
+ }
2056
+ }
2057
+ };
2058
+
2059
+ /**
2060
+ * Preloads the images of an item.
2061
+ * @protected
2062
+ * @param {jQuery} images - The images to load.
2063
+ * @param {jQuery} $item - The item for which the images are loaded.
2064
+ */
2065
+ LazyLoad.prototype.preload = function(images, $item) {
2066
+ var $el, img, srcType;
2067
+
2068
+ images.each($.proxy(function(i, el) {
2069
+
2070
+ this.owl.trigger('load', null, 'lazy');
2071
+
2072
+ $el = $(el);
2073
+ img = new Image();
2074
+ srcType = window.devicePixelRatio > 1 ? $el.attr('data-src-retina') : $el.attr('data-src');
2075
+ srcType = srcType || $el.attr('data-src');
2076
+
2077
+ img.onload = $.proxy(function() {
2078
+ $item.data('owl-item').loaded = true;
2079
+ if ($el.is('img')) {
2080
+ $el.attr('src', img.src);
2081
+ } else {
2082
+ $el.css('background-image', 'url(' + img.src + ')');
2083
+ }
2084
+
2085
+ $el.css('opacity', 1);
2086
+ this.owl.trigger('loaded', null, 'lazy');
2087
+ }, this);
2088
+ img.src = srcType;
2089
+ }, this));
2090
+ };
2091
+
2092
+ /**
2093
+ * Destroys the plugin.
2094
+ * @public
2095
+ */
2096
+ LazyLoad.prototype.destroy = function() {
2097
+ var handler, property;
2098
+
2099
+ for (handler in this.handlers) {
2100
+ this.owl.dom.$el.off(handler, this.handlers[handler]);
2101
+ }
2102
+ for (property in Object.getOwnPropertyNames(this)) {
2103
+ typeof this[property] != 'function' && (this[property] = null);
2104
+ }
2105
+ };
2106
+
2107
+ $.fn.owlCarousel.Constructor.Plugins.lazyLoad = LazyLoad;
2108
+
2109
+ })(window.Zepto || window.jQuery, window, document);
2110
+
2111
+ /**
2112
+ * AutoHeight Plugin
2113
+ * @version 2.0.0
2114
+ * @author Bartosz Wojciechowski
2115
+ * @license The MIT License (MIT)
2116
+ */
2117
+ ;(function($, window, document, undefined) {
2118
+
2119
+ /**
2120
+ * Creates the auto height plugin.
2121
+ * @class The Auto Height Plugin
2122
+ * @param {Owl} scope - The Owl Carousel
2123
+ */
2124
+ AutoHeight = function(scope) {
2125
+ this.owl = scope;
2126
+ this.owl.options = $.extend({}, AutoHeight.Defaults, this.owl.options);
2127
+
2128
+ this.handlers = {
2129
+ 'changed.owl.carousel': $.proxy(function(e) {
2130
+ if (e.property.name == 'position' && this.owl.settings.autoHeight){
2131
+ this.setHeight();
2132
+ }
2133
+ }, this)
2134
+ };
2135
+
2136
+ this.owl.dom.$el.on(this.handlers);
2137
+ };
2138
+
2139
+ /**
2140
+ * Default options.
2141
+ * @public
2142
+ */
2143
+ AutoHeight.Defaults = {
2144
+ autoHeight: false,
2145
+ autoHeightClass: 'owl-height'
2146
+ };
2147
+
2148
+ /**
2149
+ *
2150
+ * @param {Boolean} callback - Whether
2151
+ * @returns {Boolean}
2152
+ */
2153
+ AutoHeight.prototype.setHeight = function() {
2154
+ var loaded = this.owl.dom.$items.eq(this.owl.current()),
2155
+ stage = this.owl.dom.$oStage,
2156
+ iterations = 0,
2157
+ isLoaded;
2158
+
2159
+ if (!this.owl.dom.$oStage.hasClass(this.owl.settings.autoHeightClass)) {
2160
+ this.owl.dom.$oStage.addClass(this.owl.settings.autoHeightClass);
2161
+ }
2162
+
2163
+ isLoaded = window.setInterval(function() {
2164
+ iterations += 1;
2165
+ if (loaded.data('owl-item').loaded) {
2166
+ stage.height(loaded.height() + 'px');
2167
+ clearInterval(isLoaded);
2168
+ } else if (iterations === 500) {
2169
+ clearInterval(isLoaded);
2170
+ }
2171
+ }, 100);
2172
+
2173
+ };
2174
+
2175
+ AutoHeight.prototype.destroy = function() {
2176
+ var handler, property;
2177
+
2178
+ for (handler in this.handlers) {
2179
+ this.owl.dom.$el.off(handler, this.handlers[handler]);
2180
+ }
2181
+ for (property in Object.getOwnPropertyNames(this)) {
2182
+ typeof this[property] != 'function' && (this[property] = null);
2183
+ }
2184
+ };
2185
+
2186
+ $.fn.owlCarousel.Constructor.Plugins.autoHeight = AutoHeight;
2187
+
2188
+ })(window.Zepto || window.jQuery, window, document);
2189
+
2190
+ /**
2191
+ * Video Plugin
2192
+ * @version 2.0.0
2193
+ * @author Bartosz Wojciechowski
2194
+ * @license The MIT License (MIT)
2195
+ */
2196
+ ;(function($, window, document, undefined) {
2197
+
2198
+ /**
2199
+ * Creates the video plugin.
2200
+ * @class The Video Plugin
2201
+ * @param {Owl} scope - The Owl Carousel
2202
+ */
2203
+ Video = function(scope) {
2204
+ this.owl = scope;
2205
+ this.owl.options = $.extend({}, Video.Defaults, this.owl.options);
2206
+
2207
+ this.handlers = {
2208
+ 'resize.owl.carousel': $.proxy(function(e) {
2209
+ if (this.owl.settings.video && !this.isInFullScreen()) {
2210
+ e.preventDefault();
2211
+ }
2212
+ }, this),
2213
+ 'refresh.owl.carousel changed.owl.carousel': $.proxy(function(e) {
2214
+ if (this.owl.state.videoPlay) {
2215
+ this.stopVideo();
2216
+ }
2217
+ }, this),
2218
+ 'refresh.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
2219
+ if (!this.owl.settings.video) {
2220
+ return false;
2221
+ }
2222
+ this.refreshing = e.type == 'refresh';
2223
+ }, this),
2224
+ 'changed.owl.carousel': $.proxy(function(e) {
2225
+ if (this.refreshing && e.property.name == 'items' && e.property.value && !e.property.value.is(':empty')) {
2226
+ this.checkVideoLinks();
2227
+ }
2228
+ }, this)
2229
+ };
2230
+
2231
+ this.owl.dom.$el.on(this.handlers);
2232
+
2233
+ this.owl.dom.$el.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2234
+ this.playVideo(e);
2235
+ }, this));
2236
+ };
2237
+
2238
+ /**
2239
+ * Default options.
2240
+ * @public
2241
+ */
2242
+ Video.Defaults = {
2243
+ video: false,
2244
+ videoHeight: false,
2245
+ videoWidth: false
2246
+ };
2247
+
2248
+ /**
2249
+ * Checks if for any videos links exists.
2250
+ * @protected
2251
+ */
2252
+ Video.prototype.checkVideoLinks = function() {
2253
+ var videoEl, item, i;
2254
+
2255
+ for (i = 0; i < this.owl.num.items; i++) {
2256
+
2257
+ item = this.owl.dom.$items.eq(i);
2258
+ if (item.data('owl-item').hasVideo) {
2259
+ continue;
2260
+ }
2261
+
2262
+ videoEl = item.find('.owl-video');
2263
+ if (videoEl.length) {
2264
+ this.owl.state.hasVideos = true;
2265
+ this.owl.dom.$items.eq(i).data('owl-item').hasVideo = true;
2266
+ videoEl.css('display', 'none');
2267
+ this.getVideoInfo(videoEl, item);
2268
+ }
2269
+ }
2270
+ };
2271
+
2272
+ /**
2273
+ * Gets the video ID and the type (YouTube/Vimeo only).
2274
+ * @protected
2275
+ * @param {jQuery} videoEl - The element containing the video data.
2276
+ * @param {jQuery} item - The item containing the video.
2277
+ */
2278
+ Video.prototype.getVideoInfo = function(videoEl, item) {
2279
+
2280
+ var info, type, id, dimensions,
2281
+ vimeoId = videoEl.data('vimeo-id'),
2282
+ youTubeId = videoEl.data('youtube-id'),
2283
+ width = videoEl.data('width') || this.owl.settings.videoWidth,
2284
+ height = videoEl.data('height') || this.owl.settings.videoHeight,
2285
+ url = videoEl.attr('href');
2286
+
2287
+ if (vimeoId) {
2288
+ type = 'vimeo';
2289
+ id = vimeoId;
2290
+ } else if (youTubeId) {
2291
+ type = 'youtube';
2292
+ id = youTubeId;
2293
+ } else if (url) {
2294
+ id = url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2295
+
2296
+ if (id[3].indexOf('youtu') > -1) {
2297
+ type = 'youtube';
2298
+ } else if (id[3].indexOf('vimeo') > -1) {
2299
+ type = 'vimeo';
2300
+ }
2301
+ id = id[6];
2302
+ } else {
2303
+ throw new Error('Missing video link.');
2304
+ }
2305
+
2306
+ item.data('owl-item').videoType = type;
2307
+ item.data('owl-item').videoId = id;
2308
+ item.data('owl-item').videoWidth = width;
2309
+ item.data('owl-item').videoHeight = height;
2310
+
2311
+ info = {
2312
+ type: type,
2313
+ id: id
2314
+ };
2315
+
2316
+ // Check dimensions
2317
+ dimensions = width && height ? 'style="width:' + width + 'px;height:' + height + 'px;"' : '';
2318
+
2319
+ // wrap video content into owl-video-wrapper div
2320
+ videoEl.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>');
2321
+
2322
+ this.createVideoTn(videoEl, info);
2323
+ };
2324
+
2325
+ /**
2326
+ * Creates video thumbnail.
2327
+ * @protected
2328
+ * @param {jQuery} videoEl - The element containing the video data.
2329
+ * @param {Object} info - The video info object.
2330
+ * @see `getVideoInfo`
2331
+ */
2332
+ Video.prototype.createVideoTn = function(videoEl, info) {
2333
+
2334
+ var tnLink, icon, path,
2335
+ customTn = videoEl.find('img'),
2336
+ srcType = 'src',
2337
+ lazyClass = '',
2338
+ that = this.owl;
2339
+
2340
+ if (this.owl.settings.lazyLoad) {
2341
+ srcType = 'data-src';
2342
+ lazyClass = 'owl-lazy';
2343
+ }
2344
+
2345
+ // Custom thumbnail
2346
+
2347
+ if (customTn.length) {
2348
+ addThumbnail(customTn.attr(srcType));
2349
+ customTn.remove();
2350
+ return false;
2351
+ }
2352
+
2353
+ function addThumbnail(tnPath) {
2354
+ icon = '<div class="owl-video-play-icon"></div>';
2355
+
2356
+ if (that.settings.lazyLoad) {
2357
+ tnLink = '<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + tnPath + '"></div>';
2358
+ } else {
2359
+ tnLink = '<div class="owl-video-tn" style="opacity:1;background-image:url(' + tnPath + ')"></div>';
2360
+ }
2361
+ videoEl.after(tnLink);
2362
+ videoEl.after(icon);
2363
+ }
2364
+
2365
+ if (info.type === 'youtube') {
2366
+ path = "http://img.youtube.com/vi/" + info.id + "/hqdefault.jpg";
2367
+ addThumbnail(path);
2368
+ } else if (info.type === 'vimeo') {
2369
+ $.ajax({
2370
+ type: 'GET',
2371
+ url: 'http://vimeo.com/api/v2/video/' + info.id + '.json',
2372
+ jsonp: 'callback',
2373
+ dataType: 'jsonp',
2374
+ success: function(data) {
2375
+ path = data[0].thumbnail_large;
2376
+ addThumbnail(path);
2377
+ if (that.settings.loop) {
2378
+ that.updateActiveItems();
2379
+ }
2380
+ }
2381
+ });
2382
+ }
2383
+ };
2384
+
2385
+ /**
2386
+ * Stops the current video.
2387
+ * @public
2388
+ */
2389
+ Video.prototype.stopVideo = function() {
2390
+ this.owl.trigger('stop', null, 'video');
2391
+ var item = this.owl.dom.$items.eq(this.owl.state.videoPlayIndex);
2392
+ item.find('.owl-video-frame').remove();
2393
+ item.removeClass('owl-video-playing');
2394
+ this.owl.state.videoPlay = false;
2395
+ };
2396
+
2397
+ /**
2398
+ * Starts the current video.
2399
+ * @public
2400
+ * @param {Event} ev - The event arguments.
2401
+ */
2402
+ Video.prototype.playVideo = function(ev) {
2403
+ this.owl.trigger('play', null, 'video');
2404
+
2405
+ if (this.owl.state.videoPlay) {
2406
+ this.stopVideo();
2407
+ }
2408
+ var videoLink, videoWrap, videoType,
2409
+ target = $(ev.target || ev.srcElement),
2410
+ item = target.closest('.' + this.owl.settings.itemClass);
2411
+
2412
+ videoType = item.data('owl-item').videoType, id = item.data('owl-item').videoId, width = item
2413
+ .data('owl-item').videoWidth
2414
+ || Math.floor(item.data('owl-item').width - this.owl.settings.margin), height = item.data('owl-item').videoHeight
2415
+ || this.owl.dom.$stage.height();
2416
+
2417
+ if (videoType === 'youtube') {
2418
+ videoLink = "<iframe width=\"" + width + "\" height=\"" + height + "\" src=\"http://www.youtube.com/embed/"
2419
+ + id + "?autoplay=1&v=" + id + "\" frameborder=\"0\" allowfullscreen></iframe>";
2420
+ } else if (videoType === 'vimeo') {
2421
+ videoLink = '<iframe src="http://player.vimeo.com/video/' + id + '?autoplay=1" width="' + width
2422
+ + '" height="' + height
2423
+ + '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
2424
+ }
2425
+
2426
+ item.addClass('owl-video-playing');
2427
+ this.owl.state.videoPlay = true;
2428
+ this.owl.state.videoPlayIndex = item.data('owl-item').indexAbs;
2429
+
2430
+ videoWrap = $('<div style="height:' + height + 'px; width:' + width + 'px" class="owl-video-frame">'
2431
+ + videoLink + '</div>');
2432
+ target.after(videoWrap);
2433
+ };
2434
+
2435
+ /**
2436
+ * Checks whether an video is currently in full screen mode or not.
2437
+ * @protected
2438
+ * @returns {Boolean}
2439
+ */
2440
+ Video.prototype.isInFullScreen = function() {
2441
+
2442
+ // if Vimeo Fullscreen mode
2443
+ var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement
2444
+ || document.webkitFullscreenElement;
2445
+ if (fullscreenElement) {
2446
+ if ($(fullscreenElement.parentNode).hasClass('owl-video-frame')) {
2447
+ this.owl.speed(0);
2448
+ this.owl.state.isFullScreen = true;
2449
+ }
2450
+ }
2451
+
2452
+ if (fullscreenElement && this.owl.state.isFullScreen && this.owl.state.videoPlay) {
2453
+ return false;
2454
+ }
2455
+
2456
+ // Comming back from fullscreen
2457
+ if (this.owl.state.isFullScreen) {
2458
+ this.owl.state.isFullScreen = false;
2459
+ return false;
2460
+ }
2461
+
2462
+ // check full screen mode and window orientation
2463
+ if (this.owl.state.videoPlay) {
2464
+ if (this.owl.state.orientation !== window.orientation) {
2465
+ this.owl.state.orientation = window.orientation;
2466
+ return false;
2467
+ }
2468
+ }
2469
+ return true;
2470
+ };
2471
+
2472
+ /**
2473
+ * Destroys the plugin.
2474
+ */
2475
+ Video.prototype.destroy = function() {
2476
+ var handler, property;
2477
+
2478
+ this.owl.dom.$el.off('click.owl.video');
2479
+
2480
+ for (handler in this.handlers) {
2481
+ this.owl.dom.$el.off(handler, this.handlers[handler]);
2482
+ }
2483
+ for (property in Object.getOwnPropertyNames(this)) {
2484
+ typeof this[property] != 'function' && (this[property] = null);
2485
+ }
2486
+ };
2487
+
2488
+ $.fn.owlCarousel.Constructor.Plugins.video = Video;
2489
+
2490
+ })(window.Zepto || window.jQuery, window, document);
2491
+
2492
+ /**
2493
+ * Animate Plugin
2494
+ * @version 2.0.0
2495
+ * @author Bartosz Wojciechowski
2496
+ * @license The MIT License (MIT)
2497
+ */
2498
+ ;(function($, window, document, undefined) {
2499
+
2500
+ /**
2501
+ * Creates the animate plugin.
2502
+ * @class The Navigation Plugin
2503
+ * @param {Owl} scope - The Owl Carousel
2504
+ */
2505
+ Animate = function(scope) {
2506
+ this.core = scope;
2507
+ this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2508
+ this.swapping = true;
2509
+ this.previous = undefined;
2510
+ this.next = undefined;
2511
+
2512
+ this.handlers = {
2513
+ 'change.owl.carousel': $.proxy(function(e) {
2514
+ if (e.property.name == 'position') {
2515
+ this.previous = this.core.current();
2516
+ this.next = e.property.value;
2517
+ }
2518
+ }, this),
2519
+ 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2520
+ this.swapping = e.type == 'translated';
2521
+ }, this),
2522
+ 'translate.owl.carousel': $.proxy(function(e) {
2523
+ if (this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2524
+ this.swap();
2525
+ }
2526
+ }, this)
2527
+ };
2528
+
2529
+ this.core.dom.$el.on(this.handlers);
2530
+ };
2531
+
2532
+ /**
2533
+ * Default options.
2534
+ * @public
2535
+ */
2536
+ Animate.Defaults = {
2537
+ animateOut: false,
2538
+ animateIn: false
2539
+ };
2540
+
2541
+ /**
2542
+ * Toggles the animation classes whenever an translations starts.
2543
+ * @protected
2544
+ * @returns {Boolean|undefined}
2545
+ */
2546
+ Animate.prototype.swap = function() {
2547
+
2548
+ if (this.core.settings.items !== 1 || !this.core.support3d) {
2549
+ return;
2550
+ }
2551
+
2552
+ this.core.speed(0);
2553
+
2554
+ var left,
2555
+ clear = $.proxy(this.clear, this),
2556
+ previous = this.core.dom.$items.eq(this.previous),
2557
+ next = this.core.dom.$items.eq(this.next),
2558
+ incoming = this.core.settings.animateIn,
2559
+ outgoing = this.core.settings.animateOut;
2560
+
2561
+ if (this.core.current() === this.previous) {
2562
+ return;
2563
+ }
2564
+
2565
+ if (outgoing) {
2566
+ left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2567
+ previous.css( { 'left': left + 'px' } )
2568
+ .addClass('animated owl-animated-out')
2569
+ .addClass(outgoing)
2570
+ .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
2571
+ }
2572
+
2573
+ if (incoming) {
2574
+ next.addClass('animated owl-animated-in')
2575
+ .addClass(incoming)
2576
+ .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
2577
+ }
2578
+ };
2579
+
2580
+ Animate.prototype.clear = function(e) {
2581
+ $(e.target).css( { 'left': '' } )
2582
+ .removeClass('animated owl-animated-out owl-animated-in')
2583
+ .removeClass(this.core.settings.animateIn)
2584
+ .removeClass(this.core.settings.animateOut);
2585
+ this.core.transitionEnd();
2586
+ }
2587
+
2588
+ /**
2589
+ * Destroys the plugin.
2590
+ * @public
2591
+ */
2592
+ Animate.prototype.destroy = function() {
2593
+ var handler, property;
2594
+
2595
+ for (handler in this.handlers) {
2596
+ this.core.dom.$el.off(handler, this.handlers[handler]);
2597
+ }
2598
+ for (property in Object.getOwnPropertyNames(this)) {
2599
+ typeof this[property] != 'function' && (this[property] = null);
2600
+ }
2601
+ };
2602
+
2603
+ $.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2604
+
2605
+ })(window.Zepto || window.jQuery, window, document);
2606
+
2607
+ /**
2608
+ * Autoplay Plugin
2609
+ * @version 2.0.0
2610
+ * @author Bartosz Wojciechowski
2611
+ * @license The MIT License (MIT)
2612
+ */
2613
+ ;(function($, window, document, undefined) {
2614
+
2615
+ /**
2616
+ * Creates the autoplay plugin.
2617
+ * @class The Autoplay Plugin
2618
+ * @param {Owl} scope - The Owl Carousel
2619
+ */
2620
+ Autoplay = function(scope) {
2621
+ this.core = scope;
2622
+ this.core.options = $.extend({}, Autoplay.Defaults, this.core.options);
2623
+
2624
+ this.handlers = {
2625
+ 'translated.owl.carousel refreshed.owl.carousel': $.proxy(function() {
2626
+ this.autoplay();
2627
+ }, this),
2628
+ 'play.owl.autoplay': $.proxy(function(e, t, s) {
2629
+ this.play(t, s);
2630
+ }, this),
2631
+ 'stop.owl.autoplay': $.proxy(function() {
2632
+ this.stop();
2633
+ }, this),
2634
+ 'mouseover.owl.autoplay': $.proxy(function() {
2635
+ if (this.core.settings.autoplayHoverPause) {
2636
+ this.pause();
2637
+ }
2638
+ }, this),
2639
+ 'mouseleave.owl.autoplay': $.proxy(function() {
2640
+ if (this.core.settings.autoplayHoverPause) {
2641
+ this.autoplay();
2642
+ }
2643
+ }, this)
2644
+ };
2645
+
2646
+ this.core.dom.$el.on(this.handlers);
2647
+ };
2648
+
2649
+ /**
2650
+ * Default options.
2651
+ * @public
2652
+ */
2653
+ Autoplay.Defaults = {
2654
+ autoplay: false,
2655
+ autoplayTimeout: 5000,
2656
+ autoplayHoverPause: false,
2657
+ autoplaySpeed: false
2658
+ };
2659
+
2660
+ /**
2661
+ * @protected
2662
+ * @todo Must be documented.
2663
+ */
2664
+ Autoplay.prototype.autoplay = function() {
2665
+ if (this.core.settings.autoplay && !this.core.state.videoPlay) {
2666
+ window.clearInterval(this.interval);
2667
+
2668
+ this.interval = window.setInterval($.proxy(function() {
2669
+ this.play();
2670
+ }, this), this.core.settings.autoplayTimeout);
2671
+ } else {
2672
+ window.clearInterval(this.interval);
2673
+ }
2674
+ };
2675
+
2676
+ /**
2677
+ * Starts the autoplay.
2678
+ * @public
2679
+ * @param {Number} [timeout] - ...
2680
+ * @param {Number} [speed] - ...
2681
+ * @returns {Boolean|undefined} - ...
2682
+ * @todo Must be documented.
2683
+ */
2684
+ Autoplay.prototype.play = function(timeout, speed) {
2685
+ // if tab is inactive - doesnt work in <IE10
2686
+ if (document.hidden === true) {
2687
+ return;
2688
+ }
2689
+
2690
+ if (this.core.state.isTouch || this.core.state.isScrolling
2691
+ || this.core.state.isSwiping || this.core.state.inMotion) {
2692
+ return;
2693
+ }
2694
+
2695
+ if (this.core.settings.autoplay === false) {
2696
+ window.clearInterval(this.interval);
2697
+ return;
2698
+ }
2699
+
2700
+ this.core.next(this.core.settings.autoplaySpeed);
2701
+ };
2702
+
2703
+ /**
2704
+ * Stops the autoplay.
2705
+ * @public
2706
+ */
2707
+ Autoplay.prototype.stop = function() {
2708
+ window.clearInterval(this.interval);
2709
+ };
2710
+
2711
+ /**
2712
+ * Pauses the autoplay.
2713
+ * @public
2714
+ */
2715
+ Autoplay.prototype.pause = function() {
2716
+ window.clearInterval(this.interval);
2717
+ };
2718
+
2719
+ /**
2720
+ * Destroys the plugin.
2721
+ */
2722
+ Autoplay.prototype.destroy = function() {
2723
+ var handler, property;
2724
+
2725
+ window.clearInterval(this.interval);
2726
+
2727
+ for (handler in this.handlers) {
2728
+ this.core.dom.$el.off(handler, this.handlers[handler]);
2729
+ }
2730
+ for (property in Object.getOwnPropertyNames(this)) {
2731
+ typeof this[property] != 'function' && (this[property] = null);
2732
+ }
2733
+ };
2734
+
2735
+ $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2736
+
2737
+ })(window.Zepto || window.jQuery, window, document);
2738
+
2739
+ /**
2740
+ * Navigation Plugin
2741
+ * @version 2.0.0
2742
+ * @author Artus Kolanowski
2743
+ * @license The MIT License (MIT)
2744
+ */
2745
+ ;(function($, window, document, undefined) {
2746
+ 'use strict';
2747
+
2748
+ /**
2749
+ * Creates the navigation plugin.
2750
+ * @class The Navigation Plugin
2751
+ * @param {Owl} carousel - The Owl Carousel.
2752
+ */
2753
+ var Navigation = function(carousel) {
2754
+ /**
2755
+ * Reference to the core.
2756
+ * @type {Owl}
2757
+ */
2758
+ this.core = carousel;
2759
+
2760
+ /**
2761
+ * Indicates whether the plugin is initialized or not.
2762
+ * @type {Boolean}
2763
+ */
2764
+ this.initialized = false;
2765
+
2766
+ /**
2767
+ * The current paging indexes.
2768
+ * @type {Array}
2769
+ */
2770
+ this.pages = [];
2771
+
2772
+ /**
2773
+ * All DOM elements of the user interface.
2774
+ * @type {Object}
2775
+ */
2776
+ this.controls = {};
2777
+
2778
+ /**
2779
+ * Markup for an indicator.
2780
+ * @type {String}
2781
+ */
2782
+ this.template = null;
2783
+
2784
+ /**
2785
+ * The carousel element.
2786
+ * @type {jQuery}
2787
+ */
2788
+ this.$element = this.core.dom.$el;
2789
+
2790
+ /**
2791
+ * Overridden methods of the carousel.
2792
+ * @type {Object}
2793
+ */
2794
+ this.overrides = {
2795
+ next: this.core.next,
2796
+ prev: this.core.prev,
2797
+ to: this.core.to
2798
+ };
2799
+
2800
+ /**
2801
+ * All event handlers.
2802
+ * @type {Object}
2803
+ */
2804
+ this.handlers = {
2805
+ 'changed.owl.carousel': $.proxy(function(e) {
2806
+ if (e.property.name == 'items') {
2807
+ if (!this.initialized) {
2808
+ this.initialize();
2809
+ this.initialized = true;
2810
+ }
2811
+ this.update();
2812
+ this.draw();
2813
+ }
2814
+ if (this.filling) {
2815
+ e.property.value.data('owl-item').dot = $(':first-child', e.property.value)
2816
+ .find('[data-dot]').andSelf().data('dot');
2817
+ }
2818
+ }, this),
2819
+ 'change.owl.carousel': $.proxy(function(e) {
2820
+ if (e.property.name == 'position' && !this.core.state.revert
2821
+ && !this.core.settings.loop && this.core.settings.navRewind) {
2822
+ var current = this.core.current(),
2823
+ maximum = this.core.maximum(),
2824
+ minimum = this.core.minimum();
2825
+ e.data = e.property.value > maximum
2826
+ ? current >= maximum ? minimum : maximum
2827
+ : e.property.value < minimum ? maximum : e.property.value;
2828
+ }
2829
+ this.filling = this.core.settings.dotsData && e.property.name == 'item'
2830
+ && e.property.value && e.property.value.is(':empty');
2831
+ }, this),
2832
+ 'refreshed.owl.carousel': $.proxy(function() {
2833
+ if (this.initialized) {
2834
+ this.update();
2835
+ this.draw();
2836
+ }
2837
+ }, this)
2838
+ };
2839
+
2840
+ // set default options
2841
+ this.core.options = $.extend({}, Navigation.Defaults, this.core.options);
2842
+
2843
+ // register event handlers
2844
+ this.$element.on(this.handlers);
2845
+ }
2846
+
2847
+ /**
2848
+ * Default options.
2849
+ * @public
2850
+ * @todo Rename `slideBy` to `navBy`
2851
+ */
2852
+ Navigation.Defaults = {
2853
+ nav: false,
2854
+ navRewind: true,
2855
+ navText: [ 'prev', 'next' ],
2856
+ navSpeed: false,
2857
+ navElement: 'div',
2858
+ navContainer: false,
2859
+ navContainerClass: 'owl-nav',
2860
+ navClass: [ 'owl-prev', 'owl-next' ],
2861
+ slideBy: 1,
2862
+ dotClass: 'owl-dot',
2863
+ dotsClass: 'owl-dots',
2864
+ dots: true,
2865
+ dotsEach: false,
2866
+ dotData: false,
2867
+ dotsSpeed: false,
2868
+ dotsContainer: false,
2869
+ controlsClass: 'owl-controls'
2870
+ }
2871
+
2872
+ /**
2873
+ * Initializes the layout of the plugin and extends the carousel.
2874
+ * @protected
2875
+ */
2876
+ Navigation.prototype.initialize = function() {
2877
+ var $container, override,
2878
+ options = this.core.settings;
2879
+
2880
+ // create the indicator template
2881
+ if (!options.dotsData) {
2882
+ this.template = $('<div>')
2883
+ .addClass(options.dotClass)
2884
+ .append($('<span>'))
2885
+ .prop('outerHTML');
2886
+ }
2887
+
2888
+ // create controls container if needed
2889
+ if (!options.navContainer || !options.dotsContainer) {
2890
+ this.controls.$container = $('<div>')
2891
+ .addClass(options.controlsClass)
2892
+ .appendTo(this.$element);
2893
+ }
2894
+
2895
+ // create DOM structure for absolute navigation
2896
+ this.controls.$indicators = options.dotsContainer ? $(options.dotsContainer)
2897
+ : $('<div>').hide().addClass(options.dotsClass).appendTo(this.controls.$container);
2898
+
2899
+ this.controls.$indicators.on(this.core.dragType[2], 'div', $.proxy(function(e) {
2900
+ var index = $(e.target).parent().is(this.controls.$indicators)
2901
+ ? $(e.target).index() : $(e.target).parent().index();
2902
+
2903
+ e.preventDefault();
2904
+
2905
+ this.to(index, options.dotsSpeed);
2906
+ }, this));
2907
+
2908
+ // create DOM structure for relative navigation
2909
+ $container = options.navContainer ? $(options.navContainer)
2910
+ : $('<div>').addClass(options.navContainerClass).prependTo(this.controls.$container);
2911
+
2912
+ this.controls.$next = $('<' + options.navElement + '>');
2913
+ this.controls.$previous = this.controls.$next.clone();
2914
+
2915
+ this.controls.$previous
2916
+ .addClass(options.navClass[0])
2917
+ .html(options.navText[0])
2918
+ .hide()
2919
+ .prependTo($container)
2920
+ .on(this.core.dragType[2], $.proxy(function(e) {
2921
+ this.prev();
2922
+ }, this));
2923
+ this.controls.$next
2924
+ .addClass(options.navClass[1])
2925
+ .html(options.navText[1])
2926
+ .hide()
2927
+ .appendTo($container)
2928
+ .on(this.core.dragType[2], $.proxy(function(e) {
2929
+ this.next();
2930
+ }, this));
2931
+
2932
+ // override public methods of the carousel
2933
+ for (override in this.overrides) {
2934
+ this.core[override] = $.proxy(this[override], this);
2935
+ }
2936
+ }
2937
+
2938
+ /**
2939
+ * Destroys the plugin.
2940
+ * @protected
2941
+ */
2942
+ Navigation.prototype.destroy = function() {
2943
+ var handler, control, property, override;
2944
+
2945
+ for (handler in this.handlers) {
2946
+ this.$element.off(handler, this.handlers[handler]);
2947
+ }
2948
+ for (control in this.controls) {
2949
+ this.controls[control].remove();
2950
+ }
2951
+ for (override in this.overides) {
2952
+ this.core[override] = this.overrides[override];
2953
+ }
2954
+ for (property in Object.getOwnPropertyNames(this)) {
2955
+ typeof this[property] != 'function' && (this[property] = null);
2956
+ }
2957
+ }
2958
+
2959
+ /**
2960
+ * Updates the internal state.
2961
+ * @protected
2962
+ */
2963
+ Navigation.prototype.update = function() {
2964
+ var i, j, k,
2965
+ options = this.core.settings,
2966
+ lower = this.core.num.cItems / 2,
2967
+ upper = this.core.num.items - lower,
2968
+ size = options.center || options.autoWidth || options.dotData
2969
+ ? 1 : options.dotsEach || options.items;
2970
+
2971
+ if (options.slideBy !== 'page') {
2972
+ options.slideBy = Math.min(options.slideBy, options.items);
2973
+ }
2974
+
2975
+ if (options.dots) {
2976
+ this.pages = [];
2977
+
2978
+ for (i = lower, j = 0, k = 0; i < upper; i++) {
2979
+ if (j >= size || j === 0) {
2980
+ this.pages.push({
2981
+ start: i - lower,
2982
+ end: i - lower + size - 1
2983
+ });
2984
+ j = 0, ++k;
2985
+ }
2986
+ j += this.core.num.merged[i];
2987
+ }
2988
+ }
2989
+ }
2990
+
2991
+ /**
2992
+ * Draws the user interface.
2993
+ * @protected
2994
+ */
2995
+ Navigation.prototype.draw = function() {
2996
+ var difference, i, html = '',
2997
+ options = this.core.settings,
2998
+ $items = this.core.dom.$oItems,
2999
+ index = this.core.normalize(this.core.current(), true);
3000
+
3001
+ if (options.nav && !options.loop && !options.navRewind) {
3002
+ this.controls.$previous.toggleClass('disabled', index <= 0);
3003
+ this.controls.$next.toggleClass('disabled', index >= this.core.maximum());
3004
+ }
3005
+
3006
+ this.controls.$previous.toggle(options.nav);
3007
+ this.controls.$next.toggle(options.nav);
3008
+
3009
+ if (options.dots) {
3010
+ difference = this.pages.length - this.controls.$indicators.children().length;
3011
+
3012
+ if (difference > 0) {
3013
+ for (i = 0; i < Math.abs(difference); i++) {
3014
+ html += options.dotData ? $items.eq(i).data('owl-item').dot : this.template;
3015
+ }
3016
+ this.controls.$indicators.append(html);
3017
+ } else if (difference < 0) {
3018
+ this.controls.$indicators.children().slice(difference).remove();
3019
+ }
3020
+
3021
+ this.controls.$indicators.find('.active').removeClass('active');
3022
+ this.controls.$indicators.children().eq($.inArray(this.current(), this.pages)).addClass('active');
3023
+ }
3024
+
3025
+ this.controls.$indicators.toggle(options.dots);
3026
+ }
3027
+
3028
+ /**
3029
+ * Extends event data.
3030
+ * @protected
3031
+ * @param {Event} event - The event object which gets thrown.
3032
+ */
3033
+ Navigation.prototype.onTrigger = function(event) {
3034
+ var options = this.core.settings;
3035
+
3036
+ event.page = {
3037
+ index: $.inArray(this.current(), this.pages),
3038
+ count: this.pages.length,
3039
+ size: options.center || options.autoWidth || options.dotData
3040
+ ? 1 : options.dotsEach || options.items
3041
+ };
3042
+ }
3043
+
3044
+ /**
3045
+ * Gets the current page position of the carousel.
3046
+ * @protected
3047
+ * @returns {Number}
3048
+ */
3049
+ Navigation.prototype.current = function() {
3050
+ var index = this.core.normalize(this.core.current(), true);
3051
+ return $.grep(this.pages, function(o) {
3052
+ return o.start <= index && o.end >= index;
3053
+ }).pop();
3054
+ }
3055
+
3056
+ /**
3057
+ * Gets the current succesor/predecessor position.
3058
+ * @protected
3059
+ * @returns {Number}
3060
+ */
3061
+ Navigation.prototype.getPosition = function(successor) {
3062
+ var position, length,
3063
+ options = this.core.settings;
3064
+
3065
+ if (options.slideBy == 'page') {
3066
+ position = $.inArray(this.current(), this.pages);
3067
+ length = this.pages.length;
3068
+ successor ? ++position : --position;
3069
+ position = this.pages[((position % length) + length) % length].start;
3070
+ } else {
3071
+ position = this.core.normalize(this.core.current(), true);
3072
+ length = this.core.num.oItems;
3073
+ successor ? position += options.slideBy : position -= options.slideBy;
3074
+ }
3075
+ return position;
3076
+ }
3077
+
3078
+ /**
3079
+ * Slides to the next item or page.
3080
+ * @public
3081
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3082
+ */
3083
+ Navigation.prototype.next = function(speed) {
3084
+ $.proxy(this.overrides.to, this.core)(this.getPosition(true), speed);
3085
+ }
3086
+
3087
+ /**
3088
+ * Slides to the previous item or page.
3089
+ * @public
3090
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3091
+ */
3092
+ Navigation.prototype.prev = function(speed) {
3093
+ $.proxy(this.overrides.to, this.core)(this.getPosition(false), speed);
3094
+ }
3095
+
3096
+ /**
3097
+ * Slides to the specified item or page.
3098
+ * @public
3099
+ * @param {Number} position - The position of the item or page.
3100
+ * @param {Number} [speed] - The time in milliseconds for the transition.
3101
+ * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3102
+ */
3103
+ Navigation.prototype.to = function(position, speed, standard) {
3104
+ var length;
3105
+
3106
+ if (!standard) {
3107
+ length = this.pages.length;
3108
+ $.proxy(this.overrides.to, this.core)(this.pages[((position % length) + length) % length].start, speed);
3109
+ } else {
3110
+ $.proxy(this.overrides.to, this.core)(position, speed);
3111
+ }
3112
+ }
3113
+
3114
+ $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3115
+
3116
+ })(window.Zepto || window.jQuery, window, document);
3117
+
3118
+ /**
3119
+ * Hash Plugin
3120
+ * @version 2.0.0
3121
+ * @author Artus Kolanowski
3122
+ * @license The MIT License (MIT)
3123
+ */
3124
+ ;(function($, window, document, undefined) {
3125
+ 'use strict';
3126
+
3127
+ /**
3128
+ * Creates the hash plugin.
3129
+ * @class The Hash Plugin
3130
+ * @param {Owl} carousel - The Owl Carousel
3131
+ */
3132
+ var Hash = function(carousel) {
3133
+ /**
3134
+ * Reference to the core.
3135
+ * @type {Owl}
3136
+ */
3137
+ this.core = carousel;
3138
+
3139
+ /**
3140
+ * Hash table for the hashes.
3141
+ * @type {Object}
3142
+ */
3143
+ this.hashes = {};
3144
+
3145
+ /**
3146
+ * The carousel element.
3147
+ * @type {jQuery}
3148
+ */
3149
+ this.$element = this.core.dom.$el;
3150
+
3151
+ /**
3152
+ * All event handlers.
3153
+ * @type {Object}
3154
+ */
3155
+ this.handlers = {
3156
+ 'initialized.owl.carousel': $.proxy(function() {
3157
+ if (window.location.hash.substring(1)) {
3158
+ $(window).trigger('hashchange.owl.navigation');
3159
+ }
3160
+ }, this),
3161
+ 'changed.owl.carousel': $.proxy(function(e) {
3162
+ if (this.filling) {
3163
+ e.property.value.data('owl-item').hash
3164
+ = $(':first-child', e.property.value).find('[data-hash]').andSelf().data('hash');
3165
+ this.hashes[e.property.value.data('owl-item').hash] = e.property.value;
3166
+ }
3167
+ }, this),
3168
+ 'change.owl.carousel': $.proxy(function(e) {
3169
+ if (e.property.name == 'position' && this.core.current() === undefined
3170
+ && this.core.settings.startPosition == 'URLHash') {
3171
+ e.data = this.hashes[window.location.hash.substring(1)];
3172
+ }
3173
+ this.filling = e.property.name == 'item' && e.property.value && e.property.value.is(':empty');
3174
+ }, this),
3175
+ };
3176
+
3177
+ // set default options
3178
+ this.core.options = $.extend({}, Hash.Defaults, this.core.options);
3179
+
3180
+ // register the event handlers
3181
+ this.$element.on(this.handlers);
3182
+
3183
+ // register event listener for hash navigation
3184
+ $(window).on('hashchange.owl.navigation', $.proxy(function() {
3185
+ var hash = window.location.hash.substring(1),
3186
+ items = this.core.dom.$oItems,
3187
+ position = this.hashes[hash] && items.index(this.hashes[hash]) || 0;
3188
+
3189
+ if (!hash) {
3190
+ return false;
3191
+ }
3192
+
3193
+ this.core.dom.oStage.scrollLeft = 0;
3194
+ this.core.to(position, false, true);
3195
+ }, this));
3196
+ }
3197
+
3198
+ /**
3199
+ * Default options.
3200
+ * @public
3201
+ */
3202
+ Hash.Defaults = {
3203
+ URLhashListener: false
3204
+ }
3205
+
3206
+ /**
3207
+ * Destroys the plugin.
3208
+ * @public
3209
+ */
3210
+ Hash.prototype.destroy = function() {
3211
+ var handler, property;
3212
+
3213
+ $(window).off('hashchange.owl.navigation');
3214
+
3215
+ for (handler in this.handlers) {
3216
+ this.owl.dom.$el.off(handler, this.handlers[handler]);
3217
+ }
3218
+ for (property in Object.getOwnPropertyNames(this)) {
3219
+ typeof this[property] != 'function' && (this[property] = null);
3220
+ }
3221
+ }
3222
+
3223
+ $.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3224
+
3225
+ })(window.Zepto || window.jQuery, window, document);
includes/js/owlcarousel/owl.carousel.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ !function(a,b,c,d){function e(b,c){b.owlCarousel={name:"Owl Carousel",author:"Bartosz Wojciechowski",version:"2.0.0-beta.2.1"},this.settings=null,this.options=a.extend({},e.Defaults,c),this.itemData=a.extend({},l),this.dom=a.extend({},m),this.width=a.extend({},n),this.num=a.extend({},o),this.drag=a.extend({},q),this.state=a.extend({},r),this.e=a.extend({},s),this.plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=null,this.dom.el=b,this.dom.$el=a(b);for(var d in e.Plugins)this.plugins[d[0].toLowerCase()+d.slice(1)]=new e.Plugins[d](this);this.init()}function f(a){var b,d,e=c.createElement("div"),f=a;for(b in f)if(d=f[b],"undefined"!=typeof e.style[d])return e=null,[d,b];return[!1]}function g(){return f(["transition","WebkitTransition","MozTransition","OTransition"])[1]}function h(){return f(["transform","WebkitTransform","MozTransform","OTransform","msTransform"])[0]}function i(){return f(["perspective","webkitPerspective","MozPerspective","OPerspective","MsPerspective"])[0]}function j(){return"ontouchstart"in b||!!navigator.msMaxTouchPoints}function k(){return b.navigator.msPointerEnabled}var l,m,n,o,p,q,r,s;l={index:!1,indexAbs:!1,posLeft:!1,clone:!1,active:!1,loaded:!1,lazyLoad:!1,current:!1,width:!1,center:!1,page:!1,hasVideo:!1,playVideo:!1},m={el:null,$el:null,stage:null,$stage:null,oStage:null,$oStage:null,$items:null,$oItems:null,$cItems:null,$content:null},n={el:0,stage:0,item:0,prevWindow:0,cloneLast:0},o={items:0,oItems:0,cItems:0,active:0,merged:[]},q={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,offsetX:0,offsetY:0,distance:null,startTime:0,endTime:0,updatedX:0,targetEl:null},r={isTouch:!1,isScrolling:!1,isSwiping:!1,direction:!1,inMotion:!1},s={_onDragStart:null,_onDragMove:null,_onDragEnd:null,_transitionEnd:null,_resizer:null,_responsiveCall:null,_goToLoop:null,_checkVisibile:null},e.Defaults={items:3,loop:!1,center:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,responsiveClass:!1,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",themeClass:"owl-theme",baseClass:"owl-carousel",itemClass:"owl-item",centerClass:"center",activeClass:"active"},e.Plugins={},e.prototype.init=function(){if(this.setResponsiveOptions(),this.trigger("initialize"),this.dom.$el.hasClass(this.settings.baseClass)||this.dom.$el.addClass(this.settings.baseClass),this.dom.$el.hasClass(this.settings.themeClass)||this.dom.$el.addClass(this.settings.themeClass),this.settings.rtl&&this.dom.$el.addClass("owl-rtl"),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var a,b,c;if(a=this.dom.$el.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.dom.$el.children(b).width(),a.length&&0>=c)return this.preloadAutoWidthImages(a),!1}this.width.prevWindow=this.viewport(),this.createStage(),this.fetchContent(),this.eventsCall(),this.internalEvents(),this.dom.$el.addClass("owl-loading"),this.refresh(!0),this.dom.$el.removeClass("owl-loading").addClass("owl-loaded"),this.trigger("initialized"),this.addTriggerableEvents()},e.prototype.setResponsiveOptions=function(){if(this.options.responsive){var b=this.viewport(),c=this.options.responsive,d=-1;a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),this.settings=a.extend({},this.options,c[d]),delete this.settings.responsive,this.settings.responsiveClass&&this.dom.$el.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)}else this.settings=a.extend({},this.options)},e.prototype.optionsLogic=function(){this.dom.$el.toggleClass("owl-center",this.settings.center),this.settings.loop&&this.num.oItems<this.settings.items&&(this.settings.loop=!1),this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.createStage=function(){var b=c.createElement("div"),d=c.createElement(this.settings.stageElement);b.className="owl-stage-outer",d.className="owl-stage",b.appendChild(d),this.dom.el.appendChild(b),this.dom.oStage=b,this.dom.$oStage=a(b),this.dom.stage=d,this.dom.$stage=a(d),b=null,d=null},e.prototype.createItemContainer=function(){var b=c.createElement(this.settings.itemElement);return b.className=this.settings.itemClass,a(b)},e.prototype.fetchContent=function(b){this.dom.$content=b?b instanceof jQuery?b:a(b):this.settings.nestedItemSelector?this.dom.$el.find("."+this.settings.nestedItemSelector).not(".owl-stage-outer"):this.dom.$el.children().not(".owl-stage-outer"),this.num.oItems=this.dom.$content.length,0!==this.num.oItems&&this.initStructure()},e.prototype.initStructure=function(){this.createNormalStructure()},e.prototype.createNormalStructure=function(){var a,b;for(a=0;a<this.num.oItems;a++)b=this.createItemContainer(),this.initializeItemContainer(b,this.dom.$content[a]),this.dom.$stage.append(b);this.dom.$content=null},e.prototype.createCustomStructure=function(a){var b,c;for(b=0;a>b;b++)c=this.createItemContainer(),this.createItemContainerData(c),this.dom.$stage.append(c)},e.prototype.initializeItemContainer=function(a,b){this.trigger("change",{property:{name:"item",value:a}}),this.createItemContainerData(a),a.append(b),this.trigger("changed",{property:{name:"item",value:a}})},e.prototype.createItemContainerData=function(b,c){var d=a.extend({},this.itemData);c&&a.extend(d,c.data("owl-item")),b.data("owl-item",d)},e.prototype.cloneItemContainer=function(a){var b=a.clone(!0,!0).addClass("cloned");return this.createItemContainerData(b,b),b.data("owl-item").clone=!0,b},e.prototype.updateLocalContent=function(){var b,c;for(this.dom.$oItems=this.dom.$stage.find("."+this.settings.itemClass).filter(function(){return a(this).data("owl-item").clone===!1}),this.num.oItems=this.dom.$oItems.length,b=0;b<this.num.oItems;b++)c=this.dom.$oItems.eq(b),c.data("owl-item").index=b},e.prototype.loopClone=function(){if(!this.settings.loop||this.num.oItems<this.settings.items)return!1;var b,c,d,e=this.settings.items,f=this.num.oItems-1;for(this.settings.stagePadding&&1===this.settings.items&&(e+=1),this.num.cItems=2*e,d=0;e>d;d++)b=this.cloneItemContainer(this.dom.$oItems.eq(d)),c=this.cloneItemContainer(this.dom.$oItems.eq(f-d)),this.dom.$stage.append(b),this.dom.$stage.prepend(c);this.dom.$cItems=this.dom.$stage.find("."+this.settings.itemClass).filter(function(){return a(this).data("owl-item").clone===!0})},e.prototype.reClone=function(){null!==this.dom.$cItems&&(this.dom.$cItems.remove(),this.dom.$cItems=null,this.num.cItems=0),this.settings.loop&&this.loopClone()},e.prototype.calculate=function(){var a,b,c,d,e,f,g,h=0,i=0;for(this.width.el=this.dom.$el.width()-2*this.settings.stagePadding,this.width.view=this.dom.$el.width(),c=this.width.el-this.settings.margin*(1===this.settings.items?0:this.settings.items-1),this.width.el=this.width.el+this.settings.margin,this.width.item=(c/this.settings.items+this.settings.margin).toFixed(3),this.dom.$items=this.dom.$stage.find(".owl-item"),this.num.items=this.dom.$items.length,this.settings.autoWidth&&this.dom.$items.css("width",""),this._coordinates=[],this.num.merged=[],d=this.settings.rtl?this.settings.center?-(this.width.el/2):0:this.settings.center?this.width.el/2:0,this.width.mergeStage=0,a=0;a<this.num.items;a++)this.settings.merge?(g=this.dom.$items.eq(a).find("[data-merge]").attr("data-merge")||1,this.settings.mergeFit&&g>this.settings.items&&(g=this.settings.items),this.num.merged.push(parseInt(g)),this.width.mergeStage+=this.width.item*this.num.merged[a]):this.num.merged.push(1),f=this.width.item*this.num.merged[a],this.settings.autoWidth&&(f=this.dom.$items.eq(a).width()+this.settings.margin,this.settings.rtl?this.dom.$items[a].style.marginLeft=this.settings.margin+"px":this.dom.$items[a].style.marginRight=this.settings.margin+"px"),this._coordinates.push(d),this.dom.$items.eq(a).data("owl-item").posLeft=h,this.dom.$items.eq(a).data("owl-item").width=f,this.settings.rtl?(d+=f,h+=f):(d-=f,h-=f),i-=Math.abs(f),this.settings.center&&(this._coordinates[a]=this.settings.rtl?this._coordinates[a]+f/2:this._coordinates[a]-f/2);for(this.width.stage=Math.abs(this.settings.autoWidth?this.settings.center?i:d:i),e=this.num.oItems+this.num.cItems,b=0;e>b;b++)this.dom.$items.eq(b).data("owl-item").indexAbs=b;this.setSizes()},e.prototype.setSizes=function(){this.settings.stagePadding!==!1&&(this.dom.oStage.style.paddingLeft=this.settings.stagePadding+"px",this.dom.oStage.style.paddingRight=this.settings.stagePadding+"px"),this.settings.rtl?b.setTimeout(a.proxy(function(){this.dom.stage.style.width=this.width.stage+"px"},this),0):this.dom.stage.style.width=this.width.stage+"px";for(var c=0;c<this.num.items;c++)this.settings.autoWidth||(this.dom.$items[c].style.width=this.width.item-this.settings.margin+"px"),this.settings.rtl?this.dom.$items[c].style.marginLeft=this.settings.margin+"px":this.dom.$items[c].style.marginRight=this.settings.margin+"px",1===this.num.merged[c]||this.settings.autoWidth||(this.dom.$items[c].style.width=this.width.item*this.num.merged[c]-this.settings.margin+"px");this.width.stagePrev=this.width.stage},e.prototype.responsive=function(){if(!this.num.oItems)return!1;var a=this.isElWidthChanged();return a?this.trigger("resize").isDefaultPrevented()?!1:(this.state.responsive=!0,this.refresh(),this.state.responsive=!1,void this.trigger("resized")):!1},e.prototype.refresh=function(){var a=this.dom.$oItems&&this.dom.$oItems.eq(this.normalize(this.current(),!0));return this.trigger("refresh"),this.setResponsiveOptions(),this.updateLocalContent(),this.optionsLogic(),0===this.num.oItems?!1:(this.dom.$stage.addClass("owl-refresh"),this.reClone(),this.calculate(),this.dom.$stage.removeClass("owl-refresh"),a?this.reset(a.data("owl-item").indexAbs):(this.dom.oStage.scrollLeft=0,this.reset(this.dom.$oItems.eq(0).data("owl-item").indexAbs)),this.state.orientation=b.orientation,this.watchVisibility(),void this.trigger("refreshed"))},e.prototype.updateActiveItems=function(){this.trigger("change",{property:{name:"items",value:this.dom.$items}});var a,b,c,d,e,f;for(a=0;a<this.num.items;a++)this.dom.$items.eq(a).data("owl-item").active=!1,this.dom.$items.eq(a).data("owl-item").current=!1,this.dom.$items.eq(a).removeClass(this.settings.activeClass).removeClass(this.settings.centerClass);for(this.num.active=0,padding=2*this.settings.stagePadding,stageX=this.coordinates(this.current())+padding,view=this.settings.rtl?this.width.view:-this.width.view,b=0;b<this.num.items;b++)c=this.dom.$items.eq(b),d=c.data("owl-item").posLeft,e=c.data("owl-item").width,f=this.settings.rtl?d-e-padding:d-e+padding,(this.op(d,"<=",stageX)&&this.op(d,">",stageX+view)||this.op(f,"<",stageX)&&this.op(f,">",stageX+view))&&(this.num.active++,c.data("owl-item").active=!0,c.data("owl-item").current=!0,c.addClass(this.settings.activeClass),this.settings.lazyLoad||(c.data("owl-item").loaded=!0),this.settings.loop&&this.updateClonedItemsState(c.data("owl-item").index));this.settings.center&&(this.dom.$items.eq(this.current()).addClass(this.settings.centerClass).data("owl-item").center=!0),this.trigger("changed",{property:{name:"items",value:this.dom.$items}})},e.prototype.updateClonedItemsState=function(a){var b,c,d;for(this.settings.center&&(b=this.dom.$items.eq(this.current()).data("owl-item").index),d=0;d<this.num.items;d++)c=this.dom.$items.eq(d),c.data("owl-item").index===a&&(c.data("owl-item").current=!0,c.data("owl-item").index===b&&c.addClass(this.settings.centerClass))},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._resizer=a.proxy(function(){this.responsiveTimer()},this),this.e._responsiveCall=a.proxy(function(){this.responsive()},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.responsiveTimer=function(){return this.viewport()===this.width.prevWindow?!1:(b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._responsiveCall,this.settings.responsiveRefreshRate),void(this.width.prevWindow=this.viewport()))},e.prototype.internalEvents=function(){var a=j(),d=k();this.dragType=a&&!d?["touchstart","touchmove","touchend","touchcancel"]:a&&d?["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel"]:["mousedown","mousemove","mouseup"],(a||d)&&this.settings.touchDrag?this.on(c,this.dragType[3],this.e._onDragEnd):(this.dom.$stage.on("dragstart",function(){return!1}),this.settings.mouseDrag?this.dom.stage.onselectstart=function(){return!1}:this.dom.$el.addClass("owl-text-select-on")),this.transitionEndVendor&&this.on(this.dom.stage,this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",this.e._resizer,!1),this.dragEvents()},e.prototype.dragEvents=function(){!this.settings.touchDrag||"touchstart"!==this.dragType[0]&&"MSPointerDown"!==this.dragType[0]?this.settings.mouseDrag&&"mousedown"===this.dragType[0]?this.on(this.dom.stage,this.dragType[0],this.e._onDragStart,!1):this.off(this.dom.stage,this.dragType[0],this.e._onDragStart):this.on(this.dom.stage,this.dragType[0],this.e._onDragStart,!1)},e.prototype.onDragStart=function(a){var d,e,f,g,h;if(d=a.originalEvent||a||b.event,3===d.which)return!1;if("mousedown"===this.dragType[0]&&this.dom.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,e="touchstart"===d.type,f=e?a.targetTouches[0].pageX:d.pageX||d.clientX,g=e?a.targetTouches[0].pageY:d.pageY||d.clientY,this.drag.offsetX=this.dom.$stage.position().left-this.settings.stagePadding,this.drag.offsetY=this.dom.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.dom.$stage.position().left+this.width.stage-this.width.el+this.settings.margin),this.state.inMotion&&this.support3d)h=this.getTransformProperty(),this.drag.offsetX=h,this.animate(h),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=f-this.drag.offsetX,this.drag.startY=g-this.drag.offsetY,this.drag.start=f-this.drag.startX,this.drag.targetEl=d.target||d.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),this.on(c,this.dragType[1],this.e._onDragMove,!1),this.on(c,this.dragType[2],this.e._onDragEnd,!1)},e.prototype.onDragMove=function(a){var c,e,f,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e="touchmove"==c.type,f=e?c.targetTouches[0].pageX:c.pageX||c.clientX,g=e?c.targetTouches[0].pageY:c.pageY||c.clientY,this.drag.currentX=f-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this.num.oItems):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this.num.oItems)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(){var a,b,d;if(this.state.isTouch){if("mousedown"===this.dragType[0]&&this.dom.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),a=this.drag.endTime-this.drag.startTime,b=Math.abs(this.drag.distance),(b>3||a>300)&&this.removeClick(this.drag.targetEl),d=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(d),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(d)||this.transitionEnd(),this.drag.distance=0,this.off(c,this.dragType[1],this.e._onDragMove),this.off(c,this.dragType[2],this.e._onDragEnd)}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.dom.stage,null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=0,d=30;return this.settings.freeDrag||a.each(this.coordinates(),a.proxy(function(a,e){b>e-d&&e+d>b?c=a:this.op(b,"<",e)&&this.op(b,">",this.coordinates(a+1)||e-this.width.el)&&(c="left"===this.state.direction?a+1:a)},this)),this.settings.loop||(this.op(b,">",this.coordinates(this.minimum()))?c=b=this.minimum():this.op(b,"<",this.coordinates(this.maximum()))&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.dom.$stage.css({transform:"translate3d("+b+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.dom.$stage.css({left:b+"px"}):this.dom.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this.num.oItems)return d;if(a=this.normalize(a),this._current===a)this.animate(this.coordinates(this._current));else{var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.animate(this.coordinates(this._current)),this.updateActiveItems(),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.reset=function(a){this.suppress(["change","changed"]),this.speed(0),this.current(a),this.release(["change","changed"])},e.prototype.normalize=function(a,b){if(a===d||!this.dom.$items)return d;if(this.settings.loop){var c=this.dom.$items.length;a=(a%c+c)%c}else a=Math.max(this.minimum(),Math.min(this.maximum(),a));return b?this.dom.$items.eq(a).data("owl-item").index:a},e.prototype.maximum=function(){var b,c,d=this.settings;if(!d.loop&&d.center)b=this.num.oItems-1;else if(d.loop||d.center)if(d.loop||d.center)b=this.num.oItems+d.items;else{if(!d.autoWidth&&!d.merge)throw"Can not detect maximum absolute position.";revert=d.rtl?1:-1,c=this.dom.$stage.width()-this.$el.width(),a.each(this.coordinates(),function(a,d){return d*revert>=c?!1:void(b=a+1)})}else b=this.num.oItems-d.items;return b},e.prototype.minimum=function(){return this.dom.$oItems.eq(0).data("owl-item").indexAbs},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(a){return a!==d?this._coordinates[a]:this._coordinates},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.normalize(this.current(),!0),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1;h<this.settings.items&&i===!1?(f=this.num.items-(this.settings.items-g)-this.settings.items,this.reset(f)):h>=this.num.items-this.settings.items&&i===!0&&(f=g-this.num.oItems,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e)},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c)},e.prototype.next=function(a){a=a||!1,this.to(this.normalize(this.current(),!0)+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.normalize(this.current(),!0)-1,a)},e.prototype.transitionEnd=function(a){if(a!==d){a.stopPropagation();var b=a.target||a.srcElement||a.originalTarget;if(b!==this.dom.stage)return!1}this.state.inMotion=!1,this.trigger("translated")},e.prototype.isElWidthChanged=function(){var a=this.dom.$el.width()-this.settings.stagePadding,b=this.width.el+this.settings.margin;return a!==b},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.insertContent=function(a){this.dom.$stage.empty(),this.fetchContent(a),this.refresh()},e.prototype.addItem=function(a,b){var c=this.createItemContainer();b=b||0,this.initializeItemContainer(c,a),0===this.dom.$oItems.length?this.dom.$stage.append(c):-1!==p?this.dom.$oItems.eq(b).before(c):this.dom.$oItems.eq(b).after(c),this.refresh()},e.prototype.removeItem=function(a){this.dom.$oItems.eq(a).remove(),this.refresh()},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.insertContent,add:this.addItem,remove:this.removeItem},a.proxy(function(a,c){this.dom.$el.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.dom.el)&&(this.dom.$el.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.dom.el)||(this.dom.$el.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.init())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.dom.$el.hasClass(this.settings.themeClass)&&this.dom.$el.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&this.off(b,"resize",this.e._resizer),this.transitionEndVendor&&this.off(this.dom.stage,this.transitionEndVendor,this.e._transitionEnd);for(var a in this.plugins)this.plugins[a].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.off(this.dom.stage,this.dragType[0],this.e._onDragStart),this.settings.mouseDrag&&this.off(c,this.dragType[3],this.e._onDragStart),this.settings.mouseDrag&&(this.dom.$stage.off("dragstart",function(){return!1}),this.dom.stage.onselectstart=function(){})),this.dom.$el.off(".owl"),null!==this.dom.$cItems&&this.dom.$cItems.remove(),this.e=null,this.dom.$el.data("owlCarousel",null),delete this.dom.el.owlCarousel,this.dom.$stage.unwrap(),this.dom.$items.unwrap(),this.dom.$items.contents().unwrap(),this.dom=null},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},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){var e={item:{count:this.num.oItems,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[g.type]||(a.each(this.plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.dom.$el.trigger(g),"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},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.browserSupport=function(){if(this.support3d=i(),this.support3d){this.transformVendor=h();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[g()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){LazyLoad=function(b){this.owl=b,this.owl.options=a.extend({},LazyLoad.Defaults,this.owl.options),this.handlers={"changed.owl.carousel":a.proxy(function(a){"items"==a.property.name&&a.property.value&&!a.property.value.is(":empty")&&this.check()},this)},this.owl.dom.$el.on(this.handlers)},LazyLoad.Defaults={lazyLoad:!1},LazyLoad.prototype.check=function(){var a,c,d,e,f=b.devicePixelRatio>1?"data-src-retina":"data-src";for(d=0;d<this.owl.num.items;d++)e=this.owl.dom.$items.eq(d),e.data("owl-item").current===!0&&e.data("owl-item").loaded===!1&&(c=e.find(".owl-lazy"),a=c.attr(f),a=a||c.attr("data-src"),a&&(c.css("opacity","0"),this.preload(c,e)))},LazyLoad.prototype.preload=function(c,d){var e,f,g;c.each(a.proxy(function(c,h){this.owl.trigger("load",null,"lazy"),e=a(h),f=new Image,g=e.attr(b.devicePixelRatio>1?"data-src-retina":"data-src"),g=g||e.attr("data-src"),f.onload=a.proxy(function(){d.data("owl-item").loaded=!0,e.is("img")?e.attr("src",f.src):e.css("background-image","url("+f.src+")"),e.css("opacity",1),this.owl.trigger("loaded",null,"lazy")},this),f.src=g},this))},LazyLoad.prototype.destroy=function(){var a,b;for(a in this.handlers)this.owl.dom.$el.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.lazyLoad=LazyLoad}(window.Zepto||window.jQuery,window,document),function(a,b){AutoHeight=function(b){this.owl=b,this.owl.options=a.extend({},AutoHeight.Defaults,this.owl.options),this.handlers={"changed.owl.carousel":a.proxy(function(a){"position"==a.property.name&&this.owl.settings.autoHeight&&this.setHeight()},this)},this.owl.dom.$el.on(this.handlers)},AutoHeight.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},AutoHeight.prototype.setHeight=function(){var a,c=this.owl.dom.$items.eq(this.owl.current()),d=this.owl.dom.$oStage,e=0;this.owl.dom.$oStage.hasClass(this.owl.settings.autoHeightClass)||this.owl.dom.$oStage.addClass(this.owl.settings.autoHeightClass),a=b.setInterval(function(){e+=1,c.data("owl-item").loaded?(d.height(c.height()+"px"),clearInterval(a)):500===e&&clearInterval(a)},100)},AutoHeight.prototype.destroy=function(){var a,b;for(a in this.handlers)this.owl.dom.$el.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoHeight=AutoHeight}(window.Zepto||window.jQuery,window,document),function(a,b,c){Video=function(b){this.owl=b,this.owl.options=a.extend({},Video.Defaults,this.owl.options),this.handlers={"resize.owl.carousel":a.proxy(function(a){this.owl.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this.owl.state.videoPlay&&this.stopVideo()},this),"refresh.owl.carousel refreshed.owl.carousel":a.proxy(function(a){return this.owl.settings.video?void(this.refreshing="refresh"==a.type):!1},this),"changed.owl.carousel":a.proxy(function(a){this.refreshing&&"items"==a.property.name&&a.property.value&&!a.property.value.is(":empty")&&this.checkVideoLinks()},this)},this.owl.dom.$el.on(this.handlers),this.owl.dom.$el.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.playVideo(a)},this))},Video.Defaults={video:!1,videoHeight:!1,videoWidth:!1},Video.prototype.checkVideoLinks=function(){var a,b,c;for(c=0;c<this.owl.num.items;c++)b=this.owl.dom.$items.eq(c),b.data("owl-item").hasVideo||(a=b.find(".owl-video"),a.length&&(this.owl.state.hasVideos=!0,this.owl.dom.$items.eq(c).data("owl-item").hasVideo=!0,a.css("display","none"),this.getVideoInfo(a,b)))},Video.prototype.getVideoInfo=function(a,b){var c,d,e,f,g=a.data("vimeo-id"),h=a.data("youtube-id"),i=a.data("width")||this.owl.settings.videoWidth,j=a.data("height")||this.owl.settings.videoHeight,k=a.attr("href");if(g)d="vimeo",e=g;else if(h)d="youtube",e=h;else{if(!k)throw new Error("Missing video link.");e=k.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),e[3].indexOf("youtu")>-1?d="youtube":e[3].indexOf("vimeo")>-1&&(d="vimeo"),e=e[6]}b.data("owl-item").videoType=d,b.data("owl-item").videoId=e,b.data("owl-item").videoWidth=i,b.data("owl-item").videoHeight=j,c={type:d,id:e},f=i&&j?'style="width:'+i+"px;height:"+j+'px;"':"",a.wrap('<div class="owl-video-wrapper"'+f+"></div>"),this.createVideoTn(a,c)},Video.prototype.createVideoTn=function(b,c){function d(a){f='<div class="owl-video-play-icon"></div>',e=k.settings.lazyLoad?'<div class="owl-video-tn '+j+'" '+i+'="'+a+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+a+')"></div>',b.after(e),b.after(f)}var e,f,g,h=b.find("img"),i="src",j="",k=this.owl;return this.owl.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(d(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(g="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",d(g)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){g=a[0].thumbnail_large,d(g),k.settings.loop&&k.updateActiveItems()}}))},Video.prototype.stopVideo=function(){this.owl.trigger("stop",null,"video");var a=this.owl.dom.$items.eq(this.owl.state.videoPlayIndex);a.find(".owl-video-frame").remove(),a.removeClass("owl-video-playing"),this.owl.state.videoPlay=!1},Video.prototype.playVideo=function(b){this.owl.trigger("play",null,"video"),this.owl.state.videoPlay&&this.stopVideo();var c,d,e,f=a(b.target||b.srcElement),g=f.closest("."+this.owl.settings.itemClass);e=g.data("owl-item").videoType,id=g.data("owl-item").videoId,width=g.data("owl-item").videoWidth||Math.floor(g.data("owl-item").width-this.owl.settings.margin),height=g.data("owl-item").videoHeight||this.owl.dom.$stage.height(),"youtube"===e?c='<iframe width="'+width+'" height="'+height+'" src="http://www.youtube.com/embed/'+id+"?autoplay=1&v="+id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===e&&(c='<iframe src="http://player.vimeo.com/video/'+id+'?autoplay=1" width="'+width+'" height="'+height+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'),g.addClass("owl-video-playing"),this.owl.state.videoPlay=!0,this.owl.state.videoPlayIndex=g.data("owl-item").indexAbs,d=a('<div style="height:'+height+"px; width:"+width+'px" class="owl-video-frame">'+c+"</div>"),f.after(d)
2
+ },Video.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d.parentNode).hasClass("owl-video-frame")&&(this.owl.speed(0),this.owl.state.isFullScreen=!0),d&&this.owl.state.isFullScreen&&this.owl.state.videoPlay?!1:this.owl.state.isFullScreen?(this.owl.state.isFullScreen=!1,!1):this.owl.state.videoPlay&&this.owl.state.orientation!==b.orientation?(this.owl.state.orientation=b.orientation,!1):!0},Video.prototype.destroy=function(){var a,b;this.owl.dom.$el.off("click.owl.video");for(a in this.handlers)this.owl.dom.$el.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.video=Video}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){Animate=function(b){this.core=b,this.core.options=a.extend({},Animate.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"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){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.dom.$el.on(this.handlers)},Animate.Defaults={animateOut:!1,animateIn:!1},Animate.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.dom.$items.eq(this.previous),e=this.core.dom.$items.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.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},Animate.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.transitionEnd()},Animate.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.dom.$el.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=Animate}(window.Zepto||window.jQuery,window,document),function(a,b,c){Autoplay=function(b){this.core=b,this.core.options=a.extend({},Autoplay.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay()},this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.dom.$el.on(this.handlers)},Autoplay.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},Autoplay.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},Autoplay.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},Autoplay.prototype.stop=function(){b.clearInterval(this.interval)},Autoplay.prototype.pause=function(){b.clearInterval(this.interval)},Autoplay.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.dom.$el.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this.core=c,this.initialized=!1,this.pages=[],this.controls={},this.template=null,this.$element=this.core.dom.$el,this.overrides={next:this.core.next,prev:this.core.prev,to:this.core.to},this.handlers={"changed.owl.carousel":a.proxy(function(b){"items"==b.property.name&&(this.initialized||(this.initialize(),this.initialized=!0),this.update(),this.draw()),this.filling&&(b.property.value.data("owl-item").dot=a(":first-child",b.property.value).find("[data-dot]").andSelf().data("dot"))},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this.core.state.revert&&!this.core.settings.loop&&this.core.settings.navRewind){var b=this.core.current(),c=this.core.maximum(),d=this.core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value<d?c:a.property.value}this.filling=this.core.settings.dotsData&&"item"==a.property.name&&a.property.value&&a.property.value.is(":empty")},this),"refreshed.owl.carousel":a.proxy(function(){this.initialized&&(this.update(),this.draw())},this)},this.core.options=a.extend({},b.Defaults,this.core.options),this.$element.on(this.handlers)};b.Defaults={nav:!1,navRewind:!0,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotData:!1,dotsSpeed:!1,dotsContainer:!1,controlsClass:"owl-controls"},b.prototype.initialize=function(){var b,c,d=this.core.settings;d.dotsData||(this.template=a("<div>").addClass(d.dotClass).append(a("<span>")).prop("outerHTML")),d.navContainer&&d.dotsContainer||(this.controls.$container=a("<div>").addClass(d.controlsClass).appendTo(this.$element)),this.controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("<div>").hide().addClass(d.dotsClass).appendTo(this.controls.$container),this.controls.$indicators.on(this.core.dragType[2],"div",a.proxy(function(b){var c=a(b.target).parent().is(this.controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("<div>").addClass(d.navContainerClass).prependTo(this.controls.$container),this.controls.$next=a("<"+d.navElement+">"),this.controls.$previous=this.controls.$next.clone(),this.controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on(this.core.dragType[2],a.proxy(function(){this.prev()},this)),this.controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on(this.core.dragType[2],a.proxy(function(){this.next()},this));for(c in this.overrides)this.core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this.handlers)this.$element.off(a,this.handlers[a]);for(b in this.controls)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)},b.prototype.update=function(){var a,b,c,d=this.core.settings,e=this.core.num.cItems/2,f=this.core.num.items-e,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots)for(this.pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this.pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this.core.num.merged[a]},b.prototype.draw=function(){var b,c,d="",e=this.core.settings,f=this.core.dom.$oItems,g=this.core.normalize(this.core.current(),!0);if(!e.nav||e.loop||e.navRewind||(this.controls.$previous.toggleClass("disabled",0>=g),this.controls.$next.toggleClass("disabled",g>=this.core.maximum())),this.controls.$previous.toggle(e.nav),this.controls.$next.toggle(e.nav),e.dots){if(b=this.pages.length-this.controls.$indicators.children().length,b>0){for(c=0;c<Math.abs(b);c++)d+=e.dotData?f.eq(c).data("owl-item").dot:this.template;this.controls.$indicators.append(d)}else 0>b&&this.controls.$indicators.children().slice(b).remove();this.controls.$indicators.find(".active").removeClass("active"),this.controls.$indicators.children().eq(a.inArray(this.current(),this.pages)).addClass("active")}this.controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this.core.settings;b.page={index:a.inArray(this.current(),this.pages),count:this.pages.length,size:c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items}},b.prototype.current=function(){var b=this.core.normalize(this.core.current(),!0);return a.grep(this.pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.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.normalize(this.core.current(),!0),d=this.core.num.oItems,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this.overrides.to,this.core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this.overrides.to,this.core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this.overrides.to,this.core)(b,c):(e=this.pages.length,a.proxy(this.overrides.to,this.core)(this.pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(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.dom.$el,this.handlers={"initialized.owl.carousel":a.proxy(function(){b.location.hash.substring(1)&&a(b).trigger("hashchange.owl.navigation")},this),"changed.owl.carousel":a.proxy(function(b){this.filling&&(b.property.value.data("owl-item").hash=a(":first-child",b.property.value).find("[data-hash]").andSelf().data("hash"),this.hashes[b.property.value.data("owl-item").hash]=b.property.value)},this),"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&this.core.current()===d&&"URLHash"==this.core.settings.startPosition&&(a.data=this.hashes[b.location.hash.substring(1)]),this.filling="item"==a.property.name&&a.property.value&&a.property.value.is(":empty")},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(){var a=b.location.hash.substring(1),c=this.core.dom.$oItems,d=this.hashes[a]&&c.index(this.hashes[a])||0;return a?(this.core.dom.oStage.scrollLeft=0,void this.core.to(d,!1,!0)):!1},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this.handlers)this.owl.dom.$el.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);
includes/options.php CHANGED
@@ -1,6 +1,9 @@
1
  <?php
2
- $wc_gallery_options = array(
3
- 'misc' => array(
 
 
 
4
  'title' => 'Misc',
5
  'sections' => array(
6
  array(
@@ -10,7 +13,7 @@ $wc_gallery_options = array(
10
  array(
11
  'id' => 'enable_gallery_css',
12
  'title' => 'Gallery CSS',
13
- 'default' => '1',
14
  'description' => '',
15
  'label' => 'Use gallery CSS provided by plugin',
16
  'type' => 'checkbox',
@@ -18,7 +21,7 @@ $wc_gallery_options = array(
18
  array(
19
  'id' => 'enable_image_popup',
20
  'title' => 'Image Popup',
21
- 'default' => '1',
22
  'description' => '',
23
  'label' => 'Use <a target="_blank" href="http://dimsemenov.com/plugins/magnific-popup/">Magnific Popup</a> to showcase your images?',
24
  'type' => 'checkbox',
@@ -26,5 +29,264 @@ $wc_gallery_options = array(
26
  ),
27
  ),
28
  ),
29
- ),
30
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ function wc_gallery_set_options() {
3
+ global $wc_gallery_options;
4
+ global $wc_gallery_theme_support;
5
+
6
+ $wc_gallery_options['misc'] = array(
7
  'title' => 'Misc',
8
  'sections' => array(
9
  array(
13
  array(
14
  'id' => 'enable_gallery_css',
15
  'title' => 'Gallery CSS',
16
+ 'default' => true,
17
  'description' => '',
18
  'label' => 'Use gallery CSS provided by plugin',
19
  'type' => 'checkbox',
21
  array(
22
  'id' => 'enable_image_popup',
23
  'title' => 'Image Popup',
24
+ 'default' => true,
25
  'description' => '',
26
  'label' => 'Use <a target="_blank" href="http://dimsemenov.com/plugins/magnific-popup/">Magnific Popup</a> to showcase your images?',
27
  'type' => 'checkbox',
29
  ),
30
  ),
31
  ),
32
+ );
33
+
34
+ $wc_gallery_options['wc-image-sizes'] = array(
35
+ 'title' => 'Image Sizes',
36
+ 'sections' => array(
37
+ array(
38
+ 'section' => 'wc-gallery-options-image-sizes-section',
39
+ 'title' => 'Additional Image Sizes',
40
+ 'options' => array(
41
+ array(
42
+ 'id' => 'icon_size',
43
+ 'title' => 'Icon Size',
44
+ 'description' => '',
45
+ 'group' => array(
46
+ array(
47
+ 'id' => 'icon_size_w',
48
+ 'label' => 'Max Width',
49
+ 'default' => $wc_gallery_theme_support['icon']['size_w'],
50
+ 'type' => 'positive_number',
51
+ ),
52
+ array(
53
+ 'id' => 'icon_size_h',
54
+ 'label' => 'Max Height',
55
+ 'default' => $wc_gallery_theme_support['icon']['size_h'],
56
+ 'type' => 'positive_number',
57
+ ),
58
+ array(
59
+ 'id' => 'icon_crop',
60
+ 'label' => 'Crop to exact dimensions',
61
+ 'default' => $wc_gallery_theme_support['icon']['crop'],
62
+ 'description' => '',
63
+ 'type' => 'checkbox',
64
+ ),
65
+ ),
66
+ ),
67
+ array(
68
+ 'id' => 'square_size',
69
+ 'title' => 'Square Size',
70
+ 'description' => '',
71
+ 'group' => array(
72
+ array(
73
+ 'id' => 'square_size_w',
74
+ 'label' => 'Max Width',
75
+ 'default' => $wc_gallery_theme_support['square']['size_w'],
76
+ 'type' => 'positive_number',
77
+ 'less' => true,
78
+ ),
79
+ array(
80
+ 'id' => 'square_size_h',
81
+ 'label' => 'Max Height',
82
+ 'default' => $wc_gallery_theme_support['square']['size_h'],
83
+ 'type' => 'positive_number',
84
+ 'less' => true,
85
+ ),
86
+ array(
87
+ 'id' => 'square_crop',
88
+ 'label' => 'Crop to exact dimensions',
89
+ 'default' => $wc_gallery_theme_support['square']['crop'],
90
+ 'description' => '',
91
+ 'type' => 'checkbox',
92
+ ),
93
+ ),
94
+ ),
95
+ array(
96
+ 'id' => 'small_size',
97
+ 'title' => 'Small Size',
98
+ 'description' => '',
99
+ 'group' => array(
100
+ array(
101
+ 'id' => 'small_size_w',
102
+ 'label' => 'Max Width',
103
+ 'default' => $wc_gallery_theme_support['small']['size_w'],
104
+ 'type' => 'positive_number',
105
+ ),
106
+ array(
107
+ 'id' => 'small_size_h',
108
+ 'label' => 'Max Height',
109
+ 'default' => $wc_gallery_theme_support['small']['size_h'],
110
+ 'type' => 'positive_number',
111
+ ),
112
+ ),
113
+ ),
114
+ array(
115
+ 'id' => 'standard_size',
116
+ 'title' => 'Standard Size',
117
+ 'description' => '',
118
+ 'group' => array(
119
+ array(
120
+ 'id' => 'standard_size_w',
121
+ 'label' => 'Max Width',
122
+ 'default' => $wc_gallery_theme_support['standard']['size_w'],
123
+ 'type' => 'positive_number',
124
+ ),
125
+ array(
126
+ 'id' => 'standard_size_h',
127
+ 'label' => 'Max Height',
128
+ 'default' => $wc_gallery_theme_support['standard']['size_h'],
129
+ 'type' => 'positive_number',
130
+ ),
131
+ ),
132
+ ),
133
+ array(
134
+ 'id' => 'big_size',
135
+ 'title' => 'Big Size',
136
+ 'description' => '',
137
+ 'group' => array(
138
+ array(
139
+ 'id' => 'big_size_w',
140
+ 'label' => 'Max Width',
141
+ 'default' => $wc_gallery_theme_support['big']['size_w'],
142
+ 'type' => 'positive_number',
143
+ ),
144
+ array(
145
+ 'id' => 'big_size_h',
146
+ 'label' => 'Max Height',
147
+ 'default' => $wc_gallery_theme_support['big']['size_h'],
148
+ 'type' => 'positive_number',
149
+ ),
150
+ ),
151
+ ),
152
+ array(
153
+ 'id' => 'fixedheightsmall_size',
154
+ 'title' => 'Fixed Height Small Size',
155
+ 'description' => '',
156
+ 'group' => array(
157
+ array(
158
+ 'id' => 'fixedheightsmall_size_w',
159
+ 'label' => 'Max Width',
160
+ 'default' => $wc_gallery_theme_support['fixedheightsmall']['size_w'],
161
+ 'type' => 'positive_number',
162
+ ),
163
+ array(
164
+ 'id' => 'fixedheightsmall_size_h',
165
+ 'label' => 'Max Height',
166
+ 'default' => $wc_gallery_theme_support['fixedheightsmall']['size_h'],
167
+ 'type' => 'positive_number',
168
+ ),
169
+ ),
170
+ ),
171
+ array(
172
+ 'id' => 'fixedheightmedium_size',
173
+ 'title' => 'Fixed Height Medium Size',
174
+ 'description' => '',
175
+ 'group' => array(
176
+ array(
177
+ 'id' => 'fixedheightmedium_size_w',
178
+ 'label' => 'Max Width',
179
+ 'default' => $wc_gallery_theme_support['fixedheightmedium']['size_w'],
180
+ 'type' => 'positive_number',
181
+ ),
182
+ array(
183
+ 'id' => 'fixedheightmedium_size_h',
184
+ 'label' => 'Max Height',
185
+ 'default' => $wc_gallery_theme_support['fixedheightmedium']['size_h'],
186
+ 'type' => 'positive_number',
187
+ ),
188
+ ),
189
+ ),
190
+ array(
191
+ 'id' => 'fixedheight_size',
192
+ 'title' => 'Fixed Height Large Size',
193
+ 'description' => '',
194
+ 'group' => array(
195
+ array(
196
+ 'id' => 'fixedheight_size_w',
197
+ 'label' => 'Max Width',
198
+ 'default' => $wc_gallery_theme_support['fixedheight']['size_w'],
199
+ 'type' => 'positive_number',
200
+ ),
201
+ array(
202
+ 'id' => 'fixedheight_size_h',
203
+ 'label' => 'Max Height',
204
+ 'default' => $wc_gallery_theme_support['fixedheight']['size_h'],
205
+ 'type' => 'positive_number',
206
+ ),
207
+ ),
208
+ ),
209
+ array(
210
+ 'id' => 'carouselsmall_size',
211
+ 'title' => 'Carousel Small Size',
212
+ 'description' => '',
213
+ 'group' => array(
214
+ array(
215
+ 'id' => 'carouselsmall_size_w',
216
+ 'label' => 'Max Width',
217
+ 'default' => $wc_gallery_theme_support['carouselsmall']['size_w'],
218
+ 'type' => 'positive_number',
219
+ ),
220
+ array(
221
+ 'id' => 'carouselsmall_size_h',
222
+ 'label' => 'Max Height',
223
+ 'default' => $wc_gallery_theme_support['carouselsmall']['size_h'],
224
+ 'type' => 'positive_number',
225
+ ),
226
+ array(
227
+ 'id' => 'carouselsmall_crop',
228
+ 'label' => 'Crop to exact dimensions',
229
+ 'default' => $wc_gallery_theme_support['carouselsmall']['crop'],
230
+ 'description' => '',
231
+ 'type' => 'checkbox',
232
+ ),
233
+ ),
234
+ ),
235
+ array(
236
+ 'id' => 'carousel_size',
237
+ 'title' => 'Carousel Large Size',
238
+ 'description' => '',
239
+ 'group' => array(
240
+ array(
241
+ 'id' => 'carousel_size_w',
242
+ 'label' => 'Max Width',
243
+ 'default' => $wc_gallery_theme_support['carousel']['size_w'],
244
+ 'type' => 'positive_number',
245
+ ),
246
+ array(
247
+ 'id' => 'carousel_size_h',
248
+ 'label' => 'Max Height',
249
+ 'default' => $wc_gallery_theme_support['carousel']['size_h'],
250
+ 'type' => 'positive_number',
251
+ ),
252
+ array(
253
+ 'id' => 'carousel_crop',
254
+ 'label' => 'Crop to exact dimensions',
255
+ 'default' => $wc_gallery_theme_support['carousel']['crop'],
256
+ 'description' => '',
257
+ 'type' => 'checkbox',
258
+ ),
259
+ ),
260
+ ),
261
+ array(
262
+ 'id' => 'slider_size',
263
+ 'title' => 'Slider Size',
264
+ 'description' => '',
265
+ 'group' => array(
266
+ array(
267
+ 'id' => 'slider_size_w',
268
+ 'label' => 'Max Width',
269
+ 'default' => $wc_gallery_theme_support['slider']['size_w'],
270
+ 'type' => 'positive_number',
271
+ ),
272
+ array(
273
+ 'id' => 'slider_size_h',
274
+ 'label' => 'Max Height',
275
+ 'default' => $wc_gallery_theme_support['slider']['size_h'],
276
+ 'type' => 'positive_number',
277
+ ),
278
+ array(
279
+ 'id' => 'slider_crop',
280
+ 'label' => 'Crop to exact dimensions',
281
+ 'default' => $wc_gallery_theme_support['slider']['crop'],
282
+ 'description' => '',
283
+ 'type' => 'checkbox',
284
+ ),
285
+ ),
286
+ ),
287
+ ),
288
+ ),
289
+ ),
290
+ );
291
+ }
292
+ add_action( 'after_setup_theme', 'wc_gallery_set_options', 100 );
includes/scripts.php CHANGED
@@ -17,14 +17,12 @@ if( !function_exists ('wc_gallery_scripts') ) :
17
  wp_enqueue_style( 'wc-gallery-style', plugin_dir_url( __FILE__ ) . 'css/style.css', array( ), $ver );
18
  }
19
 
20
- // Masonry
21
- wp_deregister_script( 'jquery-masonry' );
22
- wp_register_script( 'jquery-masonry', plugin_dir_url( __FILE__ ) . 'js/masonry.pkgd.min.js', array( ), '3.1.5', true );
23
- wp_enqueue_script( 'jquery-masonry' );
24
-
25
  // jQuery
26
  wp_enqueue_script('jquery');
27
 
 
 
 
28
  // images loaded
29
  wp_register_script( 'wordpresscanvas-imagesloaded', plugin_dir_url( __FILE__ ) . 'js/imagesloaded.pkgd.min.js', array (), '3.1.5', true );
30
 
@@ -35,7 +33,10 @@ if( !function_exists ('wc_gallery_scripts') ) :
35
 
36
  // Gallery Shortcode
37
  wp_enqueue_style( 'wc-gallery-flexslider-style', plugin_dir_url( __FILE__ ) . 'js/flexslider/flexslider.css', array( ), '2.2.0' );
 
 
38
  wp_register_script( 'wc-gallery-flexslider', plugin_dir_url( __FILE__ ) . 'js/flexslider/jquery.flexslider-min.js', array ( 'jquery' ), '2.2.0', true );
 
39
  wp_register_script( 'wc-gallery', plugin_dir_url( __FILE__ ) . 'js/gallery.js', array ( 'jquery', 'wordpresscanvas-imagesloaded' ), $ver, true );
40
  wp_register_script( 'wc-gallery-woocommerce-product', plugin_dir_url( __FILE__ ) . 'js/woocommerce.product.js', array( 'jquery' ), $ver, true );
41
 
17
  wp_enqueue_style( 'wc-gallery-style', plugin_dir_url( __FILE__ ) . 'css/style.css', array( ), $ver );
18
  }
19
 
 
 
 
 
 
20
  // jQuery
21
  wp_enqueue_script('jquery');
22
 
23
+ // Masonry
24
+ wp_enqueue_script( 'jquery-masonry' );
25
+
26
  // images loaded
27
  wp_register_script( 'wordpresscanvas-imagesloaded', plugin_dir_url( __FILE__ ) . 'js/imagesloaded.pkgd.min.js', array (), '3.1.5', true );
28
 
33
 
34
  // Gallery Shortcode
35
  wp_enqueue_style( 'wc-gallery-flexslider-style', plugin_dir_url( __FILE__ ) . 'js/flexslider/flexslider.css', array( ), '2.2.0' );
36
+ wp_enqueue_style( 'wc-gallery-owlcarousel-style', plugin_dir_url( __FILE__ ) . 'js/owlcarousel/assets/owl.carousel.min.css', array( ), '2.0.0' );
37
+ wp_enqueue_style( 'wc-gallery-owlcarousel-theme-style', plugin_dir_url( __FILE__ ) . 'js/owlcarousel/assets/owl.theme.default.css', array( ), '2.0.0' );
38
  wp_register_script( 'wc-gallery-flexslider', plugin_dir_url( __FILE__ ) . 'js/flexslider/jquery.flexslider-min.js', array ( 'jquery' ), '2.2.0', true );
39
+ wp_register_script( 'wc-gallery-owlcarousel', plugin_dir_url( __FILE__ ) . 'js/owlcarousel/owl.carousel.min.js', array ( 'jquery' ), '2.0.0', true );
40
  wp_register_script( 'wc-gallery', plugin_dir_url( __FILE__ ) . 'js/gallery.js', array ( 'jquery', 'wordpresscanvas-imagesloaded' ), $ver, true );
41
  wp_register_script( 'wc-gallery-woocommerce-product', plugin_dir_url( __FILE__ ) . 'js/woocommerce.product.js', array( 'jquery' ), $ver, true );
42
 
includes/settings.php CHANGED
@@ -14,11 +14,30 @@ function wc_gallery_options_init() {
14
  foreach ( $wc_gallery_options as $tab => $o ) {
15
  foreach ( $o['sections'] as $oo ) {
16
  add_settings_section( $oo['section'], $oo['title'], '', 'wc-gallery-options' . $tab );
17
- foreach ( $oo['options'] as $ooo ) {
18
- $ooo['option_name'] = WC_GALLERY_PREFIX . $ooo['id'];
19
- $callback = wc_gallery_options_find_sanitize_callback( $ooo['type'] );
20
- register_setting( 'wc-gallery-options-'.$tab.'group', WC_GALLERY_PREFIX . $ooo['id'], $callback );
21
- add_settings_field('wc_gallery_'.$ooo['id'].'', '<label for="wc_gallery_'.$ooo['id'].'">'.__($ooo['title'] , 'wc_gallery' ).'</label>' , 'wc_gallery_options_display_setting', 'wc-gallery-options'.$tab, $oo['section'], $ooo );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
  }
24
  }
@@ -33,7 +52,7 @@ function wc_gallery_options_admin_menu() {
33
  }
34
 
35
  // add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
36
- $view_hook_name = add_submenu_page( 'themes.php', 'WC Gallery', 'WC Gallery', 'manage_options', 'wc-gallery-options', 'wc_gallery_options_display_page' );
37
  }
38
  add_action( 'admin_menu', 'wc_gallery_options_admin_menu' );
39
 
@@ -91,6 +110,29 @@ function wc_gallery_options_display_page() {
91
  <?php
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  /*
95
  * Display Options
96
  */
@@ -111,6 +153,9 @@ function wc_gallery_options_display_setting( $args ) {
111
  case 'checkbox' :
112
  wc_gallery_options_display_checkbox_field( $args );
113
  break;
 
 
 
114
  default :
115
  wc_gallery_options_input_field( $args );
116
  break;
@@ -180,6 +225,35 @@ function wc_gallery_options_display_checkbox_field( $args ) {
180
  <?php
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  /*
184
  * Sanitize Options
185
  */
@@ -191,11 +265,33 @@ function wc_gallery_options_find_sanitize_callback( $type ) {
191
  return 'esc_url_raw';
192
  case 'checkbox' :
193
  return 'wc_gallery_options_sanitize_checkbox';
 
 
194
  }
195
 
196
  return '';
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  function wc_gallery_options_sanitize_checkbox( $val ) {
200
  if ( $val )
201
  return 1;
@@ -233,12 +329,34 @@ add_action( 'admin_init', 'wc_gallery_remember_last_options_tab' );
233
  function wc_gallery_options_activation_hook() {
234
  global $wc_gallery_options;
235
 
236
- foreach ( $wc_gallery_options as $o ) {
237
- foreach ( $o['sections'] as $oo ) {
238
- foreach ( $oo['options'] as $ooo ) {
239
- $option_name = WC_GALLERY_PREFIX . $ooo['id'];
240
- add_option( $option_name, $ooo['default'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
  }
243
  }
244
  }
 
14
  foreach ( $wc_gallery_options as $tab => $o ) {
15
  foreach ( $o['sections'] as $oo ) {
16
  add_settings_section( $oo['section'], $oo['title'], '', 'wc-gallery-options' . $tab );
17
+ foreach( $oo['options'] as $ooo ) {
18
+ if ( isset( $ooo['group'] ) && is_array( $ooo['group'] ) ) {
19
+ foreach ( $ooo['group'] as $key => $oooo ) {
20
+ $oooo['option_name'] = WC_GALLERY_PREFIX . $oooo['id'];
21
+ $ooo['group'][ $key ]['option_name'] = WC_GALLERY_PREFIX . $oooo['id'];
22
+
23
+ if ( isset( $oooo['option_name'] ) ) {
24
+ $callback = wc_gallery_options_find_sanitize_callback( $oooo['type'] );
25
+ register_setting( 'wc-gallery-options-'.$tab.'group', $oooo['option_name'], $callback );
26
+ }
27
+ }
28
+ if ( isset( $ooo['id'] ) && isset( $ooo['title'] ) ) {
29
+ add_settings_field('wc_gallery_'.$ooo['id'].'', '<label for="wc_gallery_'.$ooo['id'].'">'.__($ooo['title'] , 'wc_gallery' ).'</label>' , 'wc_gallery_options_display_group', 'wc-gallery-options'.$tab, $oo['section'], $ooo );
30
+ }
31
+ }
32
+ else {
33
+ $ooo['option_name'] = WC_GALLERY_PREFIX . $ooo['id'];
34
+
35
+ if ( isset( $ooo['option_name'] ) ) {
36
+ $callback = wc_gallery_options_find_sanitize_callback( $ooo['type'] );
37
+ register_setting( 'wc-gallery-options-'.$tab.'group', $ooo['option_name'], $callback );
38
+ add_settings_field('wc_gallery_'.$ooo['option_name'].'', '<label for="wc_gallery_'.$ooo['option_name'].'">'.__($ooo['title'] , 'wc_gallery' ).'</label>' , 'wc_gallery_options_display_setting', 'wc-gallery-options'.$tab, $oo['section'], $ooo );
39
+ }
40
+ }
41
  }
42
  }
43
  }
52
  }
53
 
54
  // add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
55
+ $view_hook_name = add_submenu_page( 'themes.php', 'Gallery', 'Gallery', 'manage_options', 'wc-gallery-options', 'wc_gallery_options_display_page' );
56
  }
57
  add_action( 'admin_menu', 'wc_gallery_options_admin_menu' );
58
 
110
  <?php
111
  }
112
 
113
+ /**
114
+ * Call all the options displays in a given option
115
+ * group
116
+ *
117
+ * @since 3.5.2
118
+ * @access public
119
+ *
120
+ * @param array $args
121
+ * @return void
122
+ */
123
+ function wc_gallery_options_display_group( $args ) {
124
+ foreach ( $args['group'] as $g ) {
125
+ wc_gallery_options_display_setting( $g );
126
+ }
127
+ ?>
128
+
129
+ <?php if ( isset( $args['description'] ) ) : ?>
130
+ <p class="description"><?php echo $args['description']; ?></p>
131
+ <?php endif; ?>
132
+
133
+ <?php
134
+ }
135
+
136
  /*
137
  * Display Options
138
  */
153
  case 'checkbox' :
154
  wc_gallery_options_display_checkbox_field( $args );
155
  break;
156
+ case 'positive_number' :
157
+ wc_gallery_options_display_positive_number_input_field( $args );
158
+ break;
159
  default :
160
  wc_gallery_options_input_field( $args );
161
  break;
225
  <?php
226
  }
227
 
228
+ /**
229
+ * Display positive pixel input field.
230
+ *
231
+ * @since 3.5.2
232
+ * @access public
233
+ *
234
+ * @param array $args
235
+ * @return void
236
+ */
237
+ function wc_gallery_options_display_positive_number_input_field( $args ) {
238
+ extract( $args );
239
+
240
+ $val = get_option( $option_name, $default );
241
+ $val = preg_replace("/[^0-9]/", "",$val);
242
+ ?>
243
+
244
+ <?php if ( isset( $label ) ) : ?>
245
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
246
+ <?php endif; ?>
247
+
248
+ <input type="number" min="0" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
249
+
250
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
251
+ <p class="description"><?php echo $description; ?></p>
252
+ <?php endif; ?>
253
+
254
+ <?php
255
+ }
256
+
257
  /*
258
  * Sanitize Options
259
  */
265
  return 'esc_url_raw';
266
  case 'checkbox' :
267
  return 'wc_gallery_options_sanitize_checkbox';
268
+ case 'positive_number' :
269
+ return 'wc_gallery_options_sanitize_positive_number';
270
  }
271
 
272
  return '';
273
  }
274
 
275
+ /**
276
+ * Strips all non numerica characters and returns
277
+ * intval() of string. Only allows for positive values.
278
+ *
279
+ * @since 3.6
280
+ * @access public
281
+ *
282
+ * @param string $value
283
+ * @return void
284
+ */
285
+ function wc_gallery_options_sanitize_positive_number( $value ) {
286
+ $value = preg_replace("/[^0-9]/", "",$value);
287
+ $value = intval( $value );
288
+
289
+ if ( empty( $value ) )
290
+ $value = '0';
291
+
292
+ return $value;
293
+ }
294
+
295
  function wc_gallery_options_sanitize_checkbox( $val ) {
296
  if ( $val )
297
  return 1;
329
  function wc_gallery_options_activation_hook() {
330
  global $wc_gallery_options;
331
 
332
+ $initialize = false;
333
+
334
+ if ( ! WC_GALLERY_CURRENT_VERSION ) {
335
+ $initialize = true;
336
+ }
337
+ else if ( version_compare( WC_GALLERY_VERSION, WC_GALLERY_CURRENT_VERSION ) > 0 ) {
338
+ $initialize = true;
339
+ }
340
+
341
+ if ( $initialize ) {
342
+ update_option( WC_GALLERY_PREFIX . 'current_version', WC_GALLERY_VERSION );
343
+
344
+ foreach ( $wc_gallery_options as $o ) {
345
+ foreach ( $o['sections'] as $oo ) {
346
+ foreach ( $oo['options'] as $ooo ) {
347
+ if ( isset( $ooo['group'] ) && is_array( $ooo['group'] ) ) {
348
+ foreach ( $ooo['group'] as $key => $oooo ) {
349
+ $option_name = WC_GALLERY_PREFIX . $oooo['id'];
350
+ add_option( $option_name, $oooo['default'] );
351
+ }
352
+ }
353
+ else {
354
+ $option_name = WC_GALLERY_PREFIX . $ooo['id'];
355
+ add_option( $option_name, $ooo['default'] );
356
+ }
357
+ }
358
  }
359
  }
360
  }
361
  }
362
+ add_action( 'init', 'wc_gallery_options_activation_hook' );
readme.txt CHANGED
@@ -46,6 +46,15 @@ Insert a gallery through your dashboard. You will see extra dropdown settings wh
46
 
47
  == Changelog ==
48
 
 
 
 
 
 
 
 
 
 
49
  ### Version 1.11
50
 
51
  * Fixed a very obscure bug that kept image sizes from displaying.
46
 
47
  == Changelog ==
48
 
49
+ ### Version 1.12
50
+
51
+ * Use masonry library provided by WordPress
52
+ * loading jquery before masonry
53
+ * Added image sizes
54
+ * Replaced percentage gutter width with pixel value.
55
+ * Added Owl Carousel
56
+ * Added 2 more slider displays
57
+
58
  ### Version 1.11
59
 
60
  * Fixed a very obscure bug that kept image sizes from displaying.
wc-gallery.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wordpresscanvas.com/features/gallery/
5
  Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.11
9
  License: GPLv2 or later
10
  */
11
 
@@ -13,18 +13,76 @@ function wc_gallery_using_woocommerce() {
13
  return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
14
  }
15
 
16
- define( 'WC_GALLERY_VERSION', '1.11' );
17
  define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
18
  define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
19
  define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
20
  define( 'WC_GALLERY_USING_WOOCOMMERCE', wc_gallery_using_woocommerce() );
 
21
 
22
  global $wc_gallery_options;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
25
  require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
26
  require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
27
  require_once( dirname(__FILE__) . '/includes/scripts.php' ); // Adds plugin JS and CSS
28
  require_once( dirname(__FILE__) . '/includes/widgets.php' ); // include any widgets
29
-
30
- register_activation_hook( __FILE__, 'wc_gallery_options_activation_hook' );
5
  Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.12
9
  License: GPLv2 or later
10
  */
11
 
13
  return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
14
  }
15
 
16
+ define( 'WC_GALLERY_VERSION', '1.12' );
17
  define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
18
  define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
19
  define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
20
  define( 'WC_GALLERY_USING_WOOCOMMERCE', wc_gallery_using_woocommerce() );
21
+ define( 'WC_GALLERY_CURRENT_VERSION', get_option( WC_GALLERY_PREFIX . 'current_version' ) );
22
 
23
  global $wc_gallery_options;
24
+ global $wc_gallery_theme_support;
25
+
26
+ $wc_gallery_theme_support = array(
27
+ 'icon' => array(
28
+ 'size_w' => '48',
29
+ 'size_h' => '48',
30
+ 'crop' => true,
31
+ ),
32
+ 'square' => array(
33
+ 'size_w' => '300',
34
+ 'size_h' => '300',
35
+ 'crop' => true,
36
+ ),
37
+ 'small' => array(
38
+ 'size_w' => '250',
39
+ 'size_h' => '9999',
40
+ 'crop' => false,
41
+ ),
42
+ 'standard' => array(
43
+ 'size_w' => '550',
44
+ 'size_h' => '9999',
45
+ 'crop' => false,
46
+ ),
47
+ 'big' => array(
48
+ 'size_w' => '800',
49
+ 'size_h' => '9999',
50
+ 'crop' => false,
51
+ ),
52
+ 'fixedheightsmall' => array(
53
+ 'size_w' => '9999',
54
+ 'size_h' => '180',
55
+ 'crop' => false,
56
+ ),
57
+ 'fixedheightmedium' => array(
58
+ 'size_w' => '9999',
59
+ 'size_h' => '300',
60
+ 'crop' => false,
61
+ ),
62
+ 'fixedheight' => array(
63
+ 'size_w' => '9999',
64
+ 'size_h' => '500',
65
+ 'crop' => false,
66
+ ),
67
+ 'carouselsmall' => array(
68
+ 'size_w' => '210',
69
+ 'size_h' => '150',
70
+ 'crop' => true,
71
+ ),
72
+ 'carousel' => array(
73
+ 'size_w' => '400',
74
+ 'size_h' => '285',
75
+ 'crop' => true,
76
+ ),
77
+ 'slider' => array(
78
+ 'size_w' => '1100',
79
+ 'size_h' => '500',
80
+ 'crop' => true,
81
+ ),
82
+ );
83
 
84
  require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
85
  require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
86
  require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
87
  require_once( dirname(__FILE__) . '/includes/scripts.php' ); // Adds plugin JS and CSS
88
  require_once( dirname(__FILE__) . '/includes/widgets.php' ); // include any widgets