Responsive Lightbox & Gallery - Version 2.0

Version Description

  • New: Powerful gallery builder
  • New: 3 gallery templates - Basic Grid, Slider and Masonry
  • New: Magnific Popup lightbox
  • New: Iframe, Ajax, HTML5 and Inline lightbox content support
  • Tweak: Improved Visual Composer compatibility
  • Tweak: Revamped admin interface
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Responsive Lightbox & Gallery
Version 2.0
Comparing to
See all releases

Code changes from version 1.7.2 to 2.0

Files changed (101) hide show
  1. assets/fancybox/jquery.fancybox-1.3.4.js +3 -3
  2. assets/fancybox/jquery.fancybox.css +359 -0
  3. assets/fancybox/jquery.fancybox.js +1177 -0
  4. assets/fancybox/jquery.fancybox.min.css +1 -0
  5. assets/fancybox/jquery.fancybox.min.js +1 -0
  6. assets/featherlight/featherlight.css +160 -0
  7. assets/featherlight/featherlight.gallery.css +122 -0
  8. assets/featherlight/featherlight.gallery.js +169 -0
  9. assets/featherlight/featherlight.gallery.min.css +3 -3
  10. assets/featherlight/featherlight.gallery.min.js +3 -3
  11. assets/featherlight/featherlight.js +631 -0
  12. assets/featherlight/featherlight.min.css +3 -3
  13. assets/featherlight/featherlight.min.js +3 -3
  14. assets/imagelightbox/css/imagelightbox.css +5 -7
  15. assets/imagelightbox/css/imagelightbox.min.css +1 -0
  16. assets/imagelightbox/js/imagelightbox.js +315 -0
  17. assets/imagelightbox/js/imagelightbox.min.js +1 -1
  18. assets/imagesloaded/imagesloaded.pkgd.js +497 -0
  19. assets/imagesloaded/imagesloaded.pkgd.min.js +7 -0
  20. assets/infinitescroll/infinite-scroll.pkgd.js +2197 -0
  21. assets/infinitescroll/infinite-scroll.pkgd.min.js +12 -0
  22. assets/magnific/jquery.magnific-popup.js +1860 -0
  23. assets/magnific/jquery.magnific-popup.min.js +4 -0
  24. assets/magnific/magnific-popup.css +362 -0
  25. assets/magnific/magnific-popup.min.css +1 -0
  26. assets/masonry/masonry.pkgd.js +2502 -0
  27. assets/masonry/masonry.pkgd.min.js +9 -0
  28. assets/nivo/nivo-lightbox.css +205 -0
  29. assets/nivo/nivo-lightbox.js +411 -0
  30. assets/prettyphoto/css/prettyPhoto.css +796 -172
  31. assets/prettyphoto/css/prettyPhoto.min.css +1 -0
  32. assets/prettyphoto/js/jquery.prettyPhoto.min.js +1 -0
  33. assets/select2/css/select2.css +500 -0
  34. assets/select2/css/select2.min.css +1 -0
  35. assets/select2/js/i18n/af.js +3 -0
  36. assets/select2/js/i18n/ar.js +3 -0
  37. assets/select2/js/i18n/az.js +3 -0
  38. assets/select2/js/i18n/bg.js +3 -0
  39. assets/select2/js/i18n/bs.js +3 -0
  40. assets/select2/js/i18n/ca.js +3 -0
  41. assets/select2/js/i18n/cs.js +3 -0
  42. assets/select2/js/i18n/da.js +3 -0
  43. assets/select2/js/i18n/de.js +3 -0
  44. assets/select2/js/i18n/dsb.js +3 -0
  45. assets/select2/js/i18n/el.js +3 -0
  46. assets/select2/js/i18n/en.js +3 -0
  47. assets/select2/js/i18n/es.js +3 -0
  48. assets/select2/js/i18n/et.js +3 -0
  49. assets/select2/js/i18n/eu.js +3 -0
  50. assets/select2/js/i18n/fa.js +3 -0
  51. assets/select2/js/i18n/fi.js +3 -0
  52. assets/select2/js/i18n/fr.js +3 -0
  53. assets/select2/js/i18n/gl.js +3 -0
  54. assets/select2/js/i18n/he.js +3 -0
  55. assets/select2/js/i18n/hi.js +3 -0
  56. assets/select2/js/i18n/hr.js +3 -0
  57. assets/select2/js/i18n/hsb.js +3 -0
  58. assets/select2/js/i18n/hu.js +3 -0
  59. assets/select2/js/i18n/hy.js +3 -0
  60. assets/select2/js/i18n/id.js +3 -0
  61. assets/select2/js/i18n/is.js +3 -0
  62. assets/select2/js/i18n/it.js +3 -0
  63. assets/select2/js/i18n/ja.js +3 -0
  64. assets/select2/js/i18n/km.js +3 -0
  65. assets/select2/js/i18n/ko.js +3 -0
  66. assets/select2/js/i18n/lt.js +3 -0
  67. assets/select2/js/i18n/lv.js +3 -0
  68. assets/select2/js/i18n/mk.js +3 -0
  69. assets/select2/js/i18n/ms.js +3 -0
  70. assets/select2/js/i18n/nb.js +3 -0
  71. assets/select2/js/i18n/nl.js +3 -0
  72. assets/select2/js/i18n/pl.js +3 -0
  73. assets/select2/js/i18n/ps.js +3 -0
  74. assets/select2/js/i18n/pt-BR.js +3 -0
  75. assets/select2/js/i18n/pt.js +3 -0
  76. assets/select2/js/i18n/ro.js +3 -0
  77. assets/select2/js/i18n/ru.js +3 -0
  78. assets/select2/js/i18n/sk.js +3 -0
  79. assets/select2/js/i18n/sl.js +3 -0
  80. assets/select2/js/i18n/sr-Cyrl.js +3 -0
  81. assets/select2/js/i18n/sr.js +3 -0
  82. assets/select2/js/i18n/sv.js +3 -0
  83. assets/select2/js/i18n/th.js +3 -0
  84. assets/select2/js/i18n/tr.js +3 -0
  85. assets/select2/js/i18n/uk.js +3 -0
  86. assets/select2/js/i18n/vi.js +3 -0
  87. assets/select2/js/i18n/zh-CN.js +3 -0
  88. assets/select2/js/i18n/zh-TW.js +3 -0
  89. assets/select2/js/select2.js +5833 -0
  90. assets/select2/js/select2.min.js +1 -0
  91. assets/slippry/images/arrows.svg +10 -0
  92. assets/slippry/images/sy-loader.gif +0 -0
  93. assets/slippry/slippry.css +285 -0
  94. assets/slippry/slippry.js +710 -0
  95. assets/slippry/slippry.min.css +1 -0
  96. assets/slippry/slippry.min.js +14 -0
  97. assets/swipebox/README.md +8 -21
  98. assets/tosrus/css/jquery.tosrus.all.css +600 -117
  99. assets/tosrus/css/jquery.tosrus.min.all.css +1 -0
  100. assets/tosrus/js/hammer.js +2643 -0
  101. assets/tosrus/js/hammer.min.js +3 -4
assets/fancybox/jquery.fancybox-1.3.4.js CHANGED
@@ -28,7 +28,7 @@
28
 
29
  titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
30
 
31
- isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
32
 
33
  /*
34
  * Private methods
@@ -828,12 +828,12 @@
828
  selectedArray = [];
829
  selectedIndex = 0;
830
 
831
- var rel = $(this).attr('rel') || $(this).data('rel');
832
 
833
  if (!rel || rel == '' || rel === 'nofollow') {
834
  selectedArray.push(this);
835
  } else {
836
- selectedArray = $('a[rel="'+rel+'"], area[rel="'+rel+'"], a[data-rel="'+rel+'"]');
837
  selectedIndex = selectedArray.index(this);
838
  }
839
 
28
 
29
  titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
30
 
31
+ isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
32
 
33
  /*
34
  * Private methods
828
  selectedArray = [];
829
  selectedIndex = 0;
830
 
831
+ var rel = $(this).attr('rel') || '';
832
 
833
  if (!rel || rel == '' || rel === 'nofollow') {
834
  selectedArray.push(this);
835
  } else {
836
+ selectedArray = $('a[rel="'+rel+'"], area[rel="'+rel+'"]');
837
  selectedIndex = selectedArray.index(this);
838
  }
839
 
assets/fancybox/jquery.fancybox.css ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ #fancybox-loading {
19
+ position: fixed;
20
+ top: 50%;
21
+ left: 50%;
22
+ width: 40px;
23
+ height: 40px;
24
+ margin-top: -20px;
25
+ margin-left: -20px;
26
+ cursor: pointer;
27
+ overflow: hidden;
28
+ z-index: 1104;
29
+ display: none;
30
+ }
31
+
32
+ #fancybox-loading div {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ width: 40px;
37
+ height: 480px;
38
+ background-image: url('fancybox.png');
39
+ }
40
+
41
+ #fancybox-overlay {
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ width: 100%;
46
+ z-index: 1100;
47
+ display: none;
48
+ }
49
+
50
+ #fancybox-tmp {
51
+ padding: 0;
52
+ margin: 0;
53
+ border: 0;
54
+ overflow: auto;
55
+ display: none;
56
+ }
57
+
58
+ #fancybox-wrap {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ padding: 20px;
63
+ z-index: 1101;
64
+ outline: none;
65
+ display: none;
66
+ }
67
+
68
+ #fancybox-outer {
69
+ position: relative;
70
+ width: 100%;
71
+ height: 100%;
72
+ background: #fff;
73
+ }
74
+
75
+ #fancybox-content {
76
+ width: 0;
77
+ height: 0;
78
+ padding: 0;
79
+ outline: none;
80
+ position: relative;
81
+ overflow: hidden;
82
+ z-index: 1102;
83
+ border: 0px solid #fff;
84
+ }
85
+
86
+ #fancybox-hide-sel-frame {
87
+ position: absolute;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ background: transparent;
93
+ z-index: 1101;
94
+ }
95
+
96
+ #fancybox-close {
97
+ position: absolute;
98
+ top: -15px;
99
+ right: -15px;
100
+ width: 30px;
101
+ height: 30px;
102
+ background: transparent url('fancybox.png') -40px 0px;
103
+ cursor: pointer;
104
+ z-index: 1103;
105
+ display: none;
106
+ }
107
+
108
+ #fancybox-error {
109
+ color: #444;
110
+ font: normal 12px/20px Arial;
111
+ padding: 14px;
112
+ margin: 0;
113
+ }
114
+
115
+ #fancybox-img {
116
+ width: 100%;
117
+ height: 100%;
118
+ padding: 0;
119
+ margin: 0;
120
+ border: none;
121
+ outline: none;
122
+ line-height: 0;
123
+ vertical-align: top;
124
+ }
125
+
126
+ #fancybox-frame {
127
+ width: 100%;
128
+ height: 100%;
129
+ border: none;
130
+ display: block;
131
+ }
132
+
133
+ #fancybox-left, #fancybox-right {
134
+ position: absolute;
135
+ bottom: 0px;
136
+ height: 100%;
137
+ width: 35%;
138
+ cursor: pointer;
139
+ outline: none;
140
+ background: transparent url('blank.gif');
141
+ z-index: 1102;
142
+ display: none;
143
+ }
144
+
145
+ #fancybox-left {
146
+ left: 0px;
147
+ }
148
+
149
+ #fancybox-right {
150
+ right: 0px;
151
+ }
152
+
153
+ #fancybox-left-ico, #fancybox-right-ico {
154
+ position: absolute;
155
+ top: 50%;
156
+ left: -9999px;
157
+ width: 30px;
158
+ height: 30px;
159
+ margin-top: -15px;
160
+ cursor: pointer;
161
+ z-index: 1102;
162
+ display: block;
163
+ }
164
+
165
+ #fancybox-left-ico {
166
+ background-image: url('fancybox.png');
167
+ background-position: -40px -30px;
168
+ }
169
+
170
+ #fancybox-right-ico {
171
+ background-image: url('fancybox.png');
172
+ background-position: -40px -60px;
173
+ }
174
+
175
+ #fancybox-left:hover, #fancybox-right:hover {
176
+ visibility: visible; /* IE6 */
177
+ }
178
+
179
+ #fancybox-left:hover span {
180
+ left: 20px;
181
+ }
182
+
183
+ #fancybox-right:hover span {
184
+ left: auto;
185
+ right: 20px;
186
+ }
187
+
188
+ .fancybox-bg {
189
+ position: absolute;
190
+ padding: 0;
191
+ margin: 0;
192
+ border: 0;
193
+ width: 20px;
194
+ height: 20px;
195
+ z-index: 1001;
196
+ }
197
+
198
+ #fancybox-bg-n {
199
+ top: -20px;
200
+ left: 0;
201
+ width: 100%;
202
+ background-image: url('fancybox-x.png');
203
+ }
204
+
205
+ #fancybox-bg-ne {
206
+ top: -20px;
207
+ right: -20px;
208
+ background-image: url('fancybox.png');
209
+ background-position: -40px -162px;
210
+ }
211
+
212
+ #fancybox-bg-e {
213
+ top: 0;
214
+ right: -20px;
215
+ height: 100%;
216
+ background-image: url('fancybox-y.png');
217
+ background-position: -20px 0px;
218
+ }
219
+
220
+ #fancybox-bg-se {
221
+ bottom: -20px;
222
+ right: -20px;
223
+ background-image: url('fancybox.png');
224
+ background-position: -40px -182px;
225
+ }
226
+
227
+ #fancybox-bg-s {
228
+ bottom: -20px;
229
+ left: 0;
230
+ width: 100%;
231
+ background-image: url('fancybox-x.png');
232
+ background-position: 0px -20px;
233
+ }
234
+
235
+ #fancybox-bg-sw {
236
+ bottom: -20px;
237
+ left: -20px;
238
+ background-image: url('fancybox.png');
239
+ background-position: -40px -142px;
240
+ }
241
+
242
+ #fancybox-bg-w {
243
+ top: 0;
244
+ left: -20px;
245
+ height: 100%;
246
+ background-image: url('fancybox-y.png');
247
+ }
248
+
249
+ #fancybox-bg-nw {
250
+ top: -20px;
251
+ left: -20px;
252
+ background-image: url('fancybox.png');
253
+ background-position: -40px -122px;
254
+ }
255
+
256
+ #fancybox-title {
257
+ font-family: Helvetica;
258
+ font-size: 12px;
259
+ z-index: 1102;
260
+ }
261
+
262
+ .fancybox-title-inside {
263
+ padding-bottom: 10px;
264
+ text-align: center;
265
+ color: #333;
266
+ background: #fff;
267
+ position: relative;
268
+ }
269
+
270
+ .fancybox-title-outside {
271
+ padding-top: 10px;
272
+ color: #fff;
273
+ }
274
+
275
+ .fancybox-title-over {
276
+ position: absolute;
277
+ bottom: 0;
278
+ left: 0;
279
+ color: #FFF;
280
+ text-align: left;
281
+ }
282
+
283
+ #fancybox-title-over {
284
+ padding: 10px;
285
+ background-image: url('fancy_title_over.png');
286
+ display: block;
287
+ }
288
+
289
+ .fancybox-title-float {
290
+ position: absolute;
291
+ left: 0;
292
+ bottom: -20px;
293
+ height: 32px;
294
+ }
295
+
296
+ #fancybox-title-float-wrap {
297
+ border: none;
298
+ border-collapse: collapse;
299
+ width: auto;
300
+ }
301
+
302
+ #fancybox-title-float-wrap td {
303
+ border: none;
304
+ white-space: nowrap;
305
+ }
306
+
307
+ #fancybox-title-float-left {
308
+ padding: 0 0 0 15px;
309
+ background: url('fancybox.png') -40px -90px no-repeat;
310
+ }
311
+
312
+ #fancybox-title-float-main {
313
+ color: #FFF;
314
+ line-height: 29px;
315
+ font-weight: bold;
316
+ padding: 0 0 3px 0;
317
+ background: url('fancybox-x.png') 0px -40px;
318
+ }
319
+
320
+ #fancybox-title-float-right {
321
+ padding: 0 0 0 15px;
322
+ background: url('fancybox.png') -55px -90px no-repeat;
323
+ }
324
+
325
+ /* IE6 */
326
+
327
+ .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale', enabled='true'); }
328
+
329
+ .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale', enabled='true'); }
330
+ .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale', enabled='true'); }
331
+
332
+ .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale', enabled='true'); zoom: 1; }
333
+ .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale', enabled='true'); }
334
+ .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale', enabled='true'); }
335
+ .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale', enabled='true'); }
336
+
337
+ .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
338
+ height: expression(this.parentNode.clientHeight + "px");
339
+ }
340
+
341
+ #fancybox-loading.fancybox-ie6 {
342
+ position: absolute; margin-top: 0;
343
+ top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
344
+ }
345
+
346
+ #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale', enabled='true'); }
347
+
348
+ /* IE6, IE7, IE8 */
349
+
350
+ .fancybox-ie .fancybox-bg { background: transparent !important; }
351
+
352
+ .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale', enabled='true'); }
353
+ .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale', enabled='true'); }
354
+ .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale', enabled='true'); }
355
+ .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale', enabled='true'); }
356
+ .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale', enabled='true'); }
357
+ .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale', enabled='true'); }
358
+ .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale', enabled='true'); }
359
+ .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale', enabled='true'); }
assets/fancybox/jquery.fancybox.js ADDED
@@ -0,0 +1,1177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function($) {
19
+ var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
20
+
21
+ videoToShow = '',
22
+
23
+ selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
24
+
25
+ ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
26
+
27
+ loadingTimer, loadingFrame = 1,
28
+
29
+ titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
30
+
31
+ isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
32
+
33
+ /*
34
+ * Private methods
35
+ */
36
+
37
+ _abort = function() {
38
+ loading.hide();
39
+
40
+ imgPreloader.onerror = imgPreloader.onload = null;
41
+
42
+ if (ajaxLoader) {
43
+ ajaxLoader.abort();
44
+ }
45
+
46
+ tmp.empty();
47
+ },
48
+
49
+ _error = function() {
50
+ if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
51
+ loading.hide();
52
+ busy = false;
53
+ return;
54
+ }
55
+
56
+ selectedOpts.titleShow = false;
57
+
58
+ selectedOpts.width = 'auto';
59
+ selectedOpts.height = 'auto';
60
+
61
+ tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
62
+
63
+ _process_inline();
64
+ },
65
+
66
+ _is_video = function(videoURL) {
67
+ var matchesYoutube = videoURL.match(/(?:(?:http|https):\/\/)?(?:www\.)?youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)/);
68
+
69
+ if(matchesYoutube) {
70
+ videoToShow = '//www.youtube.com/embed/'+matchesYoutube[1];
71
+ return true;
72
+ }
73
+
74
+ var matchesVimeo = videoURL.match(/(?:(?:http|https):\/\/)?(?:www\.)?vimeo.com\/([0-9]+)/);
75
+
76
+ if (matchesVimeo){
77
+ videoToShow = '//player.vimeo.com/video/'+matchesVimeo[1];
78
+ return true;
79
+ }
80
+
81
+ return false;
82
+ },
83
+
84
+ _start = function() {
85
+ var obj = selectedArray[ selectedIndex ],
86
+ href,
87
+ type,
88
+ title,
89
+ str,
90
+ emb,
91
+ ret;
92
+
93
+ _abort();
94
+
95
+ selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
96
+
97
+ ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
98
+
99
+ if (ret === false) {
100
+ busy = false;
101
+ return;
102
+ } else if (typeof ret == 'object') {
103
+ selectedOpts = $.extend(selectedOpts, ret);
104
+ }
105
+
106
+ title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
107
+
108
+ if (obj.nodeName && !selectedOpts.orig) {
109
+ selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
110
+ }
111
+
112
+ if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
113
+ title = selectedOpts.orig.attr('alt');
114
+ }
115
+
116
+ href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
117
+
118
+ if ((/^(?:javascript)/i).test(href) || href == '#') {
119
+ href = null;
120
+ }
121
+
122
+ if (selectedOpts.type) {
123
+ type = selectedOpts.type;
124
+
125
+ if (!href) {
126
+ href = selectedOpts.content;
127
+ }
128
+
129
+ } else if (selectedOpts.content) {
130
+ type = 'html';
131
+
132
+ } else if (href) {
133
+ if (href.match(imgRegExp)) {
134
+ type = 'image';
135
+
136
+ } else if (href.match(swfRegExp)) {
137
+ type = 'swf';
138
+
139
+ } else if ($(obj).hasClass('iframe') || _is_video($(obj).attr('href'))) {
140
+ type = 'iframe';
141
+
142
+ } else if (href.indexOf("#") === 0) {
143
+ type = 'inline';
144
+
145
+ } else {
146
+ type = 'ajax';
147
+ }
148
+ }
149
+
150
+ if (!type) {
151
+ _error();
152
+ return;
153
+ }
154
+
155
+ if (type == 'inline') {
156
+ obj = href.substr(href.indexOf("#"));
157
+ type = $(obj).length > 0 ? 'inline' : 'ajax';
158
+ }
159
+
160
+ selectedOpts.type = type;
161
+ selectedOpts.href = href;
162
+ selectedOpts.title = title;
163
+
164
+ if (selectedOpts.autoDimensions) {
165
+ if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
166
+ selectedOpts.width = 'auto';
167
+ selectedOpts.height = 'auto';
168
+ } else {
169
+ selectedOpts.autoDimensions = false;
170
+ }
171
+ }
172
+
173
+ if (selectedOpts.modal) {
174
+ selectedOpts.overlayShow = true;
175
+ selectedOpts.hideOnOverlayClick = false;
176
+ selectedOpts.hideOnContentClick = false;
177
+ selectedOpts.enableEscapeButton = false;
178
+ selectedOpts.showCloseButton = false;
179
+ }
180
+
181
+ selectedOpts.padding = parseInt(selectedOpts.padding, 10);
182
+ selectedOpts.margin = parseInt(selectedOpts.margin, 10);
183
+
184
+ tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
185
+
186
+ $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
187
+ $(this).replaceWith(content.children());
188
+ });
189
+
190
+ switch (type) {
191
+ case 'html' :
192
+ tmp.html( selectedOpts.content );
193
+ _process_inline();
194
+ break;
195
+
196
+ case 'inline' :
197
+ if ( $(obj).parent().is('#fancybox-content') === true) {
198
+ busy = false;
199
+ return;
200
+ }
201
+
202
+ $('<div class="fancybox-inline-tmp" />')
203
+ .hide()
204
+ .insertBefore( $(obj) )
205
+ .bind('fancybox-cleanup', function() {
206
+ $(this).replaceWith(content.children());
207
+ }).bind('fancybox-cancel', function() {
208
+ $(this).replaceWith(tmp.children());
209
+ });
210
+
211
+ $(obj).appendTo(tmp);
212
+
213
+ _process_inline();
214
+ break;
215
+
216
+ case 'image':
217
+ busy = false;
218
+
219
+ $.fancybox.showActivity();
220
+
221
+ imgPreloader = new Image();
222
+
223
+ imgPreloader.onerror = function() {
224
+ _error();
225
+ };
226
+
227
+ imgPreloader.onload = function() {
228
+ busy = true;
229
+
230
+ imgPreloader.onerror = imgPreloader.onload = null;
231
+
232
+ _process_image();
233
+ };
234
+
235
+ imgPreloader.src = href;
236
+ break;
237
+
238
+ case 'swf':
239
+ selectedOpts.scrolling = 'no';
240
+
241
+ str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
242
+ emb = '';
243
+
244
+ $.each(selectedOpts.swf, function(name, val) {
245
+ str += '<param name="' + name + '" value="' + val + '"></param>';
246
+ emb += ' ' + name + '="' + val + '"';
247
+ });
248
+
249
+ str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
250
+
251
+ tmp.html(str);
252
+
253
+ _process_inline();
254
+ break;
255
+
256
+ case 'ajax':
257
+ busy = false;
258
+
259
+ $.fancybox.showActivity();
260
+
261
+ selectedOpts.ajax.win = selectedOpts.ajax.success;
262
+
263
+ ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
264
+ url : href,
265
+ data : selectedOpts.ajax.data || {},
266
+ error : function(XMLHttpRequest, textStatus, errorThrown) {
267
+ if ( XMLHttpRequest.status > 0 ) {
268
+ _error();
269
+ }
270
+ },
271
+ success : function(data, textStatus, XMLHttpRequest) {
272
+ var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
273
+ if (o.status == 200) {
274
+ if ( typeof selectedOpts.ajax.win == 'function' ) {
275
+ ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
276
+
277
+ if (ret === false) {
278
+ loading.hide();
279
+ return;
280
+ } else if (typeof ret == 'string' || typeof ret == 'object') {
281
+ data = ret;
282
+ }
283
+ }
284
+
285
+ tmp.html( data );
286
+ _process_inline();
287
+ }
288
+ }
289
+ }));
290
+
291
+ break;
292
+
293
+ case 'iframe':
294
+ _show();
295
+ break;
296
+ }
297
+ },
298
+
299
+ _process_inline = function() {
300
+ var
301
+ w = selectedOpts.width,
302
+ h = selectedOpts.height;
303
+
304
+ if (w.toString().indexOf('%') > -1) {
305
+ w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
306
+
307
+ } else {
308
+ w = w == 'auto' ? 'auto' : w + 'px';
309
+ }
310
+
311
+ if (h.toString().indexOf('%') > -1) {
312
+ h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
313
+
314
+ } else {
315
+ h = h == 'auto' ? 'auto' : h + 'px';
316
+ }
317
+
318
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
319
+
320
+ selectedOpts.width = tmp.width();
321
+ selectedOpts.height = tmp.height();
322
+
323
+ _show();
324
+ },
325
+
326
+ _process_image = function() {
327
+ selectedOpts.width = imgPreloader.width;
328
+ selectedOpts.height = imgPreloader.height;
329
+
330
+ $("<img />").attr({
331
+ 'id' : 'fancybox-img',
332
+ 'src' : imgPreloader.src,
333
+ 'alt' : selectedOpts.title
334
+ }).appendTo( tmp );
335
+
336
+ _show();
337
+ },
338
+
339
+ _show = function() {
340
+ var pos, equal;
341
+
342
+ loading.hide();
343
+
344
+ if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
345
+ $.event.trigger('fancybox-cancel');
346
+
347
+ busy = false;
348
+ return;
349
+ }
350
+
351
+ busy = true;
352
+
353
+ $(content.add( overlay )).unbind();
354
+
355
+ $(window).unbind("resize.fb scroll.fb");
356
+ $(document).unbind('keydown.fb');
357
+
358
+ if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
359
+ wrap.css('height', wrap.height());
360
+ }
361
+
362
+ currentArray = selectedArray;
363
+ currentIndex = selectedIndex;
364
+ currentOpts = selectedOpts;
365
+
366
+ if (currentOpts.overlayShow) {
367
+ overlay.css({
368
+ 'background-color' : currentOpts.overlayColor,
369
+ 'opacity' : currentOpts.overlayOpacity,
370
+ 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
371
+ 'height' : $(document).height()
372
+ });
373
+
374
+ if (!overlay.is(':visible')) {
375
+ if (isIE6) {
376
+ $('select:not(#fancybox-tmp select)').filter(function() {
377
+ return this.style.visibility !== 'hidden';
378
+ }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
379
+ this.style.visibility = 'inherit';
380
+ });
381
+ }
382
+
383
+ overlay.show();
384
+ }
385
+ } else {
386
+ overlay.hide();
387
+ }
388
+
389
+ final_pos = _get_zoom_to();
390
+
391
+ _process_title();
392
+
393
+ if (wrap.is(":visible")) {
394
+ $( close.add( nav_left ).add( nav_right ) ).hide();
395
+
396
+ pos = wrap.position(),
397
+
398
+ start_pos = {
399
+ top : pos.top,
400
+ left : pos.left,
401
+ width : wrap.width(),
402
+ height : wrap.height()
403
+ };
404
+
405
+ equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
406
+
407
+ content.fadeTo(currentOpts.changeFade, 0.3, function() {
408
+ var finish_resizing = function() {
409
+ content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
410
+ };
411
+
412
+ $.event.trigger('fancybox-change');
413
+
414
+ content
415
+ .empty()
416
+ .removeAttr('filter')
417
+ .css({
418
+ 'border-width' : currentOpts.padding,
419
+ 'width' : final_pos.width - currentOpts.padding * 2,
420
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
421
+ });
422
+
423
+ if (equal) {
424
+ finish_resizing();
425
+
426
+ } else {
427
+ fx.prop = 0;
428
+
429
+ $(fx).animate({prop: 1}, {
430
+ duration : currentOpts.changeSpeed,
431
+ easing : currentOpts.easingChange,
432
+ step : _draw,
433
+ complete : finish_resizing
434
+ });
435
+ }
436
+ });
437
+
438
+ return;
439
+ }
440
+
441
+ wrap.removeAttr("style");
442
+
443
+ content.css('border-width', currentOpts.padding);
444
+
445
+ if (currentOpts.transitionIn == 'elastic') {
446
+ start_pos = _get_zoom_from();
447
+
448
+ content.html( tmp.contents() );
449
+
450
+ wrap.show();
451
+
452
+ if (currentOpts.opacity) {
453
+ final_pos.opacity = 0;
454
+ }
455
+
456
+ fx.prop = 0;
457
+
458
+ $(fx).animate({prop: 1}, {
459
+ duration : currentOpts.speedIn,
460
+ easing : currentOpts.easingIn,
461
+ step : _draw,
462
+ complete : _finish
463
+ });
464
+
465
+ return;
466
+ }
467
+
468
+ if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
469
+ title.show();
470
+ }
471
+
472
+ content
473
+ .css({
474
+ 'width' : final_pos.width - currentOpts.padding * 2,
475
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
476
+ })
477
+ .html( tmp.contents() );
478
+
479
+ wrap
480
+ .css(final_pos)
481
+ .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
482
+ },
483
+
484
+ _format_title = function(title) {
485
+ if (title && title.length) {
486
+ if (currentOpts.titlePosition == 'float') {
487
+ return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
488
+ }
489
+
490
+ return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
491
+ }
492
+
493
+ return false;
494
+ },
495
+
496
+ _process_title = function() {
497
+ titleStr = currentOpts.title || '';
498
+ titleHeight = 0;
499
+
500
+ title
501
+ .empty()
502
+ .removeAttr('style')
503
+ .removeClass();
504
+
505
+ if (currentOpts.titleShow === false) {
506
+ title.hide();
507
+ return;
508
+ }
509
+
510
+ titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
511
+
512
+ if (!titleStr || titleStr === '') {
513
+ title.hide();
514
+ return;
515
+ }
516
+
517
+ title
518
+ .addClass('fancybox-title-' + currentOpts.titlePosition)
519
+ .html( titleStr )
520
+ .appendTo( 'body' )
521
+ .show();
522
+
523
+ switch (currentOpts.titlePosition) {
524
+ case 'inside':
525
+ title
526
+ .css({
527
+ 'width' : final_pos.width - (currentOpts.padding * 2),
528
+ 'marginLeft' : currentOpts.padding,
529
+ 'marginRight' : currentOpts.padding
530
+ });
531
+
532
+ titleHeight = title.outerHeight(true);
533
+
534
+ title.appendTo( outer );
535
+
536
+ final_pos.height += titleHeight;
537
+ break;
538
+
539
+ case 'over':
540
+ title
541
+ .css({
542
+ 'marginLeft' : currentOpts.padding,
543
+ 'width' : final_pos.width - (currentOpts.padding * 2),
544
+ 'bottom' : currentOpts.padding
545
+ })
546
+ .appendTo( outer );
547
+ break;
548
+
549
+ case 'float':
550
+ title
551
+ .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
552
+ .appendTo( wrap );
553
+ break;
554
+
555
+ default:
556
+ title
557
+ .css({
558
+ 'width' : final_pos.width - (currentOpts.padding * 2),
559
+ 'paddingLeft' : currentOpts.padding,
560
+ 'paddingRight' : currentOpts.padding
561
+ })
562
+ .appendTo( wrap );
563
+ break;
564
+ }
565
+
566
+ title.hide();
567
+ },
568
+
569
+ _set_navigation = function() {
570
+ if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
571
+ $(document).bind('keydown.fb', function(e) {
572
+ if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
573
+ e.preventDefault();
574
+ $.fancybox.close();
575
+
576
+ } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
577
+ e.preventDefault();
578
+ $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
579
+ }
580
+ });
581
+ }
582
+
583
+ if (!currentOpts.showNavArrows) {
584
+ nav_left.hide();
585
+ nav_right.hide();
586
+ return;
587
+ }
588
+
589
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
590
+ nav_left.show();
591
+ }
592
+
593
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
594
+ nav_right.show();
595
+ }
596
+ },
597
+
598
+ _finish = function () {
599
+ if (!$.support.opacity) {
600
+ content.get(0).style.removeAttribute('filter');
601
+ wrap.get(0).style.removeAttribute('filter');
602
+ }
603
+
604
+ if (selectedOpts.autoDimensions) {
605
+ content.css('height', 'auto');
606
+ }
607
+
608
+ wrap.css('height', 'auto');
609
+
610
+ if (titleStr && titleStr.length) {
611
+ title.show();
612
+ }
613
+
614
+ if (currentOpts.showCloseButton) {
615
+ close.show();
616
+ }
617
+
618
+ _set_navigation();
619
+
620
+ if (currentOpts.hideOnContentClick) {
621
+ content.bind('click', $.fancybox.close);
622
+ }
623
+
624
+ if (currentOpts.hideOnOverlayClick) {
625
+ overlay.bind('click', $.fancybox.close);
626
+ }
627
+
628
+ $(window).bind("resize.fb", $.fancybox.resize);
629
+
630
+ if (currentOpts.centerOnScroll) {
631
+ $(window).bind("scroll.fb", $.fancybox.center);
632
+ }
633
+
634
+ if (currentOpts.type == 'iframe') {
635
+ $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + (videoToShow !== '' ? videoToShow : currentOpts.href) + '"></iframe>').appendTo(content);
636
+
637
+ videoToShow = ''
638
+ }
639
+
640
+ wrap.show();
641
+
642
+ busy = false;
643
+
644
+ $.fancybox.center();
645
+
646
+ currentOpts.onComplete(currentArray, currentIndex, currentOpts);
647
+
648
+ _preload_images();
649
+ },
650
+
651
+ _preload_images = function() {
652
+ var href,
653
+ objNext;
654
+
655
+ if ((currentArray.length -1) > currentIndex) {
656
+ href = currentArray[ currentIndex + 1 ].href;
657
+
658
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
659
+ objNext = new Image();
660
+ objNext.src = href;
661
+ }
662
+ }
663
+
664
+ if (currentIndex > 0) {
665
+ href = currentArray[ currentIndex - 1 ].href;
666
+
667
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
668
+ objNext = new Image();
669
+ objNext.src = href;
670
+ }
671
+ }
672
+ },
673
+
674
+ _draw = function(pos) {
675
+ var dim = {
676
+ width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
677
+ height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
678
+
679
+ top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
680
+ left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
681
+ };
682
+
683
+ if (typeof final_pos.opacity !== 'undefined') {
684
+ dim.opacity = pos < 0.5 ? 0.5 : pos;
685
+ }
686
+
687
+ wrap.css(dim);
688
+
689
+ content.css({
690
+ 'width' : dim.width - currentOpts.padding * 2,
691
+ 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
692
+ });
693
+ },
694
+
695
+ _get_viewport = function() {
696
+ return [
697
+ $(window).width() - (currentOpts.margin * 2),
698
+ $(window).height() - (currentOpts.margin * 2),
699
+ $(document).scrollLeft() + currentOpts.margin,
700
+ $(document).scrollTop() + currentOpts.margin
701
+ ];
702
+ },
703
+
704
+ _get_zoom_to = function () {
705
+ var view = _get_viewport(),
706
+ to = {},
707
+ resize = currentOpts.autoScale,
708
+ double_padding = currentOpts.padding * 2,
709
+ ratio;
710
+
711
+ if (currentOpts.width.toString().indexOf('%') > -1) {
712
+ to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
713
+ } else {
714
+ to.width = currentOpts.width + double_padding;
715
+ }
716
+
717
+ if (currentOpts.height.toString().indexOf('%') > -1) {
718
+ to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
719
+ } else {
720
+ to.height = currentOpts.height + double_padding;
721
+ }
722
+
723
+ if (resize && (to.width > view[0] || to.height > view[1])) {
724
+ if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
725
+ ratio = (currentOpts.width ) / (currentOpts.height );
726
+
727
+ if ((to.width ) > view[0]) {
728
+ to.width = view[0];
729
+ to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
730
+ }
731
+
732
+ if ((to.height) > view[1]) {
733
+ to.height = view[1];
734
+ to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
735
+ }
736
+
737
+ } else {
738
+ to.width = Math.min(to.width, view[0]);
739
+ to.height = Math.min(to.height, view[1]);
740
+ }
741
+ }
742
+
743
+ to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
744
+ to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
745
+
746
+ return to;
747
+ },
748
+
749
+ _get_obj_pos = function(obj) {
750
+ var pos = obj.offset();
751
+
752
+ pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
753
+ pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
754
+
755
+ pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
756
+ pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
757
+
758
+ pos.width = obj.width();
759
+ pos.height = obj.height();
760
+
761
+ return pos;
762
+ },
763
+
764
+ _get_zoom_from = function() {
765
+ var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
766
+ from = {},
767
+ pos,
768
+ view;
769
+
770
+ if (orig && orig.length) {
771
+ pos = _get_obj_pos(orig);
772
+
773
+ from = {
774
+ width : pos.width + (currentOpts.padding * 2),
775
+ height : pos.height + (currentOpts.padding * 2),
776
+ top : pos.top - currentOpts.padding - 20,
777
+ left : pos.left - currentOpts.padding - 20
778
+ };
779
+
780
+ } else {
781
+ view = _get_viewport();
782
+
783
+ from = {
784
+ width : currentOpts.padding * 2,
785
+ height : currentOpts.padding * 2,
786
+ top : parseInt(view[3] + view[1] * 0.5, 10),
787
+ left : parseInt(view[2] + view[0] * 0.5, 10)
788
+ };
789
+ }
790
+
791
+ return from;
792
+ },
793
+
794
+ _animate_loading = function() {
795
+ if (!loading.is(':visible')){
796
+ clearInterval(loadingTimer);
797
+ return;
798
+ }
799
+
800
+ $('div', loading).css('top', (loadingFrame * -40) + 'px');
801
+
802
+ loadingFrame = (loadingFrame + 1) % 12;
803
+ };
804
+
805
+ /*
806
+ * Public methods
807
+ */
808
+
809
+ $.fn.fancybox = function(options) {
810
+ if (!$(this).length) {
811
+ return this;
812
+ }
813
+
814
+ $(this)
815
+ .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
816
+ .unbind('click.fb')
817
+ .bind('click.fb', function(e) {
818
+ e.preventDefault();
819
+
820
+ if (busy) {
821
+ return;
822
+ }
823
+
824
+ busy = true;
825
+
826
+ $(this).blur();
827
+
828
+ selectedArray = [];
829
+ selectedIndex = 0;
830
+
831
+ var rel = $(this).attr('rel') || $(this).data('rel');
832
+
833
+ if (!rel || rel == '' || rel === 'nofollow') {
834
+ selectedArray.push(this);
835
+ } else {
836
+ selectedArray = $('a[rel="'+rel+'"], area[rel="'+rel+'"], a[data-rel="'+rel+'"]');
837
+ selectedIndex = selectedArray.index(this);
838
+ }
839
+
840
+ _start();
841
+
842
+ return;
843
+ });
844
+
845
+ return this;
846
+ };
847
+
848
+ $.fancybox = function(obj) {
849
+ var opts;
850
+
851
+ if (busy) {
852
+ return;
853
+ }
854
+
855
+ busy = true;
856
+ opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
857
+
858
+ selectedArray = [];
859
+ selectedIndex = parseInt(opts.index, 10) || 0;
860
+
861
+ if ($.isArray(obj)) {
862
+ for (var i = 0, j = obj.length; i < j; i++) {
863
+ if (typeof obj[i] == 'object') {
864
+ $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
865
+ } else {
866
+ obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
867
+ }
868
+ }
869
+
870
+ selectedArray = jQuery.merge(selectedArray, obj);
871
+
872
+ } else {
873
+ if (typeof obj == 'object') {
874
+ $(obj).data('fancybox', $.extend({}, opts, obj));
875
+ } else {
876
+ obj = $({}).data('fancybox', $.extend({content : obj}, opts));
877
+ }
878
+
879
+ selectedArray.push(obj);
880
+ }
881
+
882
+ if (selectedIndex > selectedArray.length || selectedIndex < 0) {
883
+ selectedIndex = 0;
884
+ }
885
+
886
+ _start();
887
+ };
888
+
889
+ $.fancybox.showActivity = function() {
890
+ clearInterval(loadingTimer);
891
+
892
+ loading.show();
893
+ loadingTimer = setInterval(_animate_loading, 66);
894
+ };
895
+
896
+ $.fancybox.hideActivity = function() {
897
+ loading.hide();
898
+ };
899
+
900
+ $.fancybox.next = function() {
901
+ return $.fancybox.pos( currentIndex + 1);
902
+ };
903
+
904
+ $.fancybox.prev = function() {
905
+ return $.fancybox.pos( currentIndex - 1);
906
+ };
907
+
908
+ $.fancybox.pos = function(pos) {
909
+ if (busy) {
910
+ return;
911
+ }
912
+
913
+ pos = parseInt(pos);
914
+
915
+ selectedArray = currentArray;
916
+
917
+ if (pos > -1 && pos < currentArray.length) {
918
+ selectedIndex = pos;
919
+ _start();
920
+
921
+ } else if (currentOpts.cyclic && currentArray.length > 1) {
922
+ selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
923
+ _start();
924
+ }
925
+
926
+ return;
927
+ };
928
+
929
+ $.fancybox.cancel = function() {
930
+ if (busy) {
931
+ return;
932
+ }
933
+
934
+ busy = true;
935
+
936
+ $.event.trigger('fancybox-cancel');
937
+
938
+ _abort();
939
+
940
+ selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
941
+
942
+ busy = false;
943
+ };
944
+
945
+ // Note: within an iframe use - parent.$.fancybox.close();
946
+ $.fancybox.close = function() {
947
+ if (busy || wrap.is(':hidden')) {
948
+ return;
949
+ }
950
+
951
+ busy = true;
952
+
953
+ if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
954
+ busy = false;
955
+ return;
956
+ }
957
+
958
+ _abort();
959
+
960
+ $(close.add( nav_left ).add( nav_right )).hide();
961
+
962
+ $(content.add( overlay )).unbind();
963
+
964
+ $(window).unbind("resize.fb scroll.fb");
965
+ $(document).unbind('keydown.fb');
966
+
967
+ content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
968
+
969
+ if (currentOpts.titlePosition !== 'inside') {
970
+ title.empty();
971
+ }
972
+
973
+ wrap.stop();
974
+
975
+ function _cleanup() {
976
+ overlay.fadeOut('fast');
977
+
978
+ title.empty().hide();
979
+ wrap.hide();
980
+
981
+ $.event.trigger('fancybox-cleanup');
982
+
983
+ content.empty();
984
+
985
+ currentOpts.onClosed(currentArray, currentIndex, currentOpts);
986
+
987
+ currentArray = selectedOpts = [];
988
+ currentIndex = selectedIndex = 0;
989
+ currentOpts = selectedOpts = {};
990
+
991
+ busy = false;
992
+ }
993
+
994
+ if (currentOpts.transitionOut == 'elastic') {
995
+ start_pos = _get_zoom_from();
996
+
997
+ var pos = wrap.position();
998
+
999
+ final_pos = {
1000
+ top : pos.top ,
1001
+ left : pos.left,
1002
+ width : wrap.width(),
1003
+ height : wrap.height()
1004
+ };
1005
+
1006
+ if (currentOpts.opacity) {
1007
+ final_pos.opacity = 1;
1008
+ }
1009
+
1010
+ title.empty().hide();
1011
+
1012
+ fx.prop = 1;
1013
+
1014
+ $(fx).animate({ prop: 0 }, {
1015
+ duration : currentOpts.speedOut,
1016
+ easing : currentOpts.easingOut,
1017
+ step : _draw,
1018
+ complete : _cleanup
1019
+ });
1020
+
1021
+ } else {
1022
+ wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1023
+ }
1024
+ };
1025
+
1026
+ $.fancybox.resize = function() {
1027
+ if (overlay.is(':visible')) {
1028
+ overlay.css('height', $(document).height());
1029
+ }
1030
+
1031
+ $.fancybox.center(true);
1032
+ };
1033
+
1034
+ $.fancybox.center = function() {
1035
+ var view, align;
1036
+
1037
+ if (busy) {
1038
+ return;
1039
+ }
1040
+
1041
+ align = arguments[0] === true ? 1 : 0;
1042
+ view = _get_viewport();
1043
+
1044
+ if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
1045
+ return;
1046
+ }
1047
+
1048
+ wrap
1049
+ .stop()
1050
+ .animate({
1051
+ 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1052
+ 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1053
+ }, typeof arguments[0] == 'number' ? arguments[0] : 200);
1054
+ };
1055
+
1056
+ $.fancybox.init = function() {
1057
+ if ($("#fancybox-wrap").length) {
1058
+ return;
1059
+ }
1060
+
1061
+ $('body').append(
1062
+ tmp = $('<div id="fancybox-tmp"></div>'),
1063
+ loading = $('<div id="fancybox-loading"><div></div></div>'),
1064
+ overlay = $('<div id="fancybox-overlay"></div>'),
1065
+ wrap = $('<div id="fancybox-wrap"></div>')
1066
+ );
1067
+
1068
+ outer = $('<div id="fancybox-outer"></div>')
1069
+ .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
1070
+ .appendTo( wrap );
1071
+
1072
+ outer.append(
1073
+ content = $('<div id="fancybox-content"></div>'),
1074
+ close = $('<a id="fancybox-close"></a>'),
1075
+ title = $('<div id="fancybox-title"></div>'),
1076
+
1077
+ nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1078
+ nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1079
+ );
1080
+
1081
+ close.click($.fancybox.close);
1082
+ loading.click($.fancybox.cancel);
1083
+
1084
+ nav_left.click(function(e) {
1085
+ e.preventDefault();
1086
+ $.fancybox.prev();
1087
+ });
1088
+
1089
+ nav_right.click(function(e) {
1090
+ e.preventDefault();
1091
+ $.fancybox.next();
1092
+ });
1093
+
1094
+ if ($.fn.mousewheel) {
1095
+ wrap.bind('mousewheel.fb', function(e, delta) {
1096
+ if (busy) {
1097
+ e.preventDefault();
1098
+
1099
+ } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1100
+ e.preventDefault();
1101
+ $.fancybox[ delta > 0 ? 'prev' : 'next']();
1102
+ }
1103
+ });
1104
+ }
1105
+
1106
+ if (!$.support.opacity) {
1107
+ wrap.addClass('fancybox-ie');
1108
+ }
1109
+
1110
+ if (isIE6) {
1111
+ loading.addClass('fancybox-ie6');
1112
+ wrap.addClass('fancybox-ie6');
1113
+
1114
+ $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
1115
+ }
1116
+ };
1117
+
1118
+ $.fn.fancybox.defaults = {
1119
+ padding : 10,
1120
+ margin : 40,
1121
+ opacity : false,
1122
+ modal : false,
1123
+ cyclic : false,
1124
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
1125
+
1126
+ width : 560,
1127
+ height : 340,
1128
+
1129
+ autoScale : true,
1130
+ autoDimensions : true,
1131
+ centerOnScroll : false,
1132
+
1133
+ ajax : {},
1134
+ swf : { wmode: 'transparent' },
1135
+
1136
+ hideOnOverlayClick : true,
1137
+ hideOnContentClick : false,
1138
+
1139
+ overlayShow : true,
1140
+ overlayOpacity : 0.7,
1141
+ overlayColor : '#777',
1142
+
1143
+ titleShow : true,
1144
+ titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1145
+ titleFormat : null,
1146
+ titleFromAlt : false,
1147
+
1148
+ transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1149
+ transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1150
+
1151
+ speedIn : 300,
1152
+ speedOut : 300,
1153
+
1154
+ changeSpeed : 300,
1155
+ changeFade : 'fast',
1156
+
1157
+ easingIn : 'swing',
1158
+ easingOut : 'swing',
1159
+
1160
+ showCloseButton : true,
1161
+ showNavArrows : true,
1162
+ enableEscapeButton : true,
1163
+ enableKeyboardNav : true,
1164
+
1165
+ onStart : function(){},
1166
+ onCancel : function(){},
1167
+ onComplete : function(){},
1168
+ onCleanup : function(){},
1169
+ onClosed : function(){},
1170
+ onError : function(){}
1171
+ };
1172
+
1173
+ $(document).ready(function() {
1174
+ $.fancybox.init();
1175
+ });
1176
+
1177
+ })(jQuery);
assets/fancybox/jquery.fancybox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #fancybox-loading div,#fancybox-overlay,#fancybox-wrap{position:absolute;top:0;left:0}#fancybox-bg-ne,#fancybox-bg-nw,#fancybox-bg-se,#fancybox-bg-sw,#fancybox-left-ico,#fancybox-loading div,#fancybox-right-ico{background-image:url(fancybox.png)}#fancybox-frame,#fancybox-img{width:100%;border:none;height:100%}#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:1104;display:none}#fancybox-loading div{width:40px;height:480px}#fancybox-overlay{width:100%;z-index:1100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{padding:20px;z-index:1101;outline:0;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff}#fancybox-content{width:0;height:0;padding:0;outline:0;position:relative;overflow:hidden;z-index:1102;border:0 solid #fff}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;background:0 0;z-index:1101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:30px;height:30px;background:url(fancybox.png) -40px 0;cursor:pointer;z-index:1103;display:none}#fancybox-error{color:#444;font:400 12px/20px Arial;padding:14px;margin:0}#fancybox-img{padding:0;margin:0;outline:0;line-height:0;vertical-align:top}#fancybox-frame{display:block}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;outline:0;background:url(blank.gif);z-index:1102;display:none}#fancybox-left{left:0}#fancybox-right{right:0}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:1102;display:block}#fancybox-left-ico{background-position:-40px -30px}#fancybox-right-ico{background-position:-40px -60px}#fancybox-left:hover,#fancybox-right:hover{visibility:visible}#fancybox-left:hover span{left:20px}#fancybox-right:hover span{left:auto;right:20px}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:1001}#fancybox-bg-n,#fancybox-bg-s{left:0;width:100%;background-image:url(fancybox-x.png)}#fancybox-bg-e,#fancybox-bg-w{top:0;height:100%;background-image:url(fancybox-y.png)}#fancybox-bg-n{top:-20px}#fancybox-bg-ne{top:-20px;right:-20px;background-position:-40px -162px}#fancybox-bg-e{right:-20px;background-position:-20px 0}#fancybox-bg-se{bottom:-20px;right:-20px;background-position:-40px -182px}#fancybox-bg-s{bottom:-20px;background-position:0 -20px}#fancybox-bg-sw{bottom:-20px;left:-20px;background-position:-40px -142px}#fancybox-bg-w{left:-20px}#fancybox-bg-nw{top:-20px;left:-20px;background-position:-40px -122px}#fancybox-title{font-family:Helvetica;font-size:12px;z-index:1102}.fancybox-title-inside{padding-bottom:10px;text-align:center;color:#333;background:#fff;position:relative}.fancybox-title-outside{padding-top:10px;color:#fff}.fancybox-title-over{position:absolute;bottom:0;left:0;color:#FFF;text-align:left}#fancybox-title-over{padding:10px;background-image:url(fancy_title_over.png);display:block}.fancybox-title-float{position:absolute;left:0;bottom:-20px;height:32px}#fancybox-title-float-wrap{border:none;border-collapse:collapse;width:auto}#fancybox-title-float-wrap td{border:none;white-space:nowrap}#fancybox-title-float-left{padding:0 0 0 15px;background:url(fancybox.png) -40px -90px no-repeat}#fancybox-title-float-main{color:#FFF;line-height:29px;font-weight:700;padding:0 0 3px;background:url(fancybox-x.png) 0 -40px}#fancybox-title-float-right{padding:0 0 0 15px;background:url(fancybox.png) -55px -90px no-repeat}.fancybox-ie6 #fancybox-close{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale', enabled='true')}.fancybox-ie6 #fancybox-left-ico{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale', enabled='true')}.fancybox-ie6 #fancybox-right-ico{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale', enabled='true')}.fancybox-ie6 #fancybox-title-over{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale', enabled='true');zoom:1}.fancybox-ie6 #fancybox-title-float-left{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale', enabled='true')}.fancybox-ie6 #fancybox-title-float-main{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale', enabled='true')}.fancybox-ie6 #fancybox-title-float-right{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale', enabled='true')}#fancybox-hide-sel-frame,.fancybox-ie6 #fancybox-bg-e,.fancybox-ie6 #fancybox-bg-w,.fancybox-ie6 #fancybox-left,.fancybox-ie6 #fancybox-right{height:expression(this.parentNode.clientHeight + "px")}#fancybox-loading.fancybox-ie6{position:absolute;margin-top:0;top:expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px')}#fancybox-loading.fancybox-ie6 div{background:0 0;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale', enabled='true')}.fancybox-ie .fancybox-bg{background:0 0!important}.fancybox-ie #fancybox-bg-n{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-ne{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-e{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-se{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-s{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale', enabled='true')}.fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale', enabled='true')}
assets/fancybox/jquery.fancybox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){var e,i,n,a,o,d,c,r,s,h,l,f,p,g="",b=0,u={},y=[],w=0,m={},v=[],x=null,I=new Image,C=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,k=/[^\.]\.(swf)\s*$/i,O=1,j=0,T="",A=!1,S=t.extend(t("<div/>")[0],{prop:0}),D=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,F=function(){i.hide(),I.onerror=I.onload=null,x&&x.abort(),e.empty()},E=function(){return!1===u.onError(y,b,u)?(i.hide(),void(A=!1)):(u.titleShow=!1,u.width="auto",u.height="auto",e.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'),void P())},N=function(t){var e=t.match(/(?:(?:http|https):\/\/)?(?:www\.)?youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)/);if(e)return g="//www.youtube.com/embed/"+e[1],!0;var i=t.match(/(?:(?:http|https):\/\/)?(?:www\.)?vimeo.com\/([0-9]+)/);return i?(g="//player.vimeo.com/video/"+i[1],!0):!1},B=function(){var n,a,o,c,r,s,h=y[b];if(F(),u=t.extend({},t.fn.fancybox.defaults,"undefined"==typeof t(h).data("fancybox")?u:t(h).data("fancybox")),s=u.onStart(y,b,u),s===!1)return void(A=!1);if("object"==typeof s&&(u=t.extend(u,s)),o=u.title||(h.nodeName?t(h).attr("title"):h.title)||"",h.nodeName&&!u.orig&&(u.orig=t(h).children("img:first").length?t(h).children("img:first"):t(h)),""===o&&u.orig&&u.titleFromAlt&&(o=u.orig.attr("alt")),n=u.href||(h.nodeName?t(h).attr("href"):h.href)||null,(/^(?:javascript)/i.test(n)||"#"==n)&&(n=null),u.type?(a=u.type,n||(n=u.content)):u.content?a="html":n&&(a=n.match(C)?"image":n.match(k)?"swf":t(h).hasClass("iframe")||N(t(h).attr("href"))?"iframe":0===n.indexOf("#")?"inline":"ajax"),!a)return void E();switch("inline"==a&&(h=n.substr(n.indexOf("#")),a=t(h).length>0?"inline":"ajax"),u.type=a,u.href=n,u.title=o,u.autoDimensions&&("html"==u.type||"inline"==u.type||"ajax"==u.type?(u.width="auto",u.height="auto"):u.autoDimensions=!1),u.modal&&(u.overlayShow=!0,u.hideOnOverlayClick=!1,u.hideOnContentClick=!1,u.enableEscapeButton=!1,u.showCloseButton=!1),u.padding=parseInt(u.padding,10),u.margin=parseInt(u.margin,10),e.css("padding",u.padding+u.margin),t(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){t(this).replaceWith(d.children())}),a){case"html":e.html(u.content),P();break;case"inline":if(t(h).parent().is("#fancybox-content")===!0)return void(A=!1);t('<div class="fancybox-inline-tmp" />').hide().insertBefore(t(h)).bind("fancybox-cleanup",function(){t(this).replaceWith(d.children())}).bind("fancybox-cancel",function(){t(this).replaceWith(e.children())}),t(h).appendTo(e),P();break;case"image":A=!1,t.fancybox.showActivity(),I=new Image,I.onerror=function(){E()},I.onload=function(){A=!0,I.onerror=I.onload=null,L()},I.src=n;break;case"swf":u.scrolling="no",c='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+u.width+'" height="'+u.height+'"><param name="movie" value="'+n+'"></param>',r="",t.each(u.swf,function(t,e){c+='<param name="'+t+'" value="'+e+'"></param>',r+=" "+t+'="'+e+'"'}),c+='<embed src="'+n+'" type="application/x-shockwave-flash" width="'+u.width+'" height="'+u.height+'"'+r+"></embed></object>",e.html(c),P();break;case"ajax":A=!1,t.fancybox.showActivity(),u.ajax.win=u.ajax.success,x=t.ajax(t.extend({},u.ajax,{url:n,data:u.ajax.data||{},error:function(t,e,i){t.status>0&&E()},success:function(t,a,o){var d="object"==typeof o?o:x;if(200==d.status){if("function"==typeof u.ajax.win){if(s=u.ajax.win(n,t,a,o),s===!1)return void i.hide();("string"==typeof s||"object"==typeof s)&&(t=s)}e.html(t),P()}}}));break;case"iframe":M()}},P=function(){var i=u.width,n=u.height;i=i.toString().indexOf("%")>-1?parseInt((t(window).width()-2*u.margin)*parseFloat(i)/100,10)+"px":"auto"==i?"auto":i+"px",n=n.toString().indexOf("%")>-1?parseInt((t(window).height()-2*u.margin)*parseFloat(n)/100,10)+"px":"auto"==n?"auto":n+"px",e.wrapInner('<div style="width:'+i+";height:"+n+";overflow: "+("auto"==u.scrolling?"auto":"yes"==u.scrolling?"scroll":"hidden")+';position:relative;"></div>'),u.width=e.width(),u.height=e.height(),M()},L=function(){u.width=I.width,u.height=I.height,t("<img />").attr({id:"fancybox-img",src:I.src,alt:u.title}).appendTo(e),M()},M=function(){var o,l;return i.hide(),a.is(":visible")&&!1===m.onCleanup(v,w,m)?(t.event.trigger("fancybox-cancel"),void(A=!1)):(A=!0,t(d.add(n)).unbind(),t(window).unbind("resize.fb scroll.fb"),t(document).unbind("keydown.fb"),a.is(":visible")&&"outside"!==m.titlePosition&&a.css("height",a.height()),v=y,w=b,m=u,m.overlayShow?(n.css({"background-color":m.overlayColor,opacity:m.overlayOpacity,cursor:m.hideOnOverlayClick?"pointer":"auto",height:t(document).height()}),n.is(":visible")||(D&&t("select:not(#fancybox-tmp select)").filter(function(){return"hidden"!==this.style.visibility}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}),n.show())):n.hide(),p=X(),H(),a.is(":visible")?(t(c.add(s).add(h)).hide(),o=a.position(),f={top:o.top,left:o.left,width:a.width(),height:a.height()},l=f.width==p.width&&f.height==p.height,void d.fadeTo(m.changeFade,.3,function(){var i=function(){d.html(e.contents()).fadeTo(m.changeFade,1,K)};t.event.trigger("fancybox-change"),d.empty().removeAttr("filter").css({"border-width":m.padding,width:p.width-2*m.padding,height:u.autoDimensions?"auto":p.height-j-2*m.padding}),l?i():(S.prop=0,t(S).animate({prop:1},{duration:m.changeSpeed,easing:m.easingChange,step:q,complete:i}))})):(a.removeAttr("style"),d.css("border-width",m.padding),"elastic"==m.transitionIn?(f=U(),d.html(e.contents()),a.show(),m.opacity&&(p.opacity=0),S.prop=0,void t(S).animate({prop:1},{duration:m.speedIn,easing:m.easingIn,step:q,complete:K})):("inside"==m.titlePosition&&j>0&&r.show(),d.css({width:p.width-2*m.padding,height:u.autoDimensions?"auto":p.height-j-2*m.padding}).html(e.contents()),void a.css(p).fadeIn("none"==m.transitionIn?0:m.speedIn,K))))},z=function(t){return t&&t.length?"float"==m.titlePosition?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+t+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+m.titlePosition+'">'+t+"</div>":!1},H=function(){if(T=m.title||"",j=0,r.empty().removeAttr("style").removeClass(),m.titleShow===!1)return void r.hide();if(T=t.isFunction(m.titleFormat)?m.titleFormat(T,v,w,m):z(T),!T||""===T)return void r.hide();switch(r.addClass("fancybox-title-"+m.titlePosition).html(T).appendTo("body").show(),m.titlePosition){case"inside":r.css({width:p.width-2*m.padding,marginLeft:m.padding,marginRight:m.padding}),j=r.outerHeight(!0),r.appendTo(o),p.height+=j;break;case"over":r.css({marginLeft:m.padding,width:p.width-2*m.padding,bottom:m.padding}).appendTo(o);break;case"float":r.css("left",-1*parseInt((r.width()-p.width-40)/2,10)).appendTo(a);break;default:r.css({width:p.width-2*m.padding,paddingLeft:m.padding,paddingRight:m.padding}).appendTo(a)}r.hide()},R=function(){return(m.enableEscapeButton||m.enableKeyboardNav)&&t(document).bind("keydown.fb",function(e){27==e.keyCode&&m.enableEscapeButton?(e.preventDefault(),t.fancybox.close()):37!=e.keyCode&&39!=e.keyCode||!m.enableKeyboardNav||"INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||"SELECT"===e.target.tagName||(e.preventDefault(),t.fancybox[37==e.keyCode?"prev":"next"]())}),m.showNavArrows?((m.cyclic&&v.length>1||0!==w)&&s.show(),void((m.cyclic&&v.length>1||w!=v.length-1)&&h.show())):(s.hide(),void h.hide())},K=function(){t.support.opacity||(d.get(0).style.removeAttribute("filter"),a.get(0).style.removeAttribute("filter")),u.autoDimensions&&d.css("height","auto"),a.css("height","auto"),T&&T.length&&r.show(),m.showCloseButton&&c.show(),R(),m.hideOnContentClick&&d.bind("click",t.fancybox.close),m.hideOnOverlayClick&&n.bind("click",t.fancybox.close),t(window).bind("resize.fb",t.fancybox.resize),m.centerOnScroll&&t(window).bind("scroll.fb",t.fancybox.center),"iframe"==m.type&&(t('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(t.browser.msie?'allowtransparency="true""':"")+' scrolling="'+u.scrolling+'" src="'+(""!==g?g:m.href)+'"></iframe>').appendTo(d),g=""),a.show(),A=!1,t.fancybox.center(),m.onComplete(v,w,m),W()},W=function(){var t,e;v.length-1>w&&(t=v[w+1].href,"undefined"!=typeof t&&t.match(C)&&(e=new Image,e.src=t)),w>0&&(t=v[w-1].href,"undefined"!=typeof t&&t.match(C)&&(e=new Image,e.src=t))},q=function(t){var e={width:parseInt(f.width+(p.width-f.width)*t,10),height:parseInt(f.height+(p.height-f.height)*t,10),top:parseInt(f.top+(p.top-f.top)*t,10),left:parseInt(f.left+(p.left-f.left)*t,10)};"undefined"!=typeof p.opacity&&(e.opacity=.5>t?.5:t),a.css(e),d.css({width:e.width-2*m.padding,height:e.height-j*t-2*m.padding})},Q=function(){return[t(window).width()-2*m.margin,t(window).height()-2*m.margin,t(document).scrollLeft()+m.margin,t(document).scrollTop()+m.margin]},X=function(){var t,e=Q(),i={},n=m.autoScale,a=2*m.padding;return m.width.toString().indexOf("%")>-1?i.width=parseInt(e[0]*parseFloat(m.width)/100,10):i.width=m.width+a,m.height.toString().indexOf("%")>-1?i.height=parseInt(e[1]*parseFloat(m.height)/100,10):i.height=m.height+a,n&&(i.width>e[0]||i.height>e[1])&&("image"==u.type||"swf"==u.type?(t=m.width/m.height,i.width>e[0]&&(i.width=e[0],i.height=parseInt((i.width-a)/t+a,10)),i.height>e[1]&&(i.height=e[1],i.width=parseInt((i.height-a)*t+a,10))):(i.width=Math.min(i.width,e[0]),i.height=Math.min(i.height,e[1]))),i.top=parseInt(Math.max(e[3]-20,e[3]+.5*(e[1]-i.height-40)),10),i.left=parseInt(Math.max(e[2]-20,e[2]+.5*(e[0]-i.width-40)),10),i},$=function(t){var e=t.offset();return e.top+=parseInt(t.css("paddingTop"),10)||0,e.left+=parseInt(t.css("paddingLeft"),10)||0,e.top+=parseInt(t.css("border-top-width"),10)||0,e.left+=parseInt(t.css("border-left-width"),10)||0,e.width=t.width(),e.height=t.height(),e},U=function(){var e,i,n=u.orig?t(u.orig):!1,a={};return n&&n.length?(e=$(n),a={width:e.width+2*m.padding,height:e.height+2*m.padding,top:e.top-m.padding-20,left:e.left-m.padding-20}):(i=Q(),a={width:2*m.padding,height:2*m.padding,top:parseInt(i[3]+.5*i[1],10),left:parseInt(i[2]+.5*i[0],10)}),a},Z=function(){return i.is(":visible")?(t("div",i).css("top",-40*O+"px"),void(O=(O+1)%12)):void clearInterval(l)};t.fn.fancybox=function(e){return t(this).length?(t(this).data("fancybox",t.extend({},e,t.metadata?t(this).metadata():{})).unbind("click.fb").bind("click.fb",function(e){if(e.preventDefault(),!A){A=!0,t(this).blur(),y=[],b=0;var i=t(this).attr("rel")||t(this).data("rel");i&&""!=i&&"nofollow"!==i?(y=t('a[rel="'+i+'"], area[rel="'+i+'"], a[data-rel="'+i+'"]'),b=y.index(this)):y.push(this),B()}}),this):this},t.fancybox=function(e){var i;if(!A){if(A=!0,i="undefined"!=typeof arguments[1]?arguments[1]:{},y=[],b=parseInt(i.index,10)||0,t.isArray(e)){for(var n=0,a=e.length;a>n;n++)"object"==typeof e[n]?t(e[n]).data("fancybox",t.extend({},i,e[n])):e[n]=t({}).data("fancybox",t.extend({content:e[n]},i));y=jQuery.merge(y,e)}else"object"==typeof e?t(e).data("fancybox",t.extend({},i,e)):e=t({}).data("fancybox",t.extend({content:e},i)),y.push(e);(b>y.length||0>b)&&(b=0),B()}},t.fancybox.showActivity=function(){clearInterval(l),i.show(),l=setInterval(Z,66)},t.fancybox.hideActivity=function(){i.hide()},t.fancybox.next=function(){return t.fancybox.pos(w+1)},t.fancybox.prev=function(){return t.fancybox.pos(w-1)},t.fancybox.pos=function(t){A||(t=parseInt(t),y=v,t>-1&&t<v.length?(b=t,B()):m.cyclic&&v.length>1&&(b=t>=v.length?0:v.length-1,B()))},t.fancybox.cancel=function(){A||(A=!0,t.event.trigger("fancybox-cancel"),F(),u.onCancel(y,b,u),A=!1)},t.fancybox.close=function(){function e(){n.fadeOut("fast"),r.empty().hide(),a.hide(),t.event.trigger("fancybox-cleanup"),d.empty(),m.onClosed(v,w,m),v=u=[],w=b=0,m=u={},A=!1}if(!A&&!a.is(":hidden")){if(A=!0,m&&!1===m.onCleanup(v,w,m))return void(A=!1);if(F(),t(c.add(s).add(h)).hide(),t(d.add(n)).unbind(),t(window).unbind("resize.fb scroll.fb"),t(document).unbind("keydown.fb"),d.find("iframe").attr("src",D&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank"),"inside"!==m.titlePosition&&r.empty(),a.stop(),"elastic"==m.transitionOut){f=U();var i=a.position();p={top:i.top,left:i.left,width:a.width(),height:a.height()},m.opacity&&(p.opacity=1),r.empty().hide(),S.prop=1,t(S).animate({prop:0},{duration:m.speedOut,easing:m.easingOut,step:q,complete:e})}else a.fadeOut("none"==m.transitionOut?0:m.speedOut,e)}},t.fancybox.resize=function(){n.is(":visible")&&n.css("height",t(document).height()),t.fancybox.center(!0)},t.fancybox.center=function(){var t,e;A||(e=arguments[0]===!0?1:0,t=Q(),(e||!(a.width()>t[0]||a.height()>t[1]))&&a.stop().animate({top:parseInt(Math.max(t[3]-20,t[3]+.5*(t[1]-d.height()-40)-m.padding)),left:parseInt(Math.max(t[2]-20,t[2]+.5*(t[0]-d.width()-40)-m.padding))},"number"==typeof arguments[0]?arguments[0]:200))},t.fancybox.init=function(){t("#fancybox-wrap").length||(t("body").append(e=t('<div id="fancybox-tmp"></div>'),i=t('<div id="fancybox-loading"><div></div></div>'),n=t('<div id="fancybox-overlay"></div>'),a=t('<div id="fancybox-wrap"></div>')),o=t('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(a),o.append(d=t('<div id="fancybox-content"></div>'),c=t('<a id="fancybox-close"></a>'),r=t('<div id="fancybox-title"></div>'),s=t('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),h=t('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')),c.click(t.fancybox.close),i.click(t.fancybox.cancel),s.click(function(e){e.preventDefault(),t.fancybox.prev()}),h.click(function(e){e.preventDefault(),t.fancybox.next()}),t.fn.mousewheel&&a.bind("mousewheel.fb",function(e,i){A?e.preventDefault():(0==t(e.target).get(0).clientHeight||t(e.target).get(0).scrollHeight===t(e.target).get(0).clientHeight)&&(e.preventDefault(),t.fancybox[i>0?"prev":"next"]())}),t.support.opacity||a.addClass("fancybox-ie"),D&&(i.addClass("fancybox-ie6"),a.addClass("fancybox-ie6"),t('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(o)))},t.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!1,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:.7,overlayColor:"#777",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!1,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}},t(document).ready(function(){t.fancybox.init()})}(jQuery);
assets/featherlight/featherlight.css ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Featherlight – ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
+ *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
+ * MIT Licensed.
7
+ **/
8
+ @media all {
9
+ html.with-featherlight {
10
+ /* disable global scrolling when featherlights are visible */
11
+ overflow: hidden;
12
+ }
13
+
14
+ .featherlight {
15
+ display: none;
16
+
17
+ /* dimensions: spanning the background from edge to edge */
18
+ position:fixed;
19
+ top: 0; right: 0; bottom: 0; left: 0;
20
+ z-index: 2147483647; /* z-index needs to be >= elements on the site. */
21
+
22
+ /* position: centering content */
23
+ text-align: center;
24
+
25
+ /* insures that the ::before pseudo element doesn't force wrap with fixed width content; */
26
+ white-space: nowrap;
27
+
28
+ /* styling */
29
+ cursor: pointer;
30
+ background: #333;
31
+ /* IE8 "hack" for nested featherlights */
32
+ background: rgba(0, 0, 0, 0);
33
+ }
34
+
35
+ /* support for nested featherlights. Does not work in IE8 (use JS to fix) */
36
+ .featherlight:last-of-type {
37
+ background: rgba(0, 0, 0, 0.8);
38
+ }
39
+
40
+ .featherlight:before {
41
+ /* position: trick to center content vertically */
42
+ content: '';
43
+ display: inline-block;
44
+ height: 100%;
45
+ vertical-align: middle;
46
+ }
47
+
48
+ .featherlight .featherlight-content {
49
+ /* make content container for positioned elements (close button) */
50
+ position: relative;
51
+
52
+ /* position: centering vertical and horizontal */
53
+ text-align: left;
54
+ vertical-align: middle;
55
+ display: inline-block;
56
+
57
+ /* dimensions: cut off images */
58
+ overflow: auto;
59
+ padding: 25px 25px 0;
60
+ border-bottom: 25px solid transparent;
61
+
62
+ /* dimensions: handling large content */
63
+ margin-left: 5%;
64
+ margin-right: 5%;
65
+ max-height: 95%;
66
+
67
+ /* styling */
68
+ background: #fff;
69
+ cursor: auto;
70
+
71
+ /* reset white-space wrapping */
72
+ white-space: normal;
73
+ }
74
+
75
+ /* contains the content */
76
+ .featherlight .featherlight-inner {
77
+ /* make sure its visible */
78
+ display: block;
79
+ }
80
+
81
+ /* don't show these though */
82
+ .featherlight script.featherlight-inner,
83
+ .featherlight link.featherlight-inner,
84
+ .featherlight style.featherlight-inner {
85
+ display: none;
86
+ }
87
+
88
+ .featherlight .featherlight-close-icon {
89
+ /* position: centering vertical and horizontal */
90
+ position: absolute;
91
+ z-index: 9999;
92
+ top: 0;
93
+ right: 0;
94
+
95
+ /* dimensions: 25px x 25px */
96
+ line-height: 25px;
97
+ width: 25px;
98
+
99
+ /* styling */
100
+ cursor: pointer;
101
+ text-align: center;
102
+ font-family: Arial, sans-serif;
103
+ background: #fff; /* Set the background in case it overlaps the content */
104
+ background: rgba(255, 255, 255, 0.3);
105
+ color: #000;
106
+ border: none;
107
+ padding: 0;
108
+ }
109
+
110
+ /* See http://stackoverflow.com/questions/16077341/how-to-reset-all-default-styles-of-the-html5-button-element */
111
+ .featherlight .featherlight-close-icon::-moz-focus-inner {
112
+ border: 0;
113
+ padding: 0;
114
+ }
115
+
116
+ .featherlight .featherlight-image {
117
+ /* styling */
118
+ width: 100%;
119
+ }
120
+
121
+
122
+ .featherlight-iframe .featherlight-content {
123
+ /* removed the border for image croping since iframe is edge to edge */
124
+ border-bottom: 0;
125
+ padding: 0;
126
+ -webkit-overflow-scrolling: touch;
127
+ overflow-y: scroll;
128
+ }
129
+
130
+ .featherlight iframe {
131
+ /* styling */
132
+ border: none;
133
+ }
134
+
135
+ .featherlight * { /* See https://github.com/noelboss/featherlight/issues/42 */
136
+ -webkit-box-sizing: border-box;
137
+ -moz-box-sizing: border-box;
138
+ box-sizing: border-box;
139
+ }
140
+ }
141
+
142
+ /* handling phones and small screens */
143
+ @media only screen and (max-width: 1024px) {
144
+ .featherlight .featherlight-content {
145
+ /* dimensions: maximize lightbox with for small screens */
146
+ margin-left: 0;
147
+ margin-right: 0;
148
+ max-height: 98%;
149
+
150
+ padding: 10px 10px 0;
151
+ border-bottom: 10px solid transparent;
152
+ }
153
+ }
154
+
155
+ /* hide non featherlight items when printing */
156
+ @media print {
157
+ html.with-featherlight > * > :not(.featherlight) {
158
+ display: none;
159
+ }
160
+ }
assets/featherlight/featherlight.gallery.css ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
+ *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
+ * MIT Licensed.
7
+ **/
8
+ @media all {
9
+ .featherlight-next,
10
+ .featherlight-previous {
11
+ display: block;
12
+ position: absolute;
13
+ top: 25px;
14
+ right: 25px;
15
+ bottom: 0;
16
+ left: 80%;
17
+ cursor: pointer;
18
+ /* preventing text selection */
19
+ -webkit-touch-callout: none;
20
+ -webkit-user-select: none;
21
+ -khtml-user-select: none;
22
+ -moz-user-select: none;
23
+ -ms-user-select: none;
24
+ user-select: none;
25
+ /* IE9 hack, otherwise navigation doesn't appear */
26
+ background: rgba(0,0,0,0);
27
+ }
28
+
29
+ .featherlight-previous {
30
+ left: 25px;
31
+ right: 80%;
32
+ }
33
+
34
+ .featherlight-next:hover,
35
+ .featherlight-previous:hover {
36
+ background: rgba(255,255,255,0.25);
37
+ }
38
+
39
+
40
+ .featherlight-next span,
41
+ .featherlight-previous span {
42
+ display: none;
43
+ position: absolute;
44
+
45
+ top: 50%;
46
+ left: 5%;
47
+ width: 82%;
48
+
49
+ /* center horizontally */
50
+ text-align: center;
51
+
52
+ font-size: 80px;
53
+ line-height: 80px;
54
+
55
+ /* center vertically */
56
+ margin-top: -40px;
57
+
58
+ text-shadow: 0px 0px 5px #fff;
59
+ color: #fff;
60
+ font-style: normal;
61
+ font-weight: normal;
62
+ }
63
+ .featherlight-next span {
64
+ right: 5%;
65
+ left: auto;
66
+ }
67
+
68
+
69
+ .featherlight-next:hover span,
70
+ .featherlight-previous:hover span {
71
+ display: inline-block;
72
+ }
73
+
74
+ .featherlight-swipe-aware .featherlight-next,
75
+ .featherlight-swipe-aware .featherlight-previous {
76
+ display: none;
77
+ }
78
+
79
+ /* Hide navigation while loading */
80
+ .featherlight-loading .featherlight-previous, .featherlight-loading .featherlight-next {
81
+ display:none;
82
+ }
83
+
84
+ /* Hide navigation in case of single image */
85
+ .featherlight-first-slide.featherlight-last-slide .featherlight-previous,
86
+ .featherlight-first-slide.featherlight-last-slide .featherlight-next {
87
+ display:none;
88
+ }
89
+ }
90
+
91
+ /* Always display arrows on touch devices */
92
+ @media only screen and (max-device-width: 1024px){
93
+ .featherlight-next:hover,
94
+ .featherlight-previous:hover {
95
+ background: none;
96
+ }
97
+ .featherlight-next span,
98
+ .featherlight-previous span {
99
+ display: block;
100
+ }
101
+ }
102
+
103
+ /* handling phones and small screens */
104
+ @media only screen and (max-width: 1024px) {
105
+ .featherlight-next,
106
+ .featherlight-previous {
107
+ top: 10px;
108
+ right: 10px;
109
+ left: 85%;
110
+ }
111
+
112
+ .featherlight-previous {
113
+ left: 10px;
114
+ right: 85%;
115
+ }
116
+
117
+ .featherlight-next span,
118
+ .featherlight-previous span {
119
+ margin-top: -30px;
120
+ font-size: 40px;
121
+ }
122
+ }
assets/featherlight/featherlight.gallery.js ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
+ *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
+ * MIT Licensed.
7
+ **/
8
+ (function($) {
9
+ "use strict";
10
+
11
+ var warn = function(m) {
12
+ if(window.console && window.console.warn) {
13
+ window.console.warn('FeatherlightGallery: ' + m);
14
+ }
15
+ };
16
+
17
+ if('undefined' === typeof $) {
18
+ return warn('Too much lightness, Featherlight needs jQuery.');
19
+ } else if(!$.featherlight) {
20
+ return warn('Load the featherlight plugin before the gallery plugin');
21
+ }
22
+
23
+ var isTouchAware = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,
24
+ jQueryConstructor = $.event && $.event.special.swipeleft && $,
25
+ hammerConstructor = window.Hammer && function($el){
26
+ var mc = new window.Hammer.Manager($el[0]);
27
+ mc.add(new window.Hammer.Swipe());
28
+ return mc;
29
+ },
30
+ swipeAwareConstructor = isTouchAware && (jQueryConstructor || hammerConstructor);
31
+ if(isTouchAware && !swipeAwareConstructor) {
32
+ warn('No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.');
33
+ }
34
+
35
+ var callbackChain = {
36
+ afterClose: function(_super, event) {
37
+ var self = this;
38
+ self.$instance.off('next.'+self.namespace+' previous.'+self.namespace);
39
+ if (self._swiper) {
40
+ self._swiper
41
+ .off('swipeleft', self._swipeleft) /* See http://stackoverflow.com/questions/17367198/hammer-js-cant-remove-event-listener */
42
+ .off('swiperight', self._swiperight);
43
+ self._swiper = null;
44
+ }
45
+ return _super(event);
46
+ },
47
+ beforeOpen: function(_super, event){
48
+ var self = this;
49
+
50
+ self.$instance.on('next.'+self.namespace+' previous.'+self.namespace, function(event){
51
+ var offset = event.type === 'next' ? +1 : -1;
52
+ self.navigateTo(self.currentNavigation() + offset);
53
+ });
54
+
55
+ if (swipeAwareConstructor) {
56
+ self._swiper = swipeAwareConstructor(self.$instance)
57
+ .on('swipeleft', self._swipeleft = function() { self.$instance.trigger('next'); })
58
+ .on('swiperight', self._swiperight = function() { self.$instance.trigger('previous'); });
59
+
60
+ self.$instance
61
+ .addClass(this.namespace+'-swipe-aware', swipeAwareConstructor);
62
+ }
63
+
64
+ self.$instance.find('.'+self.namespace+'-content')
65
+ .append(self.createNavigation('previous'))
66
+ .append(self.createNavigation('next'));
67
+
68
+ return _super(event);
69
+ },
70
+ beforeContent: function(_super, event) {
71
+ var index = this.currentNavigation();
72
+ var len = this.slides().length;
73
+ this.$instance
74
+ .toggleClass(this.namespace+'-first-slide', index === 0)
75
+ .toggleClass(this.namespace+'-last-slide', index === len - 1);
76
+ return _super(event);
77
+ },
78
+ onKeyUp: function(_super, event){
79
+ var dir = {
80
+ 37: 'previous', /* Left arrow */
81
+ 39: 'next' /* Rigth arrow */
82
+ }[event.keyCode];
83
+ if(dir) {
84
+ this.$instance.trigger(dir);
85
+ return false;
86
+ } else {
87
+ return _super(event);
88
+ }
89
+ }
90
+ };
91
+
92
+ function FeatherlightGallery($source, config) {
93
+ if(this instanceof FeatherlightGallery) { /* called with new */
94
+ $.featherlight.apply(this, arguments);
95
+ this.chainCallbacks(callbackChain);
96
+ } else {
97
+ var flg = new FeatherlightGallery($.extend({$source: $source, $currentTarget: $source.first()}, config));
98
+ flg.open();
99
+ return flg;
100
+ }
101
+ }
102
+
103
+ $.featherlight.extend(FeatherlightGallery, {
104
+ autoBind: '[data-featherlight-gallery]'
105
+ });
106
+
107
+ $.extend(FeatherlightGallery.prototype, {
108
+ /** Additional settings for Gallery **/
109
+ previousIcon: '&#9664;', /* Code that is used as previous icon */
110
+ nextIcon: '&#9654;', /* Code that is used as next icon */
111
+ galleryFadeIn: 100, /* fadeIn speed when image is loaded */
112
+ galleryFadeOut: 300, /* fadeOut speed before image is loaded */
113
+
114
+ slides: function() {
115
+ if (this.filter) {
116
+ return this.$source.find(this.filter);
117
+ }
118
+ return this.$source;
119
+ },
120
+
121
+ images: function() {
122
+ warn('images is deprecated, please use slides instead');
123
+ return this.slides();
124
+ },
125
+
126
+ currentNavigation: function() {
127
+ return this.slides().index(this.$currentTarget);
128
+ },
129
+
130
+ navigateTo: function(index) {
131
+ var self = this,
132
+ source = self.slides(),
133
+ len = source.length,
134
+ $inner = self.$instance.find('.' + self.namespace + '-inner');
135
+ index = ((index % len) + len) % len; /* pin index to [0, len[ */
136
+
137
+ self.$currentTarget = source.eq(index);
138
+ self.beforeContent();
139
+ return $.when(
140
+ self.getContent(),
141
+ $inner.fadeTo(self.galleryFadeOut,0.2)
142
+ ).always(function($newContent) {
143
+ self.setContent($newContent);
144
+ self.afterContent();
145
+ $newContent.fadeTo(self.galleryFadeIn,1);
146
+ });
147
+ },
148
+
149
+ createNavigation: function(target) {
150
+ var self = this;
151
+ return $('<span title="'+target+'" class="'+this.namespace+'-'+target+'"><span>'+this[target+'Icon']+'</span></span>').click(function(evt){
152
+ $(this).trigger(target+'.'+self.namespace);
153
+ evt.preventDefault();
154
+ });
155
+ }
156
+ });
157
+
158
+ $.featherlightGallery = FeatherlightGallery;
159
+
160
+ /* extend jQuery with selector featherlight method $(elm).featherlight(config, elm); */
161
+ $.fn.featherlightGallery = function(config) {
162
+ FeatherlightGallery.attach(this, config);
163
+ return this;
164
+ };
165
+
166
+ /* bind featherlight on ready if config autoBind is set */
167
+ $(document).ready(function(){ FeatherlightGallery._onReady(); });
168
+
169
+ }(jQuery));
assets/featherlight/featherlight.gallery.min.css CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
- * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
- * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
- @media all{.featherlight-next,.featherlight-previous{display:block;position:absolute;top:25px;right:25px;bottom:0;left:80%;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:rgba(0,0,0,0)}.featherlight-previous{left:25px;right:80%}.featherlight-next:hover,.featherlight-previous:hover{background:rgba(255,255,255,.25)}.featherlight-next span,.featherlight-previous span{display:none;position:absolute;top:50%;left:5%;width:82%;text-align:center;font-size:80px;line-height:80px;margin-top:-40px;text-shadow:0 0 5px #fff;color:#fff;font-style:normal;font-weight:400}.featherlight-next span{right:5%;left:auto}.featherlight-next:hover span,.featherlight-previous:hover span{display:inline-block}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous,.featherlight-swipe-aware .featherlight-next,.featherlight-swipe-aware .featherlight-previous{display:none}}@media only screen and (max-device-width:1024px){.featherlight-next:hover,.featherlight-previous:hover{background:0 0}.featherlight-next span,.featherlight-previous span{display:block}}@media only screen and (max-width:1024px){.featherlight-next,.featherlight-previous{top:10px;right:10px;left:85%}.featherlight-previous{left:10px;right:85%}.featherlight-next span,.featherlight-previous span{margin-top:-30px;font-size:40px}}
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
  *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
+ @media all{.featherlight-next,.featherlight-previous{display:block;position:absolute;top:25px;right:25px;bottom:0;left:80%;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:rgba(0,0,0,0)}.featherlight-previous{left:25px;right:80%}.featherlight-next:hover,.featherlight-previous:hover{background:rgba(255,255,255,.25)}.featherlight-next span,.featherlight-previous span{display:none;position:absolute;top:50%;left:5%;width:82%;text-align:center;font-size:80px;line-height:80px;margin-top:-40px;text-shadow:0 0 5px #fff;color:#fff;font-style:normal;font-weight:400}.featherlight-next span{right:5%;left:auto}.featherlight-next:hover span,.featherlight-previous:hover span{display:inline-block}.featherlight-first-slide.featherlight-last-slide .featherlight-next,.featherlight-first-slide.featherlight-last-slide .featherlight-previous,.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous,.featherlight-swipe-aware .featherlight-next,.featherlight-swipe-aware .featherlight-previous{display:none}}@media only screen and (max-device-width:1024px){.featherlight-next:hover,.featherlight-previous:hover{background:0 0}.featherlight-next span,.featherlight-previous span{display:block}}@media only screen and (max-width:1024px){.featherlight-next,.featherlight-previous{top:10px;right:10px;left:85%}.featherlight-previous{left:10px;right:85%}.featherlight-next span,.featherlight-previous span{margin-top:-30px;font-size:40px}}
assets/featherlight/featherlight.gallery.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
- * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
- * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
- **/!function(a){"use strict";function b(c,d){if(!(this instanceof b)){var e=new b(a.extend({$source:c,$currentTarget:c.first()},d));return e.open(),e}a.featherlight.apply(this,arguments),this.chainCallbacks(h)}var c=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"==typeof a)return c("Too much lightness, Featherlight needs jQuery.");if(!a.featherlight)return c("Load the featherlight plugin before the gallery plugin");var d="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=a.event&&a.event.special.swipeleft&&a,f=window.Hammer&&function(a){var b=new window.Hammer.Manager(a[0]);return b.add(new window.Hammer.Swipe),b},g=d&&(e||f);d&&!g&&c("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var h={afterClose:function(a,b){var c=this;return c.$instance.off("next."+c.namespace+" previous."+c.namespace),c._swiper&&(c._swiper.off("swipeleft",c._swipeleft).off("swiperight",c._swiperight),c._swiper=null),a(b)},beforeOpen:function(a,b){var c=this;return c.$instance.on("next."+c.namespace+" previous."+c.namespace,function(a){var b="next"===a.type?1:-1;c.navigateTo(c.currentNavigation()+b)}),g&&(c._swiper=g(c.$instance).on("swipeleft",c._swipeleft=function(){c.$instance.trigger("next")}).on("swiperight",c._swiperight=function(){c.$instance.trigger("previous")}),c.$instance.addClass(this.namespace+"-swipe-aware",g)),c.$instance.find("."+c.namespace+"-content").append(c.createNavigation("previous")).append(c.createNavigation("next")),a(b)},beforeContent:function(a,b){var c=this.currentNavigation(),d=this.slides().length;return this.$instance.toggleClass(this.namespace+"-first-slide",0===c).toggleClass(this.namespace+"-last-slide",c===d-1),a(b)},onKeyUp:function(a,b){var c={37:"previous",39:"next"}[b.keyCode];return c?(this.$instance.trigger(c),!1):a(b)}};a.featherlight.extend(b,{autoBind:"[data-featherlight-gallery]"}),a.extend(b.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return c("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(b){var c=this,d=c.slides(),e=d.length,f=c.$instance.find("."+c.namespace+"-inner");return b=(b%e+e)%e,c.$currentTarget=d.eq(b),c.beforeContent(),a.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a),c.afterContent(),a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(b){var c=this;return a('<span title="'+b+'" class="'+this.namespace+"-"+b+'"><span>'+this[b+"Icon"]+"</span></span>").click(function(){a(this).trigger(b+"."+c.namespace)})}}),a.featherlightGallery=b,a.fn.featherlightGallery=function(a){return b.attach(this,a)},a(document).ready(function(){b._onReady()})}(jQuery);
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
  *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
+ **/!function(a){"use strict";function b(c,d){if(!(this instanceof b)){var e=new b(a.extend({$source:c,$currentTarget:c.first()},d));return e.open(),e}a.featherlight.apply(this,arguments),this.chainCallbacks(h)}var c=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"==typeof a)return c("Too much lightness, Featherlight needs jQuery.");if(!a.featherlight)return c("Load the featherlight plugin before the gallery plugin");var d="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=a.event&&a.event.special.swipeleft&&a,f=window.Hammer&&function(a){var b=new window.Hammer.Manager(a[0]);return b.add(new window.Hammer.Swipe),b},g=d&&(e||f);d&&!g&&c("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var h={afterClose:function(a,b){var c=this;return c.$instance.off("next."+c.namespace+" previous."+c.namespace),c._swiper&&(c._swiper.off("swipeleft",c._swipeleft).off("swiperight",c._swiperight),c._swiper=null),a(b)},beforeOpen:function(a,b){var c=this;return c.$instance.on("next."+c.namespace+" previous."+c.namespace,function(a){var b="next"===a.type?1:-1;c.navigateTo(c.currentNavigation()+b)}),g&&(c._swiper=g(c.$instance).on("swipeleft",c._swipeleft=function(){c.$instance.trigger("next")}).on("swiperight",c._swiperight=function(){c.$instance.trigger("previous")}),c.$instance.addClass(this.namespace+"-swipe-aware",g)),c.$instance.find("."+c.namespace+"-content").append(c.createNavigation("previous")).append(c.createNavigation("next")),a(b)},beforeContent:function(a,b){var c=this.currentNavigation(),d=this.slides().length;return this.$instance.toggleClass(this.namespace+"-first-slide",0===c).toggleClass(this.namespace+"-last-slide",c===d-1),a(b)},onKeyUp:function(a,b){var c={37:"previous",39:"next"}[b.keyCode];return c?(this.$instance.trigger(c),!1):a(b)}};a.featherlight.extend(b,{autoBind:"[data-featherlight-gallery]"}),a.extend(b.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return c("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(b){var c=this,d=c.slides(),e=d.length,f=c.$instance.find("."+c.namespace+"-inner");return b=(b%e+e)%e,c.$currentTarget=d.eq(b),c.beforeContent(),a.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a),c.afterContent(),a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(b){var c=this;return a('<span title="'+b+'" class="'+this.namespace+"-"+b+'"><span>'+this[b+"Icon"]+"</span></span>").click(function(d){a(this).trigger(b+"."+c.namespace),d.preventDefault()})}}),a.featherlightGallery=b,a.fn.featherlightGallery=function(a){return b.attach(this,a),this},a(document).ready(function(){b._onReady()})}(jQuery);
assets/featherlight/featherlight.js ADDED
@@ -0,0 +1,631 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
+ *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
+ * MIT Licensed.
7
+ **/
8
+ (function($) {
9
+ "use strict";
10
+
11
+ if('undefined' === typeof $) {
12
+ if('console' in window){ window.console.info('Too much lightness, Featherlight needs jQuery.'); }
13
+ return;
14
+ }
15
+ if($.fn.jquery.match(/-ajax/)) {
16
+ if('console' in window){ window.console.info('Featherlight needs regular jQuery, not the slim version.'); }
17
+ return;
18
+ }
19
+ /* Featherlight is exported as $.featherlight.
20
+ It is a function used to open a featherlight lightbox.
21
+
22
+ [tech]
23
+ Featherlight uses prototype inheritance.
24
+ Each opened lightbox will have a corresponding object.
25
+ That object may have some attributes that override the
26
+ prototype's.
27
+ Extensions created with Featherlight.extend will have their
28
+ own prototype that inherits from Featherlight's prototype,
29
+ thus attributes can be overriden either at the object level,
30
+ or at the extension level.
31
+ To create callbacks that chain themselves instead of overriding,
32
+ use chainCallbacks.
33
+ For those familiar with CoffeeScript, this correspond to
34
+ Featherlight being a class and the Gallery being a class
35
+ extending Featherlight.
36
+ The chainCallbacks is used since we don't have access to
37
+ CoffeeScript's `super`.
38
+ */
39
+
40
+ function Featherlight($content, config) {
41
+ if(this instanceof Featherlight) { /* called with new */
42
+ this.id = Featherlight.id++;
43
+ this.setup($content, config);
44
+ this.chainCallbacks(Featherlight._callbackChain);
45
+ } else {
46
+ var fl = new Featherlight($content, config);
47
+ fl.open();
48
+ return fl;
49
+ }
50
+ }
51
+
52
+ var opened = [],
53
+ pruneOpened = function(remove) {
54
+ opened = $.grep(opened, function(fl) {
55
+ return fl !== remove && fl.$instance.closest('body').length > 0;
56
+ } );
57
+ return opened;
58
+ };
59
+
60
+ // Removes keys of `set` from `obj` and returns the removed key/values.
61
+ function slice(obj, set) {
62
+ var r = {};
63
+ for (var key in obj) {
64
+ if (key in set) {
65
+ r[key] = obj[key];
66
+ delete obj[key];
67
+ }
68
+ }
69
+ return r;
70
+ }
71
+
72
+ // NOTE: List of available [iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
73
+ var iFrameAttributeSet = {
74
+ allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1,
75
+ name: 1, referrerpolicy: 1, scrolling: 1, sandbox: 1, src: 1, srcdoc: 1, width: 1
76
+ };
77
+
78
+ // Converts camelCased attributes to dasherized versions for given prefix:
79
+ // parseAttrs({hello: 1, hellFrozeOver: 2}, 'hell') => {froze-over: 2}
80
+ function parseAttrs(obj, prefix) {
81
+ var attrs = {},
82
+ regex = new RegExp('^' + prefix + '([A-Z])(.*)');
83
+ for (var key in obj) {
84
+ var match = key.match(regex);
85
+ if (match) {
86
+ var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase();
87
+ attrs[dasherized] = obj[key];
88
+ }
89
+ }
90
+ return attrs;
91
+ }
92
+
93
+ /* document wide key handler */
94
+ var eventMap = { keyup: 'onKeyUp', resize: 'onResize' };
95
+
96
+ var globalEventHandler = function(event) {
97
+ $.each(Featherlight.opened().reverse(), function() {
98
+ if (!event.isDefaultPrevented()) {
99
+ if (false === this[eventMap[event.type]](event)) {
100
+ event.preventDefault(); event.stopPropagation(); return false;
101
+ }
102
+ }
103
+ });
104
+ };
105
+
106
+ var toggleGlobalEvents = function(set) {
107
+ if(set !== Featherlight._globalHandlerInstalled) {
108
+ Featherlight._globalHandlerInstalled = set;
109
+ var events = $.map(eventMap, function(_, name) { return name+'.'+Featherlight.prototype.namespace; } ).join(' ');
110
+ $(window)[set ? 'on' : 'off'](events, globalEventHandler);
111
+ }
112
+ };
113
+
114
+ Featherlight.prototype = {
115
+ constructor: Featherlight,
116
+ /*** defaults ***/
117
+ /* extend featherlight with defaults and methods */
118
+ namespace: 'featherlight', /* Name of the events and css class prefix */
119
+ targetAttr: 'data-featherlight', /* Attribute of the triggered element that contains the selector to the lightbox content */
120
+ variant: null, /* Class that will be added to change look of the lightbox */
121
+ resetCss: false, /* Reset all css */
122
+ background: null, /* Custom DOM for the background, wrapper and the closebutton */
123
+ openTrigger: 'click', /* Event that triggers the lightbox */
124
+ closeTrigger: 'click', /* Event that triggers the closing of the lightbox */
125
+ filter: null, /* Selector to filter events. Think $(...).on('click', filter, eventHandler) */
126
+ root: 'body', /* Where to append featherlights */
127
+ openSpeed: 250, /* Duration of opening animation */
128
+ closeSpeed: 250, /* Duration of closing animation */
129
+ closeOnClick: 'background', /* Close lightbox on click ('background', 'anywhere' or false) */
130
+ closeOnEsc: true, /* Close lightbox when pressing esc */
131
+ closeIcon: '&#10005;', /* Close icon */
132
+ loading: '', /* Content to show while initial content is loading */
133
+ persist: false, /* If set, the content will persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */
134
+ otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */
135
+ beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
136
+ beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */
137
+ beforeClose: $.noop, /* Called before close. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
138
+ afterOpen: $.noop, /* Called after open. Gets event as parameter, this contains all data */
139
+ afterContent: $.noop, /* Called after content is ready and has been set. Gets event as parameter, this contains all data */
140
+ afterClose: $.noop, /* Called after close. Gets event as parameter, this contains all data */
141
+ onKeyUp: $.noop, /* Called on key up for the frontmost featherlight */
142
+ onResize: $.noop, /* Called after new content and when a window is resized */
143
+ type: null, /* Specify type of lightbox. If unset, it will check for the targetAttrs value. */
144
+ contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], /* List of content filters to use to determine the content */
145
+
146
+ /*** methods ***/
147
+ /* setup iterates over a single instance of featherlight and prepares the background and binds the events */
148
+ setup: function(target, config){
149
+ /* all arguments are optional */
150
+ if (typeof target === 'object' && target instanceof $ === false && !config) {
151
+ config = target;
152
+ target = undefined;
153
+ }
154
+
155
+ var self = $.extend(this, config, {target: target}),
156
+ css = !self.resetCss ? self.namespace : self.namespace+'-reset', /* by adding -reset to the classname, we reset all the default css */
157
+ $background = $(self.background || [
158
+ '<div class="'+css+'-loading '+css+'">',
159
+ '<div class="'+css+'-content">',
160
+ '<button class="'+css+'-close-icon '+ self.namespace + '-close" aria-label="Close">',
161
+ self.closeIcon,
162
+ '</button>',
163
+ '<div class="'+self.namespace+'-inner">' + self.loading + '</div>',
164
+ '</div>',
165
+ '</div>'].join('')),
166
+ closeButtonSelector = '.'+self.namespace+'-close' + (self.otherClose ? ',' + self.otherClose : '');
167
+
168
+ self.$instance = $background.clone().addClass(self.variant); /* clone DOM for the background, wrapper and the close button */
169
+
170
+ /* close when click on background/anywhere/null or closebox */
171
+ self.$instance.on(self.closeTrigger+'.'+self.namespace, function(event) {
172
+ if(event.isDefaultPrevented()) {
173
+ return;
174
+ }
175
+ var $target = $(event.target);
176
+ if( ('background' === self.closeOnClick && $target.is('.'+self.namespace))
177
+ || 'anywhere' === self.closeOnClick
178
+ || $target.closest(closeButtonSelector).length ){
179
+ self.close(event);
180
+ event.preventDefault();
181
+ }
182
+ });
183
+
184
+ return this;
185
+ },
186
+
187
+ /* this method prepares the content and converts it into a jQuery object or a promise */
188
+ getContent: function(){
189
+ if(this.persist !== false && this.$content) {
190
+ return this.$content;
191
+ }
192
+ var self = this,
193
+ filters = this.constructor.contentFilters,
194
+ readTargetAttr = function(name){ return self.$currentTarget && self.$currentTarget.attr(name); },
195
+ targetValue = readTargetAttr(self.targetAttr),
196
+ data = self.target || targetValue || '';
197
+
198
+ /* Find which filter applies */
199
+ var filter = filters[self.type]; /* check explicit type like {type: 'image'} */
200
+
201
+ /* check explicit type like data-featherlight="image" */
202
+ if(!filter && data in filters) {
203
+ filter = filters[data];
204
+ data = self.target && targetValue;
205
+ }
206
+ data = data || readTargetAttr('href') || '';
207
+
208
+ /* check explicity type & content like {image: 'photo.jpg'} */
209
+ if(!filter) {
210
+ for(var filterName in filters) {
211
+ if(self[filterName]) {
212
+ filter = filters[filterName];
213
+ data = self[filterName];
214
+ }
215
+ }
216
+ }
217
+
218
+ /* otherwise it's implicit, run checks */
219
+ if(!filter) {
220
+ var target = data;
221
+ data = null;
222
+ $.each(self.contentFilters, function() {
223
+ filter = filters[this];
224
+ if(filter.test) {
225
+ data = filter.test(target);
226
+ }
227
+ if(!data && filter.regex && target.match && target.match(filter.regex)) {
228
+ data = target;
229
+ }
230
+ return !data;
231
+ });
232
+ if(!data) {
233
+ if('console' in window){ window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"' : ' (no target specified)')); }
234
+ return false;
235
+ }
236
+ }
237
+ /* Process it */
238
+ return filter.process.call(self, data);
239
+ },
240
+
241
+ /* sets the content of $instance to $content */
242
+ setContent: function($content){
243
+ this.$instance.removeClass(this.namespace+'-loading');
244
+
245
+ /* we need a special class for the iframe */
246
+ this.$instance.toggleClass(this.namespace+'-iframe', $content.is('iframe'));
247
+
248
+ /* replace content by appending to existing one before it is removed
249
+ this insures that featherlight-inner remain at the same relative
250
+ position to any other items added to featherlight-content */
251
+ this.$instance.find('.'+this.namespace+'-inner')
252
+ .not($content) /* excluded new content, important if persisted */
253
+ .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */
254
+ .replaceWith($.contains(this.$instance[0], $content[0]) ? '' : $content);
255
+
256
+ this.$content = $content.addClass(this.namespace+'-inner');
257
+
258
+ return this;
259
+ },
260
+
261
+ /* opens the lightbox. "this" contains $instance with the lightbox, and with the config.
262
+ Returns a promise that is resolved after is successfully opened. */
263
+ open: function(event){
264
+ var self = this;
265
+ self.$instance.hide().appendTo(self.root);
266
+ if((!event || !event.isDefaultPrevented())
267
+ && self.beforeOpen(event) !== false) {
268
+
269
+ if(event){
270
+ event.preventDefault();
271
+ }
272
+ var $content = self.getContent();
273
+
274
+ if($content) {
275
+ opened.push(self);
276
+
277
+ toggleGlobalEvents(true);
278
+
279
+ self.$instance.fadeIn(self.openSpeed);
280
+ self.beforeContent(event);
281
+
282
+ /* Set content and show */
283
+ return $.when($content)
284
+ .always(function($content){
285
+ self.setContent($content);
286
+ self.afterContent(event);
287
+ })
288
+ .then(self.$instance.promise())
289
+ /* Call afterOpen after fadeIn is done */
290
+ .done(function(){ self.afterOpen(event); });
291
+ }
292
+ }
293
+ self.$instance.detach();
294
+ return $.Deferred().reject().promise();
295
+ },
296
+
297
+ /* closes the lightbox. "this" contains $instance with the lightbox, and with the config
298
+ returns a promise, resolved after the lightbox is successfully closed. */
299
+ close: function(event){
300
+ var self = this,
301
+ deferred = $.Deferred();
302
+
303
+ if(self.beforeClose(event) === false) {
304
+ deferred.reject();
305
+ } else {
306
+
307
+ if (0 === pruneOpened(self).length) {
308
+ toggleGlobalEvents(false);
309
+ }
310
+
311
+ self.$instance.fadeOut(self.closeSpeed,function(){
312
+ self.$instance.detach();
313
+ self.afterClose(event);
314
+ deferred.resolve();
315
+ });
316
+ }
317
+ return deferred.promise();
318
+ },
319
+
320
+ /* resizes the content so it fits in visible area and keeps the same aspect ratio.
321
+ Does nothing if either the width or the height is not specified.
322
+ Called automatically on window resize.
323
+ Override if you want different behavior. */
324
+ resize: function(w, h) {
325
+ if (w && h) {
326
+ /* Reset apparent image size first so container grows */
327
+ this.$content.css('width', '').css('height', '');
328
+ /* Calculate the worst ratio so that dimensions fit */
329
+ /* Note: -1 to avoid rounding errors */
330
+ var ratio = Math.max(
331
+ w / (this.$content.parent().width()-1),
332
+ h / (this.$content.parent().height()-1));
333
+ /* Resize content */
334
+ if (ratio > 1) {
335
+ ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */
336
+ this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px');
337
+ }
338
+ }
339
+ },
340
+
341
+ /* Utility function to chain callbacks
342
+ [Warning: guru-level]
343
+ Used be extensions that want to let users specify callbacks but
344
+ also need themselves to use the callbacks.
345
+ The argument 'chain' has callback names as keys and function(super, event)
346
+ as values. That function is meant to call `super` at some point.
347
+ */
348
+ chainCallbacks: function(chain) {
349
+ for (var name in chain) {
350
+ this[name] = $.proxy(chain[name], this, $.proxy(this[name], this));
351
+ }
352
+ }
353
+ };
354
+
355
+ $.extend(Featherlight, {
356
+ id: 0, /* Used to id single featherlight instances */
357
+ autoBind: '[data-featherlight]', /* Will automatically bind elements matching this selector. Clear or set before onReady */
358
+ defaults: Featherlight.prototype, /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */
359
+ /* Contains the logic to determine content */
360
+ contentFilters: {
361
+ jquery: {
362
+ regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */
363
+ test: function(elem) { return elem instanceof $ && elem; },
364
+ process: function(elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); }
365
+ },
366
+ image: {
367
+ regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,
368
+ process: function(url) {
369
+ var self = this,
370
+ deferred = $.Deferred(),
371
+ img = new Image(),
372
+ $img = $('<img src="'+url+'" alt="" class="'+self.namespace+'-image" />');
373
+ img.onload = function() {
374
+ /* Store naturalWidth & height for IE8 */
375
+ $img.naturalWidth = img.width; $img.naturalHeight = img.height;
376
+ deferred.resolve( $img );
377
+ };
378
+ img.onerror = function() { deferred.reject($img); };
379
+ img.src = url;
380
+ return deferred.promise();
381
+ }
382
+ },
383
+ html: {
384
+ regex: /^\s*<[\w!][^<]*>/, /* Anything that starts with some kind of valid tag */
385
+ process: function(html) { return $(html); }
386
+ },
387
+ ajax: {
388
+ regex: /./, /* At this point, any content is assumed to be an URL */
389
+ process: function(url) {
390
+ var self = this,
391
+ deferred = $.Deferred();
392
+ /* we are using load so one can specify a target with: url.html #targetelement */
393
+ var $container = $('<div></div>').load(url, function(response, status){
394
+ if ( status !== "error" ) {
395
+ deferred.resolve($container.contents());
396
+ }
397
+ deferred.fail();
398
+ });
399
+ return deferred.promise();
400
+ }
401
+ },
402
+ iframe: {
403
+ process: function(url) {
404
+ var deferred = new $.Deferred();
405
+ var $content = $('<iframe/>');
406
+ var css = parseAttrs(this, 'iframe');
407
+ var attrs = slice(css, iFrameAttributeSet);
408
+ $content.hide()
409
+ .attr('src', url)
410
+ .attr(attrs)
411
+ .css(css)
412
+ .on('load', function() { deferred.resolve($content.show()); })
413
+ // We can't move an <iframe> and avoid reloading it,
414
+ // so let's put it in place ourselves right now:
415
+ .appendTo(this.$instance.find('.' + this.namespace + '-content'));
416
+ return deferred.promise();
417
+ }
418
+ },
419
+ text: {
420
+ process: function(text) { return $('<div>', {text: text}); }
421
+ }
422
+ },
423
+
424
+ functionAttributes: ['beforeOpen', 'afterOpen', 'beforeContent', 'afterContent', 'beforeClose', 'afterClose'],
425
+
426
+ /*** class methods ***/
427
+ /* read element's attributes starting with data-featherlight- */
428
+ readElementConfig: function(element, namespace) {
429
+ var Klass = this,
430
+ regexp = new RegExp('^data-' + namespace + '-(.*)'),
431
+ config = {};
432
+ if (element && element.attributes) {
433
+ $.each(element.attributes, function(){
434
+ var match = this.name.match(regexp);
435
+ if (match) {
436
+ var val = this.value,
437
+ name = $.camelCase(match[1]);
438
+ if ($.inArray(name, Klass.functionAttributes) >= 0) { /* jshint -W054 */
439
+ val = new Function(val); /* jshint +W054 */
440
+ } else {
441
+ try { val = JSON.parse(val); }
442
+ catch(e) {}
443
+ }
444
+ config[name] = val;
445
+ }
446
+ });
447
+ }
448
+ return config;
449
+ },
450
+
451
+ /* Used to create a Featherlight extension
452
+ [Warning: guru-level]
453
+ Creates the extension's prototype that in turn
454
+ inherits Featherlight's prototype.
455
+ Could be used to extend an extension too...
456
+ This is pretty high level wizardy, it comes pretty much straight
457
+ from CoffeeScript and won't teach you anything about Featherlight
458
+ as it's not really specific to this library.
459
+ My suggestion: move along and keep your sanity.
460
+ */
461
+ extend: function(child, defaults) {
462
+ /* Setup class hierarchy, adapted from CoffeeScript */
463
+ var Ctor = function(){ this.constructor = child; };
464
+ Ctor.prototype = this.prototype;
465
+ child.prototype = new Ctor();
466
+ child.__super__ = this.prototype;
467
+ /* Copy class methods & attributes */
468
+ $.extend(child, this, defaults);
469
+ child.defaults = child.prototype;
470
+ return child;
471
+ },
472
+
473
+ attach: function($source, $content, config) {
474
+ var Klass = this;
475
+ if (typeof $content === 'object' && $content instanceof $ === false && !config) {
476
+ config = $content;
477
+ $content = undefined;
478
+ }
479
+ /* make a copy */
480
+ config = $.extend({}, config);
481
+
482
+ /* Only for openTrigger and namespace... */
483
+ var namespace = config.namespace || Klass.defaults.namespace,
484
+ tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), config),
485
+ sharedPersist;
486
+ var handler = function(event) {
487
+ var $target = $(event.currentTarget);
488
+ /* ... since we might as well compute the config on the actual target */
489
+ var elemConfig = $.extend(
490
+ {$source: $source, $currentTarget: $target},
491
+ Klass.readElementConfig($source[0], tempConfig.namespace),
492
+ Klass.readElementConfig(event.currentTarget, tempConfig.namespace),
493
+ config);
494
+ var fl = sharedPersist || $target.data('featherlight-persisted') || new Klass($content, elemConfig);
495
+ if(fl.persist === 'shared') {
496
+ sharedPersist = fl;
497
+ } else if(fl.persist !== false) {
498
+ $target.data('featherlight-persisted', fl);
499
+ }
500
+ if (elemConfig.$currentTarget.blur) {
501
+ elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again
502
+ }
503
+ fl.open(event);
504
+ };
505
+
506
+ $source.on(tempConfig.openTrigger+'.'+tempConfig.namespace, tempConfig.filter, handler);
507
+
508
+ return handler;
509
+ },
510
+
511
+ current: function() {
512
+ var all = this.opened();
513
+ return all[all.length - 1] || null;
514
+ },
515
+
516
+ opened: function() {
517
+ var klass = this;
518
+ pruneOpened();
519
+ return $.grep(opened, function(fl) { return fl instanceof klass; } );
520
+ },
521
+
522
+ close: function(event) {
523
+ var cur = this.current();
524
+ if(cur) { return cur.close(event); }
525
+ },
526
+
527
+ /* Does the auto binding on startup.
528
+ Meant only to be used by Featherlight and its extensions
529
+ */
530
+ _onReady: function() {
531
+ var Klass = this;
532
+ if(Klass.autoBind){
533
+ /* Bind existing elements */
534
+ $(Klass.autoBind).each(function(){
535
+ Klass.attach($(this));
536
+ });
537
+ /* If a click propagates to the document level, then we have an item that was added later on */
538
+ $(document).on('click', Klass.autoBind, function(evt) {
539
+ if (evt.isDefaultPrevented()) {
540
+ return;
541
+ }
542
+ /* Bind featherlight */
543
+ var handler = Klass.attach($(evt.currentTarget));
544
+ /* Dispatch event directly */
545
+ handler(evt);
546
+ });
547
+ }
548
+ },
549
+
550
+ /* Featherlight uses the onKeyUp callback to intercept the escape key.
551
+ Private to Featherlight.
552
+ */
553
+ _callbackChain: {
554
+ onKeyUp: function(_super, event){
555
+ if(27 === event.keyCode) {
556
+ if (this.closeOnEsc) {
557
+ $.featherlight.close(event);
558
+ }
559
+ return false;
560
+ } else {
561
+ return _super(event);
562
+ }
563
+ },
564
+
565
+ beforeOpen: function(_super, event) {
566
+ // Used to disable scrolling
567
+ $(document.documentElement).addClass('with-featherlight');
568
+
569
+ // Remember focus:
570
+ this._previouslyActive = document.activeElement;
571
+
572
+ // Disable tabbing:
573
+ // See http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus
574
+ this._$previouslyTabbable = $("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]")
575
+ .not('[tabindex]')
576
+ .not(this.$instance.find('button'));
577
+
578
+ this._$previouslyWithTabIndex = $('[tabindex]').not('[tabindex="-1"]');
579
+ this._previousWithTabIndices = this._$previouslyWithTabIndex.map(function(_i, elem) {
580
+ return $(elem).attr('tabindex');
581
+ });
582
+
583
+ this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr('tabindex', -1);
584
+
585
+ if (document.activeElement.blur) {
586
+ document.activeElement.blur();
587
+ }
588
+ return _super(event);
589
+ },
590
+
591
+ afterClose: function(_super, event) {
592
+ var r = _super(event);
593
+ // Restore focus
594
+ var self = this;
595
+ this._$previouslyTabbable.removeAttr('tabindex');
596
+ this._$previouslyWithTabIndex.each(function(i, elem) {
597
+ $(elem).attr('tabindex', self._previousWithTabIndices[i]);
598
+ });
599
+ this._previouslyActive.focus();
600
+ // Restore scroll
601
+ if(Featherlight.opened().length === 0) {
602
+ $(document.documentElement).removeClass('with-featherlight');
603
+ }
604
+ return r;
605
+ },
606
+
607
+ onResize: function(_super, event){
608
+ this.resize(this.$content.naturalWidth, this.$content.naturalHeight);
609
+ return _super(event);
610
+ },
611
+
612
+ afterContent: function(_super, event){
613
+ var r = _super(event);
614
+ this.$instance.find('[autofocus]:not([disabled])').focus();
615
+ this.onResize(event);
616
+ return r;
617
+ }
618
+ }
619
+ });
620
+
621
+ $.featherlight = Featherlight;
622
+
623
+ /* bind jQuery elements to trigger featherlight */
624
+ $.fn.featherlight = function($content, config) {
625
+ Featherlight.attach(this, $content, config);
626
+ return this;
627
+ };
628
+
629
+ /* bind featherlight on ready if config autoBind is set */
630
+ $(document).ready(function(){ Featherlight._onReady(); });
631
+ }(jQuery));
assets/featherlight/featherlight.min.css CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
- * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
- * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
- @media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch;overflow-y:scroll}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
  *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
+ @media all{html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch;overflow-y:scroll}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}}
assets/featherlight/featherlight.min.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
- * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
- * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
- !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,name:1,referrerpolicy:1,scrolling:1,sandbox:1,src:1,srcdoc:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<button class="'+e+"-close-icon "+d.namespace+'-close" aria-label="Close">',d.closeIcon,"</button>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){var c=this;return(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.namespace+"-iframe"),c.$instance.removeClass(c.namespace+"-loading"),c.$instance.find("."+c.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(c.$instance[0],b[0])?"":b),c.$content=b.addClass(c.namespace+"-inner"),c},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){c.setContent(a),c.afterContent(b)}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(parseInt(this.$content.parent().css("width"),10)-1),b/(parseInt(this.$content.parent().css("height"),10)-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("<iframe/>"),h=d(this,"iframe"),i=c(h,g);return f.hide().attr("src",b).attr(i).css(h).on("load",function(){e.resolve(f.show())}).appendTo(this.$instance.find("."+this.namespace+"-content")),e.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=JSON.parse(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d);return b.on(h.openTrigger+"."+h.namespace,h.filter,function(g){var i=a.extend({$source:b,$currentTarget:a(this)},e.readElementConfig(b[0],h.namespace),e.readElementConfig(this,h.namespace),d),j=f||a(this).data("featherlight-persisted")||new e(c,i);"shared"===j.persist?f=j:j.persist!==!1&&a(this).data("featherlight-persisted",j),i.$currentTarget.blur(),j.open(g)}),b},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return f(),a.grep(e,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;b.autoBind&&(a(b.autoBind).each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(c){c.isDefaultPrevented()||"featherlight"===c.namespace||(c.preventDefault(),b.attach(a(c.currentTarget)),a(c.target).trigger("click.featherlight"))}))},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},beforeOpen:function(b,c){return this._previouslyActive=document.activeElement,this._$previouslyTabbable=a("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]").not("[tabindex]").not(this.$instance.find("button")),this._$previouslyWithTabIndex=a("[tabindex]").not('[tabindex="-1"]'),this._previousWithTabIndices=this._$previouslyWithTabIndex.map(function(b,c){return a(c).attr("tabindex")}),this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr("tabindex",-1),document.activeElement.blur(),b(c)},afterClose:function(b,c){var d=b(c),e=this;return this._$previouslyTabbable.removeAttr("tabindex"),this._$previouslyWithTabIndex.each(function(b,c){a(c).attr("tabindex",e._previousWithTabIndices[b])}),this._previouslyActive.focus(),d},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.$instance.find("[autofocus]:not([disabled])").focus(),this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c)},a(document).ready(function(){b._onReady()})}(jQuery);
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.12 - http://noelboss.github.io/featherlight/
4
  *
5
+ * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
+ !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));if(a.fn.jquery.match(/-ajax/))return void("console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,name:1,referrerpolicy:1,scrolling:1,sandbox:1,src:1,srcdoc:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<button class="'+e+"-close-icon "+d.namespace+'-close" aria-label="Close">',d.closeIcon,"</button>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){if(!b.isDefaultPrevented()){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",b.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(this.$instance[0],b[0])?"":b),this.$content=b.addClass(this.namespace+"-inner"),this},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){c.setContent(a),c.afterContent(b)}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(this.$content.parent().width()-1),b/(this.$content.parent().height()-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("<iframe/>"),h=d(this,"iframe"),i=c(h,g);return f.hide().attr("src",b).attr(i).css(h).on("load",function(){e.resolve(f.show())}).appendTo(this.$instance.find("."+this.namespace+"-content")),e.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=JSON.parse(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d),i=function(g){var i=a(g.currentTarget),j=a.extend({$source:b,$currentTarget:i},e.readElementConfig(b[0],h.namespace),e.readElementConfig(g.currentTarget,h.namespace),d),k=f||i.data("featherlight-persisted")||new e(c,j);"shared"===k.persist?f=k:k.persist!==!1&&i.data("featherlight-persisted",k),j.$currentTarget.blur&&j.$currentTarget.blur(),k.open(g)};return b.on(h.openTrigger+"."+h.namespace,h.filter,i),i},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return f(),a.grep(e,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;b.autoBind&&(a(b.autoBind).each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(c){if(!c.isDefaultPrevented()){var d=b.attach(a(c.currentTarget));d(c)}}))},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},beforeOpen:function(b,c){return a(document.documentElement).addClass("with-featherlight"),this._previouslyActive=document.activeElement,this._$previouslyTabbable=a("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]").not("[tabindex]").not(this.$instance.find("button")),this._$previouslyWithTabIndex=a("[tabindex]").not('[tabindex="-1"]'),this._previousWithTabIndices=this._$previouslyWithTabIndex.map(function(b,c){return a(c).attr("tabindex")}),this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr("tabindex",-1),document.activeElement.blur&&document.activeElement.blur(),b(c)},afterClose:function(c,d){var e=c(d),f=this;return this._$previouslyTabbable.removeAttr("tabindex"),this._$previouslyWithTabIndex.each(function(b,c){a(c).attr("tabindex",f._previousWithTabIndices[b])}),this._previouslyActive.focus(),0===b.opened().length&&a(document.documentElement).removeClass("with-featherlight"),e},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.$instance.find("[autofocus]:not([disabled])").focus(),this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c),this},a(document).ready(function(){b._onReady()})}(jQuery);
assets/imagelightbox/css/imagelightbox.css CHANGED
@@ -1,8 +1,6 @@
1
- #imagelightbox
2
- {
3
- position: fixed;
4
- z-index: 9999;
5
-
6
- -ms-touch-action: none;
7
- touch-action: none;
8
  }
1
+ #imagelightbox {
2
+ position: fixed;
3
+ z-index: 9999;
4
+ -ms-touch-action: none;
5
+ touch-action: none;
 
 
6
  }
assets/imagelightbox/css/imagelightbox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #imagelightbox{position:fixed;z-index:9999;-ms-touch-action:none;touch-action:none}
assets/imagelightbox/js/imagelightbox.js ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*
3
+ By Osvaldas Valutis, www.osvaldas.info
4
+ Available for use under the MIT License
5
+ */
6
+
7
+ ;( function( $, window, document, undefined )
8
+ {
9
+ 'use strict';
10
+
11
+ var cssTransitionSupport = function()
12
+ {
13
+ var s = document.body || document.documentElement, s = s.style;
14
+ if( s.WebkitTransition == '' ) return '-webkit-';
15
+ if( s.MozTransition == '' ) return '-moz-';
16
+ if( s.OTransition == '' ) return '-o-';
17
+ if( s.transition == '' ) return '';
18
+ return false;
19
+ },
20
+
21
+ isCssTransitionSupport = cssTransitionSupport() === false ? false : true,
22
+
23
+ cssTransitionTranslateX = function( element, positionX, speed )
24
+ {
25
+ var options = {}, prefix = cssTransitionSupport();
26
+ options[ prefix + 'transform' ] = 'translateX(' + positionX + ')';
27
+ options[ prefix + 'transition' ] = prefix + 'transform ' + speed + 's linear';
28
+ element.css( options );
29
+ },
30
+
31
+ hasTouch = ( 'ontouchstart' in window ),
32
+ hasPointers = window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
33
+ wasTouched = function( event )
34
+ {
35
+ if( hasTouch )
36
+ return true;
37
+
38
+ if( !hasPointers || typeof event === 'undefined' || typeof event.pointerType === 'undefined' )
39
+ return false;
40
+
41
+ if( typeof event.MSPOINTER_TYPE_MOUSE !== 'undefined' )
42
+ {
43
+ if( event.MSPOINTER_TYPE_MOUSE != event.pointerType )
44
+ return true;
45
+ }
46
+ else
47
+ if( event.pointerType != 'mouse' )
48
+ return true;
49
+
50
+ return false;
51
+ };
52
+
53
+ $.fn.imageLightbox = function( options )
54
+ {
55
+ var options = $.extend(
56
+ {
57
+ selector: 'id="imagelightbox"',
58
+ animationSpeed: 250,
59
+ preloadNext: true,
60
+ enableKeyboard: true,
61
+ quitOnEnd: false,
62
+ quitOnImgClick: false,
63
+ quitOnDocClick: true,
64
+ onStart: false,
65
+ onEnd: false,
66
+ onLoadStart: false,
67
+ onLoadEnd: false
68
+ },
69
+ options ),
70
+
71
+ targets = $([]),
72
+ target = $(),
73
+ image = $(),
74
+ imageWidth = 0,
75
+ imageHeight = 0,
76
+ swipeDiff = 0,
77
+ inProgress = false,
78
+
79
+ setImage = function()
80
+ {
81
+ if( !image.length ) return true;
82
+
83
+ var screenWidth = $( window ).width() * 0.8,
84
+ screenHeight = $( window ).height() * 0.9,
85
+ tmpImage = new Image();
86
+
87
+ tmpImage.src = image.attr( 'src' );
88
+ tmpImage.onload = function()
89
+ {
90
+ imageWidth = tmpImage.width;
91
+ imageHeight = tmpImage.height;
92
+
93
+ if( imageWidth > screenWidth || imageHeight > screenHeight )
94
+ {
95
+ var ratio = imageWidth / imageHeight > screenWidth / screenHeight ? imageWidth / screenWidth : imageHeight / screenHeight;
96
+ imageWidth /= ratio;
97
+ imageHeight /= ratio;
98
+ }
99
+
100
+ image.css(
101
+ {
102
+ 'width': imageWidth + 'px',
103
+ 'height': imageHeight + 'px',
104
+ 'top': ( $( window ).height() - imageHeight ) / 2 + 'px',
105
+ 'left': ( $( window ).width() - imageWidth ) / 2 + 'px'
106
+ });
107
+ };
108
+ },
109
+
110
+ loadImage = function( direction )
111
+ {
112
+ if( inProgress ) return false;
113
+
114
+ direction = typeof direction === 'undefined' ? false : direction == 'left' ? 1 : -1;
115
+
116
+ if( image.length )
117
+ {
118
+ if( direction !== false && ( targets.length < 2 || ( options.quitOnEnd === true && ( ( direction === -1 && targets.index( target ) == 0 ) || ( direction === 1 && targets.index( target ) == targets.length - 1 ) ) ) ) )
119
+ {
120
+ quitLightbox();
121
+ return false;
122
+ }
123
+ var params = { 'opacity': 0 };
124
+ if( isCssTransitionSupport ) cssTransitionTranslateX( image, ( 100 * direction ) - swipeDiff + 'px', options.animationSpeed / 1000 );
125
+ else params.left = parseInt( image.css( 'left' ) ) + 100 * direction + 'px';
126
+ image.animate( params, options.animationSpeed, function(){ removeImage(); });
127
+ swipeDiff = 0;
128
+ }
129
+
130
+ inProgress = true;
131
+ if( options.onLoadStart !== false ) options.onLoadStart();
132
+
133
+ setTimeout( function()
134
+ {
135
+ image = $( '<img ' + options.selector + ' />' )
136
+ .attr( 'src', target.attr( 'href' ) )
137
+ .on( 'load', function()
138
+ {
139
+ image.appendTo( 'body' );
140
+ setImage();
141
+
142
+ var params = { 'opacity': 1 };
143
+
144
+ image.css( 'opacity', 0 );
145
+ if( isCssTransitionSupport )
146
+ {
147
+ cssTransitionTranslateX( image, -100 * direction + 'px', 0 );
148
+ setTimeout( function(){ cssTransitionTranslateX( image, 0 + 'px', options.animationSpeed / 1000 ) }, 50 );
149
+ }
150
+ else
151
+ {
152
+ var imagePosLeft = parseInt( image.css( 'left' ) );
153
+ params.left = imagePosLeft + 'px';
154
+ image.css( 'left', imagePosLeft - 100 * direction + 'px' );
155
+ }
156
+
157
+ image.animate( params, options.animationSpeed, function()
158
+ {
159
+ inProgress = false;
160
+ if( options.onLoadEnd !== false ) options.onLoadEnd();
161
+ });
162
+ if( options.preloadNext )
163
+ {
164
+ var nextTarget = targets.eq( targets.index( target ) + 1 );
165
+ if( !nextTarget.length ) nextTarget = targets.eq( 0 );
166
+ $( '<img />' ).attr( 'src', nextTarget.attr( 'href' ) );
167
+ }
168
+ })
169
+ .on( 'error', function()
170
+ {
171
+ if( options.onLoadEnd !== false ) options.onLoadEnd();
172
+ });
173
+
174
+ var swipeStart = 0,
175
+ swipeEnd = 0,
176
+ imagePosLeft = 0;
177
+
178
+ image.on( hasPointers ? 'pointerup MSPointerUp' : 'click', function( e )
179
+ {
180
+ e.preventDefault();
181
+ if( options.quitOnImgClick )
182
+ {
183
+ quitLightbox();
184
+ return false;
185
+ }
186
+ if( wasTouched( e.originalEvent ) ) return true;
187
+ var posX = ( e.pageX || e.originalEvent.pageX ) - e.target.offsetLeft;
188
+ target = targets.eq( targets.index( target ) - ( imageWidth / 2 > posX ? 1 : -1 ) );
189
+ if( !target.length ) target = targets.eq( imageWidth / 2 > posX ? targets.length : 0 );
190
+ loadImage( imageWidth / 2 > posX ? 'left' : 'right' );
191
+ })
192
+ .on( 'touchstart pointerdown MSPointerDown', function( e )
193
+ {
194
+ if( !wasTouched( e.originalEvent ) || options.quitOnImgClick ) return true;
195
+ if( isCssTransitionSupport ) imagePosLeft = parseInt( image.css( 'left' ) );
196
+ swipeStart = e.originalEvent.pageX || e.originalEvent.touches[ 0 ].pageX;
197
+ })
198
+ .on( 'touchmove pointermove MSPointerMove', function( e )
199
+ {
200
+ if( !wasTouched( e.originalEvent ) || options.quitOnImgClick ) return true;
201
+ e.preventDefault();
202
+ swipeEnd = e.originalEvent.pageX || e.originalEvent.touches[ 0 ].pageX;
203
+ swipeDiff = swipeStart - swipeEnd;
204
+ if( isCssTransitionSupport ) cssTransitionTranslateX( image, -swipeDiff + 'px', 0 );
205
+ else image.css( 'left', imagePosLeft - swipeDiff + 'px' );
206
+ })
207
+ .on( 'touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel', function( e )
208
+ {
209
+ if( !wasTouched( e.originalEvent ) || options.quitOnImgClick ) return true;
210
+ if( Math.abs( swipeDiff ) > 50 )
211
+ {
212
+ target = targets.eq( targets.index( target ) - ( swipeDiff < 0 ? 1 : -1 ) );
213
+ if( !target.length ) target = targets.eq( swipeDiff < 0 ? targets.length : 0 );
214
+ loadImage( swipeDiff > 0 ? 'right' : 'left' );
215
+ }
216
+ else
217
+ {
218
+ if( isCssTransitionSupport ) cssTransitionTranslateX( image, 0 + 'px', options.animationSpeed / 1000 );
219
+ else image.animate({ 'left': imagePosLeft + 'px' }, options.animationSpeed / 2 );
220
+ }
221
+ });
222
+
223
+ }, options.animationSpeed + 100 );
224
+ },
225
+
226
+ removeImage = function()
227
+ {
228
+ if( !image.length ) return false;
229
+ image.remove();
230
+ image = $();
231
+ },
232
+
233
+ quitLightbox = function()
234
+ {
235
+ if( !image.length ) return false;
236
+ image.animate({ 'opacity': 0 }, options.animationSpeed, function()
237
+ {
238
+ removeImage();
239
+ inProgress = false;
240
+ if( options.onEnd !== false ) options.onEnd();
241
+ });
242
+ },
243
+
244
+ addTargets = function( newTargets )
245
+ {
246
+ newTargets.each( function()
247
+ {
248
+ targets = targets.add( $( this ) );
249
+ });
250
+
251
+ newTargets.on( 'click.imageLightbox', function( e )
252
+ {
253
+ e.preventDefault();
254
+ if( inProgress ) return false;
255
+ inProgress = false;
256
+ if( options.onStart !== false ) options.onStart();
257
+ target = $( this );
258
+ loadImage();
259
+ });
260
+ };
261
+
262
+ $( window ).on( 'resize', setImage );
263
+
264
+ if( options.quitOnDocClick )
265
+ {
266
+ $( document ).on( hasTouch ? 'touchend' : 'click', function( e )
267
+ {
268
+ if( image.length && !$( e.target ).is( image ) ) quitLightbox();
269
+ });
270
+ }
271
+
272
+ if( options.enableKeyboard )
273
+ {
274
+ $( document ).on( 'keyup', function( e )
275
+ {
276
+ if( !image.length ) return true;
277
+ e.preventDefault();
278
+ if( e.keyCode == 27 ) quitLightbox();
279
+ if( e.keyCode == 37 || e.keyCode == 39 )
280
+ {
281
+ target = targets.eq( targets.index( target ) - ( e.keyCode == 37 ? 1 : -1 ) );
282
+ if( !target.length ) target = targets.eq( e.keyCode == 37 ? targets.length : 0 );
283
+ loadImage( e.keyCode == 37 ? 'left' : 'right' );
284
+ }
285
+ });
286
+ }
287
+
288
+ addTargets( $( this ) );
289
+
290
+ this.switchImageLightbox = function( index )
291
+ {
292
+ var tmpTarget = targets.eq( index );
293
+ if( tmpTarget.length )
294
+ {
295
+ var currentIndex = targets.index( target );
296
+ target = tmpTarget;
297
+ loadImage( index < currentIndex ? 'left' : 'right' );
298
+ }
299
+ return this;
300
+ };
301
+
302
+ this.addToImageLightbox = function( newTargets )
303
+ {
304
+ addTargets( newTargets );
305
+ };
306
+
307
+ this.quitImageLightbox = function()
308
+ {
309
+ quitLightbox();
310
+ return this;
311
+ };
312
+
313
+ return this;
314
+ };
315
+ })( jQuery, window, document );
assets/imagelightbox/js/imagelightbox.min.js CHANGED
@@ -3,4 +3,4 @@
3
  Available for use under the MIT License
4
  */
5
 
6
- ;(function(e,t,n,r){"use strict";var i=function(){var e=n.body||n.documentElement,e=e.style;if(e.WebkitTransition=="")return"-webkit-";if(e.MozTransition=="")return"-moz-";if(e.OTransition=="")return"-o-";if(e.transition=="")return"";return false},s=i()===false?false:true,o=function(e,t,n){var r={},s=i();r[s+"transform"]="translateX("+t+")";r[s+"transition"]=s+"transform "+n+"s linear";e.css(r)},u="ontouchstart"in t,a=t.navigator.pointerEnabled||t.navigator.msPointerEnabled,f=function(e){if(u)return true;if(!a||typeof e==="undefined"||typeof e.pointerType==="undefined")return false;if(typeof e.MSPOINTER_TYPE_MOUSE!=="undefined"){if(e.MSPOINTER_TYPE_MOUSE!=e.pointerType)return true}else if(e.pointerType!="mouse")return true;return false};e.fn.imageLightbox=function(r){var r=e.extend({selector:'id="imagelightbox"',allowedTypes:"png|jpg|jpeg|gif",animationSpeed:250,preloadNext:true,enableKeyboard:true,quitOnEnd:false,quitOnImgClick:false,quitOnDocClick:true,onStart:false,onEnd:false,onLoadStart:false,onLoadEnd:false},r),i=e([]),l=e(),c=e(),h=0,p=0,d=0,v=false,m=function(t){return e(t).prop("tagName").toLowerCase()=="a"&&(new RegExp(".("+r.allowedTypes+")$","i")).test(e(t).attr("href"))},g=function(){if(!c.length)return true;var n=e(t).width()*.8,r=e(t).height()*.9,i=new Image;i.src=c.attr("src");i.onload=function(){h=i.width;p=i.height;if(h>n||p>r){var s=h/p>n/r?h/n:p/r;h/=s;p/=s}c.css({width:h+"px",height:p+"px",top:(e(t).height()-p)/2+"px",left:(e(t).width()-h)/2+"px"})}},y=function(t){if(v)return false;t=typeof t==="undefined"?false:t=="left"?1:-1;if(c.length){if(t!==false&&(i.length<2||r.quitOnEnd===true&&(t===-1&&i.index(l)==0||t===1&&i.index(l)==i.length-1))){w();return false}var n={opacity:0};if(s)o(c,100*t-d+"px",r.animationSpeed/1e3);else n.left=parseInt(c.css("left"))+100*t+"px";c.animate(n,r.animationSpeed,function(){b()});d=0}v=true;if(r.onLoadStart!==false)r.onLoadStart();setTimeout(function(){c=e("<img "+r.selector+" />").attr("src",l.attr("href")).load(function(){c.appendTo("body");g();var n={opacity:1};c.css("opacity",0);if(s){o(c,-100*t+"px",0);setTimeout(function(){o(c,0+"px",r.animationSpeed/1e3)},50)}else{var u=parseInt(c.css("left"));n.left=u+"px";c.css("left",u-100*t+"px")}c.animate(n,r.animationSpeed,function(){v=false;if(r.onLoadEnd!==false)r.onLoadEnd()});if(r.preloadNext){var a=i.eq(i.index(l)+1);if(!a.length)a=i.eq(0);e("<img />").attr("src",a.attr("href")).load()}}).error(function(){if(r.onLoadEnd!==false)r.onLoadEnd()});var n=0,u=0,p=0;c.on(a?"pointerup MSPointerUp":"click",function(e){e.preventDefault();if(r.quitOnImgClick){w();return false}if(f(e.originalEvent))return true;var t=(e.pageX||e.originalEvent.pageX)-e.target.offsetLeft;l=i.eq(i.index(l)-(h/2>t?1:-1));if(!l.length)l=i.eq(h/2>t?i.length:0);y(h/2>t?"left":"right")}).on("touchstart pointerdown MSPointerDown",function(e){if(!f(e.originalEvent)||r.quitOnImgClick)return true;if(s)p=parseInt(c.css("left"));n=e.originalEvent.pageX||e.originalEvent.touches[0].pageX}).on("touchmove pointermove MSPointerMove",function(e){if(!f(e.originalEvent)||r.quitOnImgClick)return true;e.preventDefault();u=e.originalEvent.pageX||e.originalEvent.touches[0].pageX;d=n-u;if(s)o(c,-d+"px",0);else c.css("left",p-d+"px")}).on("touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel",function(e){if(!f(e.originalEvent)||r.quitOnImgClick)return true;if(Math.abs(d)>50){l=i.eq(i.index(l)-(d<0?1:-1));if(!l.length)l=i.eq(d<0?i.length:0);y(d>0?"right":"left")}else{if(s)o(c,0+"px",r.animationSpeed/1e3);else c.animate({left:p+"px"},r.animationSpeed/2)}})},r.animationSpeed+100)},b=function(){if(!c.length)return false;c.remove();c=e()},w=function(){if(!c.length)return false;c.animate({opacity:0},r.animationSpeed,function(){b();v=false;if(r.onEnd!==false)r.onEnd()})};e(t).on("resize",g);if(r.quitOnDocClick){e(n).on(u?"touchend":"click",function(t){if(c.length&&!e(t.target).is(c))w()})}if(r.enableKeyboard){e(n).on("keyup",function(e){if(!c.length)return true;e.preventDefault();if(e.keyCode==27)w();if(e.keyCode==37||e.keyCode==39){l=i.eq(i.index(l)-(e.keyCode==37?1:-1));if(!l.length)l=i.eq(e.keyCode==37?i.length:0);y(e.keyCode==37?"left":"right")}})}e(n).on("click",this.selector,function(t){if(!m(this))return true;t.preventDefault();if(v)return false;v=false;if(r.onStart!==false)r.onStart();l=e(this);y()});this.each(function(){if(!m(this))return true;i=i.add(e(this))});this.switchImageLightbox=function(e){var t=i.eq(e);if(t.length){var n=i.index(l);l=t;y(e<n?"left":"right")}return this};this.quitImageLightbox=function(){w();return this};return this}})(jQuery,window,document);
3
  Available for use under the MIT License
4
  */
5
 
6
+ !function(n,t,e,i){"use strict";var o=function(){var n=e.body||e.documentElement,n=n.style;return""==n.WebkitTransition?"-webkit-":""==n.MozTransition?"-moz-":""==n.OTransition?"-o-":""==n.transition?"":!1},r=o()===!1?!1:!0,a=function(n,t,e){var i={},r=o();i[r+"transform"]="translateX("+t+")",i[r+"transition"]=r+"transform "+e+"s linear",n.css(i)},u="ontouchstart"in t,d=t.navigator.pointerEnabled||t.navigator.msPointerEnabled,c=function(n){if(u)return!0;if(!d||"undefined"==typeof n||"undefined"==typeof n.pointerType)return!1;if("undefined"!=typeof n.MSPOINTER_TYPE_MOUSE){if(n.MSPOINTER_TYPE_MOUSE!=n.pointerType)return!0}else if("mouse"!=n.pointerType)return!0;return!1};n.fn.imageLightbox=function(i){var i=n.extend({selector:'id="imagelightbox"',animationSpeed:250,preloadNext:!0,enableKeyboard:!0,quitOnEnd:!1,quitOnImgClick:!1,quitOnDocClick:!0,onStart:!1,onEnd:!1,onLoadStart:!1,onLoadEnd:!1},i),o=n([]),f=n(),l=n(),p=0,g=0,s=0,h=!1,m=function(){if(!l.length)return!0;var e=.8*n(t).width(),i=.9*n(t).height(),o=new Image;o.src=l.attr("src"),o.onload=function(){if(p=o.width,g=o.height,p>e||g>i){var r=p/g>e/i?p/e:g/i;p/=r,g/=r}l.css({width:p+"px",height:g+"px",top:(n(t).height()-g)/2+"px",left:(n(t).width()-p)/2+"px"})}},v=function(t){if(h)return!1;if(t="undefined"==typeof t?!1:"left"==t?1:-1,l.length){if(t!==!1&&(o.length<2||i.quitOnEnd===!0&&(-1===t&&0==o.index(f)||1===t&&o.index(f)==o.length-1)))return E(),!1;var e={opacity:0};r?a(l,100*t-s+"px",i.animationSpeed/1e3):e.left=parseInt(l.css("left"))+100*t+"px",l.animate(e,i.animationSpeed,function(){x()}),s=0}h=!0,i.onLoadStart!==!1&&i.onLoadStart(),setTimeout(function(){l=n("<img "+i.selector+" />").attr("src",f.attr("href")).on("load",function(){l.appendTo("body"),m();var e={opacity:1};if(l.css("opacity",0),r)a(l,-100*t+"px",0),setTimeout(function(){a(l,"0px",i.animationSpeed/1e3)},50);else{var u=parseInt(l.css("left"));e.left=u+"px",l.css("left",u-100*t+"px")}if(l.animate(e,i.animationSpeed,function(){h=!1,i.onLoadEnd!==!1&&i.onLoadEnd()}),i.preloadNext){var d=o.eq(o.index(f)+1);d.length||(d=o.eq(0)),n("<img />").attr("src",d.attr("href"))}}).on("error",function(){i.onLoadEnd!==!1&&i.onLoadEnd()});var e=0,u=0,g=0;l.on(d?"pointerup MSPointerUp":"click",function(n){if(n.preventDefault(),i.quitOnImgClick)return E(),!1;if(c(n.originalEvent))return!0;var t=(n.pageX||n.originalEvent.pageX)-n.target.offsetLeft;f=o.eq(o.index(f)-(p/2>t?1:-1)),f.length||(f=o.eq(p/2>t?o.length:0)),v(p/2>t?"left":"right")}).on("touchstart pointerdown MSPointerDown",function(n){return!c(n.originalEvent)||i.quitOnImgClick?!0:(r&&(g=parseInt(l.css("left"))),void(e=n.originalEvent.pageX||n.originalEvent.touches[0].pageX))}).on("touchmove pointermove MSPointerMove",function(n){return!c(n.originalEvent)||i.quitOnImgClick?!0:(n.preventDefault(),u=n.originalEvent.pageX||n.originalEvent.touches[0].pageX,s=e-u,void(r?a(l,-s+"px",0):l.css("left",g-s+"px")))}).on("touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel",function(n){return!c(n.originalEvent)||i.quitOnImgClick?!0:void(Math.abs(s)>50?(f=o.eq(o.index(f)-(0>s?1:-1)),f.length||(f=o.eq(0>s?o.length:0)),v(s>0?"right":"left")):r?a(l,"0px",i.animationSpeed/1e3):l.animate({left:g+"px"},i.animationSpeed/2))})},i.animationSpeed+100)},x=function(){return l.length?(l.remove(),void(l=n())):!1},E=function(){return l.length?void l.animate({opacity:0},i.animationSpeed,function(){x(),h=!1,i.onEnd!==!1&&i.onEnd()}):!1},y=function(t){t.each(function(){o=o.add(n(this))}),t.on("click.imageLightbox",function(t){return t.preventDefault(),h?!1:(h=!1,i.onStart!==!1&&i.onStart(),f=n(this),void v())})};return n(t).on("resize",m),i.quitOnDocClick&&n(e).on(u?"touchend":"click",function(t){l.length&&!n(t.target).is(l)&&E()}),i.enableKeyboard&&n(e).on("keyup",function(n){return l.length?(n.preventDefault(),27==n.keyCode&&E(),void((37==n.keyCode||39==n.keyCode)&&(f=o.eq(o.index(f)-(37==n.keyCode?1:-1)),f.length||(f=o.eq(37==n.keyCode?o.length:0)),v(37==n.keyCode?"left":"right")))):!0}),y(n(this)),this.switchImageLightbox=function(n){var t=o.eq(n);if(t.length){var e=o.index(f);f=t,v(e>n?"left":"right")}return this},this.addToImageLightbox=function(n){y(n)},this.quitImageLightbox=function(){return E(),this},this}}(jQuery,window,document);
assets/imagesloaded/imagesloaded.pkgd.js ADDED
@@ -0,0 +1,497 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * imagesLoaded PACKAGED v4.1.4
3
+ * JavaScript is all like "You images are done yet or what?"
4
+ * MIT License
5
+ */
6
+
7
+ /**
8
+ * EvEmitter v1.1.0
9
+ * Lil' event emitter
10
+ * MIT License
11
+ */
12
+
13
+ /* jshint unused: true, undef: true, strict: true */
14
+
15
+ ( function( global, factory ) {
16
+ // universal module definition
17
+ /* jshint strict: false */ /* globals define, module, window */
18
+ if ( typeof define == 'function' && define.amd ) {
19
+ // AMD - RequireJS
20
+ define( 'ev-emitter/ev-emitter',factory );
21
+ } else if ( typeof module == 'object' && module.exports ) {
22
+ // CommonJS - Browserify, Webpack
23
+ module.exports = factory();
24
+ } else {
25
+ // Browser globals
26
+ global.EvEmitter = factory();
27
+ }
28
+
29
+ }( typeof window != 'undefined' ? window : this, function() {
30
+
31
+
32
+
33
+ function EvEmitter() {}
34
+
35
+ var proto = EvEmitter.prototype;
36
+
37
+ proto.on = function( eventName, listener ) {
38
+ if ( !eventName || !listener ) {
39
+ return;
40
+ }
41
+ // set events hash
42
+ var events = this._events = this._events || {};
43
+ // set listeners array
44
+ var listeners = events[ eventName ] = events[ eventName ] || [];
45
+ // only add once
46
+ if ( listeners.indexOf( listener ) == -1 ) {
47
+ listeners.push( listener );
48
+ }
49
+
50
+ return this;
51
+ };
52
+
53
+ proto.once = function( eventName, listener ) {
54
+ if ( !eventName || !listener ) {
55
+ return;
56
+ }
57
+ // add event
58
+ this.on( eventName, listener );
59
+ // set once flag
60
+ // set onceEvents hash
61
+ var onceEvents = this._onceEvents = this._onceEvents || {};
62
+ // set onceListeners object
63
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
64
+ // set flag
65
+ onceListeners[ listener ] = true;
66
+
67
+ return this;
68
+ };
69
+
70
+ proto.off = function( eventName, listener ) {
71
+ var listeners = this._events && this._events[ eventName ];
72
+ if ( !listeners || !listeners.length ) {
73
+ return;
74
+ }
75
+ var index = listeners.indexOf( listener );
76
+ if ( index != -1 ) {
77
+ listeners.splice( index, 1 );
78
+ }
79
+
80
+ return this;
81
+ };
82
+
83
+ proto.emitEvent = function( eventName, args ) {
84
+ var listeners = this._events && this._events[ eventName ];
85
+ if ( !listeners || !listeners.length ) {
86
+ return;
87
+ }
88
+ // copy over to avoid interference if .off() in listener
89
+ listeners = listeners.slice(0);
90
+ args = args || [];
91
+ // once stuff
92
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
93
+
94
+ for ( var i=0; i < listeners.length; i++ ) {
95
+ var listener = listeners[i]
96
+ var isOnce = onceListeners && onceListeners[ listener ];
97
+ if ( isOnce ) {
98
+ // remove listener
99
+ // remove before trigger to prevent recursion
100
+ this.off( eventName, listener );
101
+ // unset once flag
102
+ delete onceListeners[ listener ];
103
+ }
104
+ // trigger listener
105
+ listener.apply( this, args );
106
+ }
107
+
108
+ return this;
109
+ };
110
+
111
+ proto.allOff = function() {
112
+ delete this._events;
113
+ delete this._onceEvents;
114
+ };
115
+
116
+ return EvEmitter;
117
+
118
+ }));
119
+
120
+ /*!
121
+ * imagesLoaded v4.1.4
122
+ * JavaScript is all like "You images are done yet or what?"
123
+ * MIT License
124
+ */
125
+
126
+ ( function( window, factory ) { 'use strict';
127
+ // universal module definition
128
+
129
+ /*global define: false, module: false, require: false */
130
+
131
+ if ( typeof define == 'function' && define.amd ) {
132
+ // AMD
133
+ define( [
134
+ 'ev-emitter/ev-emitter'
135
+ ], function( EvEmitter ) {
136
+ return factory( window, EvEmitter );
137
+ });
138
+ } else if ( typeof module == 'object' && module.exports ) {
139
+ // CommonJS
140
+ module.exports = factory(
141
+ window,
142
+ require('ev-emitter')
143
+ );
144
+ } else {
145
+ // browser global
146
+ window.imagesLoaded = factory(
147
+ window,
148
+ window.EvEmitter
149
+ );
150
+ }
151
+
152
+ })( typeof window !== 'undefined' ? window : this,
153
+
154
+ // -------------------------- factory -------------------------- //
155
+
156
+ function factory( window, EvEmitter ) {
157
+
158
+
159
+
160
+ var $ = window.jQuery;
161
+ var console = window.console;
162
+
163
+ // -------------------------- helpers -------------------------- //
164
+
165
+ // extend objects
166
+ function extend( a, b ) {
167
+ for ( var prop in b ) {
168
+ a[ prop ] = b[ prop ];
169
+ }
170
+ return a;
171
+ }
172
+
173
+ var arraySlice = Array.prototype.slice;
174
+
175
+ // turn element or nodeList into an array
176
+ function makeArray( obj ) {
177
+ if ( Array.isArray( obj ) ) {
178
+ // use object if already an array
179
+ return obj;
180
+ }
181
+
182
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
183
+ if ( isArrayLike ) {
184
+ // convert nodeList to array
185
+ return arraySlice.call( obj );
186
+ }
187
+
188
+ // array of single index
189
+ return [ obj ];
190
+ }
191
+
192
+ // -------------------------- imagesLoaded -------------------------- //
193
+
194
+ /**
195
+ * @param {Array, Element, NodeList, String} elem
196
+ * @param {Object or Function} options - if function, use as callback
197
+ * @param {Function} onAlways - callback function
198
+ */
199
+ function ImagesLoaded( elem, options, onAlways ) {
200
+ // coerce ImagesLoaded() without new, to be new ImagesLoaded()
201
+ if ( !( this instanceof ImagesLoaded ) ) {
202
+ return new ImagesLoaded( elem, options, onAlways );
203
+ }
204
+ // use elem as selector string
205
+ var queryElem = elem;
206
+ if ( typeof elem == 'string' ) {
207
+ queryElem = document.querySelectorAll( elem );
208
+ }
209
+ // bail if bad element
210
+ if ( !queryElem ) {
211
+ console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) );
212
+ return;
213
+ }
214
+
215
+ this.elements = makeArray( queryElem );
216
+ this.options = extend( {}, this.options );
217
+ // shift arguments if no options set
218
+ if ( typeof options == 'function' ) {
219
+ onAlways = options;
220
+ } else {
221
+ extend( this.options, options );
222
+ }
223
+
224
+ if ( onAlways ) {
225
+ this.on( 'always', onAlways );
226
+ }
227
+
228
+ this.getImages();
229
+
230
+ if ( $ ) {
231
+ // add jQuery Deferred object
232
+ this.jqDeferred = new $.Deferred();
233
+ }
234
+
235
+ // HACK check async to allow time to bind listeners
236
+ setTimeout( this.check.bind( this ) );
237
+ }
238
+
239
+ ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
240
+
241
+ ImagesLoaded.prototype.options = {};
242
+
243
+ ImagesLoaded.prototype.getImages = function() {
244
+ this.images = [];
245
+
246
+ // filter & find items if we have an item selector
247
+ this.elements.forEach( this.addElementImages, this );
248
+ };
249
+
250
+ /**
251
+ * @param {Node} element
252
+ */
253
+ ImagesLoaded.prototype.addElementImages = function( elem ) {
254
+ // filter siblings
255
+ if ( elem.nodeName == 'IMG' ) {
256
+ this.addImage( elem );
257
+ }
258
+ // get background image on element
259
+ if ( this.options.background === true ) {
260
+ this.addElementBackgroundImages( elem );
261
+ }
262
+
263
+ // find children
264
+ // no non-element nodes, #143
265
+ var nodeType = elem.nodeType;
266
+ if ( !nodeType || !elementNodeTypes[ nodeType ] ) {
267
+ return;
268
+ }
269
+ var childImgs = elem.querySelectorAll('img');
270
+ // concat childElems to filterFound array
271
+ for ( var i=0; i < childImgs.length; i++ ) {
272
+ var img = childImgs[i];
273
+ this.addImage( img );
274
+ }
275
+
276
+ // get child background images
277
+ if ( typeof this.options.background == 'string' ) {
278
+ var children = elem.querySelectorAll( this.options.background );
279
+ for ( i=0; i < children.length; i++ ) {
280
+ var child = children[i];
281
+ this.addElementBackgroundImages( child );
282
+ }
283
+ }
284
+ };
285
+
286
+ var elementNodeTypes = {
287
+ 1: true,
288
+ 9: true,
289
+ 11: true
290
+ };
291
+
292
+ ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
293
+ var style = getComputedStyle( elem );
294
+ if ( !style ) {
295
+ // Firefox returns null if in a hidden iframe https://bugzil.la/548397
296
+ return;
297
+ }
298
+ // get url inside url("...")
299
+ var reURL = /url\((['"])?(.*?)\1\)/gi;
300
+ var matches = reURL.exec( style.backgroundImage );
301
+ while ( matches !== null ) {
302
+ var url = matches && matches[2];
303
+ if ( url ) {
304
+ this.addBackground( url, elem );
305
+ }
306
+ matches = reURL.exec( style.backgroundImage );
307
+ }
308
+ };
309
+
310
+ /**
311
+ * @param {Image} img
312
+ */
313
+ ImagesLoaded.prototype.addImage = function( img ) {
314
+ var loadingImage = new LoadingImage( img );
315
+ this.images.push( loadingImage );
316
+ };
317
+
318
+ ImagesLoaded.prototype.addBackground = function( url, elem ) {
319
+ var background = new Background( url, elem );
320
+ this.images.push( background );
321
+ };
322
+
323
+ ImagesLoaded.prototype.check = function() {
324
+ var _this = this;
325
+ this.progressedCount = 0;
326
+ this.hasAnyBroken = false;
327
+ // complete if no images
328
+ if ( !this.images.length ) {
329
+ this.complete();
330
+ return;
331
+ }
332
+
333
+ function onProgress( image, elem, message ) {
334
+ // HACK - Chrome triggers event before object properties have changed. #83
335
+ setTimeout( function() {
336
+ _this.progress( image, elem, message );
337
+ });
338
+ }
339
+
340
+ this.images.forEach( function( loadingImage ) {
341
+ loadingImage.once( 'progress', onProgress );
342
+ loadingImage.check();
343
+ });
344
+ };
345
+
346
+ ImagesLoaded.prototype.progress = function( image, elem, message ) {
347
+ this.progressedCount++;
348
+ this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
349
+ // progress event
350
+ this.emitEvent( 'progress', [ this, image, elem ] );
351
+ if ( this.jqDeferred && this.jqDeferred.notify ) {
352
+ this.jqDeferred.notify( this, image );
353
+ }
354
+ // check if completed
355
+ if ( this.progressedCount == this.images.length ) {
356
+ this.complete();
357
+ }
358
+
359
+ if ( this.options.debug && console ) {
360
+ console.log( 'progress: ' + message, image, elem );
361
+ }
362
+ };
363
+
364
+ ImagesLoaded.prototype.complete = function() {
365
+ var eventName = this.hasAnyBroken ? 'fail' : 'done';
366
+ this.isComplete = true;
367
+ this.emitEvent( eventName, [ this ] );
368
+ this.emitEvent( 'always', [ this ] );
369
+ if ( this.jqDeferred ) {
370
+ var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
371
+ this.jqDeferred[ jqMethod ]( this );
372
+ }
373
+ };
374
+
375
+ // -------------------------- -------------------------- //
376
+
377
+ function LoadingImage( img ) {
378
+ this.img = img;
379
+ }
380
+
381
+ LoadingImage.prototype = Object.create( EvEmitter.prototype );
382
+
383
+ LoadingImage.prototype.check = function() {
384
+ // If complete is true and browser supports natural sizes,
385
+ // try to check for image status manually.
386
+ var isComplete = this.getIsImageComplete();
387
+ if ( isComplete ) {
388
+ // report based on naturalWidth
389
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
390
+ return;
391
+ }
392
+
393
+ // If none of the checks above matched, simulate loading on detached element.
394
+ this.proxyImage = new Image();
395
+ this.proxyImage.addEventListener( 'load', this );
396
+ this.proxyImage.addEventListener( 'error', this );
397
+ // bind to image as well for Firefox. #191
398
+ this.img.addEventListener( 'load', this );
399
+ this.img.addEventListener( 'error', this );
400
+ this.proxyImage.src = this.img.src;
401
+ };
402
+
403
+ LoadingImage.prototype.getIsImageComplete = function() {
404
+ // check for non-zero, non-undefined naturalWidth
405
+ // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
406
+ return this.img.complete && this.img.naturalWidth;
407
+ };
408
+
409
+ LoadingImage.prototype.confirm = function( isLoaded, message ) {
410
+ this.isLoaded = isLoaded;
411
+ this.emitEvent( 'progress', [ this, this.img, message ] );
412
+ };
413
+
414
+ // ----- events ----- //
415
+
416
+ // trigger specified handler for event type
417
+ LoadingImage.prototype.handleEvent = function( event ) {
418
+ var method = 'on' + event.type;
419
+ if ( this[ method ] ) {
420
+ this[ method ]( event );
421
+ }
422
+ };
423
+
424
+ LoadingImage.prototype.onload = function() {
425
+ this.confirm( true, 'onload' );
426
+ this.unbindEvents();
427
+ };
428
+
429
+ LoadingImage.prototype.onerror = function() {
430
+ this.confirm( false, 'onerror' );
431
+ this.unbindEvents();
432
+ };
433
+
434
+ LoadingImage.prototype.unbindEvents = function() {
435
+ this.proxyImage.removeEventListener( 'load', this );
436
+ this.proxyImage.removeEventListener( 'error', this );
437
+ this.img.removeEventListener( 'load', this );
438
+ this.img.removeEventListener( 'error', this );
439
+ };
440
+
441
+ // -------------------------- Background -------------------------- //
442
+
443
+ function Background( url, element ) {
444
+ this.url = url;
445
+ this.element = element;
446
+ this.img = new Image();
447
+ }
448
+
449
+ // inherit LoadingImage prototype
450
+ Background.prototype = Object.create( LoadingImage.prototype );
451
+
452
+ Background.prototype.check = function() {
453
+ this.img.addEventListener( 'load', this );
454
+ this.img.addEventListener( 'error', this );
455
+ this.img.src = this.url;
456
+ // check if image is already complete
457
+ var isComplete = this.getIsImageComplete();
458
+ if ( isComplete ) {
459
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
460
+ this.unbindEvents();
461
+ }
462
+ };
463
+
464
+ Background.prototype.unbindEvents = function() {
465
+ this.img.removeEventListener( 'load', this );
466
+ this.img.removeEventListener( 'error', this );
467
+ };
468
+
469
+ Background.prototype.confirm = function( isLoaded, message ) {
470
+ this.isLoaded = isLoaded;
471
+ this.emitEvent( 'progress', [ this, this.element, message ] );
472
+ };
473
+
474
+ // -------------------------- jQuery -------------------------- //
475
+
476
+ ImagesLoaded.makeJQueryPlugin = function( jQuery ) {
477
+ jQuery = jQuery || window.jQuery;
478
+ if ( !jQuery ) {
479
+ return;
480
+ }
481
+ // set local variable
482
+ $ = jQuery;
483
+ // $().imagesLoaded()
484
+ $.fn.imagesLoaded = function( options, callback ) {
485
+ var instance = new ImagesLoaded( this, options, callback );
486
+ return instance.jqDeferred.promise( $(this) );
487
+ };
488
+ };
489
+ // try making plugin
490
+ ImagesLoaded.makeJQueryPlugin();
491
+
492
+ // -------------------------- -------------------------- //
493
+
494
+ return ImagesLoaded;
495
+
496
+ });
497
+
assets/imagesloaded/imagesloaded.pkgd.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*!
2
+ * imagesLoaded PACKAGED v4.1.4
3
+ * JavaScript is all like "You images are done yet or what?"
4
+ * MIT License
5
+ */
6
+
7
+ !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});
assets/infinitescroll/infinite-scroll.pkgd.js ADDED
@@ -0,0 +1,2197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Infinite Scroll PACKAGED v3.0.4
3
+ * Automatically add next page
4
+ *
5
+ * Licensed GPLv3 for open source use
6
+ * or Infinite Scroll Commercial License for commercial use
7
+ *
8
+ * https://infinite-scroll.com
9
+ * Copyright 2018 Metafizzy
10
+ */
11
+
12
+ /**
13
+ * Bridget makes jQuery widgets
14
+ * v2.0.1
15
+ * MIT license
16
+ */
17
+
18
+ /* jshint browser: true, strict: true, undef: true, unused: true */
19
+
20
+ ( function( window, factory ) {
21
+ // universal module definition
22
+ /*jshint strict: false */ /* globals define, module, require */
23
+ if ( typeof define == 'function' && define.amd ) {
24
+ // AMD
25
+ define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) {
26
+ return factory( window, jQuery );
27
+ });
28
+ } else if ( typeof module == 'object' && module.exports ) {
29
+ // CommonJS
30
+ module.exports = factory(
31
+ window,
32
+ require('jquery')
33
+ );
34
+ } else {
35
+ // browser global
36
+ window.jQueryBridget = factory(
37
+ window,
38
+ window.jQuery
39
+ );
40
+ }
41
+
42
+ }( window, function factory( window, jQuery ) {
43
+ 'use strict';
44
+
45
+ // ----- utils ----- //
46
+
47
+ var arraySlice = Array.prototype.slice;
48
+
49
+ // helper function for logging errors
50
+ // $.error breaks jQuery chaining
51
+ var console = window.console;
52
+ var logError = typeof console == 'undefined' ? function() {} :
53
+ function( message ) {
54
+ console.error( message );
55
+ };
56
+
57
+ // ----- jQueryBridget ----- //
58
+
59
+ function jQueryBridget( namespace, PluginClass, $ ) {
60
+ $ = $ || jQuery || window.jQuery;
61
+ if ( !$ ) {
62
+ return;
63
+ }
64
+
65
+ // add option method -> $().plugin('option', {...})
66
+ if ( !PluginClass.prototype.option ) {
67
+ // option setter
68
+ PluginClass.prototype.option = function( opts ) {
69
+ // bail out if not an object
70
+ if ( !$.isPlainObject( opts ) ){
71
+ return;
72
+ }
73
+ this.options = $.extend( true, this.options, opts );
74
+ };
75
+ }
76
+
77
+ // make jQuery plugin
78
+ $.fn[ namespace ] = function( arg0 /*, arg1 */ ) {
79
+ if ( typeof arg0 == 'string' ) {
80
+ // method call $().plugin( 'methodName', { options } )
81
+ // shift arguments by 1
82
+ var args = arraySlice.call( arguments, 1 );
83
+ return methodCall( this, arg0, args );
84
+ }
85
+ // just $().plugin({ options })
86
+ plainCall( this, arg0 );
87
+ return this;
88
+ };
89
+
90
+ // $().plugin('methodName')
91
+ function methodCall( $elems, methodName, args ) {
92
+ var returnValue;
93
+ var pluginMethodStr = '$().' + namespace + '("' + methodName + '")';
94
+
95
+ $elems.each( function( i, elem ) {
96
+ // get instance
97
+ var instance = $.data( elem, namespace );
98
+ if ( !instance ) {
99
+ logError( namespace + ' not initialized. Cannot call methods, i.e. ' +
100
+ pluginMethodStr );
101
+ return;
102
+ }
103
+
104
+ var method = instance[ methodName ];
105
+ if ( !method || methodName.charAt(0) == '_' ) {
106
+ logError( pluginMethodStr + ' is not a valid method' );
107
+ return;
108
+ }
109
+
110
+ // apply method, get return value
111
+ var value = method.apply( instance, args );
112
+ // set return value if value is returned, use only first value
113
+ returnValue = returnValue === undefined ? value : returnValue;
114
+ });
115
+
116
+ return returnValue !== undefined ? returnValue : $elems;
117
+ }
118
+
119
+ function plainCall( $elems, options ) {
120
+ $elems.each( function( i, elem ) {
121
+ var instance = $.data( elem, namespace );
122
+ if ( instance ) {
123
+ // set options & init
124
+ instance.option( options );
125
+ instance._init();
126
+ } else {
127
+ // initialize new instance
128
+ instance = new PluginClass( elem, options );
129
+ $.data( elem, namespace, instance );
130
+ }
131
+ });
132
+ }
133
+
134
+ updateJQuery( $ );
135
+
136
+ }
137
+
138
+ // ----- updateJQuery ----- //
139
+
140
+ // set $.bridget for v1 backwards compatibility
141
+ function updateJQuery( $ ) {
142
+ if ( !$ || ( $ && $.bridget ) ) {
143
+ return;
144
+ }
145
+ $.bridget = jQueryBridget;
146
+ }
147
+
148
+ updateJQuery( jQuery || window.jQuery );
149
+
150
+ // ----- ----- //
151
+
152
+ return jQueryBridget;
153
+
154
+ }));
155
+
156
+ /**
157
+ * EvEmitter v1.1.0
158
+ * Lil' event emitter
159
+ * MIT License
160
+ */
161
+
162
+ /* jshint unused: true, undef: true, strict: true */
163
+
164
+ ( function( global, factory ) {
165
+ // universal module definition
166
+ /* jshint strict: false */ /* globals define, module, window */
167
+ if ( typeof define == 'function' && define.amd ) {
168
+ // AMD - RequireJS
169
+ define( 'ev-emitter/ev-emitter',factory );
170
+ } else if ( typeof module == 'object' && module.exports ) {
171
+ // CommonJS - Browserify, Webpack
172
+ module.exports = factory();
173
+ } else {
174
+ // Browser globals
175
+ global.EvEmitter = factory();
176
+ }
177
+
178
+ }( typeof window != 'undefined' ? window : this, function() {
179
+
180
+
181
+
182
+ function EvEmitter() {}
183
+
184
+ var proto = EvEmitter.prototype;
185
+
186
+ proto.on = function( eventName, listener ) {
187
+ if ( !eventName || !listener ) {
188
+ return;
189
+ }
190
+ // set events hash
191
+ var events = this._events = this._events || {};
192
+ // set listeners array
193
+ var listeners = events[ eventName ] = events[ eventName ] || [];
194
+ // only add once
195
+ if ( listeners.indexOf( listener ) == -1 ) {
196
+ listeners.push( listener );
197
+ }
198
+
199
+ return this;
200
+ };
201
+
202
+ proto.once = function( eventName, listener ) {
203
+ if ( !eventName || !listener ) {
204
+ return;
205
+ }
206
+ // add event
207
+ this.on( eventName, listener );
208
+ // set once flag
209
+ // set onceEvents hash
210
+ var onceEvents = this._onceEvents = this._onceEvents || {};
211
+ // set onceListeners object
212
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
213
+ // set flag
214
+ onceListeners[ listener ] = true;
215
+
216
+ return this;
217
+ };
218
+
219
+ proto.off = function( eventName, listener ) {
220
+ var listeners = this._events && this._events[ eventName ];
221
+ if ( !listeners || !listeners.length ) {
222
+ return;
223
+ }
224
+ var index = listeners.indexOf( listener );
225
+ if ( index != -1 ) {
226
+ listeners.splice( index, 1 );
227
+ }
228
+
229
+ return this;
230
+ };
231
+
232
+ proto.emitEvent = function( eventName, args ) {
233
+ var listeners = this._events && this._events[ eventName ];
234
+ if ( !listeners || !listeners.length ) {
235
+ return;
236
+ }
237
+ // copy over to avoid interference if .off() in listener
238
+ listeners = listeners.slice(0);
239
+ args = args || [];
240
+ // once stuff
241
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
242
+
243
+ for ( var i=0; i < listeners.length; i++ ) {
244
+ var listener = listeners[i]
245
+ var isOnce = onceListeners && onceListeners[ listener ];
246
+ if ( isOnce ) {
247
+ // remove listener
248
+ // remove before trigger to prevent recursion
249
+ this.off( eventName, listener );
250
+ // unset once flag
251
+ delete onceListeners[ listener ];
252
+ }
253
+ // trigger listener
254
+ listener.apply( this, args );
255
+ }
256
+
257
+ return this;
258
+ };
259
+
260
+ proto.allOff = function() {
261
+ delete this._events;
262
+ delete this._onceEvents;
263
+ };
264
+
265
+ return EvEmitter;
266
+
267
+ }));
268
+
269
+ /**
270
+ * matchesSelector v2.0.2
271
+ * matchesSelector( element, '.selector' )
272
+ * MIT license
273
+ */
274
+
275
+ /*jshint browser: true, strict: true, undef: true, unused: true */
276
+
277
+ ( function( window, factory ) {
278
+ /*global define: false, module: false */
279
+ 'use strict';
280
+ // universal module definition
281
+ if ( typeof define == 'function' && define.amd ) {
282
+ // AMD
283
+ define( 'desandro-matches-selector/matches-selector',factory );
284
+ } else if ( typeof module == 'object' && module.exports ) {
285
+ // CommonJS
286
+ module.exports = factory();
287
+ } else {
288
+ // browser global
289
+ window.matchesSelector = factory();
290
+ }
291
+
292
+ }( window, function factory() {
293
+ 'use strict';
294
+
295
+ var matchesMethod = ( function() {
296
+ var ElemProto = window.Element.prototype;
297
+ // check for the standard method name first
298
+ if ( ElemProto.matches ) {
299
+ return 'matches';
300
+ }
301
+ // check un-prefixed
302
+ if ( ElemProto.matchesSelector ) {
303
+ return 'matchesSelector';
304
+ }
305
+ // check vendor prefixes
306
+ var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
307
+
308
+ for ( var i=0; i < prefixes.length; i++ ) {
309
+ var prefix = prefixes[i];
310
+ var method = prefix + 'MatchesSelector';
311
+ if ( ElemProto[ method ] ) {
312
+ return method;
313
+ }
314
+ }
315
+ })();
316
+
317
+ return function matchesSelector( elem, selector ) {
318
+ return elem[ matchesMethod ]( selector );
319
+ };
320
+
321
+ }));
322
+
323
+ /**
324
+ * Fizzy UI utils v2.0.7
325
+ * MIT license
326
+ */
327
+
328
+ /*jshint browser: true, undef: true, unused: true, strict: true */
329
+
330
+ ( function( window, factory ) {
331
+ // universal module definition
332
+ /*jshint strict: false */ /*globals define, module, require */
333
+
334
+ if ( typeof define == 'function' && define.amd ) {
335
+ // AMD
336
+ define( 'fizzy-ui-utils/utils',[
337
+ 'desandro-matches-selector/matches-selector'
338
+ ], function( matchesSelector ) {
339
+ return factory( window, matchesSelector );
340
+ });
341
+ } else if ( typeof module == 'object' && module.exports ) {
342
+ // CommonJS
343
+ module.exports = factory(
344
+ window,
345
+ require('desandro-matches-selector')
346
+ );
347
+ } else {
348
+ // browser global
349
+ window.fizzyUIUtils = factory(
350
+ window,
351
+ window.matchesSelector
352
+ );
353
+ }
354
+
355
+ }( window, function factory( window, matchesSelector ) {
356
+
357
+
358
+
359
+ var utils = {};
360
+
361
+ // ----- extend ----- //
362
+
363
+ // extends objects
364
+ utils.extend = function( a, b ) {
365
+ for ( var prop in b ) {
366
+ a[ prop ] = b[ prop ];
367
+ }
368
+ return a;
369
+ };
370
+
371
+ // ----- modulo ----- //
372
+
373
+ utils.modulo = function( num, div ) {
374
+ return ( ( num % div ) + div ) % div;
375
+ };
376
+
377
+ // ----- makeArray ----- //
378
+
379
+ var arraySlice = Array.prototype.slice;
380
+
381
+ // turn element or nodeList into an array
382
+ utils.makeArray = function( obj ) {
383
+ if ( Array.isArray( obj ) ) {
384
+ // use object if already an array
385
+ return obj;
386
+ }
387
+ // return empty array if undefined or null. #6
388
+ if ( obj === null || obj === undefined ) {
389
+ return [];
390
+ }
391
+
392
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
393
+ if ( isArrayLike ) {
394
+ // convert nodeList to array
395
+ return arraySlice.call( obj );
396
+ }
397
+
398
+ // array of single index
399
+ return [ obj ];
400
+ };
401
+
402
+ // ----- removeFrom ----- //
403
+
404
+ utils.removeFrom = function( ary, obj ) {
405
+ var index = ary.indexOf( obj );
406
+ if ( index != -1 ) {
407
+ ary.splice( index, 1 );
408
+ }
409
+ };
410
+
411
+ // ----- getParent ----- //
412
+
413
+ utils.getParent = function( elem, selector ) {
414
+ while ( elem.parentNode && elem != document.body ) {
415
+ elem = elem.parentNode;
416
+ if ( matchesSelector( elem, selector ) ) {
417
+ return elem;
418
+ }
419
+ }
420
+ };
421
+
422
+ // ----- getQueryElement ----- //
423
+
424
+ // use element as selector string
425
+ utils.getQueryElement = function( elem ) {
426
+ if ( typeof elem == 'string' ) {
427
+ return document.querySelector( elem );
428
+ }
429
+ return elem;
430
+ };
431
+
432
+ // ----- handleEvent ----- //
433
+
434
+ // enable .ontype to trigger from .addEventListener( elem, 'type' )
435
+ utils.handleEvent = function( event ) {
436
+ var method = 'on' + event.type;
437
+ if ( this[ method ] ) {
438
+ this[ method ]( event );
439
+ }
440
+ };
441
+
442
+ // ----- filterFindElements ----- //
443
+
444
+ utils.filterFindElements = function( elems, selector ) {
445
+ // make array of elems
446
+ elems = utils.makeArray( elems );
447
+ var ffElems = [];
448
+
449
+ elems.forEach( function( elem ) {
450
+ // check that elem is an actual element
451
+ if ( !( elem instanceof HTMLElement ) ) {
452
+ return;
453
+ }
454
+ // add elem if no selector
455
+ if ( !selector ) {
456
+ ffElems.push( elem );
457
+ return;
458
+ }
459
+ // filter & find items if we have a selector
460
+ // filter
461
+ if ( matchesSelector( elem, selector ) ) {
462
+ ffElems.push( elem );
463
+ }
464
+ // find children
465
+ var childElems = elem.querySelectorAll( selector );
466
+ // concat childElems to filterFound array
467
+ for ( var i=0; i < childElems.length; i++ ) {
468
+ ffElems.push( childElems[i] );
469
+ }
470
+ });
471
+
472
+ return ffElems;
473
+ };
474
+
475
+ // ----- debounceMethod ----- //
476
+
477
+ utils.debounceMethod = function( _class, methodName, threshold ) {
478
+ threshold = threshold || 100;
479
+ // original method
480
+ var method = _class.prototype[ methodName ];
481
+ var timeoutName = methodName + 'Timeout';
482
+
483
+ _class.prototype[ methodName ] = function() {
484
+ var timeout = this[ timeoutName ];
485
+ clearTimeout( timeout );
486
+
487
+ var args = arguments;
488
+ var _this = this;
489
+ this[ timeoutName ] = setTimeout( function() {
490
+ method.apply( _this, args );
491
+ delete _this[ timeoutName ];
492
+ }, threshold );
493
+ };
494
+ };
495
+
496
+ // ----- docReady ----- //
497
+
498
+ utils.docReady = function( callback ) {
499
+ var readyState = document.readyState;
500
+ if ( readyState == 'complete' || readyState == 'interactive' ) {
501
+ // do async to allow for other scripts to run. metafizzy/flickity#441
502
+ setTimeout( callback );
503
+ } else {
504
+ document.addEventListener( 'DOMContentLoaded', callback );
505
+ }
506
+ };
507
+
508
+ // ----- htmlInit ----- //
509
+
510
+ // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
511
+ utils.toDashed = function( str ) {
512
+ return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
513
+ return $1 + '-' + $2;
514
+ }).toLowerCase();
515
+ };
516
+
517
+ var console = window.console;
518
+ /**
519
+ * allow user to initialize classes via [data-namespace] or .js-namespace class
520
+ * htmlInit( Widget, 'widgetName' )
521
+ * options are parsed from data-namespace-options
522
+ */
523
+ utils.htmlInit = function( WidgetClass, namespace ) {
524
+ utils.docReady( function() {
525
+ var dashedNamespace = utils.toDashed( namespace );
526
+ var dataAttr = 'data-' + dashedNamespace;
527
+ var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
528
+ var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
529
+ var elems = utils.makeArray( dataAttrElems )
530
+ .concat( utils.makeArray( jsDashElems ) );
531
+ var dataOptionsAttr = dataAttr + '-options';
532
+ var jQuery = window.jQuery;
533
+
534
+ elems.forEach( function( elem ) {
535
+ var attr = elem.getAttribute( dataAttr ) ||
536
+ elem.getAttribute( dataOptionsAttr );
537
+ var options;
538
+ try {
539
+ options = attr && JSON.parse( attr );
540
+ } catch ( error ) {
541
+ // log error, do not initialize
542
+ if ( console ) {
543
+ console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
544
+ ': ' + error );
545
+ }
546
+ return;
547
+ }
548
+ // initialize
549
+ var instance = new WidgetClass( elem, options );
550
+ // make available via $().data('namespace')
551
+ if ( jQuery ) {
552
+ jQuery.data( elem, namespace, instance );
553
+ }
554
+ });
555
+
556
+ });
557
+ };
558
+
559
+ // ----- ----- //
560
+
561
+ return utils;
562
+
563
+ }));
564
+
565
+ // core
566
+ ( function( window, factory ) {
567
+ // universal module definition
568
+ /* globals define, module, require */
569
+ if ( typeof define == 'function' && define.amd ) {
570
+ // AMD
571
+ define( 'infinite-scroll/js/core',[
572
+ 'ev-emitter/ev-emitter',
573
+ 'fizzy-ui-utils/utils',
574
+ ], function( EvEmitter, utils) {
575
+ return factory( window, EvEmitter, utils );
576
+ });
577
+ } else if ( typeof module == 'object' && module.exports ) {
578
+ // CommonJS
579
+ module.exports = factory(
580
+ window,
581
+ require('ev-emitter'),
582
+ require('fizzy-ui-utils')
583
+ );
584
+ } else {
585
+ // browser global
586
+ window.InfiniteScroll = factory(
587
+ window,
588
+ window.EvEmitter,
589
+ window.fizzyUIUtils
590
+ );
591
+ }
592
+
593
+ }( window, function factory( window, EvEmitter, utils ) {
594
+
595
+ var jQuery = window.jQuery;
596
+ // internal store of all InfiniteScroll intances
597
+ var instances = {};
598
+
599
+ function InfiniteScroll( element, options ) {
600
+ var queryElem = utils.getQueryElement( element );
601
+
602
+ if ( !queryElem ) {
603
+ console.error( 'Bad element for InfiniteScroll: ' + ( queryElem || element ) );
604
+ return;
605
+ }
606
+ element = queryElem;
607
+ // do not initialize twice on same element
608
+ if ( element.infiniteScrollGUID ) {
609
+ var instance = instances[ element.infiniteScrollGUID ];
610
+ instance.option( options );
611
+ return instance;
612
+ }
613
+
614
+ this.element = element;
615
+ // options
616
+ this.options = utils.extend( {}, InfiniteScroll.defaults );
617
+ this.option( options );
618
+ // add jQuery
619
+ if ( jQuery ) {
620
+ this.$element = jQuery( this.element );
621
+ }
622
+
623
+ this.create();
624
+ }
625
+
626
+ // defaults
627
+ InfiniteScroll.defaults = {
628
+ // path: null,
629
+ // hideNav: null,
630
+ // debug: false,
631
+ };
632
+
633
+ // create & destroy methods
634
+ InfiniteScroll.create = {};
635
+ InfiniteScroll.destroy = {};
636
+
637
+ var proto = InfiniteScroll.prototype;
638
+ // inherit EvEmitter
639
+ utils.extend( proto, EvEmitter.prototype );
640
+
641
+ // -------------------------- -------------------------- //
642
+
643
+ // globally unique identifiers
644
+ var GUID = 0;
645
+
646
+ proto.create = function() {
647
+ // create core
648
+ // add id for InfiniteScroll.data
649
+ var id = this.guid = ++GUID;
650
+ this.element.infiniteScrollGUID = id; // expando
651
+ instances[ id ] = this; // associate via id
652
+ // properties
653
+ this.pageIndex = 1; // default to first page
654
+ this.loadCount = 0;
655
+ this.updateGetPath();
656
+ // bail if getPath not set, or returns falsey #776
657
+ var hasPath = this.getPath && this.getPath();
658
+ if ( !hasPath ) {
659
+ console.error('Disabling InfiniteScroll');
660
+ return;
661
+ }
662
+ this.updateGetAbsolutePath();
663
+ this.log( 'initialized', [ this.element.className ] );
664
+ this.callOnInit();
665
+ // create features
666
+ for ( var method in InfiniteScroll.create ) {
667
+ InfiniteScroll.create[ method ].call( this );
668
+ }
669
+ };
670
+
671
+ proto.option = function( opts ) {
672
+ utils.extend( this.options, opts );
673
+ };
674
+
675
+ // call onInit option, used for binding events on init
676
+ proto.callOnInit = function() {
677
+ var onInit = this.options.onInit;
678
+ if ( onInit ) {
679
+ onInit.call( this, this );
680
+ }
681
+ };
682
+
683
+ // ----- events ----- //
684
+
685
+ proto.dispatchEvent = function( type, event, args ) {
686
+ this.log( type, args );
687
+ var emitArgs = event ? [ event ].concat( args ) : args;
688
+ this.emitEvent( type, emitArgs );
689
+ // trigger jQuery event
690
+ if ( !jQuery || !this.$element ) {
691
+ return;
692
+ }
693
+ // namespace jQuery event
694
+ type += '.infiniteScroll';
695
+ var $event = type;
696
+ if ( event ) {
697
+ // create jQuery event
698
+ var jQEvent = jQuery.Event( event );
699
+ jQEvent.type = type;
700
+ $event = jQEvent;
701
+ }
702
+ this.$element.trigger( $event, args );
703
+ };
704
+
705
+ var loggers = {
706
+ initialized: function( className ) {
707
+ return 'on ' + className;
708
+ },
709
+ request: function( path ) {
710
+ return 'URL: ' + path;
711
+ },
712
+ load: function( response, path ) {
713
+ return ( response.title || '' ) + '. URL: ' + path;
714
+ },
715
+ error: function( error, path ) {
716
+ return error + '. URL: ' + path;
717
+ },
718
+ append: function( response, path, items ) {
719
+ return items.length + ' items. URL: ' + path;
720
+ },
721
+ last: function( response, path ) {
722
+ return 'URL: ' + path;
723
+ },
724
+ history: function( title, path ) {
725
+ return 'URL: ' + path;
726
+ },
727
+ pageIndex: function( index, origin ) {
728
+ return 'current page determined to be: ' + index + ' from ' + origin;
729
+ },
730
+ };
731
+
732
+ // log events
733
+ proto.log = function( type, args ) {
734
+ if ( !this.options.debug ) {
735
+ return;
736
+ }
737
+ var message = '[InfiniteScroll] ' + type;
738
+ var logger = loggers[ type ];
739
+ if ( logger ) {
740
+ message += '. ' + logger.apply( this, args );
741
+ }
742
+ console.log( message );
743
+ };
744
+
745
+ // -------------------------- methods used amoung features -------------------------- //
746
+
747
+ proto.updateMeasurements = function() {
748
+ this.windowHeight = window.innerHeight;
749
+ var rect = this.element.getBoundingClientRect();
750
+ this.top = rect.top + window.pageYOffset;
751
+ };
752
+
753
+ proto.updateScroller = function() {
754
+ var elementScroll = this.options.elementScroll;
755
+ if ( !elementScroll ) {
756
+ // default, use window
757
+ this.scroller = window;
758
+ return;
759
+ }
760
+ // if true, set to element, otherwise use option
761
+ this.scroller = elementScroll === true ? this.element :
762
+ utils.getQueryElement( elementScroll );
763
+ if ( !this.scroller ) {
764
+ throw 'Unable to find elementScroll: ' + elementScroll;
765
+ }
766
+ };
767
+
768
+ // -------------------------- page path -------------------------- //
769
+
770
+ proto.updateGetPath = function() {
771
+ var optPath = this.options.path;
772
+ if ( !optPath ) {
773
+ console.error( 'InfiniteScroll path option required. Set as: ' + optPath );
774
+ return;
775
+ }
776
+ // function
777
+ var type = typeof optPath;
778
+ if ( type == 'function' ) {
779
+ this.getPath = optPath;
780
+ return;
781
+ }
782
+ // template string: '/pages/{{#}}.html'
783
+ var templateMatch = type == 'string' && optPath.match('{{#}}');
784
+ if ( templateMatch ) {
785
+ this.updateGetPathTemplate( optPath );
786
+ return;
787
+ }
788
+ // selector: '.next-page-selector'
789
+ this.updateGetPathSelector( optPath );
790
+ };
791
+
792
+ proto.updateGetPathTemplate = function( optPath ) {
793
+ // set getPath with template string
794
+ this.getPath = function() {
795
+ var nextIndex = this.pageIndex + 1;
796
+ return optPath.replace( '{{#}}', nextIndex );
797
+ }.bind( this );
798
+ // get pageIndex from location
799
+ // convert path option into regex to look for pattern in location
800
+ var regexString = optPath.replace( '{{#}}', '(\\d\\d?\\d?)' );
801
+ var templateRe = new RegExp( regexString );
802
+ var match = location.href.match( templateRe );
803
+ if ( match ) {
804
+ this.pageIndex = parseInt( match[1], 10 );
805
+ this.log( 'pageIndex', [ this.pageIndex, 'template string' ] );
806
+ }
807
+ };
808
+
809
+ var pathRegexes = [
810
+ // WordPress & Tumblr - example.com/page/2
811
+ // Jekyll - example.com/page2
812
+ /^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,
813
+ // Drupal - example.com/?page=1
814
+ /^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,
815
+ // catch all, last occurence of a number
816
+ /(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/,
817
+ ];
818
+
819
+ proto.updateGetPathSelector = function( optPath ) {
820
+ // parse href of link: '.next-page-link'
821
+ var hrefElem = document.querySelector( optPath );
822
+ if ( !hrefElem ) {
823
+ console.error( 'Bad InfiniteScroll path option. Next link not found: ' +
824
+ optPath );
825
+ return;
826
+ }
827
+ var href = hrefElem.getAttribute('href');
828
+ // try matching href to pathRegexes patterns
829
+ var pathParts, regex;
830
+ for ( var i=0; href && i < pathRegexes.length; i++ ) {
831
+ regex = pathRegexes[i];
832
+ var match = href.match( regex );
833
+ if ( match ) {
834
+ pathParts = match.slice(1); // remove first part
835
+ break;
836
+ }
837
+ }
838
+ if ( !pathParts ) {
839
+ console.error( 'InfiniteScroll unable to parse next link href: ' + href );
840
+ return;
841
+ }
842
+ this.isPathSelector = true; // flag for checkLastPage()
843
+ this.getPath = function() {
844
+ var nextIndex = this.pageIndex + 1;
845
+ return pathParts[0] + nextIndex + pathParts[2];
846
+ }.bind( this );
847
+ // get pageIndex from href
848
+ this.pageIndex = parseInt( pathParts[1], 10 ) - 1;
849
+ this.log( 'pageIndex', [ this.pageIndex, 'next link' ] );
850
+ };
851
+
852
+ proto.updateGetAbsolutePath = function() {
853
+ var path = this.getPath();
854
+ // path doesn't start with http or /
855
+ var isAbsolute = path.match( /^http/ ) || path.match( /^\// );
856
+ if ( isAbsolute ) {
857
+ this.getAbsolutePath = this.getPath;
858
+ return;
859
+ }
860
+
861
+ var pathname = location.pathname;
862
+ // /foo/bar/index.html => /foo/bar
863
+ var directory = pathname.substring( 0, pathname.lastIndexOf('/') );
864
+
865
+ this.getAbsolutePath = function() {
866
+ return directory + '/' + this.getPath();
867
+ };
868
+ };
869
+
870
+ // -------------------------- nav -------------------------- //
871
+
872
+ // hide navigation
873
+ InfiniteScroll.create.hideNav = function() {
874
+ var nav = utils.getQueryElement( this.options.hideNav );
875
+ if ( !nav ) {
876
+ return;
877
+ }
878
+ nav.style.display = 'none';
879
+ this.nav = nav;
880
+ };
881
+
882
+ InfiniteScroll.destroy.hideNav = function() {
883
+ if ( this.nav ) {
884
+ this.nav.style.display = '';
885
+ }
886
+ };
887
+
888
+ // -------------------------- destroy -------------------------- //
889
+
890
+ proto.destroy = function() {
891
+ this.allOff(); // remove all event listeners
892
+ // call destroy methods
893
+ for ( var method in InfiniteScroll.destroy ) {
894
+ InfiniteScroll.destroy[ method ].call( this );
895
+ }
896
+
897
+ delete this.element.infiniteScrollGUID;
898
+ delete instances[ this.guid ];
899
+ };
900
+
901
+ // -------------------------- utilities -------------------------- //
902
+
903
+ // https://remysharp.com/2010/07/21/throttling-function-calls
904
+ InfiniteScroll.throttle = function( fn, threshold ) {
905
+ threshold = threshold || 200;
906
+ var last, timeout;
907
+
908
+ return function() {
909
+ var now = +new Date();
910
+ var args = arguments;
911
+ var trigger = function() {
912
+ last = now;
913
+ fn.apply( this, args );
914
+ }.bind( this );
915
+ if ( last && now < last + threshold ) {
916
+ // hold on to it
917
+ clearTimeout( timeout );
918
+ timeout = setTimeout( trigger, threshold );
919
+ } else {
920
+ trigger();
921
+ }
922
+ };
923
+ };
924
+
925
+ InfiniteScroll.data = function( elem ) {
926
+ elem = utils.getQueryElement( elem );
927
+ var id = elem && elem.infiniteScrollGUID;
928
+ return id && instances[ id ];
929
+ };
930
+
931
+ // set internal jQuery, for Webpack + jQuery v3
932
+ InfiniteScroll.setJQuery = function( $ ) {
933
+ jQuery = $;
934
+ };
935
+
936
+ // -------------------------- setup -------------------------- //
937
+
938
+ utils.htmlInit( InfiniteScroll, 'infinite-scroll' );
939
+
940
+ if ( jQuery && jQuery.bridget ) {
941
+ jQuery.bridget( 'infiniteScroll', InfiniteScroll );
942
+ }
943
+
944
+ // -------------------------- -------------------------- //
945
+
946
+ return InfiniteScroll;
947
+
948
+ }));
949
+
950
+ // page-load
951
+ ( function( window, factory ) {
952
+ // universal module definition
953
+ /* globals define, module, require */
954
+ if ( typeof define == 'function' && define.amd ) {
955
+ // AMD
956
+ define( 'infinite-scroll/js/page-load',[
957
+ './core',
958
+ ], function( InfiniteScroll ) {
959
+ return factory( window, InfiniteScroll );
960
+ });
961
+ } else if ( typeof module == 'object' && module.exports ) {
962
+ // CommonJS
963
+ module.exports = factory(
964
+ window,
965
+ require('./core')
966
+ );
967
+ } else {
968
+ // browser global
969
+ factory(
970
+ window,
971
+ window.InfiniteScroll
972
+ );
973
+ }
974
+
975
+ }( window, function factory( window, InfiniteScroll ) {
976
+
977
+ var proto = InfiniteScroll.prototype;
978
+
979
+ // InfiniteScroll.defaults.append = false;
980
+ InfiniteScroll.defaults.loadOnScroll = true;
981
+ InfiniteScroll.defaults.checkLastPage = true;
982
+ InfiniteScroll.defaults.responseType = 'document';
983
+ // InfiniteScroll.defaults.prefill = false;
984
+ // InfiniteScroll.defaults.outlayer = null;
985
+
986
+ InfiniteScroll.create.pageLoad = function() {
987
+ this.canLoad = true;
988
+ this.on( 'scrollThreshold', this.onScrollThresholdLoad );
989
+ this.on( 'load', this.checkLastPage );
990
+ if ( this.options.outlayer ) {
991
+ this.on( 'append', this.onAppendOutlayer );
992
+ }
993
+ };
994
+
995
+ proto.onScrollThresholdLoad = function() {
996
+ if ( this.options.loadOnScroll ) {
997
+ this.loadNextPage();
998
+ }
999
+ };
1000
+
1001
+ proto.loadNextPage = function() {
1002
+ if ( this.isLoading || !this.canLoad ) {
1003
+ return;
1004
+ }
1005
+
1006
+ var path = this.getAbsolutePath();
1007
+ this.isLoading = true;
1008
+
1009
+ var onLoad = function( response ) {
1010
+ this.onPageLoad( response, path );
1011
+ }.bind( this );
1012
+
1013
+ var onError = function( error ) {
1014
+ this.onPageError( error, path );
1015
+ }.bind( this );
1016
+
1017
+ request( path, this.options.responseType, onLoad, onError );
1018
+ this.dispatchEvent( 'request', null, [ path ] );
1019
+ };
1020
+
1021
+ proto.onPageLoad = function( response, path ) {
1022
+ // done loading if not appending
1023
+ if ( !this.options.append ) {
1024
+ this.isLoading = false;
1025
+ }
1026
+ this.pageIndex++;
1027
+ this.loadCount++;
1028
+ this.dispatchEvent( 'load', null, [ response, path ] );
1029
+ this.appendNextPage( response, path );
1030
+ return response;
1031
+ };
1032
+
1033
+ proto.appendNextPage = function( response, path ) {
1034
+ var optAppend = this.options.append;
1035
+ // do not append json
1036
+ var isDocument = this.options.responseType == 'document';
1037
+ if ( !isDocument || !optAppend ) {
1038
+ return;
1039
+ }
1040
+
1041
+ var items = response.querySelectorAll( optAppend );
1042
+ var fragment = getItemsFragment( items );
1043
+ var appendReady = function () {
1044
+ this.appendItems( items, fragment );
1045
+ this.isLoading = false;
1046
+ this.dispatchEvent( 'append', null, [ response, path, items ] );
1047
+ }.bind( this );
1048
+
1049
+ // TODO add hook for option to trigger appendReady
1050
+ if ( this.options.outlayer ) {
1051
+ this.appendOutlayerItems( fragment, appendReady );
1052
+ } else {
1053
+ appendReady();
1054
+ }
1055
+ };
1056
+
1057
+ proto.appendItems = function( items, fragment ) {
1058
+ if ( !items || !items.length ) {
1059
+ return;
1060
+ }
1061
+ // get fragment if not provided
1062
+ fragment = fragment || getItemsFragment( items );
1063
+ refreshScripts( fragment );
1064
+ this.element.appendChild( fragment );
1065
+ };
1066
+
1067
+ function getItemsFragment( items ) {
1068
+ // add items to fragment
1069
+ var fragment = document.createDocumentFragment();
1070
+ for ( var i=0; items && i < items.length; i++ ) {
1071
+ fragment.appendChild( items[i] );
1072
+ }
1073
+ return fragment;
1074
+ }
1075
+
1076
+ // replace <script>s with copies so they load
1077
+ // <script>s added by InfiniteScroll will not load
1078
+ // similar to https://stackoverflow.com/questions/610995
1079
+ function refreshScripts( fragment ) {
1080
+ var scripts = fragment.querySelectorAll('script');
1081
+ for ( var i=0; i < scripts.length; i++ ) {
1082
+ var script = scripts[i];
1083
+ var freshScript = document.createElement('script');
1084
+ copyAttributes( script, freshScript );
1085
+ // copy inner script code. #718, #782
1086
+ freshScript.innerHTML = script.innerHTML;
1087
+ script.parentNode.replaceChild( freshScript, script );
1088
+ }
1089
+ }
1090
+
1091
+ function copyAttributes( fromNode, toNode ) {
1092
+ var attrs = fromNode.attributes;
1093
+ for ( var i=0; i < attrs.length; i++ ) {
1094
+ var attr = attrs[i];
1095
+ toNode.setAttribute( attr.name, attr.value );
1096
+ }
1097
+ }
1098
+
1099
+ // ----- outlayer ----- //
1100
+
1101
+ proto.appendOutlayerItems = function( fragment, appendReady ) {
1102
+ var imagesLoaded = InfiniteScroll.imagesLoaded || window.imagesLoaded;
1103
+ if ( !imagesLoaded ) {
1104
+ console.error('[InfiniteScroll] imagesLoaded required for outlayer option');
1105
+ this.isLoading = false;
1106
+ return;
1107
+ }
1108
+ // append once images loaded
1109
+ imagesLoaded( fragment, appendReady );
1110
+ };
1111
+
1112
+ proto.onAppendOutlayer = function( response, path, items ) {
1113
+ this.options.outlayer.appended( items );
1114
+ };
1115
+
1116
+ // ----- checkLastPage ----- //
1117
+
1118
+ // check response for next element
1119
+ proto.checkLastPage = function( response, path ) {
1120
+ var checkLastPage = this.options.checkLastPage;
1121
+ if ( !checkLastPage ) {
1122
+ return;
1123
+ }
1124
+
1125
+ var pathOpt = this.options.path;
1126
+ // if path is function, check if next path is truthy
1127
+ if ( typeof pathOpt == 'function' ) {
1128
+ var nextPath = this.getPath();
1129
+ if ( !nextPath ) {
1130
+ this.lastPageReached( response, path );
1131
+ return;
1132
+ }
1133
+ }
1134
+ // get selector from checkLastPage or path option
1135
+ var selector;
1136
+ if ( typeof checkLastPage == 'string' ) {
1137
+ selector = checkLastPage;
1138
+ } else if ( this.isPathSelector ) {
1139
+ // path option is selector string
1140
+ selector = pathOpt;
1141
+ }
1142
+ // check last page for selector
1143
+ // bail if no selector or not document response
1144
+ if ( !selector || !response.querySelector ) {
1145
+ return;
1146
+ }
1147
+ // check if response has selector
1148
+ var nextElem = response.querySelector( selector );
1149
+ if ( !nextElem ) {
1150
+ this.lastPageReached( response, path );
1151
+ }
1152
+ };
1153
+
1154
+ proto.lastPageReached = function( response, path ) {
1155
+ this.canLoad = false;
1156
+ this.dispatchEvent( 'last', null, [ response, path ] );
1157
+ };
1158
+
1159
+ // ----- error ----- //
1160
+
1161
+ proto.onPageError = function( error, path ) {
1162
+ this.isLoading = false;
1163
+ this.canLoad = false;
1164
+ this.dispatchEvent( 'error', null, [ error, path ] );
1165
+ return error;
1166
+ };
1167
+
1168
+ // -------------------------- prefill -------------------------- //
1169
+
1170
+ InfiniteScroll.create.prefill = function() {
1171
+ if ( !this.options.prefill ) {
1172
+ return;
1173
+ }
1174
+ var append = this.options.append;
1175
+ if ( !append ) {
1176
+ console.error( 'append option required for prefill. Set as :' + append );
1177
+ return;
1178
+ }
1179
+ this.updateMeasurements();
1180
+ this.updateScroller();
1181
+ this.isPrefilling = true;
1182
+ this.on( 'append', this.prefill );
1183
+ this.once( 'error', this.stopPrefill );
1184
+ this.once( 'last', this.stopPrefill );
1185
+ this.prefill();
1186
+ };
1187
+
1188
+ proto.prefill = function() {
1189
+ var distance = this.getPrefillDistance();
1190
+ this.isPrefilling = distance >= 0;
1191
+ if ( this.isPrefilling ) {
1192
+ this.log('prefill');
1193
+ this.loadNextPage();
1194
+ } else {
1195
+ this.stopPrefill();
1196
+ }
1197
+ };
1198
+
1199
+ proto.getPrefillDistance = function() {
1200
+ // element scroll
1201
+ if ( this.options.elementScroll ) {
1202
+ return this.scroller.clientHeight - this.scroller.scrollHeight;
1203
+ }
1204
+ // window
1205
+ return this.windowHeight - this.element.clientHeight;
1206
+ };
1207
+
1208
+ proto.stopPrefill = function() {
1209
+ this.log('stopPrefill');
1210
+ this.off( 'append', this.prefill );
1211
+ };
1212
+
1213
+ // -------------------------- request -------------------------- //
1214
+
1215
+ function request( url, responseType, onLoad, onError ) {
1216
+ var req = new XMLHttpRequest();
1217
+ req.open( 'GET', url, true );
1218
+ // set responseType document to return DOM
1219
+ req.responseType = responseType || '';
1220
+
1221
+ // set X-Requested-With header to check that is ajax request
1222
+ req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
1223
+
1224
+ req.onload = function() {
1225
+ if ( req.status == 200 ) {
1226
+ onLoad( req.response );
1227
+ } else {
1228
+ // not 200 OK, error
1229
+ var error = new Error( req.statusText );
1230
+ onError( error );
1231
+ }
1232
+ };
1233
+
1234
+ // Handle network errors
1235
+ req.onerror = function() {
1236
+ var error = new Error( 'Network error requesting ' + url );
1237
+ onError( error );
1238
+ };
1239
+
1240
+ req.send();
1241
+ }
1242
+
1243
+ // -------------------------- -------------------------- //
1244
+
1245
+ return InfiniteScroll;
1246
+
1247
+ }));
1248
+
1249
+ // scroll-watch
1250
+ ( function( window, factory ) {
1251
+ // universal module definition
1252
+ /* globals define, module, require */
1253
+ if ( typeof define == 'function' && define.amd ) {
1254
+ // AMD
1255
+ define( 'infinite-scroll/js/scroll-watch',[
1256
+ './core',
1257
+ 'fizzy-ui-utils/utils',
1258
+ ], function( InfiniteScroll, utils ) {
1259
+ return factory( window, InfiniteScroll, utils );
1260
+ });
1261
+ } else if ( typeof module == 'object' && module.exports ) {
1262
+ // CommonJS
1263
+ module.exports = factory(
1264
+ window,
1265
+ require('./core'),
1266
+ require('fizzy-ui-utils')
1267
+ );
1268
+ } else {
1269
+ // browser global
1270
+ factory(
1271
+ window,
1272
+ window.InfiniteScroll,
1273
+ window.fizzyUIUtils
1274
+ );
1275
+ }
1276
+
1277
+ }( window, function factory( window, InfiniteScroll, utils ) {
1278
+
1279
+ var proto = InfiniteScroll.prototype;
1280
+
1281
+ // default options
1282
+ InfiniteScroll.defaults.scrollThreshold = 400;
1283
+ // InfiniteScroll.defaults.elementScroll = null;
1284
+
1285
+ InfiniteScroll.create.scrollWatch = function() {
1286
+ // events
1287
+ this.pageScrollHandler = this.onPageScroll.bind( this );
1288
+ this.resizeHandler = this.onResize.bind( this );
1289
+
1290
+ var scrollThreshold = this.options.scrollThreshold;
1291
+ var isEnable = scrollThreshold || scrollThreshold === 0;
1292
+ if ( isEnable ) {
1293
+ this.enableScrollWatch();
1294
+ }
1295
+ };
1296
+
1297
+ InfiniteScroll.destroy.scrollWatch = function() {
1298
+ this.disableScrollWatch();
1299
+ };
1300
+
1301
+ proto.enableScrollWatch = function() {
1302
+ if ( this.isScrollWatching ) {
1303
+ return;
1304
+ }
1305
+ this.isScrollWatching = true;
1306
+ this.updateMeasurements();
1307
+ this.updateScroller();
1308
+ // TODO disable after error?
1309
+ this.on( 'last', this.disableScrollWatch );
1310
+ this.bindScrollWatchEvents( true );
1311
+ };
1312
+
1313
+ proto.disableScrollWatch = function() {
1314
+ if ( !this.isScrollWatching ) {
1315
+ return;
1316
+ }
1317
+ this.bindScrollWatchEvents( false );
1318
+ delete this.isScrollWatching;
1319
+ };
1320
+
1321
+ proto.bindScrollWatchEvents = function( isBind ) {
1322
+ var addRemove = isBind ? 'addEventListener' : 'removeEventListener';
1323
+ this.scroller[ addRemove ]( 'scroll', this.pageScrollHandler );
1324
+ window[ addRemove ]( 'resize', this.resizeHandler );
1325
+ };
1326
+
1327
+ proto.onPageScroll = InfiniteScroll.throttle( function() {
1328
+ var distance = this.getBottomDistance();
1329
+ if ( distance <= this.options.scrollThreshold ) {
1330
+ this.dispatchEvent('scrollThreshold');
1331
+ }
1332
+ });
1333
+
1334
+ proto.getBottomDistance = function() {
1335
+ if ( this.options.elementScroll ) {
1336
+ return this.getElementBottomDistance();
1337
+ } else {
1338
+ return this.getWindowBottomDistance();
1339
+ }
1340
+ };
1341
+
1342
+ proto.getWindowBottomDistance = function() {
1343
+ var bottom = this.top + this.element.clientHeight;
1344
+ var scrollY = window.pageYOffset + this.windowHeight;
1345
+ return bottom - scrollY;
1346
+ };
1347
+
1348
+ proto.getElementBottomDistance = function() {
1349
+ var bottom = this.scroller.scrollHeight;
1350
+ var scrollY = this.scroller.scrollTop + this.scroller.clientHeight;
1351
+ return bottom - scrollY;
1352
+ };
1353
+
1354
+ proto.onResize = function() {
1355
+ this.updateMeasurements();
1356
+ };
1357
+
1358
+ utils.debounceMethod( InfiniteScroll, 'onResize', 150 );
1359
+
1360
+ // -------------------------- -------------------------- //
1361
+
1362
+ return InfiniteScroll;
1363
+
1364
+ }));
1365
+
1366
+ // history
1367
+ ( function( window, factory ) {
1368
+ // universal module definition
1369
+ /* globals define, module, require */
1370
+ if ( typeof define == 'function' && define.amd ) {
1371
+ // AMD
1372
+ define( 'infinite-scroll/js/history',[
1373
+ './core',
1374
+ 'fizzy-ui-utils/utils',
1375
+ ], function( InfiniteScroll, utils ) {
1376
+ return factory( window, InfiniteScroll, utils );
1377
+ });
1378
+ } else if ( typeof module == 'object' && module.exports ) {
1379
+ // CommonJS
1380
+ module.exports = factory(
1381
+ window,
1382
+ require('./core'),
1383
+ require('fizzy-ui-utils')
1384
+ );
1385
+ } else {
1386
+ // browser global
1387
+ factory(
1388
+ window,
1389
+ window.InfiniteScroll,
1390
+ window.fizzyUIUtils
1391
+ );
1392
+ }
1393
+
1394
+ }( window, function factory( window, InfiniteScroll, utils ) {
1395
+
1396
+ var proto = InfiniteScroll.prototype;
1397
+
1398
+ InfiniteScroll.defaults.history = 'replace';
1399
+ // InfiniteScroll.defaults.historyTitle = false;
1400
+
1401
+ var link = document.createElement('a');
1402
+
1403
+ // ----- create/destroy ----- //
1404
+
1405
+ InfiniteScroll.create.history = function() {
1406
+ if ( !this.options.history ) {
1407
+ return;
1408
+ }
1409
+ // check for same origin
1410
+ link.href = this.getAbsolutePath();
1411
+ // MS Edge does not have origin on link https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12236493/
1412
+ var linkOrigin = link.origin || link.protocol + '//' + link.host;
1413
+ var isSameOrigin = linkOrigin == location.origin;
1414
+ if ( !isSameOrigin ) {
1415
+ console.error( '[InfiniteScroll] cannot set history with different origin: ' +
1416
+ link.origin + ' on ' + location.origin +
1417
+ ' . History behavior disabled.' );
1418
+ return;
1419
+ }
1420
+
1421
+ // two ways to handle changing history
1422
+ if ( this.options.append ) {
1423
+ this.createHistoryAppend();
1424
+ } else {
1425
+ this.createHistoryPageLoad();
1426
+ }
1427
+ };
1428
+
1429
+ proto.createHistoryAppend = function() {
1430
+ this.updateMeasurements();
1431
+ this.updateScroller();
1432
+ // array of scroll positions of appended pages
1433
+ this.scrollPages = [
1434
+ {
1435
+ // first page
1436
+ top: 0,
1437
+ path: location.href,
1438
+ title: document.title,
1439
+ }
1440
+ ];
1441
+ this.scrollPageIndex = 0;
1442
+ // events
1443
+ this.scrollHistoryHandler = this.onScrollHistory.bind( this );
1444
+ this.unloadHandler = this.onUnload.bind( this );
1445
+ this.scroller.addEventListener( 'scroll', this.scrollHistoryHandler );
1446
+ this.on( 'append', this.onAppendHistory );
1447
+ this.bindHistoryAppendEvents( true );
1448
+ };
1449
+
1450
+ proto.bindHistoryAppendEvents = function( isBind ) {
1451
+ var addRemove = isBind ? 'addEventListener' : 'removeEventListener';
1452
+ this.scroller[ addRemove ]( 'scroll', this.scrollHistoryHandler );
1453
+ window[ addRemove ]( 'unload', this.unloadHandler );
1454
+ };
1455
+
1456
+ proto.createHistoryPageLoad = function() {
1457
+ this.on( 'load', this.onPageLoadHistory );
1458
+ };
1459
+
1460
+ InfiniteScroll.destroy.history =
1461
+ proto.destroyHistory = function() {
1462
+ var isHistoryAppend = this.options.history && this.options.append;
1463
+ if ( isHistoryAppend ) {
1464
+ this.bindHistoryAppendEvents( false );
1465
+ }
1466
+ };
1467
+
1468
+ // ----- append history ----- //
1469
+
1470
+ proto.onAppendHistory = function( response, path, items ) {
1471
+ // do not proceed if no items. #779
1472
+ if ( !items || !items.length ) {
1473
+ return;
1474
+ }
1475
+ var firstItem = items[0];
1476
+ var elemScrollY = this.getElementScrollY( firstItem );
1477
+ // resolve path
1478
+ link.href = path;
1479
+ // add page data to hash
1480
+ this.scrollPages.push({
1481
+ top: elemScrollY,
1482
+ path: link.href,
1483
+ title: response.title,
1484
+ });
1485
+ };
1486
+
1487
+ proto.getElementScrollY = function( elem ) {
1488
+ if ( this.options.elementScroll ) {
1489
+ return this.getElementElementScrollY( elem );
1490
+ } else {
1491
+ return this.getElementWindowScrollY( elem );
1492
+ }
1493
+ };
1494
+
1495
+ proto.getElementWindowScrollY = function( elem ) {
1496
+ var rect = elem.getBoundingClientRect();
1497
+ return rect.top + window.pageYOffset;
1498
+ };
1499
+
1500
+ // wow, stupid name
1501
+ proto.getElementElementScrollY = function( elem ) {
1502
+ return elem.offsetTop - this.top;
1503
+ };
1504
+
1505
+ proto.onScrollHistory = function() {
1506
+ // cycle through positions, find biggest without going over
1507
+ var scrollViewY = this.getScrollViewY();
1508
+ var pageIndex, page;
1509
+ for ( var i=0; i < this.scrollPages.length; i++ ) {
1510
+ var scrollPage = this.scrollPages[i];
1511
+ if ( scrollPage.top >= scrollViewY ) {
1512
+ break;
1513
+ }
1514
+ pageIndex = i;
1515
+ page = scrollPage;
1516
+ }
1517
+ // set history if changed
1518
+ if ( pageIndex != this.scrollPageIndex ) {
1519
+ this.scrollPageIndex = pageIndex;
1520
+ this.setHistory( page.title, page.path );
1521
+ }
1522
+ };
1523
+
1524
+ utils.debounceMethod( InfiniteScroll, 'onScrollHistory', 150 );
1525
+
1526
+ proto.getScrollViewY = function() {
1527
+ if ( this.options.elementScroll ) {
1528
+ return this.scroller.scrollTop + this.scroller.clientHeight/2;
1529
+ } else {
1530
+ return window.pageYOffset + this.windowHeight/2;
1531
+ }
1532
+ };
1533
+
1534
+ proto.setHistory = function( title, path ) {
1535
+ var optHistory = this.options.history;
1536
+ var historyMethod = optHistory && history[ optHistory + 'State' ];
1537
+ if ( !historyMethod ) {
1538
+ return;
1539
+ }
1540
+
1541
+ history[ optHistory + 'State' ]( null, title, path );
1542
+
1543
+ if ( this.options.historyTitle ) {
1544
+ document.title = title;
1545
+ }
1546
+
1547
+ this.dispatchEvent( 'history', null, [ title, path ] );
1548
+ };
1549
+
1550
+ // scroll to top to prevent initial scroll-reset after page refresh
1551
+ // https://stackoverflow.com/a/18633915/182183
1552
+ proto.onUnload = function() {
1553
+ var pageIndex = this.scrollPageIndex;
1554
+ if ( pageIndex === 0 ) {
1555
+ return;
1556
+ }
1557
+ // calculate where scroll position would be on refresh
1558
+ var scrollPage = this.scrollPages[ pageIndex ];
1559
+ var scrollY = window.pageYOffset - scrollPage.top + this.top;
1560
+ // disable scroll event before setting scroll #679
1561
+ this.destroyHistory();
1562
+ scrollTo( 0, scrollY );
1563
+ };
1564
+
1565
+ // ----- load history ----- //
1566
+
1567
+ // update URL
1568
+ proto.onPageLoadHistory = function( response, path ) {
1569
+ this.setHistory( response.title, path );
1570
+ };
1571
+
1572
+ // -------------------------- -------------------------- //
1573
+
1574
+ return InfiniteScroll;
1575
+
1576
+ }));
1577
+
1578
+ // button
1579
+ ( function( window, factory ) {
1580
+ // universal module definition
1581
+ /* globals define, module, require */
1582
+ if ( typeof define == 'function' && define.amd ) {
1583
+ // AMD
1584
+ define( 'infinite-scroll/js/button',[
1585
+ './core',
1586
+ 'fizzy-ui-utils/utils',
1587
+ ], function( InfiniteScroll, utils ) {
1588
+ return factory( window, InfiniteScroll, utils );
1589
+ });
1590
+ } else if ( typeof module == 'object' && module.exports ) {
1591
+ // CommonJS
1592
+ module.exports = factory(
1593
+ window,
1594
+ require('./core'),
1595
+ require('fizzy-ui-utils')
1596
+ );
1597
+ } else {
1598
+ // browser global
1599
+ factory(
1600
+ window,
1601
+ window.InfiniteScroll,
1602
+ window.fizzyUIUtils
1603
+ );
1604
+ }
1605
+
1606
+ }( window, function factory( window, InfiniteScroll, utils ) {
1607
+
1608
+ // InfiniteScroll.defaults.button = null;
1609
+
1610
+ InfiniteScroll.create.button = function() {
1611
+ var buttonElem = utils.getQueryElement( this.options.button );
1612
+ if ( buttonElem ) {
1613
+ this.button = new InfiniteScrollButton( buttonElem, this );
1614
+ return;
1615
+ }
1616
+ };
1617
+
1618
+ InfiniteScroll.destroy.button = function() {
1619
+ if ( this.button ) {
1620
+ this.button.destroy();
1621
+ }
1622
+ };
1623
+
1624
+ // -------------------------- InfiniteScrollButton -------------------------- //
1625
+
1626
+ function InfiniteScrollButton( element, infScroll ) {
1627
+ this.element = element;
1628
+ this.infScroll = infScroll;
1629
+ // events
1630
+ this.clickHandler = this.onClick.bind( this );
1631
+ this.element.addEventListener( 'click', this.clickHandler );
1632
+ infScroll.on( 'request', this.disable.bind( this ) );
1633
+ infScroll.on( 'load', this.enable.bind( this ) );
1634
+ infScroll.on( 'error', this.hide.bind( this ) );
1635
+ infScroll.on( 'last', this.hide.bind( this ) );
1636
+ }
1637
+
1638
+ InfiniteScrollButton.prototype.onClick = function( event ) {
1639
+ event.preventDefault();
1640
+ this.infScroll.loadNextPage();
1641
+ };
1642
+
1643
+ InfiniteScrollButton.prototype.enable = function() {
1644
+ this.element.removeAttribute('disabled');
1645
+ };
1646
+
1647
+ InfiniteScrollButton.prototype.disable = function() {
1648
+ this.element.disabled = 'disabled';
1649
+ };
1650
+
1651
+ InfiniteScrollButton.prototype.hide = function() {
1652
+ this.element.style.display = 'none';
1653
+ };
1654
+
1655
+ InfiniteScrollButton.prototype.destroy = function() {
1656
+ this.element.removeEventListener( 'click', this.clickHandler );
1657
+ };
1658
+
1659
+ // -------------------------- -------------------------- //
1660
+
1661
+ InfiniteScroll.Button = InfiniteScrollButton;
1662
+
1663
+ return InfiniteScroll;
1664
+
1665
+ }));
1666
+
1667
+ // status
1668
+ ( function( window, factory ) {
1669
+ // universal module definition
1670
+ /* globals define, module, require */
1671
+ if ( typeof define == 'function' && define.amd ) {
1672
+ // AMD
1673
+ define( 'infinite-scroll/js/status',[
1674
+ './core',
1675
+ 'fizzy-ui-utils/utils',
1676
+ ], function( InfiniteScroll, utils ) {
1677
+ return factory( window, InfiniteScroll, utils );
1678
+ });
1679
+ } else if ( typeof module == 'object' && module.exports ) {
1680
+ // CommonJS
1681
+ module.exports = factory(
1682
+ window,
1683
+ require('./core'),
1684
+ require('fizzy-ui-utils')
1685
+ );
1686
+ } else {
1687
+ // browser global
1688
+ factory(
1689
+ window,
1690
+ window.InfiniteScroll,
1691
+ window.fizzyUIUtils
1692
+ );
1693
+ }
1694
+
1695
+ }( window, function factory( window, InfiniteScroll, utils ) {
1696
+
1697
+ var proto = InfiniteScroll.prototype;
1698
+
1699
+ // InfiniteScroll.defaults.status = null;
1700
+
1701
+ InfiniteScroll.create.status = function() {
1702
+ var statusElem = utils.getQueryElement( this.options.status );
1703
+ if ( !statusElem ) {
1704
+ return;
1705
+ }
1706
+ // elements
1707
+ this.statusElement = statusElem;
1708
+ this.statusEventElements = {
1709
+ request: statusElem.querySelector('.infinite-scroll-request'),
1710
+ error: statusElem.querySelector('.infinite-scroll-error'),
1711
+ last: statusElem.querySelector('.infinite-scroll-last'),
1712
+ };
1713
+ // events
1714
+ this.on( 'request', this.showRequestStatus );
1715
+ this.on( 'error', this.showErrorStatus );
1716
+ this.on( 'last', this.showLastStatus );
1717
+ this.bindHideStatus('on');
1718
+ };
1719
+
1720
+ proto.bindHideStatus = function( bindMethod ) {
1721
+ var hideEvent = this.options.append ? 'append' : 'load';
1722
+ this[ bindMethod ]( hideEvent, this.hideAllStatus );
1723
+ };
1724
+
1725
+ proto.showRequestStatus = function() {
1726
+ this.showStatus('request');
1727
+ };
1728
+
1729
+ proto.showErrorStatus = function() {
1730
+ this.showStatus('error');
1731
+ };
1732
+
1733
+ proto.showLastStatus = function() {
1734
+ this.showStatus('last');
1735
+ // prevent last then append event race condition from showing last status #706
1736
+ this.bindHideStatus('off');
1737
+ };
1738
+
1739
+ proto.showStatus = function( eventName ) {
1740
+ show( this.statusElement );
1741
+ this.hideStatusEventElements();
1742
+ var eventElem = this.statusEventElements[ eventName ];
1743
+ show( eventElem );
1744
+ };
1745
+
1746
+ proto.hideAllStatus = function() {
1747
+ hide( this.statusElement );
1748
+ this.hideStatusEventElements();
1749
+ };
1750
+
1751
+ proto.hideStatusEventElements = function() {
1752
+ for ( var type in this.statusEventElements ) {
1753
+ var eventElem = this.statusEventElements[ type ];
1754
+ hide( eventElem );
1755
+ }
1756
+ };
1757
+
1758
+ // -------------------------- -------------------------- //
1759
+
1760
+ function hide( elem ) {
1761
+ setDisplay( elem, 'none' );
1762
+ }
1763
+
1764
+ function show( elem ) {
1765
+ setDisplay( elem, 'block' );
1766
+ }
1767
+
1768
+ function setDisplay( elem, value ) {
1769
+ if ( elem ) {
1770
+ elem.style.display = value;
1771
+ }
1772
+ }
1773
+
1774
+ // -------------------------- -------------------------- //
1775
+
1776
+ return InfiniteScroll;
1777
+
1778
+ }));
1779
+
1780
+ /*!
1781
+ * Infinite Scroll v3.0.4
1782
+ * Automatically add next page
1783
+ *
1784
+ * Licensed GPLv3 for open source use
1785
+ * or Infinite Scroll Commercial License for commercial use
1786
+ *
1787
+ * https://infinite-scroll.com
1788
+ * Copyright 2018 Metafizzy
1789
+ */
1790
+
1791
+ ( function( window, factory ) {
1792
+ // universal module definition
1793
+ /* globals define, module, require */
1794
+ if ( typeof define == 'function' && define.amd ) {
1795
+ // AMD
1796
+ define( [
1797
+ 'infinite-scroll/js/core',
1798
+ 'infinite-scroll/js/page-load',
1799
+ 'infinite-scroll/js/scroll-watch',
1800
+ 'infinite-scroll/js/history',
1801
+ 'infinite-scroll/js/button',
1802
+ 'infinite-scroll/js/status',
1803
+ ], factory );
1804
+ } else if ( typeof module == 'object' && module.exports ) {
1805
+ // CommonJS
1806
+ module.exports = factory(
1807
+ require('./core'),
1808
+ require('./page-load'),
1809
+ require('./scroll-watch'),
1810
+ require('./history'),
1811
+ require('./button'),
1812
+ require('./status')
1813
+ );
1814
+ }
1815
+
1816
+ })( window, function factory( InfiniteScroll ) {
1817
+ return InfiniteScroll;
1818
+ });
1819
+
1820
+ /*!
1821
+ * imagesLoaded v4.1.4
1822
+ * JavaScript is all like "You images are done yet or what?"
1823
+ * MIT License
1824
+ */
1825
+
1826
+ ( function( window, factory ) { 'use strict';
1827
+ // universal module definition
1828
+
1829
+ /*global define: false, module: false, require: false */
1830
+
1831
+ if ( typeof define == 'function' && define.amd ) {
1832
+ // AMD
1833
+ define( 'imagesloaded/imagesloaded',[
1834
+ 'ev-emitter/ev-emitter'
1835
+ ], function( EvEmitter ) {
1836
+ return factory( window, EvEmitter );
1837
+ });
1838
+ } else if ( typeof module == 'object' && module.exports ) {
1839
+ // CommonJS
1840
+ module.exports = factory(
1841
+ window,
1842
+ require('ev-emitter')
1843
+ );
1844
+ } else {
1845
+ // browser global
1846
+ window.imagesLoaded = factory(
1847
+ window,
1848
+ window.EvEmitter
1849
+ );
1850
+ }
1851
+
1852
+ })( typeof window !== 'undefined' ? window : this,
1853
+
1854
+ // -------------------------- factory -------------------------- //
1855
+
1856
+ function factory( window, EvEmitter ) {
1857
+
1858
+
1859
+
1860
+ var $ = window.jQuery;
1861
+ var console = window.console;
1862
+
1863
+ // -------------------------- helpers -------------------------- //
1864
+
1865
+ // extend objects
1866
+ function extend( a, b ) {
1867
+ for ( var prop in b ) {
1868
+ a[ prop ] = b[ prop ];
1869
+ }
1870
+ return a;
1871
+ }
1872
+
1873
+ var arraySlice = Array.prototype.slice;
1874
+
1875
+ // turn element or nodeList into an array
1876
+ function makeArray( obj ) {
1877
+ if ( Array.isArray( obj ) ) {
1878
+ // use object if already an array
1879
+ return obj;
1880
+ }
1881
+
1882
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
1883
+ if ( isArrayLike ) {
1884
+ // convert nodeList to array
1885
+ return arraySlice.call( obj );
1886
+ }
1887
+
1888
+ // array of single index
1889
+ return [ obj ];
1890
+ }
1891
+
1892
+ // -------------------------- imagesLoaded -------------------------- //
1893
+
1894
+ /**
1895
+ * @param {Array, Element, NodeList, String} elem
1896
+ * @param {Object or Function} options - if function, use as callback
1897
+ * @param {Function} onAlways - callback function
1898
+ */
1899
+ function ImagesLoaded( elem, options, onAlways ) {
1900
+ // coerce ImagesLoaded() without new, to be new ImagesLoaded()
1901
+ if ( !( this instanceof ImagesLoaded ) ) {
1902
+ return new ImagesLoaded( elem, options, onAlways );
1903
+ }
1904
+ // use elem as selector string
1905
+ var queryElem = elem;
1906
+ if ( typeof elem == 'string' ) {
1907
+ queryElem = document.querySelectorAll( elem );
1908
+ }
1909
+ // bail if bad element
1910
+ if ( !queryElem ) {
1911
+ console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) );
1912
+ return;
1913
+ }
1914
+
1915
+ this.elements = makeArray( queryElem );
1916
+ this.options = extend( {}, this.options );
1917
+ // shift arguments if no options set
1918
+ if ( typeof options == 'function' ) {
1919
+ onAlways = options;
1920
+ } else {
1921
+ extend( this.options, options );
1922
+ }
1923
+
1924
+ if ( onAlways ) {
1925
+ this.on( 'always', onAlways );
1926
+ }
1927
+
1928
+ this.getImages();
1929
+
1930
+ if ( $ ) {
1931
+ // add jQuery Deferred object
1932
+ this.jqDeferred = new $.Deferred();
1933
+ }
1934
+
1935
+ // HACK check async to allow time to bind listeners
1936
+ setTimeout( this.check.bind( this ) );
1937
+ }
1938
+
1939
+ ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
1940
+
1941
+ ImagesLoaded.prototype.options = {};
1942
+
1943
+ ImagesLoaded.prototype.getImages = function() {
1944
+ this.images = [];
1945
+
1946
+ // filter & find items if we have an item selector
1947
+ this.elements.forEach( this.addElementImages, this );
1948
+ };
1949
+
1950
+ /**
1951
+ * @param {Node} element
1952
+ */
1953
+ ImagesLoaded.prototype.addElementImages = function( elem ) {
1954
+ // filter siblings
1955
+ if ( elem.nodeName == 'IMG' ) {
1956
+ this.addImage( elem );
1957
+ }
1958
+ // get background image on element
1959
+ if ( this.options.background === true ) {
1960
+ this.addElementBackgroundImages( elem );
1961
+ }
1962
+
1963
+ // find children
1964
+ // no non-element nodes, #143
1965
+ var nodeType = elem.nodeType;
1966
+ if ( !nodeType || !elementNodeTypes[ nodeType ] ) {
1967
+ return;
1968
+ }
1969
+ var childImgs = elem.querySelectorAll('img');
1970
+ // concat childElems to filterFound array
1971
+ for ( var i=0; i < childImgs.length; i++ ) {
1972
+ var img = childImgs[i];
1973
+ this.addImage( img );
1974
+ }
1975
+
1976
+ // get child background images
1977
+ if ( typeof this.options.background == 'string' ) {
1978
+ var children = elem.querySelectorAll( this.options.background );
1979
+ for ( i=0; i < children.length; i++ ) {
1980
+ var child = children[i];
1981
+ this.addElementBackgroundImages( child );
1982
+ }
1983
+ }
1984
+ };
1985
+
1986
+ var elementNodeTypes = {
1987
+ 1: true,
1988
+ 9: true,
1989
+ 11: true
1990
+ };
1991
+
1992
+ ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
1993
+ var style = getComputedStyle( elem );
1994
+ if ( !style ) {
1995
+ // Firefox returns null if in a hidden iframe https://bugzil.la/548397
1996
+ return;
1997
+ }
1998
+ // get url inside url("...")
1999
+ var reURL = /url\((['"])?(.*?)\1\)/gi;
2000
+ var matches = reURL.exec( style.backgroundImage );
2001
+ while ( matches !== null ) {
2002
+ var url = matches && matches[2];
2003
+ if ( url ) {
2004
+ this.addBackground( url, elem );
2005
+ }
2006
+ matches = reURL.exec( style.backgroundImage );
2007
+ }
2008
+ };
2009
+
2010
+ /**
2011
+ * @param {Image} img
2012
+ */
2013
+ ImagesLoaded.prototype.addImage = function( img ) {
2014
+ var loadingImage = new LoadingImage( img );
2015
+ this.images.push( loadingImage );
2016
+ };
2017
+
2018
+ ImagesLoaded.prototype.addBackground = function( url, elem ) {
2019
+ var background = new Background( url, elem );
2020
+ this.images.push( background );
2021
+ };
2022
+
2023
+ ImagesLoaded.prototype.check = function() {
2024
+ var _this = this;
2025
+ this.progressedCount = 0;
2026
+ this.hasAnyBroken = false;
2027
+ // complete if no images
2028
+ if ( !this.images.length ) {
2029
+ this.complete();
2030
+ return;
2031
+ }
2032
+
2033
+ function onProgress( image, elem, message ) {
2034
+ // HACK - Chrome triggers event before object properties have changed. #83
2035
+ setTimeout( function() {
2036
+ _this.progress( image, elem, message );
2037
+ });
2038
+ }
2039
+
2040
+ this.images.forEach( function( loadingImage ) {
2041
+ loadingImage.once( 'progress', onProgress );
2042
+ loadingImage.check();
2043
+ });
2044
+ };
2045
+
2046
+ ImagesLoaded.prototype.progress = function( image, elem, message ) {
2047
+ this.progressedCount++;
2048
+ this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
2049
+ // progress event
2050
+ this.emitEvent( 'progress', [ this, image, elem ] );
2051
+ if ( this.jqDeferred && this.jqDeferred.notify ) {
2052
+ this.jqDeferred.notify( this, image );
2053
+ }
2054
+ // check if completed
2055
+ if ( this.progressedCount == this.images.length ) {
2056
+ this.complete();
2057
+ }
2058
+
2059
+ if ( this.options.debug && console ) {
2060
+ console.log( 'progress: ' + message, image, elem );
2061
+ }
2062
+ };
2063
+
2064
+ ImagesLoaded.prototype.complete = function() {
2065
+ var eventName = this.hasAnyBroken ? 'fail' : 'done';
2066
+ this.isComplete = true;
2067
+ this.emitEvent( eventName, [ this ] );
2068
+ this.emitEvent( 'always', [ this ] );
2069
+ if ( this.jqDeferred ) {
2070
+ var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
2071
+ this.jqDeferred[ jqMethod ]( this );
2072
+ }
2073
+ };
2074
+
2075
+ // -------------------------- -------------------------- //
2076
+
2077
+ function LoadingImage( img ) {
2078
+ this.img = img;
2079
+ }
2080
+
2081
+ LoadingImage.prototype = Object.create( EvEmitter.prototype );
2082
+
2083
+ LoadingImage.prototype.check = function() {
2084
+ // If complete is true and browser supports natural sizes,
2085
+ // try to check for image status manually.
2086
+ var isComplete = this.getIsImageComplete();
2087
+ if ( isComplete ) {
2088
+ // report based on naturalWidth
2089
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
2090
+ return;
2091
+ }
2092
+
2093
+ // If none of the checks above matched, simulate loading on detached element.
2094
+ this.proxyImage = new Image();
2095
+ this.proxyImage.addEventListener( 'load', this );
2096
+ this.proxyImage.addEventListener( 'error', this );
2097
+ // bind to image as well for Firefox. #191
2098
+ this.img.addEventListener( 'load', this );
2099
+ this.img.addEventListener( 'error', this );
2100
+ this.proxyImage.src = this.img.src;
2101
+ };
2102
+
2103
+ LoadingImage.prototype.getIsImageComplete = function() {
2104
+ // check for non-zero, non-undefined naturalWidth
2105
+ // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
2106
+ return this.img.complete && this.img.naturalWidth;
2107
+ };
2108
+
2109
+ LoadingImage.prototype.confirm = function( isLoaded, message ) {
2110
+ this.isLoaded = isLoaded;
2111
+ this.emitEvent( 'progress', [ this, this.img, message ] );
2112
+ };
2113
+
2114
+ // ----- events ----- //
2115
+
2116
+ // trigger specified handler for event type
2117
+ LoadingImage.prototype.handleEvent = function( event ) {
2118
+ var method = 'on' + event.type;
2119
+ if ( this[ method ] ) {
2120
+ this[ method ]( event );
2121
+ }
2122
+ };
2123
+
2124
+ LoadingImage.prototype.onload = function() {
2125
+ this.confirm( true, 'onload' );
2126
+ this.unbindEvents();
2127
+ };
2128
+
2129
+ LoadingImage.prototype.onerror = function() {
2130
+ this.confirm( false, 'onerror' );
2131
+ this.unbindEvents();
2132
+ };
2133
+
2134
+ LoadingImage.prototype.unbindEvents = function() {
2135
+ this.proxyImage.removeEventListener( 'load', this );
2136
+ this.proxyImage.removeEventListener( 'error', this );
2137
+ this.img.removeEventListener( 'load', this );
2138
+ this.img.removeEventListener( 'error', this );
2139
+ };
2140
+
2141
+ // -------------------------- Background -------------------------- //
2142
+
2143
+ function Background( url, element ) {
2144
+ this.url = url;
2145
+ this.element = element;
2146
+ this.img = new Image();
2147
+ }
2148
+
2149
+ // inherit LoadingImage prototype
2150
+ Background.prototype = Object.create( LoadingImage.prototype );
2151
+
2152
+ Background.prototype.check = function() {
2153
+ this.img.addEventListener( 'load', this );
2154
+ this.img.addEventListener( 'error', this );
2155
+ this.img.src = this.url;
2156
+ // check if image is already complete
2157
+ var isComplete = this.getIsImageComplete();
2158
+ if ( isComplete ) {
2159
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
2160
+ this.unbindEvents();
2161
+ }
2162
+ };
2163
+
2164
+ Background.prototype.unbindEvents = function() {
2165
+ this.img.removeEventListener( 'load', this );
2166
+ this.img.removeEventListener( 'error', this );
2167
+ };
2168
+
2169
+ Background.prototype.confirm = function( isLoaded, message ) {
2170
+ this.isLoaded = isLoaded;
2171
+ this.emitEvent( 'progress', [ this, this.element, message ] );
2172
+ };
2173
+
2174
+ // -------------------------- jQuery -------------------------- //
2175
+
2176
+ ImagesLoaded.makeJQueryPlugin = function( jQuery ) {
2177
+ jQuery = jQuery || window.jQuery;
2178
+ if ( !jQuery ) {
2179
+ return;
2180
+ }
2181
+ // set local variable
2182
+ $ = jQuery;
2183
+ // $().imagesLoaded()
2184
+ $.fn.imagesLoaded = function( options, callback ) {
2185
+ var instance = new ImagesLoaded( this, options, callback );
2186
+ return instance.jqDeferred.promise( $(this) );
2187
+ };
2188
+ };
2189
+ // try making plugin
2190
+ ImagesLoaded.makeJQueryPlugin();
2191
+
2192
+ // -------------------------- -------------------------- //
2193
+
2194
+ return ImagesLoaded;
2195
+
2196
+ });
2197
+
assets/infinitescroll/infinite-scroll.pkgd.min.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Infinite Scroll PACKAGED v3.0.4
3
+ * Automatically add next page
4
+ *
5
+ * Licensed GPLv3 for open source use
6
+ * or Infinite Scroll Commercial License for commercial use
7
+ *
8
+ * https://infinite-scroll.com
9
+ * Copyright 2018 Metafizzy
10
+ */
11
+
12
+ !function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,l){function a(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,a){var h=l.data(a,i);if(!h)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var c=h[e];if(!c||"_"==e.charAt(0))return void s(r+" is not a valid method");var u=c.apply(h,n);o=void 0===o?u:o}),void 0!==o?o:t}function h(t,e){t.each(function(t,n){var o=l.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),l.data(n,i,o))})}l=l||e||t.jQuery,l&&(r.prototype.option||(r.prototype.option=function(t){l.isPlainObject(t)&&(this.options=l.extend(!0,this.options,t))}),l.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return a(this,t,e)}return h(this,t),this},n(l))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return n.indexOf(e)==-1&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return n!=-1&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,l=document.querySelectorAll("["+s+"]"),a=document.querySelectorAll(".js-"+r),h=i.makeArray(l).concat(i.makeArray(a)),c=s+"-options",u=t.jQuery;h.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(c);try{i=r&&JSON.parse(r)}catch(l){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+l))}var a=new e(t,i);u&&u.data(t,n,a)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/core",["ev-emitter/ev-emitter","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("fizzy-ui-utils")):t.InfiniteScroll=e(t,t.EvEmitter,t.fizzyUIUtils)}(window,function(t,e,i){function n(t,e){var s=i.getQueryElement(t);if(!s)return void console.error("Bad element for InfiniteScroll: "+(s||t));if(t=s,t.infiniteScrollGUID){var l=r[t.infiniteScrollGUID];return l.option(e),l}this.element=t,this.options=i.extend({},n.defaults),this.option(e),o&&(this.$element=o(this.element)),this.create()}var o=t.jQuery,r={};n.defaults={},n.create={},n.destroy={};var s=n.prototype;i.extend(s,e.prototype);var l=0;s.create=function(){var t=this.guid=++l;this.element.infiniteScrollGUID=t,r[t]=this,this.pageIndex=1,this.loadCount=0,this.updateGetPath();var e=this.getPath&&this.getPath();if(!e)return void console.error("Disabling InfiniteScroll");this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit();for(var i in n.create)n.create[i].call(this)},s.option=function(t){i.extend(this.options,t)},s.callOnInit=function(){var t=this.options.onInit;t&&t.call(this,this)},s.dispatchEvent=function(t,e,i){this.log(t,i);var n=e?[e].concat(i):i;if(this.emitEvent(t,n),o&&this.$element){t+=".infiniteScroll";var r=t;if(e){var s=o.Event(e);s.type=t,r=s}this.$element.trigger(r,i)}};var a={initialized:function(t){return"on "+t},request:function(t){return"URL: "+t},load:function(t,e){return(t.title||"")+". URL: "+e},error:function(t,e){return t+". URL: "+e},append:function(t,e,i){return i.length+" items. URL: "+e},last:function(t,e){return"URL: "+e},history:function(t,e){return"URL: "+e},pageIndex:function(t,e){return"current page determined to be: "+t+" from "+e}};s.log=function(t,e){if(this.options.debug){var i="[InfiniteScroll] "+t,n=a[t];n&&(i+=". "+n.apply(this,e)),console.log(i)}},s.updateMeasurements=function(){this.windowHeight=t.innerHeight;var e=this.element.getBoundingClientRect();this.top=e.top+t.pageYOffset},s.updateScroller=function(){var e=this.options.elementScroll;if(!e)return void(this.scroller=t);if(this.scroller=e===!0?this.element:i.getQueryElement(e),!this.scroller)throw"Unable to find elementScroll: "+e},s.updateGetPath=function(){var t=this.options.path;if(!t)return void console.error("InfiniteScroll path option required. Set as: "+t);var e=typeof t;if("function"==e)return void(this.getPath=t);var i="string"==e&&t.match("{{#}}");return i?void this.updateGetPathTemplate(t):void this.updateGetPathSelector(t)},s.updateGetPathTemplate=function(t){this.getPath=function(){var e=this.pageIndex+1;return t.replace("{{#}}",e)}.bind(this);var e=t.replace("{{#}}","(\\d\\d?\\d?)"),i=new RegExp(e),n=location.href.match(i);n&&(this.pageIndex=parseInt(n[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};var h=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/];return s.updateGetPathSelector=function(t){var e=document.querySelector(t);if(!e)return void console.error("Bad InfiniteScroll path option. Next link not found: "+t);for(var i,n,o=e.getAttribute("href"),r=0;o&&r<h.length;r++){n=h[r];var s=o.match(n);if(s){i=s.slice(1);break}}return i?(this.isPathSelector=!0,this.getPath=function(){var t=this.pageIndex+1;return i[0]+t+i[2]}.bind(this),this.pageIndex=parseInt(i[1],10)-1,void this.log("pageIndex",[this.pageIndex,"next link"])):void console.error("InfiniteScroll unable to parse next link href: "+o)},s.updateGetAbsolutePath=function(){var t=this.getPath(),e=t.match(/^http/)||t.match(/^\//);if(e)return void(this.getAbsolutePath=this.getPath);var i=location.pathname,n=i.substring(0,i.lastIndexOf("/"));this.getAbsolutePath=function(){return n+"/"+this.getPath()}},n.create.hideNav=function(){var t=i.getQueryElement(this.options.hideNav);t&&(t.style.display="none",this.nav=t)},n.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},s.destroy=function(){this.allOff();for(var t in n.destroy)n.destroy[t].call(this);delete this.element.infiniteScrollGUID,delete r[this.guid]},n.throttle=function(t,e){e=e||200;var i,n;return function(){var o=+new Date,r=arguments,s=function(){i=o,t.apply(this,r)}.bind(this);i&&o<i+e?(clearTimeout(n),n=setTimeout(s,e)):s()}},n.data=function(t){t=i.getQueryElement(t);var e=t&&t.infiniteScrollGUID;return e&&r[e]},n.setJQuery=function(t){o=t},i.htmlInit(n,"infinite-scroll"),o&&o.bridget&&o.bridget("infiniteScroll",n),n}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/page-load",["./core"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core")):e(t,t.InfiniteScroll)}(window,function(t,e){function i(t){for(var e=document.createDocumentFragment(),i=0;t&&i<t.length;i++)e.appendChild(t[i]);return e}function n(t){for(var e=t.querySelectorAll("script"),i=0;i<e.length;i++){var n=e[i],r=document.createElement("script");o(n,r),r.innerHTML=n.innerHTML,n.parentNode.replaceChild(r,n)}}function o(t,e){for(var i=t.attributes,n=0;n<i.length;n++){var o=i[n];e.setAttribute(o.name,o.value)}}function r(t,e,i,n){var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType=e||"",o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.onload=function(){if(200==o.status)i(o.response);else{var t=new Error(o.statusText);n(t)}},o.onerror=function(){var e=new Error("Network error requesting "+t);n(e)},o.send()}var s=e.prototype;return e.defaults.loadOnScroll=!0,e.defaults.checkLastPage=!0,e.defaults.responseType="document",e.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},s.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()},s.loadNextPage=function(){if(!this.isLoading&&this.canLoad){var t=this.getAbsolutePath();this.isLoading=!0;var e=function(e){this.onPageLoad(e,t)}.bind(this),i=function(e){this.onPageError(e,t)}.bind(this);r(t,this.options.responseType,e,i),this.dispatchEvent("request",null,[t])}},s.onPageLoad=function(t,e){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[t,e]),this.appendNextPage(t,e),t},s.appendNextPage=function(t,e){var n=this.options.append,o="document"==this.options.responseType;if(o&&n){var r=t.querySelectorAll(n),s=i(r),l=function(){this.appendItems(r,s),this.isLoading=!1,this.dispatchEvent("append",null,[t,e,r])}.bind(this);this.options.outlayer?this.appendOutlayerItems(s,l):l()}},s.appendItems=function(t,e){t&&t.length&&(e=e||i(t),n(e),this.element.appendChild(e))},s.appendOutlayerItems=function(i,n){var o=e.imagesLoaded||t.imagesLoaded;return o?void o(i,n):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},s.onAppendOutlayer=function(t,e,i){this.options.outlayer.appended(i)},s.checkLastPage=function(t,e){var i=this.options.checkLastPage;if(i){var n=this.options.path;if("function"==typeof n){var o=this.getPath();if(!o)return void this.lastPageReached(t,e)}var r;if("string"==typeof i?r=i:this.isPathSelector&&(r=n),r&&t.querySelector){var s=t.querySelector(r);s||this.lastPageReached(t,e)}}},s.lastPageReached=function(t,e){this.canLoad=!1,this.dispatchEvent("last",null,[t,e])},s.onPageError=function(t,e){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[t,e]),t},e.create.prefill=function(){if(this.options.prefill){var t=this.options.append;if(!t)return void console.error("append option required for prefill. Set as :"+t);this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()}},s.prefill=function(){var t=this.getPrefillDistance();this.isPrefilling=t>=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},s.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},s.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/scroll-watch",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){var n=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var t=this.options.scrollThreshold,e=t||0===t;e&&this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){var i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.pageScrollHandler),t[i]("resize",this.resizeHandler)},n.onPageScroll=e.throttle(function(){var t=this.getBottomDistance();t<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")}),n.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},n.getWindowBottomDistance=function(){var e=this.top+this.element.clientHeight,i=t.pageYOffset+this.windowHeight;return e-i},n.getElementBottomDistance=function(){var t=this.scroller.scrollHeight,e=this.scroller.scrollTop+this.scroller.clientHeight;return t-e},n.onResize=function(){this.updateMeasurements()},i.debounceMethod(e,"onResize",150),e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/history",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){var n=e.prototype;e.defaults.history="replace";var o=document.createElement("a");return e.create.history=function(){if(this.options.history){o.href=this.getAbsolutePath();var t=o.origin||o.protocol+"//"+o.host,e=t==location.origin;return e?void(this.options.append?this.createHistoryAppend():this.createHistoryPageLoad()):void console.error("[InfiniteScroll] cannot set history with different origin: "+o.origin+" on "+location.origin+" . History behavior disabled.")}},n.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPageIndex=0,this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},n.bindHistoryAppendEvents=function(e){var i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.scrollHistoryHandler),t[i]("unload",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){var t=this.options.history&&this.options.append;t&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(t,e,i){if(i&&i.length){var n=i[0],r=this.getElementScrollY(n);o.href=e,this.scrollPages.push({top:r,path:o.href,title:t.title})}},n.getElementScrollY=function(t){return this.options.elementScroll?this.getElementElementScrollY(t):this.getElementWindowScrollY(t)},n.getElementWindowScrollY=function(e){var i=e.getBoundingClientRect();return i.top+t.pageYOffset},n.getElementElementScrollY=function(t){return t.offsetTop-this.top},n.onScrollHistory=function(){for(var t,e,i=this.getScrollViewY(),n=0;n<this.scrollPages.length;n++){var o=this.scrollPages[n];if(o.top>=i)break;t=n,e=o}t!=this.scrollPageIndex&&(this.scrollPageIndex=t,this.setHistory(e.title,e.path))},i.debounceMethod(e,"onScrollHistory",150),n.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.pageYOffset+this.windowHeight/2},n.setHistory=function(t,e){var i=this.options.history,n=i&&history[i+"State"];n&&(history[i+"State"](null,t,e),this.options.historyTitle&&(document.title=t),this.dispatchEvent("history",null,[t,e]))},n.onUnload=function(){var e=this.scrollPageIndex;if(0!==e){var i=this.scrollPages[e],n=t.pageYOffset-i.top+this.top;this.destroyHistory(),scrollTo(0,n)}},n.onPageLoadHistory=function(t,e){this.setHistory(t.title,e)},e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/button",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){function n(t,e){this.element=t,this.infScroll=e,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),e.on("request",this.disable.bind(this)),e.on("load",this.enable.bind(this)),e.on("error",this.hide.bind(this)),e.on("last",this.hide.bind(this))}return e.create.button=function(){var t=i.getQueryElement(this.options.button);if(t)return void(this.button=new n(t,this))},e.destroy.button=function(){this.button&&this.button.destroy()},n.prototype.onClick=function(t){t.preventDefault(),this.infScroll.loadNextPage()},n.prototype.enable=function(){this.element.removeAttribute("disabled")},n.prototype.disable=function(){this.element.disabled="disabled"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.destroy=function(){this.element.removeEventListener("click",this.clickHandler)},e.Button=n,e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/status",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){function n(t){r(t,"none")}function o(t){r(t,"block")}function r(t,e){t&&(t.style.display=e)}var s=e.prototype;return e.create.status=function(){var t=i.getQueryElement(this.options.status);t&&(this.statusElement=t,this.statusEventElements={request:t.querySelector(".infinite-scroll-request"),error:t.querySelector(".infinite-scroll-error"),last:t.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},s.bindHideStatus=function(t){var e=this.options.append?"append":"load";this[t](e,this.hideAllStatus)},s.showRequestStatus=function(){this.showStatus("request")},s.showErrorStatus=function(){this.showStatus("error")},s.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},s.showStatus=function(t){o(this.statusElement),this.hideStatusEventElements();var e=this.statusEventElements[t];o(e)},s.hideAllStatus=function(){n(this.statusElement),this.hideStatusEventElements()},s.hideStatusEventElements=function(){for(var t in this.statusEventElements){var e=this.statusEventElements[t];n(e)}},e}),function(t,e){"function"==typeof define&&define.amd?define(["infinite-scroll/js/core","infinite-scroll/js/page-load","infinite-scroll/js/scroll-watch","infinite-scroll/js/history","infinite-scroll/js/button","infinite-scroll/js/status"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./core"),require("./page-load"),require("./scroll-watch"),require("./history"),require("./button"),require("./status")))}(window,function(t){return t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){if(Array.isArray(t))return t;var e="object"==typeof t&&"number"==typeof t.length;return e?h.call(t):[t]}function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);var s=t;return"string"==typeof t&&(s=document.querySelectorAll(t)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),l&&(this.jqDeferred=new l.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||t))}function r(t){this.img=t}function s(t,e){this.url=t,this.element=e,this.img=new Image}var l=t.jQuery,a=t.console,h=Array.prototype.slice;o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&c[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var c={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,t),n=i.exec(e.backgroundImage)}},o.prototype.addImage=function(t){var e=new r(t);this.images.push(e)},o.prototype.addBackground=function(t,e){var i=new s(t,e);this.images.push(i)},o.prototype.check=function(){function t(t,i,n){setTimeout(function(){e.progress(t,i,n)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},o.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,t,e)},o.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},r.prototype=Object.create(e.prototype),r.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},o.makeJQueryPlugin=function(e){e=e||t.jQuery,e&&(l=e,l.fn.imagesLoaded=function(t,e){var i=new o(this,t,e);return i.jqDeferred.promise(l(this))})},o.makeJQueryPlugin(),o});
assets/magnific/jquery.magnific-popup.js ADDED
@@ -0,0 +1,1860 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Magnific Popup - v1.1.0 - 2016-02-20
2
+ * http://dimsemenov.com/plugins/magnific-popup/
3
+ * Copyright (c) 2016 Dmitry Semenov; */
4
+ ;(function (factory) {
5
+ if (typeof define === 'function' && define.amd) {
6
+ // AMD. Register as an anonymous module.
7
+ define(['jquery'], factory);
8
+ } else if (typeof exports === 'object') {
9
+ // Node/CommonJS
10
+ factory(require('jquery'));
11
+ } else {
12
+ // Browser globals
13
+ factory(window.jQuery || window.Zepto);
14
+ }
15
+ }(function($) {
16
+
17
+ /*>>core*/
18
+ /**
19
+ *
20
+ * Magnific Popup Core JS file
21
+ *
22
+ */
23
+
24
+
25
+ /**
26
+ * Private static constants
27
+ */
28
+ var CLOSE_EVENT = 'Close',
29
+ BEFORE_CLOSE_EVENT = 'BeforeClose',
30
+ AFTER_CLOSE_EVENT = 'AfterClose',
31
+ BEFORE_APPEND_EVENT = 'BeforeAppend',
32
+ MARKUP_PARSE_EVENT = 'MarkupParse',
33
+ OPEN_EVENT = 'Open',
34
+ CHANGE_EVENT = 'Change',
35
+ NS = 'mfp',
36
+ EVENT_NS = '.' + NS,
37
+ READY_CLASS = 'mfp-ready',
38
+ REMOVING_CLASS = 'mfp-removing',
39
+ PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
40
+
41
+
42
+ /**
43
+ * Private vars
44
+ */
45
+ /*jshint -W079 */
46
+ var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
47
+ MagnificPopup = function(){},
48
+ _isJQ = !!(window.jQuery),
49
+ _prevStatus,
50
+ _window = $(window),
51
+ _document,
52
+ _prevContentType,
53
+ _wrapClasses,
54
+ _currPopupType;
55
+
56
+
57
+ /**
58
+ * Private functions
59
+ */
60
+ var _mfpOn = function(name, f) {
61
+ mfp.ev.on(NS + name + EVENT_NS, f);
62
+ },
63
+ _getEl = function(className, appendTo, html, raw) {
64
+ var el = document.createElement('div');
65
+ el.className = 'mfp-'+className;
66
+ if(html) {
67
+ el.innerHTML = html;
68
+ }
69
+ if(!raw) {
70
+ el = $(el);
71
+ if(appendTo) {
72
+ el.appendTo(appendTo);
73
+ }
74
+ } else if(appendTo) {
75
+ appendTo.appendChild(el);
76
+ }
77
+ return el;
78
+ },
79
+ _mfpTrigger = function(e, data) {
80
+ mfp.ev.triggerHandler(NS + e, data);
81
+
82
+ if(mfp.st.callbacks) {
83
+ // converts "mfpEventName" to "eventName" callback and triggers it if it's present
84
+ e = e.charAt(0).toLowerCase() + e.slice(1);
85
+ if(mfp.st.callbacks[e]) {
86
+ mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
87
+ }
88
+ }
89
+ },
90
+ _getCloseBtn = function(type) {
91
+ if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
92
+ mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
93
+ _currPopupType = type;
94
+ }
95
+ return mfp.currTemplate.closeBtn;
96
+ },
97
+ // Initialize Magnific Popup only when called at least once
98
+ _checkInstance = function() {
99
+ if(!$.magnificPopup.instance) {
100
+ /*jshint -W020 */
101
+ mfp = new MagnificPopup();
102
+ mfp.init();
103
+ $.magnificPopup.instance = mfp;
104
+ }
105
+ },
106
+ // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
107
+ supportsTransitions = function() {
108
+ var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
109
+ v = ['ms','O','Moz','Webkit']; // 'v' for vendor
110
+
111
+ if( s['transition'] !== undefined ) {
112
+ return true;
113
+ }
114
+
115
+ while( v.length ) {
116
+ if( v.pop() + 'Transition' in s ) {
117
+ return true;
118
+ }
119
+ }
120
+
121
+ return false;
122
+ };
123
+
124
+
125
+
126
+ /**
127
+ * Public functions
128
+ */
129
+ MagnificPopup.prototype = {
130
+
131
+ constructor: MagnificPopup,
132
+
133
+ /**
134
+ * Initializes Magnific Popup plugin.
135
+ * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
136
+ */
137
+ init: function() {
138
+ var appVersion = navigator.appVersion;
139
+ mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
140
+ mfp.isAndroid = (/android/gi).test(appVersion);
141
+ mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
142
+ mfp.supportsTransition = supportsTransitions();
143
+
144
+ // We disable fixed positioned lightbox on devices that don't handle it nicely.
145
+ // If you know a better way of detecting this - let me know.
146
+ mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
147
+ _document = $(document);
148
+
149
+ mfp.popupsCache = {};
150
+ },
151
+
152
+ /**
153
+ * Opens popup
154
+ * @param data [description]
155
+ */
156
+ open: function(data) {
157
+
158
+ var i;
159
+
160
+ if(data.isObj === false) {
161
+ // convert jQuery collection to array to avoid conflicts later
162
+ mfp.items = data.items.toArray();
163
+
164
+ mfp.index = 0;
165
+ var items = data.items,
166
+ item;
167
+ for(i = 0; i < items.length; i++) {
168
+ item = items[i];
169
+ if(item.parsed) {
170
+ item = item.el[0];
171
+ }
172
+ if(item === data.el[0]) {
173
+ mfp.index = i;
174
+ break;
175
+ }
176
+ }
177
+ } else {
178
+ mfp.items = $.isArray(data.items) ? data.items : [data.items];
179
+ mfp.index = data.index || 0;
180
+ }
181
+
182
+ // if popup is already opened - we just update the content
183
+ if(mfp.isOpen) {
184
+ mfp.updateItemHTML();
185
+ return;
186
+ }
187
+
188
+ mfp.types = [];
189
+ _wrapClasses = '';
190
+ if(data.mainEl && data.mainEl.length) {
191
+ mfp.ev = data.mainEl.eq(0);
192
+ } else {
193
+ mfp.ev = _document;
194
+ }
195
+
196
+ if(data.key) {
197
+ if(!mfp.popupsCache[data.key]) {
198
+ mfp.popupsCache[data.key] = {};
199
+ }
200
+ mfp.currTemplate = mfp.popupsCache[data.key];
201
+ } else {
202
+ mfp.currTemplate = {};
203
+ }
204
+
205
+
206
+
207
+ mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
208
+ mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
209
+
210
+ if(mfp.st.modal) {
211
+ mfp.st.closeOnContentClick = false;
212
+ mfp.st.closeOnBgClick = false;
213
+ mfp.st.showCloseBtn = false;
214
+ mfp.st.enableEscapeKey = false;
215
+ }
216
+
217
+
218
+ // Building markup
219
+ // main containers are created only once
220
+ if(!mfp.bgOverlay) {
221
+
222
+ // Dark overlay
223
+ mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
224
+ mfp.close();
225
+ });
226
+
227
+ mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
228
+ if(mfp._checkIfClose(e.target)) {
229
+ mfp.close();
230
+ }
231
+ });
232
+
233
+ mfp.container = _getEl('container', mfp.wrap);
234
+ }
235
+
236
+ mfp.contentContainer = _getEl('content');
237
+ if(mfp.st.preloader) {
238
+ mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
239
+ }
240
+
241
+
242
+ // Initializing modules
243
+ var modules = $.magnificPopup.modules;
244
+ for(i = 0; i < modules.length; i++) {
245
+ var n = modules[i];
246
+ n = n.charAt(0).toUpperCase() + n.slice(1);
247
+ mfp['init'+n].call(mfp);
248
+ }
249
+ _mfpTrigger('BeforeOpen');
250
+
251
+
252
+ if(mfp.st.showCloseBtn) {
253
+ // Close button
254
+ if(!mfp.st.closeBtnInside) {
255
+ mfp.wrap.append( _getCloseBtn() );
256
+ } else {
257
+ _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
258
+ values.close_replaceWith = _getCloseBtn(item.type);
259
+ });
260
+ _wrapClasses += ' mfp-close-btn-in';
261
+ }
262
+ }
263
+
264
+ if(mfp.st.alignTop) {
265
+ _wrapClasses += ' mfp-align-top';
266
+ }
267
+
268
+
269
+
270
+ if(mfp.fixedContentPos) {
271
+ mfp.wrap.css({
272
+ overflow: mfp.st.overflowY,
273
+ overflowX: 'hidden',
274
+ overflowY: mfp.st.overflowY
275
+ });
276
+ } else {
277
+ mfp.wrap.css({
278
+ top: _window.scrollTop(),
279
+ position: 'absolute'
280
+ });
281
+ }
282
+ if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
283
+ mfp.bgOverlay.css({
284
+ height: _document.height(),
285
+ position: 'absolute'
286
+ });
287
+ }
288
+
289
+
290
+
291
+ if(mfp.st.enableEscapeKey) {
292
+ // Close on ESC key
293
+ _document.on('keyup' + EVENT_NS, function(e) {
294
+ if(e.keyCode === 27) {
295
+ mfp.close();
296
+ }
297
+ });
298
+ }
299
+
300
+ _window.on('resize' + EVENT_NS, function() {
301
+ mfp.updateSize();
302
+ });
303
+
304
+
305
+ if(!mfp.st.closeOnContentClick) {
306
+ _wrapClasses += ' mfp-auto-cursor';
307
+ }
308
+
309
+ if(_wrapClasses)
310
+ mfp.wrap.addClass(_wrapClasses);
311
+
312
+
313
+ // this triggers recalculation of layout, so we get it once to not to trigger twice
314
+ var windowHeight = mfp.wH = _window.height();
315
+
316
+
317
+ var windowStyles = {};
318
+
319
+ if( mfp.fixedContentPos ) {
320
+ if(mfp._hasScrollBar(windowHeight)){
321
+ var s = mfp._getScrollbarSize();
322
+ if(s) {
323
+ windowStyles.marginRight = s;
324
+ }
325
+ }
326
+ }
327
+
328
+ if(mfp.fixedContentPos) {
329
+ if(!mfp.isIE7) {
330
+ windowStyles.overflow = 'hidden';
331
+ } else {
332
+ // ie7 double-scroll bug
333
+ $('body, html').css('overflow', 'hidden');
334
+ }
335
+ }
336
+
337
+
338
+
339
+ var classesToadd = mfp.st.mainClass;
340
+ if(mfp.isIE7) {
341
+ classesToadd += ' mfp-ie7';
342
+ }
343
+ if(classesToadd) {
344
+ mfp._addClassToMFP( classesToadd );
345
+ }
346
+
347
+ // add content
348
+ mfp.updateItemHTML();
349
+
350
+ _mfpTrigger('BuildControls');
351
+
352
+ // remove scrollbar, add margin e.t.c
353
+ $('html').css(windowStyles);
354
+
355
+ // add everything to DOM
356
+ mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
357
+
358
+ // Save last focused element
359
+ mfp._lastFocusedEl = document.activeElement;
360
+
361
+ // Wait for next cycle to allow CSS transition
362
+ setTimeout(function() {
363
+
364
+ if(mfp.content) {
365
+ mfp._addClassToMFP(READY_CLASS);
366
+ mfp._setFocus();
367
+ } else {
368
+ // if content is not defined (not loaded e.t.c) we add class only for BG
369
+ mfp.bgOverlay.addClass(READY_CLASS);
370
+ }
371
+
372
+ // Trap the focus in popup
373
+ _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
374
+
375
+ }, 16);
376
+
377
+ mfp.isOpen = true;
378
+ mfp.updateSize(windowHeight);
379
+ _mfpTrigger(OPEN_EVENT);
380
+
381
+ return data;
382
+ },
383
+
384
+ /**
385
+ * Closes the popup
386
+ */
387
+ close: function() {
388
+ if(!mfp.isOpen) return;
389
+ _mfpTrigger(BEFORE_CLOSE_EVENT);
390
+
391
+ mfp.isOpen = false;
392
+ // for CSS3 animation
393
+ if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
394
+ mfp._addClassToMFP(REMOVING_CLASS);
395
+ setTimeout(function() {
396
+ mfp._close();
397
+ }, mfp.st.removalDelay);
398
+ } else {
399
+ mfp._close();
400
+ }
401
+ },
402
+
403
+ /**
404
+ * Helper for close() function
405
+ */
406
+ _close: function() {
407
+ _mfpTrigger(CLOSE_EVENT);
408
+
409
+ var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
410
+
411
+ mfp.bgOverlay.detach();
412
+ mfp.wrap.detach();
413
+ mfp.container.empty();
414
+
415
+ if(mfp.st.mainClass) {
416
+ classesToRemove += mfp.st.mainClass + ' ';
417
+ }
418
+
419
+ mfp._removeClassFromMFP(classesToRemove);
420
+
421
+ if(mfp.fixedContentPos) {
422
+ var windowStyles = {marginRight: ''};
423
+ if(mfp.isIE7) {
424
+ $('body, html').css('overflow', '');
425
+ } else {
426
+ windowStyles.overflow = '';
427
+ }
428
+ $('html').css(windowStyles);
429
+ }
430
+
431
+ _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
432
+ mfp.ev.off(EVENT_NS);
433
+
434
+ // clean up DOM elements that aren't removed
435
+ mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
436
+ mfp.bgOverlay.attr('class', 'mfp-bg');
437
+ mfp.container.attr('class', 'mfp-container');
438
+
439
+ // remove close button from target element
440
+ if(mfp.st.showCloseBtn &&
441
+ (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
442
+ if(mfp.currTemplate.closeBtn)
443
+ mfp.currTemplate.closeBtn.detach();
444
+ }
445
+
446
+
447
+ if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
448
+ $(mfp._lastFocusedEl).focus(); // put tab focus back
449
+ }
450
+ mfp.currItem = null;
451
+ mfp.content = null;
452
+ mfp.currTemplate = null;
453
+ mfp.prevHeight = 0;
454
+
455
+ _mfpTrigger(AFTER_CLOSE_EVENT);
456
+ },
457
+
458
+ updateSize: function(winHeight) {
459
+
460
+ if(mfp.isIOS) {
461
+ // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
462
+ var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
463
+ var height = window.innerHeight * zoomLevel;
464
+ mfp.wrap.css('height', height);
465
+ mfp.wH = height;
466
+ } else {
467
+ mfp.wH = winHeight || _window.height();
468
+ }
469
+ // Fixes #84: popup incorrectly positioned with position:relative on body
470
+ if(!mfp.fixedContentPos) {
471
+ mfp.wrap.css('height', mfp.wH);
472
+ }
473
+
474
+ _mfpTrigger('Resize');
475
+
476
+ },
477
+
478
+ /**
479
+ * Set content of popup based on current index
480
+ */
481
+ updateItemHTML: function() {
482
+ var item = mfp.items[mfp.index];
483
+
484
+ // Detach and perform modifications
485
+ mfp.contentContainer.detach();
486
+
487
+ if(mfp.content)
488
+ mfp.content.detach();
489
+
490
+ if(!item.parsed) {
491
+ item = mfp.parseEl( mfp.index );
492
+ }
493
+
494
+ var type = item.type;
495
+
496
+ _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
497
+ // BeforeChange event works like so:
498
+ // _mfpOn('BeforeChange', function(e, prevType, newType) { });
499
+
500
+ mfp.currItem = item;
501
+
502
+ if(!mfp.currTemplate[type]) {
503
+ var markup = mfp.st[type] ? mfp.st[type].markup : false;
504
+
505
+ // allows to modify markup
506
+ _mfpTrigger('FirstMarkupParse', markup);
507
+
508
+ if(markup) {
509
+ mfp.currTemplate[type] = $(markup);
510
+ } else {
511
+ // if there is no markup found we just define that template is parsed
512
+ mfp.currTemplate[type] = true;
513
+ }
514
+ }
515
+
516
+ if(_prevContentType && _prevContentType !== item.type) {
517
+ mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
518
+ }
519
+
520
+ var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
521
+ mfp.appendContent(newContent, type);
522
+
523
+ item.preloaded = true;
524
+
525
+ _mfpTrigger(CHANGE_EVENT, item);
526
+ _prevContentType = item.type;
527
+
528
+ // Append container back after its content changed
529
+ mfp.container.prepend(mfp.contentContainer);
530
+
531
+ _mfpTrigger('AfterChange');
532
+ },
533
+
534
+
535
+ /**
536
+ * Set HTML content of popup
537
+ */
538
+ appendContent: function(newContent, type) {
539
+ mfp.content = newContent;
540
+
541
+ if(newContent) {
542
+ if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
543
+ mfp.currTemplate[type] === true) {
544
+ // if there is no markup, we just append close button element inside
545
+ if(!mfp.content.find('.mfp-close').length) {
546
+ mfp.content.append(_getCloseBtn());
547
+ }
548
+ } else {
549
+ mfp.content = newContent;
550
+ }
551
+ } else {
552
+ mfp.content = '';
553
+ }
554
+
555
+ _mfpTrigger(BEFORE_APPEND_EVENT);
556
+ mfp.container.addClass('mfp-'+type+'-holder');
557
+
558
+ mfp.contentContainer.append(mfp.content);
559
+ },
560
+
561
+
562
+ /**
563
+ * Creates Magnific Popup data object based on given data
564
+ * @param {int} index Index of item to parse
565
+ */
566
+ parseEl: function(index) {
567
+ var item = mfp.items[index],
568
+ type;
569
+
570
+ if(item.tagName) {
571
+ item = { el: $(item) };
572
+ } else {
573
+ type = item.type;
574
+ item = { data: item, src: item.src };
575
+ }
576
+
577
+ if(item.el) {
578
+ var types = mfp.types;
579
+
580
+ // check for 'mfp-TYPE' class
581
+ for(var i = 0; i < types.length; i++) {
582
+ if( item.el.hasClass('mfp-'+types[i]) ) {
583
+ type = types[i];
584
+ break;
585
+ }
586
+ }
587
+
588
+ item.src = item.el.attr('data-mfp-src');
589
+ if(!item.src) {
590
+ item.src = item.el.attr('href');
591
+ }
592
+ }
593
+
594
+ item.type = type || mfp.st.type || 'inline';
595
+ item.index = index;
596
+ item.parsed = true;
597
+ mfp.items[index] = item;
598
+ _mfpTrigger('ElementParse', item);
599
+
600
+ return mfp.items[index];
601
+ },
602
+
603
+
604
+ /**
605
+ * Initializes single popup or a group of popups
606
+ */
607
+ addGroup: function(el, options) {
608
+ var eHandler = function(e) {
609
+ e.mfpEl = this;
610
+ mfp._openClick(e, el, options);
611
+ };
612
+
613
+ if(!options) {
614
+ options = {};
615
+ }
616
+
617
+ var eName = 'click.magnificPopup';
618
+ options.mainEl = el;
619
+
620
+ if(options.items) {
621
+ options.isObj = true;
622
+ el.off(eName).on(eName, eHandler);
623
+ } else {
624
+ options.isObj = false;
625
+ if(options.delegate) {
626
+ el.off(eName).on(eName, options.delegate , eHandler);
627
+ } else {
628
+ options.items = el;
629
+ el.off(eName).on(eName, eHandler);
630
+ }
631
+ }
632
+ },
633
+ _openClick: function(e, el, options) {
634
+ var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
635
+
636
+
637
+ if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
638
+ return;
639
+ }
640
+
641
+ var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
642
+
643
+ if(disableOn) {
644
+ if($.isFunction(disableOn)) {
645
+ if( !disableOn.call(mfp) ) {
646
+ return true;
647
+ }
648
+ } else { // else it's number
649
+ if( _window.width() < disableOn ) {
650
+ return true;
651
+ }
652
+ }
653
+ }
654
+
655
+ if(e.type) {
656
+ e.preventDefault();
657
+
658
+ // This will prevent popup from closing if element is inside and popup is already opened
659
+ if(mfp.isOpen) {
660
+ e.stopPropagation();
661
+ }
662
+ }
663
+
664
+ options.el = $(e.mfpEl);
665
+ if(options.delegate) {
666
+ options.items = el.find(options.delegate);
667
+ }
668
+ mfp.open(options);
669
+ },
670
+
671
+
672
+ /**
673
+ * Updates text on preloader
674
+ */
675
+ updateStatus: function(status, text) {
676
+
677
+ if(mfp.preloader) {
678
+ if(_prevStatus !== status) {
679
+ mfp.container.removeClass('mfp-s-'+_prevStatus);
680
+ }
681
+
682
+ if(!text && status === 'loading') {
683
+ text = mfp.st.tLoading;
684
+ }
685
+
686
+ var data = {
687
+ status: status,
688
+ text: text
689
+ };
690
+ // allows to modify status
691
+ _mfpTrigger('UpdateStatus', data);
692
+
693
+ status = data.status;
694
+ text = data.text;
695
+
696
+ mfp.preloader.html(text);
697
+
698
+ mfp.preloader.find('a').on('click', function(e) {
699
+ e.stopImmediatePropagation();
700
+ });
701
+
702
+ mfp.container.addClass('mfp-s-'+status);
703
+ _prevStatus = status;
704
+ }
705
+ },
706
+
707
+
708
+ /*
709
+ "Private" helpers that aren't private at all
710
+ */
711
+ // Check to close popup or not
712
+ // "target" is an element that was clicked
713
+ _checkIfClose: function(target) {
714
+
715
+ if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
716
+ return;
717
+ }
718
+
719
+ var closeOnContent = mfp.st.closeOnContentClick;
720
+ var closeOnBg = mfp.st.closeOnBgClick;
721
+
722
+ if(closeOnContent && closeOnBg) {
723
+ return true;
724
+ } else {
725
+
726
+ // We close the popup if click is on close button or on preloader. Or if there is no content.
727
+ if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
728
+ return true;
729
+ }
730
+
731
+ // if click is outside the content
732
+ if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
733
+ if(closeOnBg) {
734
+ // last check, if the clicked element is in DOM, (in case it's removed onclick)
735
+ if( $.contains(document, target) ) {
736
+ return true;
737
+ }
738
+ }
739
+ } else if(closeOnContent) {
740
+ return true;
741
+ }
742
+
743
+ }
744
+ return false;
745
+ },
746
+ _addClassToMFP: function(cName) {
747
+ mfp.bgOverlay.addClass(cName);
748
+ mfp.wrap.addClass(cName);
749
+ },
750
+ _removeClassFromMFP: function(cName) {
751
+ this.bgOverlay.removeClass(cName);
752
+ mfp.wrap.removeClass(cName);
753
+ },
754
+ _hasScrollBar: function(winHeight) {
755
+ return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
756
+ },
757
+ _setFocus: function() {
758
+ (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
759
+ },
760
+ _onFocusIn: function(e) {
761
+ if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
762
+ mfp._setFocus();
763
+ return false;
764
+ }
765
+ },
766
+ _parseMarkup: function(template, values, item) {
767
+ var arr;
768
+ if(item.data) {
769
+ values = $.extend(item.data, values);
770
+ }
771
+ _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
772
+
773
+ $.each(values, function(key, value) {
774
+ if(value === undefined || value === false) {
775
+ return true;
776
+ }
777
+ arr = key.split('_');
778
+ if(arr.length > 1) {
779
+ var el = template.find(EVENT_NS + '-'+arr[0]);
780
+
781
+ if(el.length > 0) {
782
+ var attr = arr[1];
783
+ if(attr === 'replaceWith') {
784
+ if(el[0] !== value[0]) {
785
+ el.replaceWith(value);
786
+ }
787
+ } else if(attr === 'img') {
788
+ if(el.is('img')) {
789
+ el.attr('src', value);
790
+ } else {
791
+ el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
792
+ }
793
+ } else {
794
+ el.attr(arr[1], value);
795
+ }
796
+ }
797
+
798
+ } else {
799
+ template.find(EVENT_NS + '-'+key).html(value);
800
+ }
801
+ });
802
+ },
803
+
804
+ _getScrollbarSize: function() {
805
+ // thx David
806
+ if(mfp.scrollbarSize === undefined) {
807
+ var scrollDiv = document.createElement("div");
808
+ scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
809
+ document.body.appendChild(scrollDiv);
810
+ mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
811
+ document.body.removeChild(scrollDiv);
812
+ }
813
+ return mfp.scrollbarSize;
814
+ }
815
+
816
+ }; /* MagnificPopup core prototype end */
817
+
818
+
819
+
820
+
821
+ /**
822
+ * Public static functions
823
+ */
824
+ $.magnificPopup = {
825
+ instance: null,
826
+ proto: MagnificPopup.prototype,
827
+ modules: [],
828
+
829
+ open: function(options, index) {
830
+ _checkInstance();
831
+
832
+ if(!options) {
833
+ options = {};
834
+ } else {
835
+ options = $.extend(true, {}, options);
836
+ }
837
+
838
+ options.isObj = true;
839
+ options.index = index || 0;
840
+ return this.instance.open(options);
841
+ },
842
+
843
+ close: function() {
844
+ return $.magnificPopup.instance && $.magnificPopup.instance.close();
845
+ },
846
+
847
+ registerModule: function(name, module) {
848
+ if(module.options) {
849
+ $.magnificPopup.defaults[name] = module.options;
850
+ }
851
+ $.extend(this.proto, module.proto);
852
+ this.modules.push(name);
853
+ },
854
+
855
+ defaults: {
856
+
857
+ // Info about options is in docs:
858
+ // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
859
+
860
+ disableOn: 0,
861
+
862
+ key: null,
863
+
864
+ midClick: false,
865
+
866
+ mainClass: '',
867
+
868
+ preloader: true,
869
+
870
+ focus: '', // CSS selector of input to focus after popup is opened
871
+
872
+ closeOnContentClick: false,
873
+
874
+ closeOnBgClick: true,
875
+
876
+ closeBtnInside: true,
877
+
878
+ showCloseBtn: true,
879
+
880
+ enableEscapeKey: true,
881
+
882
+ modal: false,
883
+
884
+ alignTop: false,
885
+
886
+ removalDelay: 0,
887
+
888
+ prependTo: null,
889
+
890
+ fixedContentPos: 'auto',
891
+
892
+ fixedBgPos: 'auto',
893
+
894
+ overflowY: 'auto',
895
+
896
+ closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
897
+
898
+ tClose: 'Close (Esc)',
899
+
900
+ tLoading: 'Loading...',
901
+
902
+ autoFocusLast: true
903
+
904
+ }
905
+ };
906
+
907
+
908
+
909
+ $.fn.magnificPopup = function(options) {
910
+ _checkInstance();
911
+
912
+ var jqEl = $(this);
913
+
914
+ // We call some API method of first param is a string
915
+ if (typeof options === "string" ) {
916
+
917
+ if(options === 'open') {
918
+ var items,
919
+ itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
920
+ index = parseInt(arguments[1], 10) || 0;
921
+
922
+ if(itemOpts.items) {
923
+ items = itemOpts.items[index];
924
+ } else {
925
+ items = jqEl;
926
+ if(itemOpts.delegate) {
927
+ items = items.find(itemOpts.delegate);
928
+ }
929
+ items = items.eq( index );
930
+ }
931
+ mfp._openClick({mfpEl:items}, jqEl, itemOpts);
932
+ } else {
933
+ if(mfp.isOpen)
934
+ mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
935
+ }
936
+
937
+ } else {
938
+ // clone options obj
939
+ options = $.extend(true, {}, options);
940
+
941
+ /*
942
+ * As Zepto doesn't support .data() method for objects
943
+ * and it works only in normal browsers
944
+ * we assign "options" object directly to the DOM element. FTW!
945
+ */
946
+ if(_isJQ) {
947
+ jqEl.data('magnificPopup', options);
948
+ } else {
949
+ jqEl[0].magnificPopup = options;
950
+ }
951
+
952
+ mfp.addGroup(jqEl, options);
953
+
954
+ }
955
+ return jqEl;
956
+ };
957
+
958
+ /*>>core*/
959
+
960
+ /*>>inline*/
961
+
962
+ var INLINE_NS = 'inline',
963
+ _hiddenClass,
964
+ _inlinePlaceholder,
965
+ _lastInlineElement,
966
+ _putInlineElementsBack = function() {
967
+ if(_lastInlineElement) {
968
+ _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
969
+ _lastInlineElement = null;
970
+ }
971
+ };
972
+
973
+ $.magnificPopup.registerModule(INLINE_NS, {
974
+ options: {
975
+ hiddenClass: 'hide', // will be appended with `mfp-` prefix
976
+ markup: '',
977
+ tNotFound: 'Content not found'
978
+ },
979
+ proto: {
980
+
981
+ initInline: function() {
982
+ mfp.types.push(INLINE_NS);
983
+
984
+ _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
985
+ _putInlineElementsBack();
986
+ });
987
+ },
988
+
989
+ getInline: function(item, template) {
990
+
991
+ _putInlineElementsBack();
992
+
993
+ if(item.src) {
994
+ var inlineSt = mfp.st.inline,
995
+ el = $(item.src);
996
+
997
+ if(el.length) {
998
+
999
+ // If target element has parent - we replace it with placeholder and put it back after popup is closed
1000
+ var parent = el[0].parentNode;
1001
+ if(parent && parent.tagName) {
1002
+ if(!_inlinePlaceholder) {
1003
+ _hiddenClass = inlineSt.hiddenClass;
1004
+ _inlinePlaceholder = _getEl(_hiddenClass);
1005
+ _hiddenClass = 'mfp-'+_hiddenClass;
1006
+ }
1007
+ // replace target inline element with placeholder
1008
+ _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1009
+ }
1010
+
1011
+ mfp.updateStatus('ready');
1012
+ } else {
1013
+ mfp.updateStatus('error', inlineSt.tNotFound);
1014
+ el = $('<div>');
1015
+ }
1016
+
1017
+ item.inlineElement = el;
1018
+ return el;
1019
+ }
1020
+
1021
+ mfp.updateStatus('ready');
1022
+ mfp._parseMarkup(template, {}, item);
1023
+ return template;
1024
+ }
1025
+ }
1026
+ });
1027
+
1028
+ /*>>inline*/
1029
+
1030
+ /*>>ajax*/
1031
+ var AJAX_NS = 'ajax',
1032
+ _ajaxCur,
1033
+ _removeAjaxCursor = function() {
1034
+ if(_ajaxCur) {
1035
+ $(document.body).removeClass(_ajaxCur);
1036
+ }
1037
+ },
1038
+ _destroyAjaxRequest = function() {
1039
+ _removeAjaxCursor();
1040
+ if(mfp.req) {
1041
+ mfp.req.abort();
1042
+ }
1043
+ };
1044
+
1045
+ $.magnificPopup.registerModule(AJAX_NS, {
1046
+
1047
+ options: {
1048
+ settings: null,
1049
+ cursor: 'mfp-ajax-cur',
1050
+ tError: '<a href="%url%">The content</a> could not be loaded.'
1051
+ },
1052
+
1053
+ proto: {
1054
+ initAjax: function() {
1055
+ mfp.types.push(AJAX_NS);
1056
+ _ajaxCur = mfp.st.ajax.cursor;
1057
+
1058
+ _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1059
+ _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1060
+ },
1061
+ getAjax: function(item) {
1062
+
1063
+ if(_ajaxCur) {
1064
+ $(document.body).addClass(_ajaxCur);
1065
+ }
1066
+
1067
+ mfp.updateStatus('loading');
1068
+
1069
+ var opts = $.extend({
1070
+ url: item.src,
1071
+ success: function(data, textStatus, jqXHR) {
1072
+ var temp = {
1073
+ data:data,
1074
+ xhr:jqXHR
1075
+ };
1076
+
1077
+ _mfpTrigger('ParseAjax', temp);
1078
+
1079
+ mfp.appendContent( $(temp.data), AJAX_NS );
1080
+
1081
+ item.finished = true;
1082
+
1083
+ _removeAjaxCursor();
1084
+
1085
+ mfp._setFocus();
1086
+
1087
+ setTimeout(function() {
1088
+ mfp.wrap.addClass(READY_CLASS);
1089
+ }, 16);
1090
+
1091
+ mfp.updateStatus('ready');
1092
+
1093
+ _mfpTrigger('AjaxContentAdded');
1094
+ },
1095
+ error: function() {
1096
+ _removeAjaxCursor();
1097
+ item.finished = item.loadError = true;
1098
+ mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1099
+ }
1100
+ }, mfp.st.ajax.settings);
1101
+
1102
+ mfp.req = $.ajax(opts);
1103
+
1104
+ return '';
1105
+ }
1106
+ }
1107
+ });
1108
+
1109
+ /*>>ajax*/
1110
+
1111
+ /*>>image*/
1112
+ var _imgInterval,
1113
+ _getTitle = function(item) {
1114
+ if(item.data && item.data.title !== undefined)
1115
+ return item.data.title;
1116
+
1117
+ var src = mfp.st.image.titleSrc;
1118
+
1119
+ if(src) {
1120
+ if($.isFunction(src)) {
1121
+ return src.call(mfp, item);
1122
+ } else if(item.el) {
1123
+ return item.el.attr(src) || '';
1124
+ }
1125
+ }
1126
+ return '';
1127
+ };
1128
+
1129
+ $.magnificPopup.registerModule('image', {
1130
+
1131
+ options: {
1132
+ markup: '<div class="mfp-figure">'+
1133
+ '<div class="mfp-close"></div>'+
1134
+ '<figure>'+
1135
+ '<div class="mfp-img"></div>'+
1136
+ '<figcaption>'+
1137
+ '<div class="mfp-bottom-bar">'+
1138
+ '<div class="mfp-title"></div>'+
1139
+ '<div class="mfp-counter"></div>'+
1140
+ '</div>'+
1141
+ '</figcaption>'+
1142
+ '</figure>'+
1143
+ '</div>',
1144
+ cursor: 'mfp-zoom-out-cur',
1145
+ titleSrc: 'title',
1146
+ verticalFit: true,
1147
+ tError: '<a href="%url%">The image</a> could not be loaded.'
1148
+ },
1149
+
1150
+ proto: {
1151
+ initImage: function() {
1152
+ var imgSt = mfp.st.image,
1153
+ ns = '.image';
1154
+
1155
+ mfp.types.push('image');
1156
+
1157
+ _mfpOn(OPEN_EVENT+ns, function() {
1158
+ if(mfp.currItem.type === 'image' && imgSt.cursor) {
1159
+ $(document.body).addClass(imgSt.cursor);
1160
+ }
1161
+ });
1162
+
1163
+ _mfpOn(CLOSE_EVENT+ns, function() {
1164
+ if(imgSt.cursor) {
1165
+ $(document.body).removeClass(imgSt.cursor);
1166
+ }
1167
+ _window.off('resize' + EVENT_NS);
1168
+ });
1169
+
1170
+ _mfpOn('Resize'+ns, mfp.resizeImage);
1171
+ if(mfp.isLowIE) {
1172
+ _mfpOn('AfterChange', mfp.resizeImage);
1173
+ }
1174
+ },
1175
+ resizeImage: function() {
1176
+ var item = mfp.currItem;
1177
+ if(!item || !item.img) return;
1178
+
1179
+ if(mfp.st.image.verticalFit) {
1180
+ var decr = 0;
1181
+ // fix box-sizing in ie7/8
1182
+ if(mfp.isLowIE) {
1183
+ decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1184
+ }
1185
+ item.img.css('max-height', mfp.wH-decr);
1186
+ }
1187
+ },
1188
+ _onImageHasSize: function(item) {
1189
+ if(item.img) {
1190
+
1191
+ item.hasSize = true;
1192
+
1193
+ if(_imgInterval) {
1194
+ clearInterval(_imgInterval);
1195
+ }
1196
+
1197
+ item.isCheckingImgSize = false;
1198
+
1199
+ _mfpTrigger('ImageHasSize', item);
1200
+
1201
+ if(item.imgHidden) {
1202
+ if(mfp.content)
1203
+ mfp.content.removeClass('mfp-loading');
1204
+
1205
+ item.imgHidden = false;
1206
+ }
1207
+
1208
+ }
1209
+ },
1210
+
1211
+ /**
1212
+ * Function that loops until the image has size to display elements that rely on it asap
1213
+ */
1214
+ findImageSize: function(item) {
1215
+
1216
+ var counter = 0,
1217
+ img = item.img[0],
1218
+ mfpSetInterval = function(delay) {
1219
+
1220
+ if(_imgInterval) {
1221
+ clearInterval(_imgInterval);
1222
+ }
1223
+ // decelerating interval that checks for size of an image
1224
+ _imgInterval = setInterval(function() {
1225
+ if(img.naturalWidth > 0) {
1226
+ mfp._onImageHasSize(item);
1227
+ return;
1228
+ }
1229
+
1230
+ if(counter > 200) {
1231
+ clearInterval(_imgInterval);
1232
+ }
1233
+
1234
+ counter++;
1235
+ if(counter === 3) {
1236
+ mfpSetInterval(10);
1237
+ } else if(counter === 40) {
1238
+ mfpSetInterval(50);
1239
+ } else if(counter === 100) {
1240
+ mfpSetInterval(500);
1241
+ }
1242
+ }, delay);
1243
+ };
1244
+
1245
+ mfpSetInterval(1);
1246
+ },
1247
+
1248
+ getImage: function(item, template) {
1249
+
1250
+ var guard = 0,
1251
+
1252
+ // image load complete handler
1253
+ onLoadComplete = function() {
1254
+ if(item) {
1255
+ if (item.img[0].complete) {
1256
+ item.img.off('.mfploader');
1257
+
1258
+ if(item === mfp.currItem){
1259
+ mfp._onImageHasSize(item);
1260
+
1261
+ mfp.updateStatus('ready');
1262
+ }
1263
+
1264
+ item.hasSize = true;
1265
+ item.loaded = true;
1266
+
1267
+ _mfpTrigger('ImageLoadComplete');
1268
+
1269
+ }
1270
+ else {
1271
+ // if image complete check fails 200 times (20 sec), we assume that there was an error.
1272
+ guard++;
1273
+ if(guard < 200) {
1274
+ setTimeout(onLoadComplete,100);
1275
+ } else {
1276
+ onLoadError();
1277
+ }
1278
+ }
1279
+ }
1280
+ },
1281
+
1282
+ // image error handler
1283
+ onLoadError = function() {
1284
+ if(item) {
1285
+ item.img.off('.mfploader');
1286
+ if(item === mfp.currItem){
1287
+ mfp._onImageHasSize(item);
1288
+ mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1289
+ }
1290
+
1291
+ item.hasSize = true;
1292
+ item.loaded = true;
1293
+ item.loadError = true;
1294
+ }
1295
+ },
1296
+ imgSt = mfp.st.image;
1297
+
1298
+
1299
+ var el = template.find('.mfp-img');
1300
+ if(el.length) {
1301
+ var img = document.createElement('img');
1302
+ img.className = 'mfp-img';
1303
+ if(item.el && item.el.find('img').length) {
1304
+ img.alt = item.el.find('img').attr('alt');
1305
+ }
1306
+ item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1307
+ img.src = item.src;
1308
+
1309
+ // without clone() "error" event is not firing when IMG is replaced by new IMG
1310
+ // TODO: find a way to avoid such cloning
1311
+ if(el.is('img')) {
1312
+ item.img = item.img.clone();
1313
+ }
1314
+
1315
+ img = item.img[0];
1316
+ if(img.naturalWidth > 0) {
1317
+ item.hasSize = true;
1318
+ } else if(!img.width) {
1319
+ item.hasSize = false;
1320
+ }
1321
+ }
1322
+
1323
+ mfp._parseMarkup(template, {
1324
+ title: _getTitle(item),
1325
+ img_replaceWith: item.img
1326
+ }, item);
1327
+
1328
+ mfp.resizeImage();
1329
+
1330
+ if(item.hasSize) {
1331
+ if(_imgInterval) clearInterval(_imgInterval);
1332
+
1333
+ if(item.loadError) {
1334
+ template.addClass('mfp-loading');
1335
+ mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1336
+ } else {
1337
+ template.removeClass('mfp-loading');
1338
+ mfp.updateStatus('ready');
1339
+ }
1340
+ return template;
1341
+ }
1342
+
1343
+ mfp.updateStatus('loading');
1344
+ item.loading = true;
1345
+
1346
+ if(!item.hasSize) {
1347
+ item.imgHidden = true;
1348
+ template.addClass('mfp-loading');
1349
+ mfp.findImageSize(item);
1350
+ }
1351
+
1352
+ return template;
1353
+ }
1354
+ }
1355
+ });
1356
+
1357
+ /*>>image*/
1358
+
1359
+ /*>>zoom*/
1360
+ var hasMozTransform,
1361
+ getHasMozTransform = function() {
1362
+ if(hasMozTransform === undefined) {
1363
+ hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1364
+ }
1365
+ return hasMozTransform;
1366
+ };
1367
+
1368
+ $.magnificPopup.registerModule('zoom', {
1369
+
1370
+ options: {
1371
+ enabled: false,
1372
+ easing: 'ease-in-out',
1373
+ duration: 300,
1374
+ opener: function(element) {
1375
+ return element.is('img') ? element : element.find('img');
1376
+ }
1377
+ },
1378
+
1379
+ proto: {
1380
+
1381
+ initZoom: function() {
1382
+ var zoomSt = mfp.st.zoom,
1383
+ ns = '.zoom',
1384
+ image;
1385
+
1386
+ if(!zoomSt.enabled || !mfp.supportsTransition) {
1387
+ return;
1388
+ }
1389
+
1390
+ var duration = zoomSt.duration,
1391
+ getElToAnimate = function(image) {
1392
+ var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1393
+ transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1394
+ cssObj = {
1395
+ position: 'fixed',
1396
+ zIndex: 9999,
1397
+ left: 0,
1398
+ top: 0,
1399
+ '-webkit-backface-visibility': 'hidden'
1400
+ },
1401
+ t = 'transition';
1402
+
1403
+ cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1404
+
1405
+ newImg.css(cssObj);
1406
+ return newImg;
1407
+ },
1408
+ showMainContent = function() {
1409
+ mfp.content.css('visibility', 'visible');
1410
+ },
1411
+ openTimeout,
1412
+ animatedImg;
1413
+
1414
+ _mfpOn('BuildControls'+ns, function() {
1415
+ if(mfp._allowZoom()) {
1416
+
1417
+ clearTimeout(openTimeout);
1418
+ mfp.content.css('visibility', 'hidden');
1419
+
1420
+ // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1421
+
1422
+ image = mfp._getItemToZoom();
1423
+
1424
+ if(!image) {
1425
+ showMainContent();
1426
+ return;
1427
+ }
1428
+
1429
+ animatedImg = getElToAnimate(image);
1430
+
1431
+ animatedImg.css( mfp._getOffset() );
1432
+
1433
+ mfp.wrap.append(animatedImg);
1434
+
1435
+ openTimeout = setTimeout(function() {
1436
+ animatedImg.css( mfp._getOffset( true ) );
1437
+ openTimeout = setTimeout(function() {
1438
+
1439
+ showMainContent();
1440
+
1441
+ setTimeout(function() {
1442
+ animatedImg.remove();
1443
+ image = animatedImg = null;
1444
+ _mfpTrigger('ZoomAnimationEnded');
1445
+ }, 16); // avoid blink when switching images
1446
+
1447
+ }, duration); // this timeout equals animation duration
1448
+
1449
+ }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1450
+
1451
+
1452
+ // Lots of timeouts...
1453
+ }
1454
+ });
1455
+ _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1456
+ if(mfp._allowZoom()) {
1457
+
1458
+ clearTimeout(openTimeout);
1459
+
1460
+ mfp.st.removalDelay = duration;
1461
+
1462
+ if(!image) {
1463
+ image = mfp._getItemToZoom();
1464
+ if(!image) {
1465
+ return;
1466
+ }
1467
+ animatedImg = getElToAnimate(image);
1468
+ }
1469
+
1470
+ animatedImg.css( mfp._getOffset(true) );
1471
+ mfp.wrap.append(animatedImg);
1472
+ mfp.content.css('visibility', 'hidden');
1473
+
1474
+ setTimeout(function() {
1475
+ animatedImg.css( mfp._getOffset() );
1476
+ }, 16);
1477
+ }
1478
+
1479
+ });
1480
+
1481
+ _mfpOn(CLOSE_EVENT+ns, function() {
1482
+ if(mfp._allowZoom()) {
1483
+ showMainContent();
1484
+ if(animatedImg) {
1485
+ animatedImg.remove();
1486
+ }
1487
+ image = null;
1488
+ }
1489
+ });
1490
+ },
1491
+
1492
+ _allowZoom: function() {
1493
+ return mfp.currItem.type === 'image';
1494
+ },
1495
+
1496
+ _getItemToZoom: function() {
1497
+ if(mfp.currItem.hasSize) {
1498
+ return mfp.currItem.img;
1499
+ } else {
1500
+ return false;
1501
+ }
1502
+ },
1503
+
1504
+ // Get element postion relative to viewport
1505
+ _getOffset: function(isLarge) {
1506
+ var el;
1507
+ if(isLarge) {
1508
+ el = mfp.currItem.img;
1509
+ } else {
1510
+ el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
1511
+ }
1512
+
1513
+ var offset = el.offset();
1514
+ var paddingTop = parseInt(el.css('padding-top'),10);
1515
+ var paddingBottom = parseInt(el.css('padding-bottom'),10);
1516
+ offset.top -= ( $(window).scrollTop() - paddingTop );
1517
+
1518
+
1519
+ /*
1520
+
1521
+ Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
1522
+
1523
+ */
1524
+ var obj = {
1525
+ width: el.width(),
1526
+ // fix Zepto height+padding issue
1527
+ height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
1528
+ };
1529
+
1530
+ // I hate to do this, but there is no another option
1531
+ if( getHasMozTransform() ) {
1532
+ obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
1533
+ } else {
1534
+ obj.left = offset.left;
1535
+ obj.top = offset.top;
1536
+ }
1537
+ return obj;
1538
+ }
1539
+
1540
+ }
1541
+ });
1542
+
1543
+
1544
+
1545
+ /*>>zoom*/
1546
+
1547
+ /*>>iframe*/
1548
+
1549
+ var IFRAME_NS = 'iframe',
1550
+ _emptyPage = '//about:blank',
1551
+
1552
+ _fixIframeBugs = function(isShowing) {
1553
+ if(mfp.currTemplate[IFRAME_NS]) {
1554
+ var el = mfp.currTemplate[IFRAME_NS].find('iframe');
1555
+ if(el.length) {
1556
+ // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
1557
+ if(!isShowing) {
1558
+ el[0].src = _emptyPage;
1559
+ }
1560
+
1561
+ // IE8 black screen bug fix
1562
+ if(mfp.isIE8) {
1563
+ el.css('display', isShowing ? 'block' : 'none');
1564
+ }
1565
+ }
1566
+ }
1567
+ };
1568
+
1569
+ $.magnificPopup.registerModule(IFRAME_NS, {
1570
+
1571
+ options: {
1572
+ markup: '<div class="mfp-iframe-scaler">'+
1573
+ '<div class="mfp-close"></div>'+
1574
+ '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
1575
+ '</div>',
1576
+
1577
+ srcAction: 'iframe_src',
1578
+
1579
+ // we don't care and support only one default type of URL by default
1580
+ patterns: {
1581
+ youtube: {
1582
+ index: 'youtube.com',
1583
+ id: 'v=',
1584
+ src: '//www.youtube.com/embed/%id%?autoplay=1'
1585
+ },
1586
+ vimeo: {
1587
+ index: 'vimeo.com/',
1588
+ id: '/',
1589
+ src: '//player.vimeo.com/video/%id%?autoplay=1'
1590
+ },
1591
+ gmaps: {
1592
+ index: '//maps.google.',
1593
+ src: '%id%&output=embed'
1594
+ }
1595
+ }
1596
+ },
1597
+
1598
+ proto: {
1599
+ initIframe: function() {
1600
+ mfp.types.push(IFRAME_NS);
1601
+
1602
+ _mfpOn('BeforeChange', function(e, prevType, newType) {
1603
+ if(prevType !== newType) {
1604
+ if(prevType === IFRAME_NS) {
1605
+ _fixIframeBugs(); // iframe if removed
1606
+ } else if(newType === IFRAME_NS) {
1607
+ _fixIframeBugs(true); // iframe is showing
1608
+ }
1609
+ }// else {
1610
+ // iframe source is switched, don't do anything
1611
+ //}
1612
+ });
1613
+
1614
+ _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
1615
+ _fixIframeBugs();
1616
+ });
1617
+ },
1618
+
1619
+ getIframe: function(item, template) {
1620
+ var embedSrc = item.src;
1621
+ var iframeSt = mfp.st.iframe;
1622
+
1623
+ $.each(iframeSt.patterns, function() {
1624
+ if(embedSrc.indexOf( this.index ) > -1) {
1625
+ if(this.id) {
1626
+ if(typeof this.id === 'string') {
1627
+ embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
1628
+ } else {
1629
+ embedSrc = this.id.call( this, embedSrc );
1630
+ }
1631
+ }
1632
+ embedSrc = this.src.replace('%id%', embedSrc );
1633
+ return false; // break;
1634
+ }
1635
+ });
1636
+
1637
+ var dataObj = {};
1638
+ if(iframeSt.srcAction) {
1639
+ dataObj[iframeSt.srcAction] = embedSrc;
1640
+ }
1641
+ mfp._parseMarkup(template, dataObj, item);
1642
+
1643
+ mfp.updateStatus('ready');
1644
+
1645
+ return template;
1646
+ }
1647
+ }
1648
+ });
1649
+
1650
+
1651
+
1652
+ /*>>iframe*/
1653
+
1654
+ /*>>gallery*/
1655
+ /**
1656
+ * Get looped index depending on number of slides
1657
+ */
1658
+ var _getLoopedId = function(index) {
1659
+ var numSlides = mfp.items.length;
1660
+ if(index > numSlides - 1) {
1661
+ return index - numSlides;
1662
+ } else if(index < 0) {
1663
+ return numSlides + index;
1664
+ }
1665
+ return index;
1666
+ },
1667
+ _replaceCurrTotal = function(text, curr, total) {
1668
+ return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
1669
+ };
1670
+
1671
+ $.magnificPopup.registerModule('gallery', {
1672
+
1673
+ options: {
1674
+ enabled: false,
1675
+ arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
1676
+ preload: [0,2],
1677
+ navigateByImgClick: true,
1678
+ arrows: true,
1679
+
1680
+ tPrev: 'Previous (Left arrow key)',
1681
+ tNext: 'Next (Right arrow key)',
1682
+ tCounter: '%curr% of %total%'
1683
+ },
1684
+
1685
+ proto: {
1686
+ initGallery: function() {
1687
+
1688
+ var gSt = mfp.st.gallery,
1689
+ ns = '.mfp-gallery';
1690
+
1691
+ mfp.direction = true; // true - next, false - prev
1692
+
1693
+ if(!gSt || !gSt.enabled ) return false;
1694
+
1695
+ _wrapClasses += ' mfp-gallery';
1696
+
1697
+ _mfpOn(OPEN_EVENT+ns, function() {
1698
+
1699
+ if(gSt.navigateByImgClick) {
1700
+ mfp.wrap.on('click'+ns, '.mfp-img', function() {
1701
+ if(mfp.items.length > 1) {
1702
+ mfp.next();
1703
+ return false;
1704
+ }
1705
+ });
1706
+ }
1707
+
1708
+ _document.on('keydown'+ns, function(e) {
1709
+ if (e.keyCode === 37) {
1710
+ mfp.prev();
1711
+ } else if (e.keyCode === 39) {
1712
+ mfp.next();
1713
+ }
1714
+ });
1715
+ });
1716
+
1717
+ _mfpOn('UpdateStatus'+ns, function(e, data) {
1718
+ if(data.text) {
1719
+ data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
1720
+ }
1721
+ });
1722
+
1723
+ _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
1724
+ var l = mfp.items.length;
1725
+ values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
1726
+ });
1727
+
1728
+ _mfpOn('BuildControls' + ns, function() {
1729
+ if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
1730
+ var markup = gSt.arrowMarkup,
1731
+ arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1732
+ arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
1733
+
1734
+ arrowLeft.click(function() {
1735
+ mfp.prev();
1736
+ });
1737
+ arrowRight.click(function() {
1738
+ mfp.next();
1739
+ });
1740
+
1741
+ mfp.container.append(arrowLeft.add(arrowRight));
1742
+ }
1743
+ });
1744
+
1745
+ _mfpOn(CHANGE_EVENT+ns, function() {
1746
+ if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
1747
+
1748
+ mfp._preloadTimeout = setTimeout(function() {
1749
+ mfp.preloadNearbyImages();
1750
+ mfp._preloadTimeout = null;
1751
+ }, 16);
1752
+ });
1753
+
1754
+
1755
+ _mfpOn(CLOSE_EVENT+ns, function() {
1756
+ _document.off(ns);
1757
+ mfp.wrap.off('click'+ns);
1758
+ mfp.arrowRight = mfp.arrowLeft = null;
1759
+ });
1760
+
1761
+ },
1762
+ next: function() {
1763
+ mfp.direction = true;
1764
+ mfp.index = _getLoopedId(mfp.index + 1);
1765
+ mfp.updateItemHTML();
1766
+ },
1767
+ prev: function() {
1768
+ mfp.direction = false;
1769
+ mfp.index = _getLoopedId(mfp.index - 1);
1770
+ mfp.updateItemHTML();
1771
+ },
1772
+ goTo: function(newIndex) {
1773
+ mfp.direction = (newIndex >= mfp.index);
1774
+ mfp.index = newIndex;
1775
+ mfp.updateItemHTML();
1776
+ },
1777
+ preloadNearbyImages: function() {
1778
+ var p = mfp.st.gallery.preload,
1779
+ preloadBefore = Math.min(p[0], mfp.items.length),
1780
+ preloadAfter = Math.min(p[1], mfp.items.length),
1781
+ i;
1782
+
1783
+ for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
1784
+ mfp._preloadItem(mfp.index+i);
1785
+ }
1786
+ for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
1787
+ mfp._preloadItem(mfp.index-i);
1788
+ }
1789
+ },
1790
+ _preloadItem: function(index) {
1791
+ index = _getLoopedId(index);
1792
+
1793
+ if(mfp.items[index].preloaded) {
1794
+ return;
1795
+ }
1796
+
1797
+ var item = mfp.items[index];
1798
+ if(!item.parsed) {
1799
+ item = mfp.parseEl( index );
1800
+ }
1801
+
1802
+ _mfpTrigger('LazyLoad', item);
1803
+
1804
+ if(item.type === 'image') {
1805
+ item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
1806
+ item.hasSize = true;
1807
+ }).on('error.mfploader', function() {
1808
+ item.hasSize = true;
1809
+ item.loadError = true;
1810
+ _mfpTrigger('LazyLoadError', item);
1811
+ }).attr('src', item.src);
1812
+ }
1813
+
1814
+
1815
+ item.preloaded = true;
1816
+ }
1817
+ }
1818
+ });
1819
+
1820
+ /*>>gallery*/
1821
+
1822
+ /*>>retina*/
1823
+
1824
+ var RETINA_NS = 'retina';
1825
+
1826
+ $.magnificPopup.registerModule(RETINA_NS, {
1827
+ options: {
1828
+ replaceSrc: function(item) {
1829
+ return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
1830
+ },
1831
+ ratio: 1 // Function or number. Set to 1 to disable.
1832
+ },
1833
+ proto: {
1834
+ initRetina: function() {
1835
+ if(window.devicePixelRatio > 1) {
1836
+
1837
+ var st = mfp.st.retina,
1838
+ ratio = st.ratio;
1839
+
1840
+ ratio = !isNaN(ratio) ? ratio : ratio();
1841
+
1842
+ if(ratio > 1) {
1843
+ _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
1844
+ item.img.css({
1845
+ 'max-width': item.img[0].naturalWidth / ratio,
1846
+ 'width': '100%'
1847
+ });
1848
+ });
1849
+ _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
1850
+ item.src = st.replaceSrc(item, ratio);
1851
+ });
1852
+ }
1853
+ }
1854
+
1855
+ }
1856
+ }
1857
+ });
1858
+
1859
+ /*>>retina*/
1860
+ _checkInstance(); }));
assets/magnific/jquery.magnific-popup.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! Magnific Popup - v1.1.0 - 2016-02-20
2
+ * http://dimsemenov.com/plugins/magnific-popup/
3
+ * Copyright (c) 2016 Dmitry Semenov; */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
assets/magnific/magnific-popup.css ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Magnific Popup CSS */
2
+ .mfp-bg {
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ z-index: 1042;
8
+ overflow: hidden;
9
+ position: fixed;
10
+ background: #0b0b0b;
11
+ opacity: 0.8; }
12
+
13
+ .mfp-wrap {
14
+ top: 0;
15
+ left: 0;
16
+ width: 100%;
17
+ height: 100%;
18
+ z-index: 1043;
19
+ position: fixed;
20
+ outline: none !important;
21
+ -webkit-backface-visibility: hidden; }
22
+
23
+ .mfp-container {
24
+ text-align: center;
25
+ position: absolute;
26
+ width: 100%;
27
+ height: 100%;
28
+ left: 0;
29
+ top: 0;
30
+ padding: 0 8px;
31
+ box-sizing: border-box; }
32
+
33
+ .mfp-container:before {
34
+ content: '';
35
+ display: inline-block;
36
+ height: 100%;
37
+ vertical-align: middle; }
38
+
39
+ .mfp-align-top .mfp-container:before {
40
+ display: none; }
41
+
42
+ .mfp-content {
43
+ position: relative;
44
+ display: inline-block;
45
+ vertical-align: middle;
46
+ margin: 0 auto;
47
+ text-align: left;
48
+ z-index: 1045; }
49
+
50
+ .mfp-inline-holder .mfp-content,
51
+ .mfp-ajax-holder .mfp-content {
52
+ max-width: 80%;
53
+ max-height: 80%;
54
+ cursor: auto;
55
+ }
56
+
57
+ .mfp-inline-holder .mfp-content {
58
+ position: relative;
59
+ background: #fff;
60
+ padding: 20px;
61
+ width: auto;
62
+ max-width: 500px;
63
+ margin: 20px auto;
64
+ }
65
+
66
+ .mfp-ajax-cur {
67
+ cursor: progress; }
68
+
69
+ .mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
70
+ cursor: -moz-zoom-out;
71
+ cursor: -webkit-zoom-out;
72
+ cursor: zoom-out; }
73
+
74
+ .mfp-zoom {
75
+ cursor: pointer;
76
+ cursor: -webkit-zoom-in;
77
+ cursor: -moz-zoom-in;
78
+ cursor: zoom-in; }
79
+
80
+ .mfp-auto-cursor .mfp-content {
81
+ cursor: auto; }
82
+
83
+ .mfp-close,
84
+ .mfp-arrow,
85
+ .mfp-preloader,
86
+ .mfp-counter {
87
+ -webkit-user-select: none;
88
+ -moz-user-select: none;
89
+ user-select: none; }
90
+
91
+ .mfp-loading.mfp-figure {
92
+ display: none; }
93
+
94
+ .mfp-hide {
95
+ display: none !important; }
96
+
97
+ .mfp-preloader {
98
+ color: #CCC;
99
+ position: absolute;
100
+ top: 50%;
101
+ width: auto;
102
+ text-align: center;
103
+ margin-top: -0.8em;
104
+ left: 8px;
105
+ right: 8px;
106
+ z-index: 1044; }
107
+ .mfp-preloader a {
108
+ color: #CCC; }
109
+ .mfp-preloader a:hover {
110
+ color: #FFF; }
111
+
112
+ .mfp-s-ready .mfp-preloader {
113
+ display: none; }
114
+
115
+ .mfp-s-error .mfp-content {
116
+ display: none; }
117
+
118
+ button.mfp-close,
119
+ button.mfp-arrow {
120
+ overflow: visible;
121
+ cursor: pointer;
122
+ background: transparent;
123
+ border: 0;
124
+ -webkit-appearance: none;
125
+ display: block;
126
+ outline: none;
127
+ padding: 0;
128
+ z-index: 1046;
129
+ box-shadow: none;
130
+ touch-action: manipulation; }
131
+
132
+ button::-moz-focus-inner {
133
+ padding: 0;
134
+ border: 0; }
135
+
136
+ .mfp-close {
137
+ width: 44px;
138
+ height: 44px;
139
+ line-height: 44px;
140
+ position: absolute;
141
+ right: 0;
142
+ top: 0;
143
+ text-decoration: none;
144
+ text-align: center;
145
+ opacity: 0.65;
146
+ padding: 0 0 18px 10px;
147
+ color: #FFF;
148
+ font-style: normal;
149
+ font-size: 28px;
150
+ font-family: Arial, Baskerville, monospace; }
151
+ .mfp-close:hover,
152
+ .mfp-close:focus {
153
+ opacity: 1; }
154
+ .mfp-close:active {
155
+ top: 1px; }
156
+
157
+ .mfp-close-btn-in .mfp-close {
158
+ color: #333; }
159
+
160
+ .mfp-image-holder .mfp-close,
161
+ .mfp-iframe-holder .mfp-close {
162
+ color: #FFF;
163
+ right: -6px;
164
+ text-align: right;
165
+ padding-right: 6px;
166
+ width: 100%; }
167
+
168
+ .mfp-counter {
169
+ position: absolute;
170
+ top: 0;
171
+ right: 0;
172
+ color: #CCC;
173
+ font-size: 12px;
174
+ line-height: 18px;
175
+ white-space: nowrap; }
176
+
177
+ .mfp-arrow {
178
+ position: absolute;
179
+ opacity: 0.65;
180
+ margin: 0;
181
+ top: 50%;
182
+ margin-top: -55px;
183
+ padding: 0;
184
+ width: 90px;
185
+ height: 110px;
186
+ -webkit-tap-highlight-color: transparent; }
187
+ .mfp-arrow:active {
188
+ margin-top: -54px; }
189
+ .mfp-arrow:hover,
190
+ .mfp-arrow:focus {
191
+ opacity: 1; }
192
+ .mfp-arrow:before,
193
+ .mfp-arrow:after {
194
+ content: '';
195
+ display: block;
196
+ width: 0;
197
+ height: 0;
198
+ position: absolute;
199
+ left: 0;
200
+ top: 0;
201
+ margin-top: 35px;
202
+ margin-left: 35px;
203
+ border: medium inset transparent; }
204
+ .mfp-arrow:after {
205
+ border-top-width: 13px;
206
+ border-bottom-width: 13px;
207
+ top: 8px; }
208
+ .mfp-arrow:before {
209
+ border-top-width: 21px;
210
+ border-bottom-width: 21px;
211
+ opacity: 0.7; }
212
+
213
+ .mfp-arrow-left {
214
+ left: 0; }
215
+ .mfp-arrow-left:after {
216
+ border-right: 17px solid #FFF;
217
+ margin-left: 31px; }
218
+ .mfp-arrow-left:before {
219
+ margin-left: 25px;
220
+ border-right: 27px solid #3F3F3F; }
221
+
222
+ .mfp-arrow-right {
223
+ right: 0; }
224
+ .mfp-arrow-right:after {
225
+ border-left: 17px solid #FFF;
226
+ margin-left: 39px; }
227
+ .mfp-arrow-right:before {
228
+ border-left: 27px solid #3F3F3F; }
229
+
230
+ .mfp-iframe-holder {
231
+ padding-top: 40px;
232
+ padding-bottom: 40px; }
233
+ .mfp-iframe-holder .mfp-content {
234
+ line-height: 0;
235
+ width: 100%;
236
+ max-width: 900px; }
237
+ .mfp-iframe-holder .mfp-close {
238
+ top: -40px; }
239
+
240
+ .mfp-iframe-scaler {
241
+ width: 100%;
242
+ height: 0;
243
+ overflow: hidden;
244
+ padding-top: 56.25%; }
245
+ .mfp-iframe-scaler iframe {
246
+ position: absolute;
247
+ display: block;
248
+ top: 0;
249
+ left: 0;
250
+ width: 100%;
251
+ height: 100%;
252
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
253
+ background: #000; }
254
+
255
+ /* Main image in popup */
256
+ img.mfp-img {
257
+ width: auto;
258
+ max-width: 100%;
259
+ height: auto;
260
+ display: block;
261
+ line-height: 0;
262
+ box-sizing: border-box;
263
+ padding: 40px 0 40px;
264
+ margin: 0 auto; }
265
+
266
+ /* The shadow behind the image */
267
+ .mfp-figure {
268
+ line-height: 0; }
269
+ .mfp-figure:after {
270
+ content: '';
271
+ position: absolute;
272
+ left: 0;
273
+ top: 40px;
274
+ bottom: 40px;
275
+ display: block;
276
+ right: 0;
277
+ width: auto;
278
+ height: auto;
279
+ z-index: -1;
280
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
281
+ background: #444; }
282
+ .mfp-figure small {
283
+ color: #BDBDBD;
284
+ display: block;
285
+ font-size: 12px;
286
+ line-height: 14px; }
287
+ .mfp-figure figure {
288
+ margin: 0; }
289
+
290
+ .mfp-bottom-bar {
291
+ margin-top: -36px;
292
+ position: absolute;
293
+ top: 100%;
294
+ left: 0;
295
+ width: 100%;
296
+ cursor: auto; }
297
+
298
+ .mfp-title {
299
+ text-align: left;
300
+ line-height: 18px;
301
+ color: #F3F3F3;
302
+ word-wrap: break-word;
303
+ padding-right: 36px; }
304
+
305
+ .mfp-image-holder .mfp-content {
306
+ max-width: 100%; }
307
+
308
+ .mfp-gallery .mfp-image-holder .mfp-figure {
309
+ cursor: pointer; }
310
+
311
+ @media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
312
+ /**
313
+ * Remove all paddings around the image on small screen
314
+ */
315
+ .mfp-img-mobile .mfp-image-holder {
316
+ padding-left: 0;
317
+ padding-right: 0; }
318
+ .mfp-img-mobile img.mfp-img {
319
+ padding: 0; }
320
+ .mfp-img-mobile .mfp-figure:after {
321
+ top: 0;
322
+ bottom: 0; }
323
+ .mfp-img-mobile .mfp-figure small {
324
+ display: inline;
325
+ margin-left: 5px; }
326
+ .mfp-img-mobile .mfp-bottom-bar {
327
+ background: rgba(0, 0, 0, 0.6);
328
+ bottom: 0;
329
+ margin: 0;
330
+ top: auto;
331
+ padding: 3px 5px;
332
+ position: fixed;
333
+ box-sizing: border-box; }
334
+ .mfp-img-mobile .mfp-bottom-bar:empty {
335
+ padding: 0; }
336
+ .mfp-img-mobile .mfp-counter {
337
+ right: 5px;
338
+ top: 3px; }
339
+ .mfp-img-mobile .mfp-close {
340
+ top: 0;
341
+ right: 0;
342
+ width: 35px;
343
+ height: 35px;
344
+ line-height: 35px;
345
+ background: rgba(0, 0, 0, 0.6);
346
+ position: fixed;
347
+ text-align: center;
348
+ padding: 0; } }
349
+
350
+ @media all and (max-width: 900px) {
351
+ .mfp-arrow {
352
+ -webkit-transform: scale(0.75);
353
+ transform: scale(0.75); }
354
+ .mfp-arrow-left {
355
+ -webkit-transform-origin: 0;
356
+ transform-origin: 0; }
357
+ .mfp-arrow-right {
358
+ -webkit-transform-origin: 100%;
359
+ transform-origin: 100%; }
360
+ .mfp-container {
361
+ padding-left: 6px;
362
+ padding-right: 6px; } }
assets/magnific/magnific-popup.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .mfp-bg,.mfp-container,.mfp-wrap{width:100%;left:0;top:0;height:100%}.mfp-arrow:after,.mfp-arrow:before,.mfp-container:before,.mfp-figure:after{content:''}.mfp-bg{z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8}.mfp-wrap{z-index:1043;position:fixed;outline:0!important;-webkit-backface-visibility:hidden}.mfp-container{text-align:center;position:absolute;padding:0 8px;box-sizing:border-box}.mfp-container:before{display:inline-block;height:100%;vertical-align:middle}.mfp-align-top .mfp-container:before{display:none}.mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.mfp-ajax-holder .mfp-content,.mfp-inline-holder .mfp-content{max-width:80%;max-height:80%;cursor:auto}.mfp-inline-holder .mfp-content{position:relative;background:#fff;padding:20px;width:auto;max-width:500px;margin:20px auto}.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:-moz-zoom-out;cursor:-webkit-zoom-out;cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}.mfp-arrow,.mfp-close,.mfp-counter,.mfp-preloader{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none!important}.mfp-preloader{color:#CCC;position:absolute;top:50%;width:auto;text-align:center;margin-top:-.8em;left:8px;right:8px;z-index:1044}.mfp-preloader a{color:#CCC}.mfp-close,.mfp-preloader a:hover{color:#FFF}.mfp-s-error .mfp-content,.mfp-s-ready .mfp-preloader{display:none}button.mfp-arrow,button.mfp-close{overflow:visible;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;display:block;outline:0;padding:0;z-index:1046;box-shadow:none;touch-action:manipulation}.mfp-figure:after,.mfp-iframe-scaler iframe{box-shadow:0 0 8px rgba(0,0,0,.6);position:absolute;left:0}button::-moz-focus-inner{padding:0;border:0}.mfp-close{width:44px;height:44px;line-height:44px;position:absolute;right:0;top:0;text-decoration:none;text-align:center;opacity:.65;padding:0 0 18px 10px;font-style:normal;font-size:28px;font-family:Arial,Baskerville,monospace}.mfp-close:focus,.mfp-close:hover{opacity:1}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-iframe-holder .mfp-close,.mfp-image-holder .mfp-close{color:#FFF;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#CCC;font-size:12px;line-height:18px;white-space:nowrap}.mfp-figure,img.mfp-img{line-height:0}.mfp-arrow{position:absolute;opacity:.65;margin:-55px 0 0;top:50%;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:transparent}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:focus,.mfp-arrow:hover{opacity:1}.mfp-arrow:after,.mfp-arrow:before{display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #FFF;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3F3F3F}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #FFF;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3F3F3F}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-image-holder .mfp-content,img.mfp-img{max-width:100%}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{display:block;top:0;width:100%;height:100%;background:#000}.mfp-figure:after,img.mfp-img{width:auto;height:auto;display:block}img.mfp-img{box-sizing:border-box;padding:40px 0;margin:0 auto}.mfp-figure:after{top:40px;bottom:40px;right:0;z-index:-1;background:#444}.mfp-figure small{color:#BDBDBD;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.mfp-title{text-align:left;line-height:18px;color:#F3F3F3;word-wrap:break-word;padding-right:36px}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width:800px) and (orientation:landscape),screen and (max-height:300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,.6);position:fixed;text-align:center;padding:0}}@media all and (max-width:900px){.mfp-arrow{-webkit-transform:scale(.75);transform:scale(.75)}.mfp-arrow-left{-webkit-transform-origin:0;transform-origin:0}.mfp-arrow-right{-webkit-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}
assets/masonry/masonry.pkgd.js ADDED
@@ -0,0 +1,2502 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Masonry PACKAGED v4.2.1
3
+ * Cascading grid layout library
4
+ * https://masonry.desandro.com
5
+ * MIT License
6
+ * by David DeSandro
7
+ */
8
+
9
+ /**
10
+ * Bridget makes jQuery widgets
11
+ * v2.0.1
12
+ * MIT license
13
+ */
14
+
15
+ /* jshint browser: true, strict: true, undef: true, unused: true */
16
+
17
+ ( function( window, factory ) {
18
+ // universal module definition
19
+ /*jshint strict: false */ /* globals define, module, require */
20
+ if ( typeof define == 'function' && define.amd ) {
21
+ // AMD
22
+ define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) {
23
+ return factory( window, jQuery );
24
+ });
25
+ } else if ( typeof module == 'object' && module.exports ) {
26
+ // CommonJS
27
+ module.exports = factory(
28
+ window,
29
+ require('jquery')
30
+ );
31
+ } else {
32
+ // browser global
33
+ window.jQueryBridget = factory(
34
+ window,
35
+ window.jQuery
36
+ );
37
+ }
38
+
39
+ }( window, function factory( window, jQuery ) {
40
+ 'use strict';
41
+
42
+ // ----- utils ----- //
43
+
44
+ var arraySlice = Array.prototype.slice;
45
+
46
+ // helper function for logging errors
47
+ // $.error breaks jQuery chaining
48
+ var console = window.console;
49
+ var logError = typeof console == 'undefined' ? function() {} :
50
+ function( message ) {
51
+ console.error( message );
52
+ };
53
+
54
+ // ----- jQueryBridget ----- //
55
+
56
+ function jQueryBridget( namespace, PluginClass, $ ) {
57
+ $ = $ || jQuery || window.jQuery;
58
+ if ( !$ ) {
59
+ return;
60
+ }
61
+
62
+ // add option method -> $().plugin('option', {...})
63
+ if ( !PluginClass.prototype.option ) {
64
+ // option setter
65
+ PluginClass.prototype.option = function( opts ) {
66
+ // bail out if not an object
67
+ if ( !$.isPlainObject( opts ) ){
68
+ return;
69
+ }
70
+ this.options = $.extend( true, this.options, opts );
71
+ };
72
+ }
73
+
74
+ // make jQuery plugin
75
+ $.fn[ namespace ] = function( arg0 /*, arg1 */ ) {
76
+ if ( typeof arg0 == 'string' ) {
77
+ // method call $().plugin( 'methodName', { options } )
78
+ // shift arguments by 1
79
+ var args = arraySlice.call( arguments, 1 );
80
+ return methodCall( this, arg0, args );
81
+ }
82
+ // just $().plugin({ options })
83
+ plainCall( this, arg0 );
84
+ return this;
85
+ };
86
+
87
+ // $().plugin('methodName')
88
+ function methodCall( $elems, methodName, args ) {
89
+ var returnValue;
90
+ var pluginMethodStr = '$().' + namespace + '("' + methodName + '")';
91
+
92
+ $elems.each( function( i, elem ) {
93
+ // get instance
94
+ var instance = $.data( elem, namespace );
95
+ if ( !instance ) {
96
+ logError( namespace + ' not initialized. Cannot call methods, i.e. ' +
97
+ pluginMethodStr );
98
+ return;
99
+ }
100
+
101
+ var method = instance[ methodName ];
102
+ if ( !method || methodName.charAt(0) == '_' ) {
103
+ logError( pluginMethodStr + ' is not a valid method' );
104
+ return;
105
+ }
106
+
107
+ // apply method, get return value
108
+ var value = method.apply( instance, args );
109
+ // set return value if value is returned, use only first value
110
+ returnValue = returnValue === undefined ? value : returnValue;
111
+ });
112
+
113
+ return returnValue !== undefined ? returnValue : $elems;
114
+ }
115
+
116
+ function plainCall( $elems, options ) {
117
+ $elems.each( function( i, elem ) {
118
+ var instance = $.data( elem, namespace );
119
+ if ( instance ) {
120
+ // set options & init
121
+ instance.option( options );
122
+ instance._init();
123
+ } else {
124
+ // initialize new instance
125
+ instance = new PluginClass( elem, options );
126
+ $.data( elem, namespace, instance );
127
+ }
128
+ });
129
+ }
130
+
131
+ updateJQuery( $ );
132
+
133
+ }
134
+
135
+ // ----- updateJQuery ----- //
136
+
137
+ // set $.bridget for v1 backwards compatibility
138
+ function updateJQuery( $ ) {
139
+ if ( !$ || ( $ && $.bridget ) ) {
140
+ return;
141
+ }
142
+ $.bridget = jQueryBridget;
143
+ }
144
+
145
+ updateJQuery( jQuery || window.jQuery );
146
+
147
+ // ----- ----- //
148
+
149
+ return jQueryBridget;
150
+
151
+ }));
152
+
153
+ /**
154
+ * EvEmitter v1.1.0
155
+ * Lil' event emitter
156
+ * MIT License
157
+ */
158
+
159
+ /* jshint unused: true, undef: true, strict: true */
160
+
161
+ ( function( global, factory ) {
162
+ // universal module definition
163
+ /* jshint strict: false */ /* globals define, module, window */
164
+ if ( typeof define == 'function' && define.amd ) {
165
+ // AMD - RequireJS
166
+ define( 'ev-emitter/ev-emitter',factory );
167
+ } else if ( typeof module == 'object' && module.exports ) {
168
+ // CommonJS - Browserify, Webpack
169
+ module.exports = factory();
170
+ } else {
171
+ // Browser globals
172
+ global.EvEmitter = factory();
173
+ }
174
+
175
+ }( typeof window != 'undefined' ? window : this, function() {
176
+
177
+
178
+
179
+ function EvEmitter() {}
180
+
181
+ var proto = EvEmitter.prototype;
182
+
183
+ proto.on = function( eventName, listener ) {
184
+ if ( !eventName || !listener ) {
185
+ return;
186
+ }
187
+ // set events hash
188
+ var events = this._events = this._events || {};
189
+ // set listeners array
190
+ var listeners = events[ eventName ] = events[ eventName ] || [];
191
+ // only add once
192
+ if ( listeners.indexOf( listener ) == -1 ) {
193
+ listeners.push( listener );
194
+ }
195
+
196
+ return this;
197
+ };
198
+
199
+ proto.once = function( eventName, listener ) {
200
+ if ( !eventName || !listener ) {
201
+ return;
202
+ }
203
+ // add event
204
+ this.on( eventName, listener );
205
+ // set once flag
206
+ // set onceEvents hash
207
+ var onceEvents = this._onceEvents = this._onceEvents || {};
208
+ // set onceListeners object
209
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
210
+ // set flag
211
+ onceListeners[ listener ] = true;
212
+
213
+ return this;
214
+ };
215
+
216
+ proto.off = function( eventName, listener ) {
217
+ var listeners = this._events && this._events[ eventName ];
218
+ if ( !listeners || !listeners.length ) {
219
+ return;
220
+ }
221
+ var index = listeners.indexOf( listener );
222
+ if ( index != -1 ) {
223
+ listeners.splice( index, 1 );
224
+ }
225
+
226
+ return this;
227
+ };
228
+
229
+ proto.emitEvent = function( eventName, args ) {
230
+ var listeners = this._events && this._events[ eventName ];
231
+ if ( !listeners || !listeners.length ) {
232
+ return;
233
+ }
234
+ // copy over to avoid interference if .off() in listener
235
+ listeners = listeners.slice(0);
236
+ args = args || [];
237
+ // once stuff
238
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
239
+
240
+ for ( var i=0; i < listeners.length; i++ ) {
241
+ var listener = listeners[i]
242
+ var isOnce = onceListeners && onceListeners[ listener ];
243
+ if ( isOnce ) {
244
+ // remove listener
245
+ // remove before trigger to prevent recursion
246
+ this.off( eventName, listener );
247
+ // unset once flag
248
+ delete onceListeners[ listener ];
249
+ }
250
+ // trigger listener
251
+ listener.apply( this, args );
252
+ }
253
+
254
+ return this;
255
+ };
256
+
257
+ proto.allOff = function() {
258
+ delete this._events;
259
+ delete this._onceEvents;
260
+ };
261
+
262
+ return EvEmitter;
263
+
264
+ }));
265
+
266
+ /*!
267
+ * getSize v2.0.2
268
+ * measure size of elements
269
+ * MIT license
270
+ */
271
+
272
+ /*jshint browser: true, strict: true, undef: true, unused: true */
273
+ /*global define: false, module: false, console: false */
274
+
275
+ ( function( window, factory ) {
276
+ 'use strict';
277
+
278
+ if ( typeof define == 'function' && define.amd ) {
279
+ // AMD
280
+ define( 'get-size/get-size',[],function() {
281
+ return factory();
282
+ });
283
+ } else if ( typeof module == 'object' && module.exports ) {
284
+ // CommonJS
285
+ module.exports = factory();
286
+ } else {
287
+ // browser global
288
+ window.getSize = factory();
289
+ }
290
+
291
+ })( window, function factory() {
292
+ 'use strict';
293
+
294
+ // -------------------------- helpers -------------------------- //
295
+
296
+ // get a number from a string, not a percentage
297
+ function getStyleSize( value ) {
298
+ var num = parseFloat( value );
299
+ // not a percent like '100%', and a number
300
+ var isValid = value.indexOf('%') == -1 && !isNaN( num );
301
+ return isValid && num;
302
+ }
303
+
304
+ function noop() {}
305
+
306
+ var logError = typeof console == 'undefined' ? noop :
307
+ function( message ) {
308
+ console.error( message );
309
+ };
310
+
311
+ // -------------------------- measurements -------------------------- //
312
+
313
+ var measurements = [
314
+ 'paddingLeft',
315
+ 'paddingRight',
316
+ 'paddingTop',
317
+ 'paddingBottom',
318
+ 'marginLeft',
319
+ 'marginRight',
320
+ 'marginTop',
321
+ 'marginBottom',
322
+ 'borderLeftWidth',
323
+ 'borderRightWidth',
324
+ 'borderTopWidth',
325
+ 'borderBottomWidth'
326
+ ];
327
+
328
+ var measurementsLength = measurements.length;
329
+
330
+ function getZeroSize() {
331
+ var size = {
332
+ width: 0,
333
+ height: 0,
334
+ innerWidth: 0,
335
+ innerHeight: 0,
336
+ outerWidth: 0,
337
+ outerHeight: 0
338
+ };
339
+ for ( var i=0; i < measurementsLength; i++ ) {
340
+ var measurement = measurements[i];
341
+ size[ measurement ] = 0;
342
+ }
343
+ return size;
344
+ }
345
+
346
+ // -------------------------- getStyle -------------------------- //
347
+
348
+ /**
349
+ * getStyle, get style of element, check for Firefox bug
350
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
351
+ */
352
+ function getStyle( elem ) {
353
+ var style = getComputedStyle( elem );
354
+ if ( !style ) {
355
+ logError( 'Style returned ' + style +
356
+ '. Are you running this code in a hidden iframe on Firefox? ' +
357
+ 'See http://bit.ly/getsizebug1' );
358
+ }
359
+ return style;
360
+ }
361
+
362
+ // -------------------------- setup -------------------------- //
363
+
364
+ var isSetup = false;
365
+
366
+ var isBoxSizeOuter;
367
+
368
+ /**
369
+ * setup
370
+ * check isBoxSizerOuter
371
+ * do on first getSize() rather than on page load for Firefox bug
372
+ */
373
+ function setup() {
374
+ // setup once
375
+ if ( isSetup ) {
376
+ return;
377
+ }
378
+ isSetup = true;
379
+
380
+ // -------------------------- box sizing -------------------------- //
381
+
382
+ /**
383
+ * WebKit measures the outer-width on style.width on border-box elems
384
+ * IE & Firefox<29 measures the inner-width
385
+ */
386
+ var div = document.createElement('div');
387
+ div.style.width = '200px';
388
+ div.style.padding = '1px 2px 3px 4px';
389
+ div.style.borderStyle = 'solid';
390
+ div.style.borderWidth = '1px 2px 3px 4px';
391
+ div.style.boxSizing = 'border-box';
392
+
393
+ var body = document.body || document.documentElement;
394
+ body.appendChild( div );
395
+ var style = getStyle( div );
396
+
397
+ getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;
398
+ body.removeChild( div );
399
+
400
+ }
401
+
402
+ // -------------------------- getSize -------------------------- //
403
+
404
+ function getSize( elem ) {
405
+ setup();
406
+
407
+ // use querySeletor if elem is string
408
+ if ( typeof elem == 'string' ) {
409
+ elem = document.querySelector( elem );
410
+ }
411
+
412
+ // do not proceed on non-objects
413
+ if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
414
+ return;
415
+ }
416
+
417
+ var style = getStyle( elem );
418
+
419
+ // if hidden, everything is 0
420
+ if ( style.display == 'none' ) {
421
+ return getZeroSize();
422
+ }
423
+
424
+ var size = {};
425
+ size.width = elem.offsetWidth;
426
+ size.height = elem.offsetHeight;
427
+
428
+ var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
429
+
430
+ // get all measurements
431
+ for ( var i=0; i < measurementsLength; i++ ) {
432
+ var measurement = measurements[i];
433
+ var value = style[ measurement ];
434
+ var num = parseFloat( value );
435
+ // any 'auto', 'medium' value will be 0
436
+ size[ measurement ] = !isNaN( num ) ? num : 0;
437
+ }
438
+
439
+ var paddingWidth = size.paddingLeft + size.paddingRight;
440
+ var paddingHeight = size.paddingTop + size.paddingBottom;
441
+ var marginWidth = size.marginLeft + size.marginRight;
442
+ var marginHeight = size.marginTop + size.marginBottom;
443
+ var borderWidth = size.borderLeftWidth + size.borderRightWidth;
444
+ var borderHeight = size.borderTopWidth + size.borderBottomWidth;
445
+
446
+ var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
447
+
448
+ // overwrite width and height if we can get it from style
449
+ var styleWidth = getStyleSize( style.width );
450
+ if ( styleWidth !== false ) {
451
+ size.width = styleWidth +
452
+ // add padding and border unless it's already including it
453
+ ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
454
+ }
455
+
456
+ var styleHeight = getStyleSize( style.height );
457
+ if ( styleHeight !== false ) {
458
+ size.height = styleHeight +
459
+ // add padding and border unless it's already including it
460
+ ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
461
+ }
462
+
463
+ size.innerWidth = size.width - ( paddingWidth + borderWidth );
464
+ size.innerHeight = size.height - ( paddingHeight + borderHeight );
465
+
466
+ size.outerWidth = size.width + marginWidth;
467
+ size.outerHeight = size.height + marginHeight;
468
+
469
+ return size;
470
+ }
471
+
472
+ return getSize;
473
+
474
+ });
475
+
476
+ /**
477
+ * matchesSelector v2.0.2
478
+ * matchesSelector( element, '.selector' )
479
+ * MIT license
480
+ */
481
+
482
+ /*jshint browser: true, strict: true, undef: true, unused: true */
483
+
484
+ ( function( window, factory ) {
485
+ /*global define: false, module: false */
486
+ 'use strict';
487
+ // universal module definition
488
+ if ( typeof define == 'function' && define.amd ) {
489
+ // AMD
490
+ define( 'desandro-matches-selector/matches-selector',factory );
491
+ } else if ( typeof module == 'object' && module.exports ) {
492
+ // CommonJS
493
+ module.exports = factory();
494
+ } else {
495
+ // browser global
496
+ window.matchesSelector = factory();
497
+ }
498
+
499
+ }( window, function factory() {
500
+ 'use strict';
501
+
502
+ var matchesMethod = ( function() {
503
+ var ElemProto = window.Element.prototype;
504
+ // check for the standard method name first
505
+ if ( ElemProto.matches ) {
506
+ return 'matches';
507
+ }
508
+ // check un-prefixed
509
+ if ( ElemProto.matchesSelector ) {
510
+ return 'matchesSelector';
511
+ }
512
+ // check vendor prefixes
513
+ var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
514
+
515
+ for ( var i=0; i < prefixes.length; i++ ) {
516
+ var prefix = prefixes[i];
517
+ var method = prefix + 'MatchesSelector';
518
+ if ( ElemProto[ method ] ) {
519
+ return method;
520
+ }
521
+ }
522
+ })();
523
+
524
+ return function matchesSelector( elem, selector ) {
525
+ return elem[ matchesMethod ]( selector );
526
+ };
527
+
528
+ }));
529
+
530
+ /**
531
+ * Fizzy UI utils v2.0.5
532
+ * MIT license
533
+ */
534
+
535
+ /*jshint browser: true, undef: true, unused: true, strict: true */
536
+
537
+ ( function( window, factory ) {
538
+ // universal module definition
539
+ /*jshint strict: false */ /*globals define, module, require */
540
+
541
+ if ( typeof define == 'function' && define.amd ) {
542
+ // AMD
543
+ define( 'fizzy-ui-utils/utils',[
544
+ 'desandro-matches-selector/matches-selector'
545
+ ], function( matchesSelector ) {
546
+ return factory( window, matchesSelector );
547
+ });
548
+ } else if ( typeof module == 'object' && module.exports ) {
549
+ // CommonJS
550
+ module.exports = factory(
551
+ window,
552
+ require('desandro-matches-selector')
553
+ );
554
+ } else {
555
+ // browser global
556
+ window.fizzyUIUtils = factory(
557
+ window,
558
+ window.matchesSelector
559
+ );
560
+ }
561
+
562
+ }( window, function factory( window, matchesSelector ) {
563
+
564
+
565
+
566
+ var utils = {};
567
+
568
+ // ----- extend ----- //
569
+
570
+ // extends objects
571
+ utils.extend = function( a, b ) {
572
+ for ( var prop in b ) {
573
+ a[ prop ] = b[ prop ];
574
+ }
575
+ return a;
576
+ };
577
+
578
+ // ----- modulo ----- //
579
+
580
+ utils.modulo = function( num, div ) {
581
+ return ( ( num % div ) + div ) % div;
582
+ };
583
+
584
+ // ----- makeArray ----- //
585
+
586
+ // turn element or nodeList into an array
587
+ utils.makeArray = function( obj ) {
588
+ var ary = [];
589
+ if ( Array.isArray( obj ) ) {
590
+ // use object if already an array
591
+ ary = obj;
592
+ } else if ( obj && typeof obj == 'object' &&
593
+ typeof obj.length == 'number' ) {
594
+ // convert nodeList to array
595
+ for ( var i=0; i < obj.length; i++ ) {
596
+ ary.push( obj[i] );
597
+ }
598
+ } else {
599
+ // array of single index
600
+ ary.push( obj );
601
+ }
602
+ return ary;
603
+ };
604
+
605
+ // ----- removeFrom ----- //
606
+
607
+ utils.removeFrom = function( ary, obj ) {
608
+ var index = ary.indexOf( obj );
609
+ if ( index != -1 ) {
610
+ ary.splice( index, 1 );
611
+ }
612
+ };
613
+
614
+ // ----- getParent ----- //
615
+
616
+ utils.getParent = function( elem, selector ) {
617
+ while ( elem.parentNode && elem != document.body ) {
618
+ elem = elem.parentNode;
619
+ if ( matchesSelector( elem, selector ) ) {
620
+ return elem;
621
+ }
622
+ }
623
+ };
624
+
625
+ // ----- getQueryElement ----- //
626
+
627
+ // use element as selector string
628
+ utils.getQueryElement = function( elem ) {
629
+ if ( typeof elem == 'string' ) {
630
+ return document.querySelector( elem );
631
+ }
632
+ return elem;
633
+ };
634
+
635
+ // ----- handleEvent ----- //
636
+
637
+ // enable .ontype to trigger from .addEventListener( elem, 'type' )
638
+ utils.handleEvent = function( event ) {
639
+ var method = 'on' + event.type;
640
+ if ( this[ method ] ) {
641
+ this[ method ]( event );
642
+ }
643
+ };
644
+
645
+ // ----- filterFindElements ----- //
646
+
647
+ utils.filterFindElements = function( elems, selector ) {
648
+ // make array of elems
649
+ elems = utils.makeArray( elems );
650
+ var ffElems = [];
651
+
652
+ elems.forEach( function( elem ) {
653
+ // check that elem is an actual element
654
+ if ( !( elem instanceof HTMLElement ) ) {
655
+ return;
656
+ }
657
+ // add elem if no selector
658
+ if ( !selector ) {
659
+ ffElems.push( elem );
660
+ return;
661
+ }
662
+ // filter & find items if we have a selector
663
+ // filter
664
+ if ( matchesSelector( elem, selector ) ) {
665
+ ffElems.push( elem );
666
+ }
667
+ // find children
668
+ var childElems = elem.querySelectorAll( selector );
669
+ // concat childElems to filterFound array
670
+ for ( var i=0; i < childElems.length; i++ ) {
671
+ ffElems.push( childElems[i] );
672
+ }
673
+ });
674
+
675
+ return ffElems;
676
+ };
677
+
678
+ // ----- debounceMethod ----- //
679
+
680
+ utils.debounceMethod = function( _class, methodName, threshold ) {
681
+ // original method
682
+ var method = _class.prototype[ methodName ];
683
+ var timeoutName = methodName + 'Timeout';
684
+
685
+ _class.prototype[ methodName ] = function() {
686
+ var timeout = this[ timeoutName ];
687
+ if ( timeout ) {
688
+ clearTimeout( timeout );
689
+ }
690
+ var args = arguments;
691
+
692
+ var _this = this;
693
+ this[ timeoutName ] = setTimeout( function() {
694
+ method.apply( _this, args );
695
+ delete _this[ timeoutName ];
696
+ }, threshold || 100 );
697
+ };
698
+ };
699
+
700
+ // ----- docReady ----- //
701
+
702
+ utils.docReady = function( callback ) {
703
+ var readyState = document.readyState;
704
+ if ( readyState == 'complete' || readyState == 'interactive' ) {
705
+ // do async to allow for other scripts to run. metafizzy/flickity#441
706
+ setTimeout( callback );
707
+ } else {
708
+ document.addEventListener( 'DOMContentLoaded', callback );
709
+ }
710
+ };
711
+
712
+ // ----- htmlInit ----- //
713
+
714
+ // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
715
+ utils.toDashed = function( str ) {
716
+ return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
717
+ return $1 + '-' + $2;
718
+ }).toLowerCase();
719
+ };
720
+
721
+ var console = window.console;
722
+ /**
723
+ * allow user to initialize classes via [data-namespace] or .js-namespace class
724
+ * htmlInit( Widget, 'widgetName' )
725
+ * options are parsed from data-namespace-options
726
+ */
727
+ utils.htmlInit = function( WidgetClass, namespace ) {
728
+ utils.docReady( function() {
729
+ var dashedNamespace = utils.toDashed( namespace );
730
+ var dataAttr = 'data-' + dashedNamespace;
731
+ var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
732
+ var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
733
+ var elems = utils.makeArray( dataAttrElems )
734
+ .concat( utils.makeArray( jsDashElems ) );
735
+ var dataOptionsAttr = dataAttr + '-options';
736
+ var jQuery = window.jQuery;
737
+
738
+ elems.forEach( function( elem ) {
739
+ var attr = elem.getAttribute( dataAttr ) ||
740
+ elem.getAttribute( dataOptionsAttr );
741
+ var options;
742
+ try {
743
+ options = attr && JSON.parse( attr );
744
+ } catch ( error ) {
745
+ // log error, do not initialize
746
+ if ( console ) {
747
+ console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
748
+ ': ' + error );
749
+ }
750
+ return;
751
+ }
752
+ // initialize
753
+ var instance = new WidgetClass( elem, options );
754
+ // make available via $().data('namespace')
755
+ if ( jQuery ) {
756
+ jQuery.data( elem, namespace, instance );
757
+ }
758
+ });
759
+
760
+ });
761
+ };
762
+
763
+ // ----- ----- //
764
+
765
+ return utils;
766
+
767
+ }));
768
+
769
+ /**
770
+ * Outlayer Item
771
+ */
772
+
773
+ ( function( window, factory ) {
774
+ // universal module definition
775
+ /* jshint strict: false */ /* globals define, module, require */
776
+ if ( typeof define == 'function' && define.amd ) {
777
+ // AMD - RequireJS
778
+ define( 'outlayer/item',[
779
+ 'ev-emitter/ev-emitter',
780
+ 'get-size/get-size'
781
+ ],
782
+ factory
783
+ );
784
+ } else if ( typeof module == 'object' && module.exports ) {
785
+ // CommonJS - Browserify, Webpack
786
+ module.exports = factory(
787
+ require('ev-emitter'),
788
+ require('get-size')
789
+ );
790
+ } else {
791
+ // browser global
792
+ window.Outlayer = {};
793
+ window.Outlayer.Item = factory(
794
+ window.EvEmitter,
795
+ window.getSize
796
+ );
797
+ }
798
+
799
+ }( window, function factory( EvEmitter, getSize ) {
800
+ 'use strict';
801
+
802
+ // ----- helpers ----- //
803
+
804
+ function isEmptyObj( obj ) {
805
+ for ( var prop in obj ) {
806
+ return false;
807
+ }
808
+ prop = null;
809
+ return true;
810
+ }
811
+
812
+ // -------------------------- CSS3 support -------------------------- //
813
+
814
+
815
+ var docElemStyle = document.documentElement.style;
816
+
817
+ var transitionProperty = typeof docElemStyle.transition == 'string' ?
818
+ 'transition' : 'WebkitTransition';
819
+ var transformProperty = typeof docElemStyle.transform == 'string' ?
820
+ 'transform' : 'WebkitTransform';
821
+
822
+ var transitionEndEvent = {
823
+ WebkitTransition: 'webkitTransitionEnd',
824
+ transition: 'transitionend'
825
+ }[ transitionProperty ];
826
+
827
+ // cache all vendor properties that could have vendor prefix
828
+ var vendorProperties = {
829
+ transform: transformProperty,
830
+ transition: transitionProperty,
831
+ transitionDuration: transitionProperty + 'Duration',
832
+ transitionProperty: transitionProperty + 'Property',
833
+ transitionDelay: transitionProperty + 'Delay'
834
+ };
835
+
836
+ // -------------------------- Item -------------------------- //
837
+
838
+ function Item( element, layout ) {
839
+ if ( !element ) {
840
+ return;
841
+ }
842
+
843
+ this.element = element;
844
+ // parent layout class, i.e. Masonry, Isotope, or Packery
845
+ this.layout = layout;
846
+ this.position = {
847
+ x: 0,
848
+ y: 0
849
+ };
850
+
851
+ this._create();
852
+ }
853
+
854
+ // inherit EvEmitter
855
+ var proto = Item.prototype = Object.create( EvEmitter.prototype );
856
+ proto.constructor = Item;
857
+
858
+ proto._create = function() {
859
+ // transition objects
860
+ this._transn = {
861
+ ingProperties: {},
862
+ clean: {},
863
+ onEnd: {}
864
+ };
865
+
866
+ this.css({
867
+ position: 'absolute'
868
+ });
869
+ };
870
+
871
+ // trigger specified handler for event type
872
+ proto.handleEvent = function( event ) {
873
+ var method = 'on' + event.type;
874
+ if ( this[ method ] ) {
875
+ this[ method ]( event );
876
+ }
877
+ };
878
+
879
+ proto.getSize = function() {
880
+ this.size = getSize( this.element );
881
+ };
882
+
883
+ /**
884
+ * apply CSS styles to element
885
+ * @param {Object} style
886
+ */
887
+ proto.css = function( style ) {
888
+ var elemStyle = this.element.style;
889
+
890
+ for ( var prop in style ) {
891
+ // use vendor property if available
892
+ var supportedProp = vendorProperties[ prop ] || prop;
893
+ elemStyle[ supportedProp ] = style[ prop ];
894
+ }
895
+ };
896
+
897
+ // measure position, and sets it
898
+ proto.getPosition = function() {
899
+ var style = getComputedStyle( this.element );
900
+ var isOriginLeft = this.layout._getOption('originLeft');
901
+ var isOriginTop = this.layout._getOption('originTop');
902
+ var xValue = style[ isOriginLeft ? 'left' : 'right' ];
903
+ var yValue = style[ isOriginTop ? 'top' : 'bottom' ];
904
+ // convert percent to pixels
905
+ var layoutSize = this.layout.size;
906
+ var x = xValue.indexOf('%') != -1 ?
907
+ ( parseFloat( xValue ) / 100 ) * layoutSize.width : parseInt( xValue, 10 );
908
+ var y = yValue.indexOf('%') != -1 ?
909
+ ( parseFloat( yValue ) / 100 ) * layoutSize.height : parseInt( yValue, 10 );
910
+
911
+ // clean up 'auto' or other non-integer values
912
+ x = isNaN( x ) ? 0 : x;
913
+ y = isNaN( y ) ? 0 : y;
914
+ // remove padding from measurement
915
+ x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;
916
+ y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;
917
+
918
+ this.position.x = x;
919
+ this.position.y = y;
920
+ };
921
+
922
+ // set settled position, apply padding
923
+ proto.layoutPosition = function() {
924
+ var layoutSize = this.layout.size;
925
+ var style = {};
926
+ var isOriginLeft = this.layout._getOption('originLeft');
927
+ var isOriginTop = this.layout._getOption('originTop');
928
+
929
+ // x
930
+ var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight';
931
+ var xProperty = isOriginLeft ? 'left' : 'right';
932
+ var xResetProperty = isOriginLeft ? 'right' : 'left';
933
+
934
+ var x = this.position.x + layoutSize[ xPadding ];
935
+ // set in percentage or pixels
936
+ style[ xProperty ] = this.getXValue( x );
937
+ // reset other property
938
+ style[ xResetProperty ] = '';
939
+
940
+ // y
941
+ var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom';
942
+ var yProperty = isOriginTop ? 'top' : 'bottom';
943
+ var yResetProperty = isOriginTop ? 'bottom' : 'top';
944
+
945
+ var y = this.position.y + layoutSize[ yPadding ];
946
+ // set in percentage or pixels
947
+ style[ yProperty ] = this.getYValue( y );
948
+ // reset other property
949
+ style[ yResetProperty ] = '';
950
+
951
+ this.css( style );
952
+ this.emitEvent( 'layout', [ this ] );
953
+ };
954
+
955
+ proto.getXValue = function( x ) {
956
+ var isHorizontal = this.layout._getOption('horizontal');
957
+ return this.layout.options.percentPosition && !isHorizontal ?
958
+ ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px';
959
+ };
960
+
961
+ proto.getYValue = function( y ) {
962
+ var isHorizontal = this.layout._getOption('horizontal');
963
+ return this.layout.options.percentPosition && isHorizontal ?
964
+ ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px';
965
+ };
966
+
967
+ proto._transitionTo = function( x, y ) {
968
+ this.getPosition();
969
+ // get current x & y from top/left
970
+ var curX = this.position.x;
971
+ var curY = this.position.y;
972
+
973
+ var compareX = parseInt( x, 10 );
974
+ var compareY = parseInt( y, 10 );
975
+ var didNotMove = compareX === this.position.x && compareY === this.position.y;
976
+
977
+ // save end position
978
+ this.setPosition( x, y );
979
+
980
+ // if did not move and not transitioning, just go to layout
981
+ if ( didNotMove && !this.isTransitioning ) {
982
+ this.layoutPosition();
983
+ return;
984
+ }
985
+
986
+ var transX = x - curX;
987
+ var transY = y - curY;
988
+ var transitionStyle = {};
989
+ transitionStyle.transform = this.getTranslate( transX, transY );
990
+
991
+ this.transition({
992
+ to: transitionStyle,
993
+ onTransitionEnd: {
994
+ transform: this.layoutPosition
995
+ },
996
+ isCleaning: true
997
+ });
998
+ };
999
+
1000
+ proto.getTranslate = function( x, y ) {
1001
+ // flip cooridinates if origin on right or bottom
1002
+ var isOriginLeft = this.layout._getOption('originLeft');
1003
+ var isOriginTop = this.layout._getOption('originTop');
1004
+ x = isOriginLeft ? x : -x;
1005
+ y = isOriginTop ? y : -y;
1006
+ return 'translate3d(' + x + 'px, ' + y + 'px, 0)';
1007
+ };
1008
+
1009
+ // non transition + transform support
1010
+ proto.goTo = function( x, y ) {
1011
+ this.setPosition( x, y );
1012
+ this.layoutPosition();
1013
+ };
1014
+
1015
+ proto.moveTo = proto._transitionTo;
1016
+
1017
+ proto.setPosition = function( x, y ) {
1018
+ this.position.x = parseInt( x, 10 );
1019
+ this.position.y = parseInt( y, 10 );
1020
+ };
1021
+
1022
+ // ----- transition ----- //
1023
+
1024
+ /**
1025
+ * @param {Object} style - CSS
1026
+ * @param {Function} onTransitionEnd
1027
+ */
1028
+
1029
+ // non transition, just trigger callback
1030
+ proto._nonTransition = function( args ) {
1031
+ this.css( args.to );
1032
+ if ( args.isCleaning ) {
1033
+ this._removeStyles( args.to );
1034
+ }
1035
+ for ( var prop in args.onTransitionEnd ) {
1036
+ args.onTransitionEnd[ prop ].call( this );
1037
+ }
1038
+ };
1039
+
1040
+ /**
1041
+ * proper transition
1042
+ * @param {Object} args - arguments
1043
+ * @param {Object} to - style to transition to
1044
+ * @param {Object} from - style to start transition from
1045
+ * @param {Boolean} isCleaning - removes transition styles after transition
1046
+ * @param {Function} onTransitionEnd - callback
1047
+ */
1048
+ proto.transition = function( args ) {
1049
+ // redirect to nonTransition if no transition duration
1050
+ if ( !parseFloat( this.layout.options.transitionDuration ) ) {
1051
+ this._nonTransition( args );
1052
+ return;
1053
+ }
1054
+
1055
+ var _transition = this._transn;
1056
+ // keep track of onTransitionEnd callback by css property
1057
+ for ( var prop in args.onTransitionEnd ) {
1058
+ _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ];
1059
+ }
1060
+ // keep track of properties that are transitioning
1061
+ for ( prop in args.to ) {
1062
+ _transition.ingProperties[ prop ] = true;
1063
+ // keep track of properties to clean up when transition is done
1064
+ if ( args.isCleaning ) {
1065
+ _transition.clean[ prop ] = true;
1066
+ }
1067
+ }
1068
+
1069
+ // set from styles
1070
+ if ( args.from ) {
1071
+ this.css( args.from );
1072
+ // force redraw. http://blog.alexmaccaw.com/css-transitions
1073
+ var h = this.element.offsetHeight;
1074
+ // hack for JSHint to hush about unused var
1075
+ h = null;
1076
+ }
1077
+ // enable transition
1078
+ this.enableTransition( args.to );
1079
+ // set styles that are transitioning
1080
+ this.css( args.to );
1081
+
1082
+ this.isTransitioning = true;
1083
+
1084
+ };
1085
+
1086
+ // dash before all cap letters, including first for
1087
+ // WebkitTransform => -webkit-transform
1088
+ function toDashedAll( str ) {
1089
+ return str.replace( /([A-Z])/g, function( $1 ) {
1090
+ return '-' + $1.toLowerCase();
1091
+ });
1092
+ }
1093
+
1094
+ var transitionProps = 'opacity,' + toDashedAll( transformProperty );
1095
+
1096
+ proto.enableTransition = function(/* style */) {
1097
+ // HACK changing transitionProperty during a transition
1098
+ // will cause transition to jump
1099
+ if ( this.isTransitioning ) {
1100
+ return;
1101
+ }
1102
+
1103
+ // make `transition: foo, bar, baz` from style object
1104
+ // HACK un-comment this when enableTransition can work
1105
+ // while a transition is happening
1106
+ // var transitionValues = [];
1107
+ // for ( var prop in style ) {
1108
+ // // dash-ify camelCased properties like WebkitTransition
1109
+ // prop = vendorProperties[ prop ] || prop;
1110
+ // transitionValues.push( toDashedAll( prop ) );
1111
+ // }
1112
+ // munge number to millisecond, to match stagger
1113
+ var duration = this.layout.options.transitionDuration;
1114
+ duration = typeof duration == 'number' ? duration + 'ms' : duration;
1115
+ // enable transition styles
1116
+ this.css({
1117
+ transitionProperty: transitionProps,
1118
+ transitionDuration: duration,
1119
+ transitionDelay: this.staggerDelay || 0
1120
+ });
1121
+ // listen for transition end event
1122
+ this.element.addEventListener( transitionEndEvent, this, false );
1123
+ };
1124
+
1125
+ // ----- events ----- //
1126
+
1127
+ proto.onwebkitTransitionEnd = function( event ) {
1128
+ this.ontransitionend( event );
1129
+ };
1130
+
1131
+ proto.onotransitionend = function( event ) {
1132
+ this.ontransitionend( event );
1133
+ };
1134
+
1135
+ // properties that I munge to make my life easier
1136
+ var dashedVendorProperties = {
1137
+ '-webkit-transform': 'transform'
1138
+ };
1139
+
1140
+ proto.ontransitionend = function( event ) {
1141
+ // disregard bubbled events from children
1142
+ if ( event.target !== this.element ) {
1143
+ return;
1144
+ }
1145
+ var _transition = this._transn;
1146
+ // get property name of transitioned property, convert to prefix-free
1147
+ var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName;
1148
+
1149
+ // remove property that has completed transitioning
1150
+ delete _transition.ingProperties[ propertyName ];
1151
+ // check if any properties are still transitioning
1152
+ if ( isEmptyObj( _transition.ingProperties ) ) {
1153
+ // all properties have completed transitioning
1154
+ this.disableTransition();
1155
+ }
1156
+ // clean style
1157
+ if ( propertyName in _transition.clean ) {
1158
+ // clean up style
1159
+ this.element.style[ event.propertyName ] = '';
1160
+ delete _transition.clean[ propertyName ];
1161
+ }
1162
+ // trigger onTransitionEnd callback
1163
+ if ( propertyName in _transition.onEnd ) {
1164
+ var onTransitionEnd = _transition.onEnd[ propertyName ];
1165
+ onTransitionEnd.call( this );
1166
+ delete _transition.onEnd[ propertyName ];
1167
+ }
1168
+
1169
+ this.emitEvent( 'transitionEnd', [ this ] );
1170
+ };
1171
+
1172
+ proto.disableTransition = function() {
1173
+ this.removeTransitionStyles();
1174
+ this.element.removeEventListener( transitionEndEvent, this, false );
1175
+ this.isTransitioning = false;
1176
+ };
1177
+
1178
+ /**
1179
+ * removes style property from element
1180
+ * @param {Object} style
1181
+ **/
1182
+ proto._removeStyles = function( style ) {
1183
+ // clean up transition styles
1184
+ var cleanStyle = {};
1185
+ for ( var prop in style ) {
1186
+ cleanStyle[ prop ] = '';
1187
+ }
1188
+ this.css( cleanStyle );
1189
+ };
1190
+
1191
+ var cleanTransitionStyle = {
1192
+ transitionProperty: '',
1193
+ transitionDuration: '',
1194
+ transitionDelay: ''
1195
+ };
1196
+
1197
+ proto.removeTransitionStyles = function() {
1198
+ // remove transition
1199
+ this.css( cleanTransitionStyle );
1200
+ };
1201
+
1202
+ // ----- stagger ----- //
1203
+
1204
+ proto.stagger = function( delay ) {
1205
+ delay = isNaN( delay ) ? 0 : delay;
1206
+ this.staggerDelay = delay + 'ms';
1207
+ };
1208
+
1209
+ // ----- show/hide/remove ----- //
1210
+
1211
+ // remove element from DOM
1212
+ proto.removeElem = function() {
1213
+ this.element.parentNode.removeChild( this.element );
1214
+ // remove display: none
1215
+ this.css({ display: '' });
1216
+ this.emitEvent( 'remove', [ this ] );
1217
+ };
1218
+
1219
+ proto.remove = function() {
1220
+ // just remove element if no transition support or no transition
1221
+ if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) {
1222
+ this.removeElem();
1223
+ return;
1224
+ }
1225
+
1226
+ // start transition
1227
+ this.once( 'transitionEnd', function() {
1228
+ this.removeElem();
1229
+ });
1230
+ this.hide();
1231
+ };
1232
+
1233
+ proto.reveal = function() {
1234
+ delete this.isHidden;
1235
+ // remove display: none
1236
+ this.css({ display: '' });
1237
+
1238
+ var options = this.layout.options;
1239
+
1240
+ var onTransitionEnd = {};
1241
+ var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle');
1242
+ onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd;
1243
+
1244
+ this.transition({
1245
+ from: options.hiddenStyle,
1246
+ to: options.visibleStyle,
1247
+ isCleaning: true,
1248
+ onTransitionEnd: onTransitionEnd
1249
+ });
1250
+ };
1251
+
1252
+ proto.onRevealTransitionEnd = function() {
1253
+ // check if still visible
1254
+ // during transition, item may have been hidden
1255
+ if ( !this.isHidden ) {
1256
+ this.emitEvent('reveal');
1257
+ }
1258
+ };
1259
+
1260
+ /**
1261
+ * get style property use for hide/reveal transition end
1262
+ * @param {String} styleProperty - hiddenStyle/visibleStyle
1263
+ * @returns {String}
1264
+ */
1265
+ proto.getHideRevealTransitionEndProperty = function( styleProperty ) {
1266
+ var optionStyle = this.layout.options[ styleProperty ];
1267
+ // use opacity
1268
+ if ( optionStyle.opacity ) {
1269
+ return 'opacity';
1270
+ }
1271
+ // get first property
1272
+ for ( var prop in optionStyle ) {
1273
+ return prop;
1274
+ }
1275
+ };
1276
+
1277
+ proto.hide = function() {
1278
+ // set flag
1279
+ this.isHidden = true;
1280
+ // remove display: none
1281
+ this.css({ display: '' });
1282
+
1283
+ var options = this.layout.options;
1284
+
1285
+ var onTransitionEnd = {};
1286
+ var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle');
1287
+ onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd;
1288
+
1289
+ this.transition({
1290
+ from: options.visibleStyle,
1291
+ to: options.hiddenStyle,
1292
+ // keep hidden stuff hidden
1293
+ isCleaning: true,
1294
+ onTransitionEnd: onTransitionEnd
1295
+ });
1296
+ };
1297
+
1298
+ proto.onHideTransitionEnd = function() {
1299
+ // check if still hidden
1300
+ // during transition, item may have been un-hidden
1301
+ if ( this.isHidden ) {
1302
+ this.css({ display: 'none' });
1303
+ this.emitEvent('hide');
1304
+ }
1305
+ };
1306
+
1307
+ proto.destroy = function() {
1308
+ this.css({
1309
+ position: '',
1310
+ left: '',
1311
+ right: '',
1312
+ top: '',
1313
+ bottom: '',
1314
+ transition: '',
1315
+ transform: ''
1316
+ });
1317
+ };
1318
+
1319
+ return Item;
1320
+
1321
+ }));
1322
+
1323
+ /*!
1324
+ * Outlayer v2.1.0
1325
+ * the brains and guts of a layout library
1326
+ * MIT license
1327
+ */
1328
+
1329
+ ( function( window, factory ) {
1330
+ 'use strict';
1331
+ // universal module definition
1332
+ /* jshint strict: false */ /* globals define, module, require */
1333
+ if ( typeof define == 'function' && define.amd ) {
1334
+ // AMD - RequireJS
1335
+ define( 'outlayer/outlayer',[
1336
+ 'ev-emitter/ev-emitter',
1337
+ 'get-size/get-size',
1338
+ 'fizzy-ui-utils/utils',
1339
+ './item'
1340
+ ],
1341
+ function( EvEmitter, getSize, utils, Item ) {
1342
+ return factory( window, EvEmitter, getSize, utils, Item);
1343
+ }
1344
+ );
1345
+ } else if ( typeof module == 'object' && module.exports ) {
1346
+ // CommonJS - Browserify, Webpack
1347
+ module.exports = factory(
1348
+ window,
1349
+ require('ev-emitter'),
1350
+ require('get-size'),
1351
+ require('fizzy-ui-utils'),
1352
+ require('./item')
1353
+ );
1354
+ } else {
1355
+ // browser global
1356
+ window.Outlayer = factory(
1357
+ window,
1358
+ window.EvEmitter,
1359
+ window.getSize,
1360
+ window.fizzyUIUtils,
1361
+ window.Outlayer.Item
1362
+ );
1363
+ }
1364
+
1365
+ }( window, function factory( window, EvEmitter, getSize, utils, Item ) {
1366
+ 'use strict';
1367
+
1368
+ // ----- vars ----- //
1369
+
1370
+ var console = window.console;
1371
+ var jQuery = window.jQuery;
1372
+ var noop = function() {};
1373
+
1374
+ // -------------------------- Outlayer -------------------------- //
1375
+
1376
+ // globally unique identifiers
1377
+ var GUID = 0;
1378
+ // internal store of all Outlayer intances
1379
+ var instances = {};
1380
+
1381
+
1382
+ /**
1383
+ * @param {Element, String} element
1384
+ * @param {Object} options
1385
+ * @constructor
1386
+ */
1387
+ function Outlayer( element, options ) {
1388
+ var queryElement = utils.getQueryElement( element );
1389
+ if ( !queryElement ) {
1390
+ if ( console ) {
1391
+ console.error( 'Bad element for ' + this.constructor.namespace +
1392
+ ': ' + ( queryElement || element ) );
1393
+ }
1394
+ return;
1395
+ }
1396
+ this.element = queryElement;
1397
+ // add jQuery
1398
+ if ( jQuery ) {
1399
+ this.$element = jQuery( this.element );
1400
+ }
1401
+
1402
+ // options
1403
+ this.options = utils.extend( {}, this.constructor.defaults );
1404
+ this.option( options );
1405
+
1406
+ // add id for Outlayer.getFromElement
1407
+ var id = ++GUID;
1408
+ this.element.outlayerGUID = id; // expando
1409
+ instances[ id ] = this; // associate via id
1410
+
1411
+ // kick it off
1412
+ this._create();
1413
+
1414
+ var isInitLayout = this._getOption('initLayout');
1415
+ if ( isInitLayout ) {
1416
+ this.layout();
1417
+ }
1418
+ }
1419
+
1420
+ // settings are for internal use only
1421
+ Outlayer.namespace = 'outlayer';
1422
+ Outlayer.Item = Item;
1423
+
1424
+ // default options
1425
+ Outlayer.defaults = {
1426
+ containerStyle: {
1427
+ position: 'relative'
1428
+ },
1429
+ initLayout: true,
1430
+ originLeft: true,
1431
+ originTop: true,
1432
+ resize: true,
1433
+ resizeContainer: true,
1434
+ // item options
1435
+ transitionDuration: '0.4s',
1436
+ hiddenStyle: {
1437
+ opacity: 0,
1438
+ transform: 'scale(0.001)'
1439
+ },
1440
+ visibleStyle: {
1441
+ opacity: 1,
1442
+ transform: 'scale(1)'
1443
+ }
1444
+ };
1445
+
1446
+ var proto = Outlayer.prototype;
1447
+ // inherit EvEmitter
1448
+ utils.extend( proto, EvEmitter.prototype );
1449
+
1450
+ /**
1451
+ * set options
1452
+ * @param {Object} opts
1453
+ */
1454
+ proto.option = function( opts ) {
1455
+ utils.extend( this.options, opts );
1456
+ };
1457
+
1458
+ /**
1459
+ * get backwards compatible option value, check old name
1460
+ */
1461
+ proto._getOption = function( option ) {
1462
+ var oldOption = this.constructor.compatOptions[ option ];
1463
+ return oldOption && this.options[ oldOption ] !== undefined ?
1464
+ this.options[ oldOption ] : this.options[ option ];
1465
+ };
1466
+
1467
+ Outlayer.compatOptions = {
1468
+ // currentName: oldName
1469
+ initLayout: 'isInitLayout',
1470
+ horizontal: 'isHorizontal',
1471
+ layoutInstant: 'isLayoutInstant',
1472
+ originLeft: 'isOriginLeft',
1473
+ originTop: 'isOriginTop',
1474
+ resize: 'isResizeBound',
1475
+ resizeContainer: 'isResizingContainer'
1476
+ };
1477
+
1478
+ proto._create = function() {
1479
+ // get items from children
1480
+ this.reloadItems();
1481
+ // elements that affect layout, but are not laid out
1482
+ this.stamps = [];
1483
+ this.stamp( this.options.stamp );
1484
+ // set container style
1485
+ utils.extend( this.element.style, this.options.containerStyle );
1486
+
1487
+ // bind resize method
1488
+ var canBindResize = this._getOption('resize');
1489
+ if ( canBindResize ) {
1490
+ this.bindResize();
1491
+ }
1492
+ };
1493
+
1494
+ // goes through all children again and gets bricks in proper order
1495
+ proto.reloadItems = function() {
1496
+ // collection of item elements
1497
+ this.items = this._itemize( this.element.children );
1498
+ };
1499
+
1500
+
1501
+ /**
1502
+ * turn elements into Outlayer.Items to be used in layout
1503
+ * @param {Array or NodeList or HTMLElement} elems
1504
+ * @returns {Array} items - collection of new Outlayer Items
1505
+ */
1506
+ proto._itemize = function( elems ) {
1507
+
1508
+ var itemElems = this._filterFindItemElements( elems );
1509
+ var Item = this.constructor.Item;
1510
+
1511
+ // create new Outlayer Items for collection
1512
+ var items = [];
1513
+ for ( var i=0; i < itemElems.length; i++ ) {
1514
+ var elem = itemElems[i];
1515
+ var item = new Item( elem, this );
1516
+ items.push( item );
1517
+ }
1518
+
1519
+ return items;
1520
+ };
1521
+
1522
+ /**
1523
+ * get item elements to be used in layout
1524
+ * @param {Array or NodeList or HTMLElement} elems
1525
+ * @returns {Array} items - item elements
1526
+ */
1527
+ proto._filterFindItemElements = function( elems ) {
1528
+ return utils.filterFindElements( elems, this.options.itemSelector );
1529
+ };
1530
+
1531
+ /**
1532
+ * getter method for getting item elements
1533
+ * @returns {Array} elems - collection of item elements
1534
+ */
1535
+ proto.getItemElements = function() {
1536
+ return this.items.map( function( item ) {
1537
+ return item.element;
1538
+ });
1539
+ };
1540
+
1541
+ // ----- init & layout ----- //
1542
+
1543
+ /**
1544
+ * lays out all items
1545
+ */
1546
+ proto.layout = function() {
1547
+ this._resetLayout();
1548
+ this._manageStamps();
1549
+
1550
+ // don't animate first layout
1551
+ var layoutInstant = this._getOption('layoutInstant');
1552
+ var isInstant = layoutInstant !== undefined ?
1553
+ layoutInstant : !this._isLayoutInited;
1554
+ this.layoutItems( this.items, isInstant );
1555
+
1556
+ // flag for initalized
1557
+ this._isLayoutInited = true;
1558
+ };
1559
+
1560
+ // _init is alias for layout
1561
+ proto._init = proto.layout;
1562
+
1563
+ /**
1564
+ * logic before any new layout
1565
+ */
1566
+ proto._resetLayout = function() {
1567
+ this.getSize();
1568
+ };
1569
+
1570
+
1571
+ proto.getSize = function() {
1572
+ this.size = getSize( this.element );
1573
+ };
1574
+
1575
+ /**
1576
+ * get measurement from option, for columnWidth, rowHeight, gutter
1577
+ * if option is String -> get element from selector string, & get size of element
1578
+ * if option is Element -> get size of element
1579
+ * else use option as a number
1580
+ *
1581
+ * @param {String} measurement
1582
+ * @param {String} size - width or height
1583
+ * @private
1584
+ */
1585
+ proto._getMeasurement = function( measurement, size ) {
1586
+ var option = this.options[ measurement ];
1587
+ var elem;
1588
+ if ( !option ) {
1589
+ // default to 0
1590
+ this[ measurement ] = 0;
1591
+ } else {
1592
+ // use option as an element
1593
+ if ( typeof option == 'string' ) {
1594
+ elem = this.element.querySelector( option );
1595
+ } else if ( option instanceof HTMLElement ) {
1596
+ elem = option;
1597
+ }
1598
+ // use size of element, if element
1599
+ this[ measurement ] = elem ? getSize( elem )[ size ] : option;
1600
+ }
1601
+ };
1602
+
1603
+ /**
1604
+ * layout a collection of item elements
1605
+ * @api public
1606
+ */
1607
+ proto.layoutItems = function( items, isInstant ) {
1608
+ items = this._getItemsForLayout( items );
1609
+
1610
+ this._layoutItems( items, isInstant );
1611
+
1612
+ this._postLayout();
1613
+ };
1614
+
1615
+ /**
1616
+ * get the items to be laid out
1617
+ * you may want to skip over some items
1618
+ * @param {Array} items
1619
+ * @returns {Array} items
1620
+ */
1621
+ proto._getItemsForLayout = function( items ) {
1622
+ return items.filter( function( item ) {
1623
+ return !item.isIgnored;
1624
+ });
1625
+ };
1626
+
1627
+ /**
1628
+ * layout items
1629
+ * @param {Array} items
1630
+ * @param {Boolean} isInstant
1631
+ */
1632
+ proto._layoutItems = function( items, isInstant ) {
1633
+ this._emitCompleteOnItems( 'layout', items );
1634
+
1635
+ if ( !items || !items.length ) {
1636
+ // no items, emit event with empty array
1637
+ return;
1638
+ }
1639
+
1640
+ var queue = [];
1641
+
1642
+ items.forEach( function( item ) {
1643
+ // get x/y object from method
1644
+ var position = this._getItemLayoutPosition( item );
1645
+ // enqueue
1646
+ position.item = item;
1647
+ position.isInstant = isInstant || item.isLayoutInstant;
1648
+ queue.push( position );
1649
+ }, this );
1650
+
1651
+ this._processLayoutQueue( queue );
1652
+ };
1653
+
1654
+ /**
1655
+ * get item layout position
1656
+ * @param {Outlayer.Item} item
1657
+ * @returns {Object} x and y position
1658
+ */
1659
+ proto._getItemLayoutPosition = function( /* item */ ) {
1660
+ return {
1661
+ x: 0,
1662
+ y: 0
1663
+ };
1664
+ };
1665
+
1666
+ /**
1667
+ * iterate over array and position each item
1668
+ * Reason being - separating this logic prevents 'layout invalidation'
1669
+ * thx @paul_irish
1670
+ * @param {Array} queue
1671
+ */
1672
+ proto._processLayoutQueue = function( queue ) {
1673
+ this.updateStagger();
1674
+ queue.forEach( function( obj, i ) {
1675
+ this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i );
1676
+ }, this );
1677
+ };
1678
+
1679
+ // set stagger from option in milliseconds number
1680
+ proto.updateStagger = function() {
1681
+ var stagger = this.options.stagger;
1682
+ if ( stagger === null || stagger === undefined ) {
1683
+ this.stagger = 0;
1684
+ return;
1685
+ }
1686
+ this.stagger = getMilliseconds( stagger );
1687
+ return this.stagger;
1688
+ };
1689
+
1690
+ /**
1691
+ * Sets position of item in DOM
1692
+ * @param {Outlayer.Item} item
1693
+ * @param {Number} x - horizontal position
1694
+ * @param {Number} y - vertical position
1695
+ * @param {Boolean} isInstant - disables transitions
1696
+ */
1697
+ proto._positionItem = function( item, x, y, isInstant, i ) {
1698
+ if ( isInstant ) {
1699
+ // if not transition, just set CSS
1700
+ item.goTo( x, y );
1701
+ } else {
1702
+ item.stagger( i * this.stagger );
1703
+ item.moveTo( x, y );
1704
+ }
1705
+ };
1706
+
1707
+ /**
1708
+ * Any logic you want to do after each layout,
1709
+ * i.e. size the container
1710
+ */
1711
+ proto._postLayout = function() {
1712
+ this.resizeContainer();
1713
+ };
1714
+
1715
+ proto.resizeContainer = function() {
1716
+ var isResizingContainer = this._getOption('resizeContainer');
1717
+ if ( !isResizingContainer ) {
1718
+ return;
1719
+ }
1720
+ var size = this._getContainerSize();
1721
+ if ( size ) {
1722
+ this._setContainerMeasure( size.width, true );
1723
+ this._setContainerMeasure( size.height, false );
1724
+ }
1725
+ };
1726
+
1727
+ /**
1728
+ * Sets width or height of container if returned
1729
+ * @returns {Object} size
1730
+ * @param {Number} width
1731
+ * @param {Number} height
1732
+ */
1733
+ proto._getContainerSize = noop;
1734
+
1735
+ /**
1736
+ * @param {Number} measure - size of width or height
1737
+ * @param {Boolean} isWidth
1738
+ */
1739
+ proto._setContainerMeasure = function( measure, isWidth ) {
1740
+ if ( measure === undefined ) {
1741
+ return;
1742
+ }
1743
+
1744
+ var elemSize = this.size;
1745
+ // add padding and border width if border box
1746
+ if ( elemSize.isBorderBox ) {
1747
+ measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight +
1748
+ elemSize.borderLeftWidth + elemSize.borderRightWidth :
1749
+ elemSize.paddingBottom + elemSize.paddingTop +
1750
+ elemSize.borderTopWidth + elemSize.borderBottomWidth;
1751
+ }
1752
+
1753
+ measure = Math.max( measure, 0 );
1754
+ this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px';
1755
+ };
1756
+
1757
+ /**
1758
+ * emit eventComplete on a collection of items events
1759
+ * @param {String} eventName
1760
+ * @param {Array} items - Outlayer.Items
1761
+ */
1762
+ proto._emitCompleteOnItems = function( eventName, items ) {
1763
+ var _this = this;
1764
+ function onComplete() {
1765
+ _this.dispatchEvent( eventName + 'Complete', null, [ items ] );
1766
+ }
1767
+
1768
+ var count = items.length;
1769
+ if ( !items || !count ) {
1770
+ onComplete();
1771
+ return;
1772
+ }
1773
+
1774
+ var doneCount = 0;
1775
+ function tick() {
1776
+ doneCount++;
1777
+ if ( doneCount == count ) {
1778
+ onComplete();
1779
+ }
1780
+ }
1781
+
1782
+ // bind callback
1783
+ items.forEach( function( item ) {
1784
+ item.once( eventName, tick );
1785
+ });
1786
+ };
1787
+
1788
+ /**
1789
+ * emits events via EvEmitter and jQuery events
1790
+ * @param {String} type - name of event
1791
+ * @param {Event} event - original event
1792
+ * @param {Array} args - extra arguments
1793
+ */
1794
+ proto.dispatchEvent = function( type, event, args ) {
1795
+ // add original event to arguments
1796
+ var emitArgs = event ? [ event ].concat( args ) : args;
1797
+ this.emitEvent( type, emitArgs );
1798
+
1799
+ if ( jQuery ) {
1800
+ // set this.$element
1801
+ this.$element = this.$element || jQuery( this.element );
1802
+ if ( event ) {
1803
+ // create jQuery event
1804
+ var $event = jQuery.Event( event );
1805
+ $event.type = type;
1806
+ this.$element.trigger( $event, args );
1807
+ } else {
1808
+ // just trigger with type if no event available
1809
+ this.$element.trigger( type, args );
1810
+ }
1811
+ }
1812
+ };
1813
+
1814
+ // -------------------------- ignore & stamps -------------------------- //
1815
+
1816
+
1817
+ /**
1818
+ * keep item in collection, but do not lay it out
1819
+ * ignored items do not get skipped in layout
1820
+ * @param {Element} elem
1821
+ */
1822
+ proto.ignore = function( elem ) {
1823
+ var item = this.getItem( elem );
1824
+ if ( item ) {
1825
+ item.isIgnored = true;
1826
+ }
1827
+ };
1828
+
1829
+ /**
1830
+ * return item to layout collection
1831
+ * @param {Element} elem
1832
+ */
1833
+ proto.unignore = function( elem ) {
1834
+ var item = this.getItem( elem );
1835
+ if ( item ) {
1836
+ delete item.isIgnored;
1837
+ }
1838
+ };
1839
+
1840
+ /**
1841
+ * adds elements to stamps
1842
+ * @param {NodeList, Array, Element, or String} elems
1843
+ */
1844
+ proto.stamp = function( elems ) {
1845
+ elems = this._find( elems );
1846
+ if ( !elems ) {
1847
+ return;
1848
+ }
1849
+
1850
+ this.stamps = this.stamps.concat( elems );
1851
+ // ignore
1852
+ elems.forEach( this.ignore, this );
1853
+ };
1854
+
1855
+ /**
1856
+ * removes elements to stamps
1857
+ * @param {NodeList, Array, or Element} elems
1858
+ */
1859
+ proto.unstamp = function( elems ) {
1860
+ elems = this._find( elems );
1861
+ if ( !elems ){
1862
+ return;
1863
+ }
1864
+
1865
+ elems.forEach( function( elem ) {
1866
+ // filter out removed stamp elements
1867
+ utils.removeFrom( this.stamps, elem );
1868
+ this.unignore( elem );
1869
+ }, this );
1870
+ };
1871
+
1872
+ /**
1873
+ * finds child elements
1874
+ * @param {NodeList, Array, Element, or String} elems
1875
+ * @returns {Array} elems
1876
+ */
1877
+ proto._find = function( elems ) {
1878
+ if ( !elems ) {
1879
+ return;
1880
+ }
1881
+ // if string, use argument as selector string
1882
+ if ( typeof elems == 'string' ) {
1883
+ elems = this.element.querySelectorAll( elems );
1884
+ }
1885
+ elems = utils.makeArray( elems );
1886
+ return elems;
1887
+ };
1888
+
1889
+ proto._manageStamps = function() {
1890
+ if ( !this.stamps || !this.stamps.length ) {
1891
+ return;
1892
+ }
1893
+
1894
+ this._getBoundingRect();
1895
+
1896
+ this.stamps.forEach( this._manageStamp, this );
1897
+ };
1898
+
1899
+ // update boundingLeft / Top
1900
+ proto._getBoundingRect = function() {
1901
+ // get bounding rect for container element
1902
+ var boundingRect = this.element.getBoundingClientRect();
1903
+ var size = this.size;
1904
+ this._boundingRect = {
1905
+ left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,
1906
+ top: boundingRect.top + size.paddingTop + size.borderTopWidth,
1907
+ right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ),
1908
+ bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth )
1909
+ };
1910
+ };
1911
+
1912
+ /**
1913
+ * @param {Element} stamp
1914
+ **/
1915
+ proto._manageStamp = noop;
1916
+
1917
+ /**
1918
+ * get x/y position of element relative to container element
1919
+ * @param {Element} elem
1920
+ * @returns {Object} offset - has left, top, right, bottom
1921
+ */
1922
+ proto._getElementOffset = function( elem ) {
1923
+ var boundingRect = elem.getBoundingClientRect();
1924
+ var thisRect = this._boundingRect;
1925
+ var size = getSize( elem );
1926
+ var offset = {
1927
+ left: boundingRect.left - thisRect.left - size.marginLeft,
1928
+ top: boundingRect.top - thisRect.top - size.marginTop,
1929
+ right: thisRect.right - boundingRect.right - size.marginRight,
1930
+ bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom
1931
+ };
1932
+ return offset;
1933
+ };
1934
+
1935
+ // -------------------------- resize -------------------------- //
1936
+
1937
+ // enable event handlers for listeners
1938
+ // i.e. resize -> onresize
1939
+ proto.handleEvent = utils.handleEvent;
1940
+
1941
+ /**
1942
+ * Bind layout to window resizing
1943
+ */
1944
+ proto.bindResize = function() {
1945
+ window.addEventListener( 'resize', this );
1946
+ this.isResizeBound = true;
1947
+ };
1948
+
1949
+ /**
1950
+ * Unbind layout to window resizing
1951
+ */
1952
+ proto.unbindResize = function() {
1953
+ window.removeEventListener( 'resize', this );
1954
+ this.isResizeBound = false;
1955
+ };
1956
+
1957
+ proto.onresize = function() {
1958
+ this.resize();
1959
+ };
1960
+
1961
+ utils.debounceMethod( Outlayer, 'onresize', 100 );
1962
+
1963
+ proto.resize = function() {
1964
+ // don't trigger if size did not change
1965
+ // or if resize was unbound. See #9
1966
+ if ( !this.isResizeBound || !this.needsResizeLayout() ) {
1967
+ return;
1968
+ }
1969
+
1970
+ this.layout();
1971
+ };
1972
+
1973
+ /**
1974
+ * check if layout is needed post layout
1975
+ * @returns Boolean
1976
+ */
1977
+ proto.needsResizeLayout = function() {
1978
+ var size = getSize( this.element );
1979
+ // check that this.size and size are there
1980
+ // IE8 triggers resize on body size change, so they might not be
1981
+ var hasSizes = this.size && size;
1982
+ return hasSizes && size.innerWidth !== this.size.innerWidth;
1983
+ };
1984
+
1985
+ // -------------------------- methods -------------------------- //
1986
+
1987
+ /**
1988
+ * add items to Outlayer instance
1989
+ * @param {Array or NodeList or Element} elems
1990
+ * @returns {Array} items - Outlayer.Items
1991
+ **/
1992
+ proto.addItems = function( elems ) {
1993
+ var items = this._itemize( elems );
1994
+ // add items to collection
1995
+ if ( items.length ) {
1996
+ this.items = this.items.concat( items );
1997
+ }
1998
+ return items;
1999
+ };
2000
+
2001
+ /**
2002
+ * Layout newly-appended item elements
2003
+ * @param {Array or NodeList or Element} elems
2004
+ */
2005
+ proto.appended = function( elems ) {
2006
+ var items = this.addItems( elems );
2007
+ if ( !items.length ) {
2008
+ return;
2009
+ }
2010
+ // layout and reveal just the new items
2011
+ this.layoutItems( items, true );
2012
+ this.reveal( items );
2013
+ };
2014
+
2015
+ /**
2016
+ * Layout prepended elements
2017
+ * @param {Array or NodeList or Element} elems
2018
+ */
2019
+ proto.prepended = function( elems ) {
2020
+ var items = this._itemize( elems );
2021
+ if ( !items.length ) {
2022
+ return;
2023
+ }
2024
+ // add items to beginning of collection
2025
+ var previousItems = this.items.slice(0);
2026
+ this.items = items.concat( previousItems );
2027
+ // start new layout
2028
+ this._resetLayout();
2029
+ this._manageStamps();
2030
+ // layout new stuff without transition
2031
+ this.layoutItems( items, true );
2032
+ this.reveal( items );
2033
+ // layout previous items
2034
+ this.layoutItems( previousItems );
2035
+ };
2036
+
2037
+ /**
2038
+ * reveal a collection of items
2039
+ * @param {Array of Outlayer.Items} items
2040
+ */
2041
+ proto.reveal = function( items ) {
2042
+ this._emitCompleteOnItems( 'reveal', items );
2043
+ if ( !items || !items.length ) {
2044
+ return;
2045
+ }
2046
+ var stagger = this.updateStagger();
2047
+ items.forEach( function( item, i ) {
2048
+ item.stagger( i * stagger );
2049
+ item.reveal();
2050
+ });
2051
+ };
2052
+
2053
+ /**
2054
+ * hide a collection of items
2055
+ * @param {Array of Outlayer.Items} items
2056
+ */
2057
+ proto.hide = function( items ) {
2058
+ this._emitCompleteOnItems( 'hide', items );
2059
+ if ( !items || !items.length ) {
2060
+ return;
2061
+ }
2062
+ var stagger = this.updateStagger();
2063
+ items.forEach( function( item, i ) {
2064
+ item.stagger( i * stagger );
2065
+ item.hide();
2066
+ });
2067
+ };
2068
+
2069
+ /**
2070
+ * reveal item elements
2071
+ * @param {Array}, {Element}, {NodeList} items
2072
+ */
2073
+ proto.revealItemElements = function( elems ) {
2074
+ var items = this.getItems( elems );
2075
+ this.reveal( items );
2076
+ };
2077
+
2078
+ /**
2079
+ * hide item elements
2080
+ * @param {Array}, {Element}, {NodeList} items
2081
+ */
2082
+ proto.hideItemElements = function( elems ) {
2083
+ var items = this.getItems( elems );
2084
+ this.hide( items );
2085
+ };
2086
+
2087
+ /**
2088
+ * get Outlayer.Item, given an Element
2089
+ * @param {Element} elem
2090
+ * @param {Function} callback
2091
+ * @returns {Outlayer.Item} item
2092
+ */
2093
+ proto.getItem = function( elem ) {
2094
+ // loop through items to get the one that matches
2095
+ for ( var i=0; i < this.items.length; i++ ) {
2096
+ var item = this.items[i];
2097
+ if ( item.element == elem ) {
2098
+ // return item
2099
+ return item;
2100
+ }
2101
+ }
2102
+ };
2103
+
2104
+ /**
2105
+ * get collection of Outlayer.Items, given Elements
2106
+ * @param {Array} elems
2107
+ * @returns {Array} items - Outlayer.Items
2108
+ */
2109
+ proto.getItems = function( elems ) {
2110
+ elems = utils.makeArray( elems );
2111
+ var items = [];
2112
+ elems.forEach( function( elem ) {
2113
+ var item = this.getItem( elem );
2114
+ if ( item ) {
2115
+ items.push( item );
2116
+ }
2117
+ }, this );
2118
+
2119
+ return items;
2120
+ };
2121
+
2122
+ /**
2123
+ * remove element(s) from instance and DOM
2124
+ * @param {Array or NodeList or Element} elems
2125
+ */
2126
+ proto.remove = function( elems ) {
2127
+ var removeItems = this.getItems( elems );
2128
+
2129
+ this._emitCompleteOnItems( 'remove', removeItems );
2130
+
2131
+ // bail if no items to remove
2132
+ if ( !removeItems || !removeItems.length ) {
2133
+ return;
2134
+ }
2135
+
2136
+ removeItems.forEach( function( item ) {
2137
+ item.remove();
2138
+ // remove item from collection
2139
+ utils.removeFrom( this.items, item );
2140
+ }, this );
2141
+ };
2142
+
2143
+ // ----- destroy ----- //
2144
+
2145
+ // remove and disable Outlayer instance
2146
+ proto.destroy = function() {
2147
+ // clean up dynamic styles
2148
+ var style = this.element.style;
2149
+ style.height = '';
2150
+ style.position = '';
2151
+ style.width = '';
2152
+ // destroy items
2153
+ this.items.forEach( function( item ) {
2154
+ item.destroy();
2155
+ });
2156
+
2157
+ this.unbindResize();
2158
+
2159
+ var id = this.element.outlayerGUID;
2160
+ delete instances[ id ]; // remove reference to instance by id
2161
+ delete this.element.outlayerGUID;
2162
+ // remove data for jQuery
2163
+ if ( jQuery ) {
2164
+ jQuery.removeData( this.element, this.constructor.namespace );
2165
+ }
2166
+
2167
+ };
2168
+
2169
+ // -------------------------- data -------------------------- //
2170
+
2171
+ /**
2172
+ * get Outlayer instance from element
2173
+ * @param {Element} elem
2174
+ * @returns {Outlayer}
2175
+ */
2176
+ Outlayer.data = function( elem ) {
2177
+ elem = utils.getQueryElement( elem );
2178
+ var id = elem && elem.outlayerGUID;
2179
+ return id && instances[ id ];
2180
+ };
2181
+
2182
+
2183
+ // -------------------------- create Outlayer class -------------------------- //
2184
+
2185
+ /**
2186
+ * create a layout class
2187
+ * @param {String} namespace
2188
+ */
2189
+ Outlayer.create = function( namespace, options ) {
2190
+ // sub-class Outlayer
2191
+ var Layout = subclass( Outlayer );
2192
+ // apply new options and compatOptions
2193
+ Layout.defaults = utils.extend( {}, Outlayer.defaults );
2194
+ utils.extend( Layout.defaults, options );
2195
+ Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions );
2196
+
2197
+ Layout.namespace = namespace;
2198
+
2199
+ Layout.data = Outlayer.data;
2200
+
2201
+ // sub-class Item
2202
+ Layout.Item = subclass( Item );
2203
+
2204
+ // -------------------------- declarative -------------------------- //
2205
+
2206
+ utils.htmlInit( Layout, namespace );
2207
+
2208
+ // -------------------------- jQuery bridge -------------------------- //
2209
+
2210
+ // make into jQuery plugin
2211
+ if ( jQuery && jQuery.bridget ) {
2212
+ jQuery.bridget( namespace, Layout );
2213
+ }
2214
+
2215
+ return Layout;
2216
+ };
2217
+
2218
+ function subclass( Parent ) {
2219
+ function SubClass() {
2220
+ Parent.apply( this, arguments );
2221
+ }
2222
+
2223
+ SubClass.prototype = Object.create( Parent.prototype );
2224
+ SubClass.prototype.constructor = SubClass;
2225
+
2226
+ return SubClass;
2227
+ }
2228
+
2229
+ // ----- helpers ----- //
2230
+
2231
+ // how many milliseconds are in each unit
2232
+ var msUnits = {
2233
+ ms: 1,
2234
+ s: 1000
2235
+ };
2236
+
2237
+ // munge time-like parameter into millisecond number
2238
+ // '0.4s' -> 40
2239
+ function getMilliseconds( time ) {
2240
+ if ( typeof time == 'number' ) {
2241
+ return time;
2242
+ }
2243
+ var matches = time.match( /(^\d*\.?\d*)(\w*)/ );
2244
+ var num = matches && matches[1];
2245
+ var unit = matches && matches[2];
2246
+ if ( !num.length ) {
2247
+ return 0;
2248
+ }
2249
+ num = parseFloat( num );
2250
+ var mult = msUnits[ unit ] || 1;
2251
+ return num * mult;
2252
+ }
2253
+
2254
+ // ----- fin ----- //
2255
+
2256
+ // back in global
2257
+ Outlayer.Item = Item;
2258
+
2259
+ return Outlayer;
2260
+
2261
+ }));
2262
+
2263
+ /*!
2264
+ * Masonry v4.2.1
2265
+ * Cascading grid layout library
2266
+ * https://masonry.desandro.com
2267
+ * MIT License
2268
+ * by David DeSandro
2269
+ */
2270
+
2271
+ ( function( window, factory ) {
2272
+ // universal module definition
2273
+ /* jshint strict: false */ /*globals define, module, require */
2274
+ if ( typeof define == 'function' && define.amd ) {
2275
+ // AMD
2276
+ define( [
2277
+ 'outlayer/outlayer',
2278
+ 'get-size/get-size'
2279
+ ],
2280
+ factory );
2281
+ } else if ( typeof module == 'object' && module.exports ) {
2282
+ // CommonJS
2283
+ module.exports = factory(
2284
+ require('outlayer'),
2285
+ require('get-size')
2286
+ );
2287
+ } else {
2288
+ // browser global
2289
+ window.Masonry = factory(
2290
+ window.Outlayer,
2291
+ window.getSize
2292
+ );
2293
+ }
2294
+
2295
+ }( window, function factory( Outlayer, getSize ) {
2296
+
2297
+
2298
+
2299
+ // -------------------------- masonryDefinition -------------------------- //
2300
+
2301
+ // create an Outlayer layout class
2302
+ var Masonry = Outlayer.create('masonry');
2303
+ // isFitWidth -> fitWidth
2304
+ Masonry.compatOptions.fitWidth = 'isFitWidth';
2305
+
2306
+ var proto = Masonry.prototype;
2307
+
2308
+ proto._resetLayout = function() {
2309
+ this.getSize();
2310
+ this._getMeasurement( 'columnWidth', 'outerWidth' );
2311
+ this._getMeasurement( 'gutter', 'outerWidth' );
2312
+ this.measureColumns();
2313
+
2314
+ // reset column Y
2315
+ this.colYs = [];
2316
+ for ( var i=0; i < this.cols; i++ ) {
2317
+ this.colYs.push( 0 );
2318
+ }
2319
+
2320
+ this.maxY = 0;
2321
+ this.horizontalColIndex = 0;
2322
+ };
2323
+
2324
+ proto.measureColumns = function() {
2325
+ this.getContainerWidth();
2326
+ // if columnWidth is 0, default to outerWidth of first item
2327
+ if ( !this.columnWidth ) {
2328
+ var firstItem = this.items[0];
2329
+ var firstItemElem = firstItem && firstItem.element;
2330
+ // columnWidth fall back to item of first element
2331
+ this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth ||
2332
+ // if first elem has no width, default to size of container
2333
+ this.containerWidth;
2334
+ }
2335
+
2336
+ var columnWidth = this.columnWidth += this.gutter;
2337
+
2338
+ // calculate columns
2339
+ var containerWidth = this.containerWidth + this.gutter;
2340
+ var cols = containerWidth / columnWidth;
2341
+ // fix rounding errors, typically with gutters
2342
+ var excess = columnWidth - containerWidth % columnWidth;
2343
+ // if overshoot is less than a pixel, round up, otherwise floor it
2344
+ var mathMethod = excess && excess < 1 ? 'round' : 'floor';
2345
+ cols = Math[ mathMethod ]( cols );
2346
+ this.cols = Math.max( cols, 1 );
2347
+ };
2348
+
2349
+ proto.getContainerWidth = function() {
2350
+ // container is parent if fit width
2351
+ var isFitWidth = this._getOption('fitWidth');
2352
+ var container = isFitWidth ? this.element.parentNode : this.element;
2353
+ // check that this.size and size are there
2354
+ // IE8 triggers resize on body size change, so they might not be
2355
+ var size = getSize( container );
2356
+ this.containerWidth = size && size.innerWidth;
2357
+ };
2358
+
2359
+ proto._getItemLayoutPosition = function( item ) {
2360
+ item.getSize();
2361
+ // how many columns does this brick span
2362
+ var remainder = item.size.outerWidth % this.columnWidth;
2363
+ var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';
2364
+ // round if off by 1 pixel, otherwise use ceil
2365
+ var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );
2366
+ colSpan = Math.min( colSpan, this.cols );
2367
+ // use horizontal or top column position
2368
+ var colPosMethod = this.options.horizontalOrder ?
2369
+ '_getHorizontalColPosition' : '_getTopColPosition';
2370
+ var colPosition = this[ colPosMethod ]( colSpan, item );
2371
+ // position the brick
2372
+ var position = {
2373
+ x: this.columnWidth * colPosition.col,
2374
+ y: colPosition.y
2375
+ };
2376
+ // apply setHeight to necessary columns
2377
+ var setHeight = colPosition.y + item.size.outerHeight;
2378
+ var setMax = colSpan + colPosition.col;
2379
+ for ( var i = colPosition.col; i < setMax; i++ ) {
2380
+ this.colYs[i] = setHeight;
2381
+ }
2382
+
2383
+ return position;
2384
+ };
2385
+
2386
+ proto._getTopColPosition = function( colSpan ) {
2387
+ var colGroup = this._getTopColGroup( colSpan );
2388
+ // get the minimum Y value from the columns
2389
+ var minimumY = Math.min.apply( Math, colGroup );
2390
+
2391
+ return {
2392
+ col: colGroup.indexOf( minimumY ),
2393
+ y: minimumY,
2394
+ };
2395
+ };
2396
+
2397
+ /**
2398
+ * @param {Number} colSpan - number of columns the element spans
2399
+ * @returns {Array} colGroup
2400
+ */
2401
+ proto._getTopColGroup = function( colSpan ) {
2402
+ if ( colSpan < 2 ) {
2403
+ // if brick spans only one column, use all the column Ys
2404
+ return this.colYs;
2405
+ }
2406
+
2407
+ var colGroup = [];
2408
+ // how many different places could this brick fit horizontally
2409
+ var groupCount = this.cols + 1 - colSpan;
2410
+ // for each group potential horizontal position
2411
+ for ( var i = 0; i < groupCount; i++ ) {
2412
+ colGroup[i] = this._getColGroupY( i, colSpan );
2413
+ }
2414
+ return colGroup;
2415
+ };
2416
+
2417
+ proto._getColGroupY = function( col, colSpan ) {
2418
+ if ( colSpan < 2 ) {
2419
+ return this.colYs[ col ];
2420
+ }
2421
+ // make an array of colY values for that one group
2422
+ var groupColYs = this.colYs.slice( col, col + colSpan );
2423
+ // and get the max value of the array
2424
+ return Math.max.apply( Math, groupColYs );
2425
+ };
2426
+
2427
+ // get column position based on horizontal index. #873
2428
+ proto._getHorizontalColPosition = function( colSpan, item ) {
2429
+ var col = this.horizontalColIndex % this.cols;
2430
+ var isOver = colSpan > 1 && col + colSpan > this.cols;
2431
+ // shift to next row if item can't fit on current row
2432
+ col = isOver ? 0 : col;
2433
+ // don't let zero-size items take up space
2434
+ var hasSize = item.size.outerWidth && item.size.outerHeight;
2435
+ this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;
2436
+
2437
+ return {
2438
+ col: col,
2439
+ y: this._getColGroupY( col, colSpan ),
2440
+ };
2441
+ };
2442
+
2443
+ proto._manageStamp = function( stamp ) {
2444
+ var stampSize = getSize( stamp );
2445
+ var offset = this._getElementOffset( stamp );
2446
+ // get the columns that this stamp affects
2447
+ var isOriginLeft = this._getOption('originLeft');
2448
+ var firstX = isOriginLeft ? offset.left : offset.right;
2449
+ var lastX = firstX + stampSize.outerWidth;
2450
+ var firstCol = Math.floor( firstX / this.columnWidth );
2451
+ firstCol = Math.max( 0, firstCol );
2452
+ var lastCol = Math.floor( lastX / this.columnWidth );
2453
+ // lastCol should not go over if multiple of columnWidth #425
2454
+ lastCol -= lastX % this.columnWidth ? 0 : 1;
2455
+ lastCol = Math.min( this.cols - 1, lastCol );
2456
+ // set colYs to bottom of the stamp
2457
+
2458
+ var isOriginTop = this._getOption('originTop');
2459
+ var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) +
2460
+ stampSize.outerHeight;
2461
+ for ( var i = firstCol; i <= lastCol; i++ ) {
2462
+ this.colYs[i] = Math.max( stampMaxY, this.colYs[i] );
2463
+ }
2464
+ };
2465
+
2466
+ proto._getContainerSize = function() {
2467
+ this.maxY = Math.max.apply( Math, this.colYs );
2468
+ var size = {
2469
+ height: this.maxY
2470
+ };
2471
+
2472
+ if ( this._getOption('fitWidth') ) {
2473
+ size.width = this._getContainerFitWidth();
2474
+ }
2475
+
2476
+ return size;
2477
+ };
2478
+
2479
+ proto._getContainerFitWidth = function() {
2480
+ var unusedCols = 0;
2481
+ // count unused columns
2482
+ var i = this.cols;
2483
+ while ( --i ) {
2484
+ if ( this.colYs[i] !== 0 ) {
2485
+ break;
2486
+ }
2487
+ unusedCols++;
2488
+ }
2489
+ // fit container to columns that have been used
2490
+ return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;
2491
+ };
2492
+
2493
+ proto.needsResizeLayout = function() {
2494
+ var previousWidth = this.containerWidth;
2495
+ this.getContainerWidth();
2496
+ return previousWidth != this.containerWidth;
2497
+ };
2498
+
2499
+ return Masonry;
2500
+
2501
+ }));
2502
+
assets/masonry/masonry.pkgd.min.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Masonry PACKAGED v4.2.1
3
+ * Cascading grid layout library
4
+ * https://masonry.desandro.com
5
+ * MIT License
6
+ * by David DeSandro
7
+ */
8
+
9
+ !function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);r.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e},i.makeArray=function(t){var e=[];if(Array.isArray(t))e=t;else if(t&&"object"==typeof t&&"number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];t&&clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i||100)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var n=t.console;return i.htmlInit=function(e,o){i.docReady(function(){var r=i.toDashed(o),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(n&&n.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,o,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=this.layout.size,s=-1!=n.indexOf("%")?parseFloat(n)/100*r.width:parseInt(n,10),a=-1!=o.indexOf("%")?parseFloat(o)/100*r.height:parseInt(o,10);s=isNaN(s)?0:s,a=isNaN(a)?0:a,s-=e?r.paddingLeft:r.paddingRight,a-=i?r.paddingTop:r.paddingBottom,this.position.x=s,this.position.y=a},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,h=e-n,u={};u.transform=this.getTranslate(a,h),this.transition({to:u,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
assets/nivo/nivo-lightbox.css ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Nivo Lightbox v1.3.1
3
+ * http://dev7studios.com/nivo-lightbox
4
+ *
5
+ * Copyright 2013, Dev7studios
6
+ * Free to use and abuse under the MIT license.
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ */
9
+
10
+ .nivo-lightbox-overlay {
11
+ position: fixed;
12
+ top: 0;
13
+ left: 0;
14
+ z-index: 99998;
15
+ width: 100%;
16
+ height: 100%;
17
+ overflow: hidden;
18
+ visibility: hidden;
19
+ opacity: 0;
20
+ -webkit-box-sizing: border-box;
21
+ -moz-box-sizing: border-box;
22
+ box-sizing: border-box;
23
+ }
24
+ .nivo-lightbox-overlay.nivo-lightbox-open {
25
+ visibility: visible;
26
+ opacity: 1;
27
+ }
28
+ .nivo-lightbox-wrap {
29
+ position: absolute;
30
+ top: 10%;
31
+ bottom: 10%;
32
+ left: 10%;
33
+ right: 10%;
34
+ }
35
+ .nivo-lightbox-content {
36
+ width: 100%;
37
+ height: 100%;
38
+ }
39
+ .nivo-lightbox-title-wrap {
40
+ position: absolute;
41
+ bottom: 0;
42
+ left: 0;
43
+ width: 100%;
44
+ z-index: 99999;
45
+ text-align: center;
46
+ }
47
+ .nivo-lightbox-nav { display: none; }
48
+ .nivo-lightbox-prev {
49
+ position: absolute;
50
+ top: 50%;
51
+ left: 0;
52
+ }
53
+ .nivo-lightbox-next {
54
+ position: absolute;
55
+ top: 50%;
56
+ right: 0;
57
+ }
58
+ .nivo-lightbox-close {
59
+ position: absolute;
60
+ top: 2%;
61
+ right: 2%;
62
+ }
63
+
64
+ .nivo-lightbox-image { text-align: center; }
65
+ .nivo-lightbox-image img {
66
+ max-width: 100%;
67
+ max-height: 100%;
68
+ width: auto;
69
+ height: auto;
70
+ vertical-align: middle;
71
+ }
72
+ .nivo-lightbox-content iframe {
73
+ width: 100%;
74
+ height: 100%;
75
+ }
76
+ .nivo-lightbox-inline,
77
+ .nivo-lightbox-ajax {
78
+ max-height: 100%;
79
+ overflow: auto;
80
+ -webkit-box-sizing: border-box;
81
+ -moz-box-sizing: border-box;
82
+ box-sizing: border-box;
83
+ /* https://bugzilla.mozilla.org/show_bug.cgi?id=308801 */
84
+ }
85
+ .nivo-lightbox-error {
86
+ display: table;
87
+ text-align: center;
88
+ width: 100%;
89
+ height: 100%;
90
+ color: #fff;
91
+ text-shadow: 0 1px 1px #000;
92
+ }
93
+ .nivo-lightbox-error p {
94
+ display: table-cell;
95
+ vertical-align: middle;
96
+ }
97
+
98
+ /* Effects
99
+ **********************************************/
100
+ .nivo-lightbox-notouch .nivo-lightbox-effect-fade,
101
+ .nivo-lightbox-notouch .nivo-lightbox-effect-fadeScale,
102
+ .nivo-lightbox-notouch .nivo-lightbox-effect-slideLeft,
103
+ .nivo-lightbox-notouch .nivo-lightbox-effect-slideRight,
104
+ .nivo-lightbox-notouch .nivo-lightbox-effect-slideUp,
105
+ .nivo-lightbox-notouch .nivo-lightbox-effect-slideDown,
106
+ .nivo-lightbox-notouch .nivo-lightbox-effect-fall {
107
+ -webkit-transition: all 0.2s ease-in-out;
108
+ -moz-transition: all 0.2s ease-in-out;
109
+ -ms-transition: all 0.2s ease-in-out;
110
+ -o-transition: all 0.2s ease-in-out;
111
+ transition: all 0.2s ease-in-out;
112
+ }
113
+
114
+ /* fadeScale */
115
+ .nivo-lightbox-effect-fadeScale .nivo-lightbox-wrap {
116
+ -webkit-transition: all 0.3s;
117
+ -moz-transition: all 0.3s;
118
+ -ms-transition: all 0.3s;
119
+ -o-transition: all 0.3s;
120
+ transition: all 0.3s;
121
+ -webkit-transform: scale(0.7);
122
+ -moz-transform: scale(0.7);
123
+ -ms-transform: scale(0.7);
124
+ transform: scale(0.7);
125
+ }
126
+ .nivo-lightbox-effect-fadeScale.nivo-lightbox-open .nivo-lightbox-wrap {
127
+ -webkit-transform: scale(1);
128
+ -moz-transform: scale(1);
129
+ -ms-transform: scale(1);
130
+ transform: scale(1);
131
+ }
132
+
133
+ /* slideLeft / slideRight / slideUp / slideDown */
134
+ .nivo-lightbox-effect-slideLeft .nivo-lightbox-wrap,
135
+ .nivo-lightbox-effect-slideRight .nivo-lightbox-wrap,
136
+ .nivo-lightbox-effect-slideUp .nivo-lightbox-wrap,
137
+ .nivo-lightbox-effect-slideDown .nivo-lightbox-wrap {
138
+ -webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
139
+ -moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
140
+ -ms-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
141
+ -o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
142
+ transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
143
+ }
144
+ .nivo-lightbox-effect-slideLeft .nivo-lightbox-wrap {
145
+ -webkit-transform: translateX(-10%);
146
+ -moz-transform: translateX(-10%);
147
+ -ms-transform: translateX(-10%);
148
+ transform: translateX(-10%);
149
+ }
150
+ .nivo-lightbox-effect-slideRight .nivo-lightbox-wrap {
151
+ -webkit-transform: translateX(10%);
152
+ -moz-transform: translateX(10%);
153
+ -ms-transform: translateX(10%);
154
+ transform: translateX(10%);
155
+ }
156
+ .nivo-lightbox-effect-slideLeft.nivo-lightbox-open .nivo-lightbox-wrap,
157
+ .nivo-lightbox-effect-slideRight.nivo-lightbox-open .nivo-lightbox-wrap {
158
+ -webkit-transform: translateX(0);
159
+ -moz-transform: translateX(0);
160
+ -ms-transform: translateX(0);
161
+ transform: translateX(0);
162
+ }
163
+ .nivo-lightbox-effect-slideDown .nivo-lightbox-wrap {
164
+ -webkit-transform: translateY(-10%);
165
+ -moz-transform: translateY(-10%);
166
+ -ms-transform: translateY(-10%);
167
+ transform: translateY(-10%);
168
+ }
169
+ .nivo-lightbox-effect-slideUp .nivo-lightbox-wrap {
170
+ -webkit-transform: translateY(10%);
171
+ -moz-transform: translateY(10%);
172
+ -ms-transform: translateY(10%);
173
+ transform: translateY(10%);
174
+ }
175
+ .nivo-lightbox-effect-slideUp.nivo-lightbox-open .nivo-lightbox-wrap,
176
+ .nivo-lightbox-effect-slideDown.nivo-lightbox-open .nivo-lightbox-wrap {
177
+ -webkit-transform: translateY(0);
178
+ -moz-transform: translateY(0);
179
+ -ms-transform: translateY(0);
180
+ transform: translateY(0);
181
+ }
182
+
183
+ /* fall */
184
+ .nivo-lightbox-body-effect-fall .nivo-lightbox-effect-fall {
185
+ -webkit-perspective: 1000px;
186
+ -moz-perspective: 1000px;
187
+ perspective: 1000px;
188
+ }
189
+ .nivo-lightbox-effect-fall .nivo-lightbox-wrap {
190
+ -webkit-transition: all 0.3s ease-out;
191
+ -moz-transition: all 0.3s ease-out;
192
+ -ms-transition: all 0.3s ease-out;
193
+ -o-transition: all 0.3s ease-out;
194
+ transition: all 0.3s ease-out;
195
+ -webkit-transform: translateZ(300px);
196
+ -moz-transform: translateZ(300px);
197
+ -ms-transform: translateZ(300px);
198
+ transform: translateZ(300px);
199
+ }
200
+ .nivo-lightbox-effect-fall.nivo-lightbox-open .nivo-lightbox-wrap {
201
+ -webkit-transform: translateZ(0);
202
+ -moz-transform: translateZ(0);
203
+ -ms-transform: translateZ(0);
204
+ transform: translateZ(0);
205
+ }
assets/nivo/nivo-lightbox.js ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Nivo Lightbox v1.3.1
3
+ * http://dev7studios.com/nivo-lightbox
4
+ *
5
+ * Copyright 2013, Dev7studios
6
+ * Free to use and abuse under the MIT license.
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ */
9
+
10
+ ;(function($, window, document, undefined){
11
+
12
+ var pluginName = 'nivoLightbox',
13
+ defaults = {
14
+ effect: 'fade',
15
+ theme: 'default',
16
+ keyboardNav: true,
17
+ clickImgToClose: false,
18
+ clickOverlayToClose: true,
19
+ onInit: function(){},
20
+ beforeShowLightbox: function(){},
21
+ afterShowLightbox: function(lightbox){},
22
+ beforeHideLightbox: function(){},
23
+ afterHideLightbox: function(){},
24
+ beforePrev: function(element){},
25
+ onPrev: function(element){},
26
+ beforeNext: function(element){},
27
+ onNext: function(element){},
28
+ errorMessage: 'The requested content cannot be loaded. Please try again later.'
29
+ };
30
+
31
+ function NivoLightbox(element, options){
32
+ this.el = element;
33
+ this.$el = $(this.el);
34
+
35
+ this.options = $.extend({}, defaults, options);
36
+
37
+ this._defaults = defaults;
38
+ this._name = pluginName;
39
+
40
+ this.init();
41
+ }
42
+
43
+ NivoLightbox.prototype = {
44
+
45
+ init: function(){
46
+ var $this = this;
47
+
48
+ // Need this so we don't use CSS transitions in mobile
49
+ if(!$('html').hasClass('nivo-lightbox-notouch')) $('html').addClass('nivo-lightbox-notouch');
50
+ if('ontouchstart' in document) $('html').removeClass('nivo-lightbox-notouch');
51
+
52
+ // Setup the click
53
+ this.$el.on('click', function(e){
54
+ $this.showLightbox(e);
55
+ });
56
+
57
+ // keyboardNav
58
+ if(this.options.keyboardNav){
59
+ $('body').off('keyup').on('keyup', function(e){
60
+ var code = (e.keyCode ? e.keyCode : e.which);
61
+ // Escape
62
+ if(code == 27) $this.destructLightbox();
63
+ // Left
64
+ if(code == 37) $('.nivo-lightbox-prev').trigger('click');
65
+ // Right
66
+ if(code == 39) $('.nivo-lightbox-next').trigger('click');
67
+ });
68
+ }
69
+
70
+ this.options.onInit.call(this);
71
+
72
+ },
73
+
74
+ showLightbox: function(e){
75
+ var $this = this,
76
+ currentLink = this.$el;
77
+
78
+ // Check content
79
+ var check = this.checkContent(currentLink);
80
+ if(!check) return;
81
+
82
+ e.preventDefault();
83
+ this.options.beforeShowLightbox.call(this);
84
+ var lightbox = this.constructLightbox();
85
+ if(!lightbox) return;
86
+ var content = lightbox.find('.nivo-lightbox-content');
87
+ if(!content) return;
88
+
89
+ $('body').addClass('nivo-lightbox-body-effect-'+ this.options.effect);
90
+
91
+ this.processContent( content, currentLink );
92
+
93
+ // Nav
94
+ if(this.$el.attr('data-lightbox-gallery')){
95
+ var galleryItems = $('[data-lightbox-gallery="'+ this.$el.attr('data-lightbox-gallery') +'"]');
96
+
97
+ $('.nivo-lightbox-nav').show();
98
+
99
+ // Prev
100
+ $('.nivo-lightbox-prev').off('click').on('click', function(e){
101
+ e.preventDefault();
102
+ var index = galleryItems.index(currentLink);
103
+ currentLink = galleryItems.eq(index - 1);
104
+ if(!$(currentLink).length) currentLink = galleryItems.last();
105
+ $.when($this.options.beforePrev.call(this, [ currentLink ])).done(function(){
106
+ $this.processContent(content, currentLink);
107
+ $this.options.onPrev.call(this, [ currentLink ]);
108
+ });
109
+ });
110
+
111
+ // Next
112
+ $('.nivo-lightbox-next').off('click').on('click', function(e){
113
+ e.preventDefault();
114
+ var index = galleryItems.index(currentLink);
115
+ currentLink = galleryItems.eq(index + 1);
116
+ if(!$(currentLink).length) currentLink = galleryItems.first();
117
+ $.when($this.options.beforeNext.call(this, [ currentLink ])).done(function(){
118
+ $this.processContent(content, currentLink);
119
+ $this.options.onNext.call(this, [ currentLink ]);
120
+ });
121
+ });
122
+ }
123
+
124
+ setTimeout(function(){
125
+ lightbox.addClass('nivo-lightbox-open');
126
+ $this.options.afterShowLightbox.call(this, [ lightbox ]);
127
+ }, 1); // For CSS transitions
128
+ },
129
+
130
+ checkContent: function( link ) {
131
+ var $this = this,
132
+ href = link.attr('href'),
133
+ video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
134
+
135
+ if(href.match(/\.(jpeg|jpg|gif|png)$/i) !== null){
136
+ return true;
137
+ }
138
+ // Video (Youtube/Vimeo)
139
+ else if(video){
140
+ return true;
141
+ }
142
+ // AJAX
143
+ else if(link.attr('data-lightbox-type') == 'ajax'){
144
+ return true;
145
+ }
146
+ // Inline HTML
147
+ else if(href.substring(0, 1) == '#' && link.attr('data-lightbox-type') == 'inline'){
148
+ return true;
149
+ }
150
+ // iFrame (default)
151
+ else if(link.attr('data-lightbox-type') == 'iframe'){
152
+ return true;
153
+ }
154
+
155
+ return false;
156
+ },
157
+
158
+ processContent: function(content, link){
159
+ var $this = this,
160
+ href = link.attr('href'),
161
+ video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
162
+
163
+ content.html('').addClass('nivo-lightbox-loading');
164
+
165
+ // Is HiDPI?
166
+ if(this.isHidpi() && link.attr('data-lightbox-hidpi')){
167
+ href = link.attr('data-lightbox-hidpi');
168
+ }
169
+
170
+ // Image
171
+ if(href.match(/\.(jpeg|jpg|gif|png)$/i) !== null){
172
+ var img = $('<img>', { src: href, 'class': 'nivo-lightbox-image-display' });
173
+ img.one('load', function() {
174
+ var wrap = $('<div class="nivo-lightbox-image" />');
175
+ wrap.append(img);
176
+ content.html(wrap).removeClass('nivo-lightbox-loading');
177
+
178
+ // Vertically center images
179
+ wrap.css({
180
+ 'line-height': $('.nivo-lightbox-content').height() +'px',
181
+ 'height': $('.nivo-lightbox-content').height() +'px' // For Firefox
182
+ });
183
+ $(window).resize(function() {
184
+ wrap.css({
185
+ 'line-height': $('.nivo-lightbox-content').height() +'px',
186
+ 'height': $('.nivo-lightbox-content').height() +'px' // For Firefox
187
+ });
188
+ });
189
+ }).each(function() {
190
+ if(this.complete) $(this).load();
191
+ });
192
+
193
+ img.error(function() {
194
+ var wrap = $('<div class="nivo-lightbox-error"><p>'+ $this.options.errorMessage +'</p></div>');
195
+ content.html(wrap).removeClass('nivo-lightbox-loading');
196
+ });
197
+ }
198
+ // Video (Youtube/Vimeo)
199
+ else if(video){
200
+ var src = '',
201
+ classTerm = 'nivo-lightbox-video';
202
+
203
+ if(video[1] == 'youtube'){
204
+ src = '//www.youtube.com/embed/'+ video[4];
205
+ classTerm = 'nivo-lightbox-youtube';
206
+ }
207
+ if(video[1] == 'youtube-nocookie'){
208
+ src = href; //https://www.youtube-nocookie.com/embed/...
209
+ classTerm = 'nivo-lightbox-youtube';
210
+ }
211
+ if(video[1] == 'youtu'){
212
+ src = '//www.youtube.com/embed/'+ video[3];
213
+ classTerm = 'nivo-lightbox-youtube';
214
+ }
215
+ if(video[1] == 'vimeo'){
216
+ src = '//player.vimeo.com/video/'+ video[3];
217
+ classTerm = 'nivo-lightbox-vimeo';
218
+ }
219
+
220
+ if(src){
221
+ var iframeVideo = $('<iframe>', {
222
+ src: src,
223
+ 'class': classTerm,
224
+ frameborder: 0,
225
+ vspace: 0,
226
+ hspace: 0,
227
+ scrolling: 'auto'
228
+ });
229
+ content.html(iframeVideo);
230
+ iframeVideo.load(function(){ content.removeClass('nivo-lightbox-loading'); });
231
+ }
232
+ }
233
+ // AJAX
234
+ else if(link.attr('data-lightbox-type') == 'ajax'){
235
+ $.ajax({
236
+ url: href,
237
+ cache: false,
238
+ success: function(data) {
239
+ var wrap = $('<div class="nivo-lightbox-ajax" />');
240
+ wrap.append(data);
241
+ content.html(wrap).removeClass('nivo-lightbox-loading');
242
+
243
+ // Vertically center html
244
+ if(wrap.outerHeight() < content.height()){
245
+ wrap.css({
246
+ 'position': 'relative',
247
+ 'top': '50%',
248
+ 'margin-top': -(wrap.outerHeight()/2) +'px'
249
+ });
250
+ }
251
+ $(window).resize(function() {
252
+ if(wrap.outerHeight() < content.height()){
253
+ wrap.css({
254
+ 'position': 'relative',
255
+ 'top': '50%',
256
+ 'margin-top': -(wrap.outerHeight()/2) +'px'
257
+ });
258
+ }
259
+ });
260
+ },
261
+ error: function(){
262
+ var wrap = $('<div class="nivo-lightbox-error"><p>'+ $this.options.errorMessage +'</p></div>');
263
+ content.html(wrap).removeClass('nivo-lightbox-loading');
264
+ }
265
+ });
266
+ }
267
+ // Inline HTML
268
+ else if(href.substring(0, 1) == '#' && link.attr('data-lightbox-type') == 'inline'){
269
+ if($(href).length){
270
+ var wrap = $('<div class="nivo-lightbox-inline" />');
271
+ wrap.append($(href).clone().show());
272
+ content.html(wrap).removeClass('nivo-lightbox-loading');
273
+
274
+ // Vertically center html
275
+ if(wrap.outerHeight() < content.height()){
276
+ wrap.css({
277
+ 'position': 'relative',
278
+ 'top': '50%',
279
+ 'margin-top': -(wrap.outerHeight()/2) +'px'
280
+ });
281
+ }
282
+ $(window).resize(function() {
283
+ if(wrap.outerHeight() < content.height()){
284
+ wrap.css({
285
+ 'position': 'relative',
286
+ 'top': '50%',
287
+ 'margin-top': -(wrap.outerHeight()/2) +'px'
288
+ });
289
+ }
290
+ });
291
+ } else {
292
+ var wrapError = $('<div class="nivo-lightbox-error"><p>'+ $this.options.errorMessage +'</p></div>');
293
+ content.html(wrapError).removeClass('nivo-lightbox-loading');
294
+ }
295
+ }
296
+ // iFrame (default)
297
+ else if(link.attr('data-lightbox-type') == 'iframe'){
298
+ var iframe = $('<iframe>', {
299
+ src: href,
300
+ 'class': 'nivo-lightbox-item',
301
+ frameborder: 0,
302
+ vspace: 0,
303
+ hspace: 0,
304
+ scrolling: 'auto'
305
+ });
306
+ content.html(iframe);
307
+ iframe.load(function(){ content.removeClass('nivo-lightbox-loading'); });
308
+ } else {
309
+ return false;
310
+ }
311
+
312
+ // Set the title
313
+ if(link.attr('title')){
314
+ var titleWrap = $('<span>', { 'class': 'nivo-lightbox-title' });
315
+ titleWrap.text(link.attr('title'));
316
+ $('.nivo-lightbox-title-wrap').html(titleWrap);
317
+ } else {
318
+ $('.nivo-lightbox-title-wrap').html('');
319
+ }
320
+ },
321
+
322
+ constructLightbox: function(){
323
+ if($('.nivo-lightbox-overlay').length) return $('.nivo-lightbox-overlay');
324
+
325
+ var overlay = $('<div>', { 'class': 'nivo-lightbox-overlay nivo-lightbox-theme-'+ this.options.theme +' nivo-lightbox-effect-'+ this.options.effect });
326
+ var wrap = $('<div>', { 'class': 'nivo-lightbox-wrap' });
327
+ var content = $('<div>', { 'class': 'nivo-lightbox-content' });
328
+ var nav = $('<a href="#" class="nivo-lightbox-nav nivo-lightbox-prev">Previous</a><a href="#" class="nivo-lightbox-nav nivo-lightbox-next">Next</a>');
329
+ var close = $('<a href="#" class="nivo-lightbox-close" title="Close">Close</a>');
330
+ var title = $('<div>', { 'class': 'nivo-lightbox-title-wrap' });
331
+
332
+ var isMSIE = /*@cc_on!@*/0;
333
+ if(isMSIE) overlay.addClass('nivo-lightbox-ie');
334
+
335
+ wrap.append(content);
336
+ wrap.append(title);
337
+ overlay.append(wrap);
338
+ overlay.append(nav);
339
+ overlay.append(close);
340
+ $('body').append(overlay);
341
+
342
+ var $this = this;
343
+ if($this.options.clickOverlayToClose){
344
+ overlay.on('click', function(e){
345
+ if(e.target === this || $(e.target).hasClass('nivo-lightbox-content') || $(e.target).hasClass('nivo-lightbox-image')){
346
+ $this.destructLightbox();
347
+ }
348
+ });
349
+ }
350
+ if($this.options.clickImgToClose){
351
+ overlay.on('click', function(e){
352
+ if(e.target === this || $(e.target).hasClass('nivo-lightbox-image-display')){
353
+ $this.destructLightbox();
354
+ }
355
+ });
356
+ }
357
+
358
+ close.on('click', function(e){
359
+ e.preventDefault();
360
+ $this.destructLightbox();
361
+ });
362
+
363
+ return overlay;
364
+ },
365
+
366
+ destructLightbox: function(){
367
+ var $this = this;
368
+ this.options.beforeHideLightbox.call(this);
369
+
370
+ $('.nivo-lightbox-overlay').removeClass('nivo-lightbox-open');
371
+ $('.nivo-lightbox-nav').hide();
372
+ $('body').removeClass('nivo-lightbox-body-effect-'+ $this.options.effect);
373
+
374
+ // For IE
375
+ var isMSIE = /*@cc_on!@*/0;
376
+ if(isMSIE){
377
+ $('.nivo-lightbox-overlay iframe').attr("src", " ");
378
+ $('.nivo-lightbox-overlay iframe').remove();
379
+ }
380
+
381
+ // Remove click handlers
382
+ $('.nivo-lightbox-prev').off('click');
383
+ $('.nivo-lightbox-next').off('click');
384
+
385
+ // Empty content (for videos)
386
+ $('.nivo-lightbox-content').empty();
387
+
388
+ this.options.afterHideLightbox.call(this);
389
+ },
390
+
391
+ isHidpi: function(){
392
+ var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
393
+ (min--moz-device-pixel-ratio: 1.5),\
394
+ (-o-min-device-pixel-ratio: 3/2),\
395
+ (min-resolution: 1.5dppx)";
396
+ if(window.devicePixelRatio > 1) return true;
397
+ if(window.matchMedia && window.matchMedia(mediaQuery).matches) return true;
398
+ return false;
399
+ }
400
+
401
+ };
402
+
403
+ $.fn[pluginName] = function(options){
404
+ return this.each(function(){
405
+ if(!$.data(this, pluginName)){
406
+ $.data(this, pluginName, new NivoLightbox(this, options));
407
+ }
408
+ });
409
+ };
410
+
411
+ })(jQuery, window, document);
assets/prettyphoto/css/prettyPhoto.css CHANGED
@@ -1,172 +1,796 @@
1
- div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height:13px}
2
- div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}
3
- div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}
4
- div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}
5
- div.pp_default .pp_content .ppt{color:#f8f8f8}
6
- div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}
7
- div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}
8
- div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}
9
- div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}
10
- div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px}
11
- div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}
12
- div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px}
13
- div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}
14
- div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer}
15
- div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}
16
- div.pp_default .pp_social{margin-top:7px}
17
- div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{position:static;left:auto}
18
- div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}
19
- div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}
20
- div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0}
21
- div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px}
22
- div.pp_default .pp_content_container .pp_details{margin-top:5px}
23
- div.pp_default .pp_nav{clear:none;height:30px;width:110px;position:relative}
24
- div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px}
25
- div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7}
26
- div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}
27
- div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}
28
- div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}
29
- div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}
30
- div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}
31
- div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}
32
- div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}
33
- div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}
34
- div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
35
- div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
36
- div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
37
- div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
38
- div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
39
- div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
40
- div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
41
- div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
42
- div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}
43
- div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}
44
- div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}
45
- div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}
46
- div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}
47
- div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}
48
- div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}
49
- div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}
50
- div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}
51
- div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
52
- div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
53
- div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
54
- div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
55
- div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
56
- div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
57
- div.dark_rounded .pp_description{margin-right:85px;color:#fff}
58
- div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
59
- div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
60
- div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}
61
- div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}
62
- div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}
63
- div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}
64
- div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}
65
- div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000}
66
- div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}
67
- div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}
68
- div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
69
- div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
70
- div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
71
- div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
72
- div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
73
- div.dark_square .pp_nav{clear:none}
74
- div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
75
- div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
76
- div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}
77
- div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}
78
- div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}
79
- div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}
80
- div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
81
- div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
82
- div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
83
- div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
84
- div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
85
- div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
86
- div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
87
- div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}
88
- div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}
89
- div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}
90
- div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}
91
- div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}
92
- div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}
93
- div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}
94
- div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}
95
- div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}
96
- div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}
97
- div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}
98
- div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}
99
- div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}
100
- div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer}
101
- div.facebook .pp_description{margin:0 37px 0 0}
102
- div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}
103
- div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}
104
- div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}
105
- div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}
106
- div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}
107
- div.facebook .pp_nav{margin-top:0}
108
- div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}
109
- div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}
110
- div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}
111
- div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}
112
- div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}
113
- div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}
114
- div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}
115
- div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}
116
- div.pp_pic_holder a:focus{outline:none}
117
- div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}
118
- div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}
119
- .pp_content{height:40px;min-width:40px}
120
- * html .pp_content{width:40px}
121
- .pp_content_container{position:relative;text-align:left;width:100%}
122
- .pp_content_container .pp_left{padding-left:20px}
123
- .pp_content_container .pp_right{padding-right:20px}
124
- .pp_content_container .pp_details{float:left;margin:10px 0 2px}
125
- .pp_description{display:none;margin:0}
126
- .pp_social{float:left;margin:0}
127
- .pp_social .facebook{float:left;margin-left:5px;width:55px;overflow:hidden}
128
- .pp_social .twitter{float:left}
129
- .pp_nav{clear:right;float:left;margin:3px 10px 0 0}
130
- .pp_nav p{float:left;white-space:nowrap;margin:2px 4px}
131
- .pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px}
132
- a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}
133
- .pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}
134
- .pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}
135
- .pp_gallery div{float:left;overflow:hidden;position:relative}
136
- .pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0}
137
- .pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden}
138
- .pp_gallery ul a img{border:0}
139
- .pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}
140
- .pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px}
141
- .pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important}
142
-
143
- a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) no-repeat 10000px center;display:block;float:right;height:100%;text-indent:-10000px;width:49%}
144
- a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) no-repeat -10000px center;display:block;float:left;height:100%;text-indent:-10000px;width:49%}
145
-
146
- a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}
147
- a.pp_close{position:absolute;right:0;top:0;display:block;line-height:22px;text-indent:-10000px}
148
- .pp_loaderIcon{display:block;height:24px;left:50%;position:absolute;top:50%;width:24px;margin:-12px 0 0 -12px}
149
- #pp_full_res{line-height:1!important}
150
- #pp_full_res .pp_inline{text-align:left}
151
- #pp_full_res .pp_inline p{margin:0 0 15px}
152
- div.ppt{color:#fff;display:none;font-size:17px;z-index:9999;margin:0 0 5px 15px}
153
- div.pp_default .pp_content,div.light_rounded .pp_content{background-color:#fff}
154
- div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000}
155
- div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff}
156
- div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative}
157
- div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff}
158
- div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}
159
- div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important}
160
- div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}
161
- div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}
162
- div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}
163
- div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat}
164
- div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}
165
- div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}
166
- .pp_top,.pp_bottom{height:20px;position:relative}
167
- * html .pp_top,* html .pp_bottom{padding:0 20px}
168
- .pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px}
169
- .pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px}
170
- * html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static}
171
- .pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
172
- .pp_fade,.pp_gallery li.default a img{display:none}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div.pp_default .pp_top,
2
+ div.pp_default .pp_top .pp_middle,
3
+ div.pp_default .pp_top .pp_left,
4
+ div.pp_default .pp_top .pp_right,
5
+ div.pp_default .pp_bottom,
6
+ div.pp_default .pp_bottom .pp_left,
7
+ div.pp_default .pp_bottom .pp_middle,
8
+ div.pp_default .pp_bottom .pp_right {
9
+ height: 13px
10
+ }
11
+ div.pp_default .pp_top .pp_left {
12
+ background: url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat
13
+ }
14
+ div.pp_default .pp_top .pp_middle {
15
+ background: url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x
16
+ }
17
+ div.pp_default .pp_top .pp_right {
18
+ background: url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat
19
+ }
20
+ div.pp_default .pp_content .ppt {
21
+ color: #f8f8f8
22
+ }
23
+ div.pp_default .pp_content_container .pp_left {
24
+ background: url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;
25
+ padding-left: 13px
26
+ }
27
+ div.pp_default .pp_content_container .pp_right {
28
+ background: url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;
29
+ padding-right: 13px
30
+ }
31
+ div.pp_default .pp_next:hover {
32
+ background: url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;
33
+ cursor: pointer
34
+ }
35
+ div.pp_default .pp_previous:hover {
36
+ background: url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;
37
+ cursor: pointer
38
+ }
39
+ div.pp_default .pp_expand {
40
+ background: url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;
41
+ cursor: pointer;
42
+ width: 28px;
43
+ height: 28px
44
+ }
45
+ div.pp_default .pp_expand:hover {
46
+ background: url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;
47
+ cursor: pointer
48
+ }
49
+ div.pp_default .pp_contract {
50
+ background: url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;
51
+ cursor: pointer;
52
+ width: 28px;
53
+ height: 28px
54
+ }
55
+ div.pp_default .pp_contract:hover {
56
+ background: url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;
57
+ cursor: pointer
58
+ }
59
+ div.pp_default .pp_close {
60
+ width: 30px;
61
+ height: 30px;
62
+ background: url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;
63
+ cursor: pointer
64
+ }
65
+ div.pp_default .pp_gallery ul li a {
66
+ background: url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;
67
+ border: 1px solid #aaa
68
+ }
69
+ div.pp_default .pp_social {
70
+ margin-top: 7px
71
+ }
72
+ div.pp_default .pp_gallery a.pp_arrow_previous,
73
+ div.pp_default .pp_gallery a.pp_arrow_next {
74
+ position: static;
75
+ left: auto
76
+ }
77
+ div.pp_default .pp_nav .pp_play,
78
+ div.pp_default .pp_nav .pp_pause {
79
+ background: url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;
80
+ height: 30px;
81
+ width: 30px
82
+ }
83
+ div.pp_default .pp_nav .pp_pause {
84
+ background-position: -51px -29px
85
+ }
86
+ div.pp_default a.pp_arrow_previous,
87
+ div.pp_default a.pp_arrow_next {
88
+ background: url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;
89
+ height: 20px;
90
+ width: 20px;
91
+ margin: 4px 0 0
92
+ }
93
+ div.pp_default a.pp_arrow_next {
94
+ left: 52px;
95
+ background-position: -82px -3px
96
+ }
97
+ div.pp_default .pp_content_container .pp_details {
98
+ margin-top: 5px
99
+ }
100
+ div.pp_default .pp_nav {
101
+ clear: none;
102
+ height: 30px;
103
+ width: 110px;
104
+ position: relative
105
+ }
106
+ div.pp_default .pp_nav .currentTextHolder {
107
+ font-family: Georgia;
108
+ font-style: italic;
109
+ color: #999;
110
+ font-size: 11px;
111
+ left: 75px;
112
+ line-height: 25px;
113
+ position: absolute;
114
+ top: 2px;
115
+ margin: 0;
116
+ padding: 0 0 0 10px
117
+ }
118
+ div.pp_default .pp_close:hover,
119
+ div.pp_default .pp_nav .pp_play:hover,
120
+ div.pp_default .pp_nav .pp_pause:hover,
121
+ div.pp_default .pp_arrow_next:hover,
122
+ div.pp_default .pp_arrow_previous:hover {
123
+ opacity: 0.7
124
+ }
125
+ div.pp_default .pp_description {
126
+ font-size: 11px;
127
+ font-weight: 700;
128
+ line-height: 14px;
129
+ margin: 5px 50px 5px 0
130
+ }
131
+ div.pp_default .pp_bottom .pp_left {
132
+ background: url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat
133
+ }
134
+ div.pp_default .pp_bottom .pp_middle {
135
+ background: url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x
136
+ }
137
+ div.pp_default .pp_bottom .pp_right {
138
+ background: url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat
139
+ }
140
+ div.pp_default .pp_loaderIcon {
141
+ background: url(../images/prettyPhoto/default/loader.gif) center center no-repeat
142
+ }
143
+ div.light_rounded .pp_top .pp_left {
144
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat
145
+ }
146
+ div.light_rounded .pp_top .pp_right {
147
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat
148
+ }
149
+ div.light_rounded .pp_next:hover {
150
+ background: url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;
151
+ cursor: pointer
152
+ }
153
+ div.light_rounded .pp_previous:hover {
154
+ background: url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;
155
+ cursor: pointer
156
+ }
157
+ div.light_rounded .pp_expand {
158
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;
159
+ cursor: pointer
160
+ }
161
+ div.light_rounded .pp_expand:hover {
162
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;
163
+ cursor: pointer
164
+ }
165
+ div.light_rounded .pp_contract {
166
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;
167
+ cursor: pointer
168
+ }
169
+ div.light_rounded .pp_contract:hover {
170
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;
171
+ cursor: pointer
172
+ }
173
+ div.light_rounded .pp_close {
174
+ width: 75px;
175
+ height: 22px;
176
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;
177
+ cursor: pointer
178
+ }
179
+ div.light_rounded .pp_nav .pp_play {
180
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;
181
+ height: 15px;
182
+ width: 14px
183
+ }
184
+ div.light_rounded .pp_nav .pp_pause {
185
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;
186
+ height: 15px;
187
+ width: 14px
188
+ }
189
+ div.light_rounded .pp_arrow_previous {
190
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat
191
+ }
192
+ div.light_rounded .pp_arrow_next {
193
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat
194
+ }
195
+ div.light_rounded .pp_bottom .pp_left {
196
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat
197
+ }
198
+ div.light_rounded .pp_bottom .pp_right {
199
+ background: url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat
200
+ }
201
+ div.dark_rounded .pp_top .pp_left {
202
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat
203
+ }
204
+ div.dark_rounded .pp_top .pp_right {
205
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat
206
+ }
207
+ div.dark_rounded .pp_content_container .pp_left {
208
+ background: url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y
209
+ }
210
+ div.dark_rounded .pp_content_container .pp_right {
211
+ background: url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y
212
+ }
213
+ div.dark_rounded .pp_next:hover {
214
+ background: url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;
215
+ cursor: pointer
216
+ }
217
+ div.dark_rounded .pp_previous:hover {
218
+ background: url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;
219
+ cursor: pointer
220
+ }
221
+ div.dark_rounded .pp_expand {
222
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;
223
+ cursor: pointer
224
+ }
225
+ div.dark_rounded .pp_expand:hover {
226
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;
227
+ cursor: pointer
228
+ }
229
+ div.dark_rounded .pp_contract {
230
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;
231
+ cursor: pointer
232
+ }
233
+ div.dark_rounded .pp_contract:hover {
234
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;
235
+ cursor: pointer
236
+ }
237
+ div.dark_rounded .pp_close {
238
+ width: 75px;
239
+ height: 22px;
240
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;
241
+ cursor: pointer
242
+ }
243
+ div.dark_rounded .pp_description {
244
+ margin-right: 85px;
245
+ color: #fff
246
+ }
247
+ div.dark_rounded .pp_nav .pp_play {
248
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;
249
+ height: 15px;
250
+ width: 14px
251
+ }
252
+ div.dark_rounded .pp_nav .pp_pause {
253
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;
254
+ height: 15px;
255
+ width: 14px
256
+ }
257
+ div.dark_rounded .pp_arrow_previous {
258
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat
259
+ }
260
+ div.dark_rounded .pp_arrow_next {
261
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat
262
+ }
263
+ div.dark_rounded .pp_bottom .pp_left {
264
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat
265
+ }
266
+ div.dark_rounded .pp_bottom .pp_right {
267
+ background: url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat
268
+ }
269
+ div.dark_rounded .pp_loaderIcon {
270
+ background: url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat
271
+ }
272
+ div.dark_square .pp_left,
273
+ div.dark_square .pp_middle,
274
+ div.dark_square .pp_right,
275
+ div.dark_square .pp_content {
276
+ background: #000
277
+ }
278
+ div.dark_square .pp_description {
279
+ color: #fff;
280
+ margin: 0 85px 0 0
281
+ }
282
+ div.dark_square .pp_loaderIcon {
283
+ background: url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat
284
+ }
285
+ div.dark_square .pp_expand {
286
+ background: url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;
287
+ cursor: pointer
288
+ }
289
+ div.dark_square .pp_expand:hover {
290
+ background: url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;
291
+ cursor: pointer
292
+ }
293
+ div.dark_square .pp_contract {
294
+ background: url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;
295
+ cursor: pointer
296
+ }
297
+ div.dark_square .pp_contract:hover {
298
+ background: url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;
299
+ cursor: pointer
300
+ }
301
+ div.dark_square .pp_close {
302
+ width: 75px;
303
+ height: 22px;
304
+ background: url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;
305
+ cursor: pointer
306
+ }
307
+ div.dark_square .pp_nav {
308
+ clear: none
309
+ }
310
+ div.dark_square .pp_nav .pp_play {
311
+ background: url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;
312
+ height: 15px;
313
+ width: 14px
314
+ }
315
+ div.dark_square .pp_nav .pp_pause {
316
+ background: url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;
317
+ height: 15px;
318
+ width: 14px
319
+ }
320
+ div.dark_square .pp_arrow_previous {
321
+ background: url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat
322
+ }
323
+ div.dark_square .pp_arrow_next {
324
+ background: url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat
325
+ }
326
+ div.dark_square .pp_next:hover {
327
+ background: url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;
328
+ cursor: pointer
329
+ }
330
+ div.dark_square .pp_previous:hover {
331
+ background: url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;
332
+ cursor: pointer
333
+ }
334
+ div.light_square .pp_expand {
335
+ background: url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;
336
+ cursor: pointer
337
+ }
338
+ div.light_square .pp_expand:hover {
339
+ background: url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;
340
+ cursor: pointer
341
+ }
342
+ div.light_square .pp_contract {
343
+ background: url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;
344
+ cursor: pointer
345
+ }
346
+ div.light_square .pp_contract:hover {
347
+ background: url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;
348
+ cursor: pointer
349
+ }
350
+ div.light_square .pp_close {
351
+ width: 75px;
352
+ height: 22px;
353
+ background: url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;
354
+ cursor: pointer
355
+ }
356
+ div.light_square .pp_nav .pp_play {
357
+ background: url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;
358
+ height: 15px;
359
+ width: 14px
360
+ }
361
+ div.light_square .pp_nav .pp_pause {
362
+ background: url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;
363
+ height: 15px;
364
+ width: 14px
365
+ }
366
+ div.light_square .pp_arrow_previous {
367
+ background: url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat
368
+ }
369
+ div.light_square .pp_arrow_next {
370
+ background: url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat
371
+ }
372
+ div.light_square .pp_next:hover {
373
+ background: url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;
374
+ cursor: pointer
375
+ }
376
+ div.light_square .pp_previous:hover {
377
+ background: url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;
378
+ cursor: pointer
379
+ }
380
+ div.facebook .pp_top .pp_left {
381
+ background: url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat
382
+ }
383
+ div.facebook .pp_top .pp_middle {
384
+ background: url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x
385
+ }
386
+ div.facebook .pp_top .pp_right {
387
+ background: url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat
388
+ }
389
+ div.facebook .pp_content_container .pp_left {
390
+ background: url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y
391
+ }
392
+ div.facebook .pp_content_container .pp_right {
393
+ background: url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y
394
+ }
395
+ div.facebook .pp_expand {
396
+ background: url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;
397
+ cursor: pointer
398
+ }
399
+ div.facebook .pp_expand:hover {
400
+ background: url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;
401
+ cursor: pointer
402
+ }
403
+ div.facebook .pp_contract {
404
+ background: url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;
405
+ cursor: pointer
406
+ }
407
+ div.facebook .pp_contract:hover {
408
+ background: url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;
409
+ cursor: pointer
410
+ }
411
+ div.facebook .pp_close {
412
+ width: 22px;
413
+ height: 22px;
414
+ background: url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;
415
+ cursor: pointer
416
+ }
417
+ div.facebook .pp_description {
418
+ margin: 0 37px 0 0
419
+ }
420
+ div.facebook .pp_loaderIcon {
421
+ background: url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat
422
+ }
423
+ div.facebook .pp_arrow_previous {
424
+ background: url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;
425
+ height: 22px;
426
+ margin-top: 0;
427
+ width: 22px
428
+ }
429
+ div.facebook .pp_arrow_previous.disabled {
430
+ background-position: 0 -96px;
431
+ cursor: default
432
+ }
433
+ div.facebook .pp_arrow_next {
434
+ background: url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;
435
+ height: 22px;
436
+ margin-top: 0;
437
+ width: 22px
438
+ }
439
+ div.facebook .pp_arrow_next.disabled {
440
+ background-position: -32px -96px;
441
+ cursor: default
442
+ }
443
+ div.facebook .pp_nav {
444
+ margin-top: 0
445
+ }
446
+ div.facebook .pp_nav p {
447
+ font-size: 15px;
448
+ padding: 0 3px 0 4px
449
+ }
450
+ div.facebook .pp_nav .pp_play {
451
+ background: url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;
452
+ height: 22px;
453
+ width: 22px
454
+ }
455
+ div.facebook .pp_nav .pp_pause {
456
+ background: url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;
457
+ height: 22px;
458
+ width: 22px
459
+ }
460
+ div.facebook .pp_next:hover {
461
+ background: url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;
462
+ cursor: pointer
463
+ }
464
+ div.facebook .pp_previous:hover {
465
+ background: url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;
466
+ cursor: pointer
467
+ }
468
+ div.facebook .pp_bottom .pp_left {
469
+ background: url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat
470
+ }
471
+ div.facebook .pp_bottom .pp_middle {
472
+ background: url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x
473
+ }
474
+ div.facebook .pp_bottom .pp_right {
475
+ background: url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat
476
+ }
477
+ div.pp_pic_holder a:focus {
478
+ outline: none
479
+ }
480
+ div.pp_overlay {
481
+ background: #000;
482
+ display: none;
483
+ left: 0;
484
+ position: absolute;
485
+ top: 0;
486
+ width: 100%;
487
+ z-index: 9500
488
+ }
489
+ div.pp_pic_holder {
490
+ display: none;
491
+ position: absolute;
492
+ width: 100px;
493
+ z-index: 10000
494
+ }
495
+ .pp_content {
496
+ height: 40px;
497
+ min-width: 40px
498
+ }
499
+ * html .pp_content {
500
+ width: 40px
501
+ }
502
+ .pp_content_container {
503
+ position: relative;
504
+ text-align: left;
505
+ width: 100%
506
+ }
507
+ .pp_content_container .pp_left {
508
+ padding-left: 20px
509
+ }
510
+ .pp_content_container .pp_right {
511
+ padding-right: 20px
512
+ }
513
+ .pp_content_container .pp_details {
514
+ float: left;
515
+ margin: 10px 0 2px
516
+ }
517
+ .pp_description {
518
+ display: none;
519
+ margin: 0
520
+ }
521
+ .pp_social {
522
+ float: left;
523
+ margin: 0
524
+ }
525
+ .pp_social .facebook {
526
+ float: left;
527
+ margin-left: 5px;
528
+ width: 55px;
529
+ overflow: hidden
530
+ }
531
+ .pp_social .twitter {
532
+ float: left
533
+ }
534
+ .pp_nav {
535
+ clear: right;
536
+ float: left;
537
+ margin: 3px 10px 0 0
538
+ }
539
+ .pp_nav p {
540
+ float: left;
541
+ white-space: nowrap;
542
+ margin: 2px 4px
543
+ }
544
+ .pp_nav .pp_play,
545
+ .pp_nav .pp_pause {
546
+ float: left;
547
+ margin-right: 4px;
548
+ text-indent: -10000px
549
+ }
550
+ a.pp_arrow_previous,
551
+ a.pp_arrow_next {
552
+ display: block;
553
+ float: left;
554
+ height: 15px;
555
+ margin-top: 3px;
556
+ overflow: hidden;
557
+ text-indent: -10000px;
558
+ width: 14px
559
+ }
560
+ .pp_hoverContainer {
561
+ position: absolute;
562
+ top: 0;
563
+ width: 100%;
564
+ z-index: 2000
565
+ }
566
+ .pp_gallery {
567
+ display: none;
568
+ left: 50%;
569
+ margin-top: -50px;
570
+ position: absolute;
571
+ z-index: 10000
572
+ }
573
+ .pp_gallery div {
574
+ float: left;
575
+ overflow: hidden;
576
+ position: relative
577
+ }
578
+ .pp_gallery ul {
579
+ float: left;
580
+ height: 35px;
581
+ position: relative;
582
+ white-space: nowrap;
583
+ margin: 0 0 0 5px;
584
+ padding: 0
585
+ }
586
+ .pp_gallery ul a {
587
+ border: 1px rgba(0, 0, 0, 0.5) solid;
588
+ display: block;
589
+ float: left;
590
+ height: 33px;
591
+ overflow: hidden
592
+ }
593
+ .pp_gallery ul a img {
594
+ border: 0
595
+ }
596
+ .pp_gallery li {
597
+ display: block;
598
+ float: left;
599
+ margin: 0 5px 0 0;
600
+ padding: 0
601
+ }
602
+ .pp_gallery li.default a {
603
+ background: url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;
604
+ display: block;
605
+ height: 33px;
606
+ width: 50px
607
+ }
608
+ .pp_gallery .pp_arrow_previous,
609
+ .pp_gallery .pp_arrow_next {
610
+ margin-top: 7px!important
611
+ }
612
+ a.pp_next {
613
+ background: url(../images/prettyPhoto/light_rounded/btnNext.png) no-repeat 10000px center;
614
+ display: block;
615
+ float: right;
616
+ height: 100%;
617
+ text-indent: -10000px;
618
+ width: 49%
619
+ }
620
+ a.pp_previous {
621
+ background: url(../images/prettyPhoto/light_rounded/btnPrevious.png) no-repeat -10000px center;
622
+ display: block;
623
+ float: left;
624
+ height: 100%;
625
+ text-indent: -10000px;
626
+ width: 49%
627
+ }
628
+ a.pp_expand,
629
+ a.pp_contract {
630
+ cursor: pointer;
631
+ display: none;
632
+ height: 20px;
633
+ position: absolute;
634
+ right: 30px;
635
+ text-indent: -10000px;
636
+ top: 10px;
637
+ width: 20px;
638
+ z-index: 20000
639
+ }
640
+ a.pp_close {
641
+ position: absolute;
642
+ right: 0;
643
+ top: 0;
644
+ display: block;
645
+ line-height: 22px;
646
+ text-indent: -10000px
647
+ }
648
+ .pp_loaderIcon {
649
+ display: block;
650
+ height: 24px;
651
+ left: 50%;
652
+ position: absolute;
653
+ top: 50%;
654
+ width: 24px;
655
+ margin: -12px 0 0 -12px
656
+ }
657
+ #pp_full_res {
658
+ line-height: 1!important
659
+ }
660
+ #pp_full_res .pp_inline {
661
+ text-align: left
662
+ }
663
+ #pp_full_res .pp_inline p {
664
+ margin: 0 0 15px
665
+ }
666
+ div.ppt {
667
+ color: #fff;
668
+ display: none;
669
+ font-size: 17px;
670
+ z-index: 9999;
671
+ margin: 0 0 5px 15px
672
+ }
673
+ div.pp_default .pp_content,
674
+ div.light_rounded .pp_content {
675
+ background-color: #fff
676
+ }
677
+ div.pp_default #pp_full_res .pp_inline,
678
+ div.light_rounded .pp_content .ppt,
679
+ div.light_rounded #pp_full_res .pp_inline,
680
+ div.light_square .pp_content .ppt,
681
+ div.light_square #pp_full_res .pp_inline,
682
+ div.facebook .pp_content .ppt,
683
+ div.facebook #pp_full_res .pp_inline {
684
+ color: #000
685
+ }
686
+ div.pp_default .pp_gallery ul li a:hover,
687
+ div.pp_default .pp_gallery ul li.selected a,
688
+ .pp_gallery ul a:hover,
689
+ .pp_gallery li.selected a {
690
+ border-color: #fff
691
+ }
692
+ div.pp_default .pp_details,
693
+ div.light_rounded .pp_details,
694
+ div.dark_rounded .pp_details,
695
+ div.dark_square .pp_details,
696
+ div.light_square .pp_details,
697
+ div.facebook .pp_details {
698
+ position: relative
699
+ }
700
+ div.light_rounded .pp_top .pp_middle,
701
+ div.light_rounded .pp_content_container .pp_left,
702
+ div.light_rounded .pp_content_container .pp_right,
703
+ div.light_rounded .pp_bottom .pp_middle,
704
+ div.light_square .pp_left,
705
+ div.light_square .pp_middle,
706
+ div.light_square .pp_right,
707
+ div.light_square .pp_content,
708
+ div.facebook .pp_content {
709
+ background: #fff
710
+ }
711
+ div.light_rounded .pp_description,
712
+ div.light_square .pp_description {
713
+ margin-right: 85px
714
+ }
715
+ div.light_rounded .pp_gallery a.pp_arrow_previous,
716
+ div.light_rounded .pp_gallery a.pp_arrow_next,
717
+ div.dark_rounded .pp_gallery a.pp_arrow_previous,
718
+ div.dark_rounded .pp_gallery a.pp_arrow_next,
719
+ div.dark_square .pp_gallery a.pp_arrow_previous,
720
+ div.dark_square .pp_gallery a.pp_arrow_next,
721
+ div.light_square .pp_gallery a.pp_arrow_previous,
722
+ div.light_square .pp_gallery a.pp_arrow_next {
723
+ margin-top: 12px!important
724
+ }
725
+ div.light_rounded .pp_arrow_previous.disabled,
726
+ div.dark_rounded .pp_arrow_previous.disabled,
727
+ div.dark_square .pp_arrow_previous.disabled,
728
+ div.light_square .pp_arrow_previous.disabled {
729
+ background-position: 0 -87px;
730
+ cursor: default
731
+ }
732
+ div.light_rounded .pp_arrow_next.disabled,
733
+ div.dark_rounded .pp_arrow_next.disabled,
734
+ div.dark_square .pp_arrow_next.disabled,
735
+ div.light_square .pp_arrow_next.disabled {
736
+ background-position: -22px -87px;
737
+ cursor: default
738
+ }
739
+ div.light_rounded .pp_loaderIcon,
740
+ div.light_square .pp_loaderIcon {
741
+ background: url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat
742
+ }
743
+ div.dark_rounded .pp_top .pp_middle,
744
+ div.dark_rounded .pp_content,
745
+ div.dark_rounded .pp_bottom .pp_middle {
746
+ background: url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat
747
+ }
748
+ div.dark_rounded .currentTextHolder,
749
+ div.dark_square .currentTextHolder {
750
+ color: #c4c4c4
751
+ }
752
+ div.dark_rounded #pp_full_res .pp_inline,
753
+ div.dark_square #pp_full_res .pp_inline {
754
+ color: #fff
755
+ }
756
+ .pp_top,
757
+ .pp_bottom {
758
+ height: 20px;
759
+ position: relative
760
+ }
761
+ * html .pp_top,
762
+ * html .pp_bottom {
763
+ padding: 0 20px
764
+ }
765
+ .pp_top .pp_left,
766
+ .pp_bottom .pp_left {
767
+ height: 20px;
768
+ left: 0;
769
+ position: absolute;
770
+ width: 20px
771
+ }
772
+ .pp_top .pp_middle,
773
+ .pp_bottom .pp_middle {
774
+ height: 20px;
775
+ left: 20px;
776
+ position: absolute;
777
+ right: 20px
778
+ }
779
+ * html .pp_top .pp_middle,
780
+ * html .pp_bottom .pp_middle {
781
+ left: 0;
782
+ position: static
783
+ }
784
+ .pp_top .pp_right,
785
+ .pp_bottom .pp_right {
786
+ height: 20px;
787
+ left: auto;
788
+ position: absolute;
789
+ right: 0;
790
+ top: 0;
791
+ width: 20px
792
+ }
793
+ .pp_fade,
794
+ .pp_gallery li.default a img {
795
+ display: none
796
+ }
assets/prettyphoto/css/prettyPhoto.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .pp_gallery div,.pp_gallery ul a,.pp_social .facebook{overflow:hidden;float:left}div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right,div.pp_default .pp_top,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_right{height:13px}div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}div.pp_default .pp_content .ppt{color:#f8f8f8}div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px}div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px}div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer}div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}div.pp_default .pp_social{margin-top:7px}div.pp_default .pp_gallery a.pp_arrow_next,div.pp_default .pp_gallery a.pp_arrow_previous{position:static;left:auto}div.pp_default .pp_nav .pp_pause,div.pp_default .pp_nav .pp_play{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}div.pp_default a.pp_arrow_next,div.pp_default a.pp_arrow_previous{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0}div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px}div.pp_default .pp_content_container .pp_details{margin-top:5px}div.pp_default .pp_nav{clear:none;height:30px;width:110px;position:relative}div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px}div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover,div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_nav .pp_play:hover{opacity:.7}div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}div.dark_rounded .pp_description{margin-right:85px;color:#fff}div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}div.dark_square .pp_content,div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right{background:#000}div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer}div.dark_square .pp_nav{clear:none}div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer}div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer}div.facebook .pp_description{margin:0 37px 0 0}div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}div.facebook .pp_nav{margin-top:0}div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}div.pp_pic_holder a:focus{outline:0}div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}.pp_content{height:40px;min-width:40px}* html .pp_content{width:40px}.pp_content_container{position:relative;text-align:left;width:100%}.pp_content_container .pp_left{padding-left:20px}.pp_content_container .pp_right{padding-right:20px}.pp_content_container .pp_details{float:left;margin:10px 0 2px}.pp_description{display:none;margin:0}.pp_social{float:left;margin:0}.pp_social .facebook{margin-left:5px;width:55px}.pp_social .twitter{float:left}.pp_nav{clear:right;float:left;margin:3px 10px 0 0}.pp_nav p{float:left;white-space:nowrap;margin:2px 4px}.pp_nav .pp_pause,.pp_nav .pp_play{float:left;margin-right:4px;text-indent:-10000px}a.pp_arrow_next,a.pp_arrow_previous{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}.pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}.pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}.pp_gallery div{position:relative}.pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0}.pp_gallery ul a{border:1px solid rgba(0,0,0,.5);display:block;height:33px}.pp_gallery ul a img{border:0}.pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}.pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) no-repeat;display:block;height:33px;width:50px}a.pp_next,a.pp_previous{display:block;height:100%;width:49%;text-indent:-10000px}.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous{margin-top:7px!important}a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px center no-repeat;float:right}a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) -10000px center no-repeat;float:left}a.pp_contract,a.pp_expand{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}.pp_loaderIcon,a.pp_close{display:block;position:absolute}a.pp_close{right:0;top:0;line-height:22px;text-indent:-10000px}.pp_loaderIcon{height:24px;left:50%;top:50%;width:24px;margin:-12px 0 0 -12px}.pp_fade,.pp_gallery li.default a img,div.ppt{display:none}#pp_full_res{line-height:1!important}#pp_full_res .pp_inline{text-align:left}#pp_full_res .pp_inline p{margin:0 0 15px}div.ppt{color:#fff;font-size:17px;z-index:9999;margin:0 0 5px 15px}div.light_rounded .pp_content,div.pp_default .pp_content{background-color:#fff}div.facebook #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.pp_default #pp_full_res .pp_inline{color:#000}.pp_gallery li.selected a,.pp_gallery ul a:hover,div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a{border-color:#fff}div.dark_rounded .pp_details,div.dark_square .pp_details,div.facebook .pp_details,div.light_rounded .pp_details,div.light_square .pp_details,div.pp_default .pp_details{position:relative}div.facebook .pp_content,div.light_rounded .pp_bottom .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_top .pp_middle,div.light_square .pp_content,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right{background:#fff}div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous{margin-top:12px!important}div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_rounded .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_rounded .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}div.dark_rounded .pp_bottom .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_top .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left}div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}.pp_bottom,.pp_top{height:20px;position:relative}* html .pp_bottom,* html .pp_top{padding:0 20px}.pp_bottom .pp_left,.pp_top .pp_left{height:20px;left:0;position:absolute;width:20px}.pp_bottom .pp_middle,.pp_top .pp_middle{height:20px;left:20px;position:absolute;right:20px}* html .pp_bottom .pp_middle,* html .pp_top .pp_middle{left:0;position:static}.pp_bottom .pp_right,.pp_top .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
assets/prettyphoto/js/jquery.prettyPhoto.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){function e(){var t=location.href;return hashtag=-1!==t.indexOf("#prettyPhoto")&&decodeURI(t.substring(t.indexOf("#prettyPhoto")+1,t.length)),hashtag&&(hashtag=hashtag.replace(/<|>/g,"")),hashtag}function i(){"undefined"!=typeof theRel&&(location.hash=theRel+"/"+rel_index+"/")}function o(){-1!==location.href.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto")}function a(t,e){var i="[\\?&]"+(t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"))+"=([^&#]*)",o=new RegExp(i).exec(e);return null==o?"":o[1]}t.prettyPhoto={version:"3.1.6"},t.fn.prettyPhoto=function(p){function s(t,e,i,o){var a=0,p=0;return i>o?(p=t,a=Math.round(o*t/i)):(p=Math.round(i*e/o),a=e),d(p,a)}function n(){t(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(z/2-v.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:v.contentHeight,width:v.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:M/2-v.containerWidth/2<0?0:M/2-v.containerWidth/2,width:v.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(v.height).width(v.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&"image"==c(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),settings.allow_expand&&(v.resized?t("a.pp_expand,a.pp_contract").show():t("a.pp_expand").hide()),!settings.autoplay_slideshow||x||y||t.prettyPhoto.startSlideshow(),settings.changepicturecallback(),y=!0}),u(),p.ajaxcallback()}function r(e){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){t(".pp_loaderIcon").show(),e()})}function l(e){e>1?t(".pp_nav").show():t(".pp_nav").hide()}function d(t,e){if(resized=!1,h(t,e),imageWidth=t,imageHeight=e,(P>M||k>z)&&doresize&&settings.allow_resize&&!I){for(resized=!0,fitting=!1;!fitting;)P>M?(imageWidth=M-200,imageHeight=e/t*imageWidth):k>z?(imageHeight=z-200,imageWidth=t/e*imageHeight):fitting=!0,k=imageHeight,P=imageWidth;(P>M||k>z)&&d(P,k),h(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(k),containerWidth:Math.floor(P)+2*settings.horizontal_padding,contentHeight:Math.floor(w),contentWidth:Math.floor(b),resized:resized}}function h(e,i){e=parseFloat(e),i=parseFloat(i),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(e),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(e).appendTo(t("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(e),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(t("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),w=i+detailsHeight,b=e,k=w+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),P=e}function c(t){return t.match(/youtube\.com\/watch/i)||t.match(/youtu\.be/i)?"youtube":t.match(/vimeo\.com/i)?"vimeo":t.match(/\b.mov\b/i)?"quicktime":t.match(/\b.swf\b/i)?"flash":t.match(/\biframe=true\b/i)?"iframe":t.match(/\bajax=true\b/i)?"ajax":t.match(/\bcustom=true\b/i)?"custom":"#"==t.substr(0,1)?"inline":"image"}function _(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=g(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=z/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>z)return;$pp_pic_holder.css({top:projectedTop,left:M/2+scroll_pos.scrollLeft-contentwidth/2})}}function g(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function m(){z=t(window).height(),M=t(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(t(document).height()).width(M)}function u(){isSet&&settings.overlay_gallery&&"image"==c(pp_images[set_position])?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((v.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length,totalPage=Math.ceil(pp_images.length/itemsPerPage)-1,0==totalPage?(navWidth=0,$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()):$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show(),galleryWidth=itemsPerPage*itemWidth,fullGalleryWidth=pp_images.length*itemWidth,$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected"),goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage,t.prettyPhoto.changeGalleryPage(goToPage),$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")):$pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")}function f(e){if(settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href))),settings.markup=settings.markup.replace("{pp_social}",""),t("body").append(settings.markup),$pp_pic_holder=t(".pp_pic_holder"),$ppt=t(".ppt"),$pp_overlay=t("div.pp_overlay"),isSet&&settings.overlay_gallery){currentGalleryPage=0,toInject="";for(var i=0;i<pp_images.length;i++)pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)?(classname="",img_src=pp_images[i]):(classname="default",img_src=""),toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=t(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").click(function(){return t.prettyPhoto.changeGalleryPage("next"),t.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return t.prettyPhoto.changeGalleryPage("previous"),t.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(e){t(this).find("a").click(function(){return t.prettyPhoto.changePage(e),t.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return t.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:t(document).height(),width:t(window).width()}).bind("click",function(){settings.modal||t.prettyPhoto.close()}),t("a.pp_close").bind("click",function(){return t.prettyPhoto.close(),!1}),settings.allow_expand&&t("a.pp_expand").bind("click",function(e){return t(this).hasClass("pp_expand")?(t(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(t(this).removeClass("pp_contract").addClass("pp_expand"),doresize=!0),r(function(){t.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return t.prettyPhoto.changePage("previous"),t.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return t.prettyPhoto.changePage("next"),t.prettyPhoto.stopSlideshow(),!1}),_()}p=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:'<div class="pp_pic_holder"> \t\t\t\t\t\t<div class="ppt">&nbsp;</div> \t\t\t\t\t\t<div class="pp_top"> \t\t\t\t\t\t\t<div class="pp_left"></div> \t\t\t\t\t\t\t<div class="pp_middle"></div> \t\t\t\t\t\t\t<div class="pp_right"></div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<div class="pp_content_container"> \t\t\t\t\t\t\t<div class="pp_left"> \t\t\t\t\t\t\t<div class="pp_right"> \t\t\t\t\t\t\t\t<div class="pp_content"> \t\t\t\t\t\t\t\t\t<div class="pp_loaderIcon"></div> \t\t\t\t\t\t\t\t\t<div class="pp_fade"> \t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_expand" title="Expand the image">Expand</a> \t\t\t\t\t\t\t\t\t\t<div class="pp_hoverContainer"> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_next" href="#">next</a> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_previous" href="#">previous</a> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t\t<div id="pp_full_res"></div> \t\t\t\t\t\t\t\t\t\t<div class="pp_details"> \t\t\t\t\t\t\t\t\t\t\t<div class="pp_nav"> \t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \t\t\t\t\t\t\t\t\t\t\t\t<p class="currentTextHolder">0/0</p> \t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \t\t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t\t\t<p class="pp_description"></p> \t\t\t\t\t\t\t\t\t\t\t<div class="pp_social">{pp_social}</div> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_close" href="#">Close</a> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<div class="pp_bottom"> \t\t\t\t\t\t\t<div class="pp_left"></div> \t\t\t\t\t\t\t<div class="pp_middle"></div> \t\t\t\t\t\t\t<div class="pp_right"></div> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t\t<div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \t\t\t\t\t\t\t\t<div> \t\t\t\t\t\t\t\t\t<ul> \t\t\t\t\t\t\t\t\t\t{gallery} \t\t\t\t\t\t\t\t\t</ul> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \t\t\t\t\t\t\t</div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="//www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="//www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:"",social_tools:'<div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"https";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document, "script", "twitter-wjs");<\/script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},p);var v,y,w,b,k,P,x,$={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return $.Android()||$.BlackBerry()||$.iOS()||$.Opera()||$.Windows()}},j=this,I=!1,z=t(window).height(),M=t(window).width();return doresize=!0,scroll_pos=g(),t(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){_(),m()}),p.keyboard_shortcuts&&t(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(e){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(e.keyCode){case 37:t.prettyPhoto.changePage("previous"),e.preventDefault();break;case 39:t.prettyPhoto.changePage("next"),e.preventDefault();break;case 27:settings.modal||t.prettyPhoto.close(),e.preventDefault()}}),t.prettyPhoto.initialize=function(){return settings=p,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=t(this).attr(settings.hook),galleryRegExp=/\-(?:.*)/,isSet=!!galleryRegExp.exec(theRel),pp_images=isSet?jQuery.map(j,function(e,i){if(-1!=t(e).attr(settings.hook).indexOf(theRel))return t(e).attr("href")}):t.makeArray(t(this).attr("href")),pp_titles=isSet?jQuery.map(j,function(e,i){if(-1!=t(e).attr(settings.hook).indexOf(theRel))return t(e).find("img").attr("alt")?t(e).find("img").attr("alt"):""}):t.makeArray(t(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(j,function(e,i){if(-1!=t(e).attr(settings.hook).indexOf(theRel))return t(e).attr("title")?t(e).attr("title"):""}):t.makeArray(t(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jQuery.inArray(t(this).attr("href"),pp_images),rel_index=isSet?set_position:t("a["+settings.hook+"^='"+theRel+"']").index(t(this)),f(this),settings.allow_resize&&t(window).bind("scroll.prettyphoto",function(){_()}),t.prettyPhoto.open(),!1},t.prettyPhoto.open=function(e){return"undefined"==typeof settings&&(settings=p,pp_images=t.makeArray(arguments[0]),pp_titles=arguments[1]?t.makeArray(arguments[1]):t.makeArray(""),pp_descriptions=arguments[2]?t.makeArray(arguments[2]):t.makeArray(""),isSet=pp_images.length>1,set_position=arguments[3]?arguments[3]:0,f(e.target)),settings.hideflash&&t("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),l(t(pp_images).size()),t(".pp_loaderIcon").show(),settings.deeplinking&&i(),settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href)),$pp_pic_holder.find(".pp_social").html(facebook_like_link)),$ppt.is(":hidden")&&$ppt.css("opacity",0).show(),$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity),$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+t(pp_images).size()),void 0!==pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parseFloat(a("width",pp_images[set_position]))?a("width",pp_images[set_position]):settings.default_width.toString(),movie_height=parseFloat(a("height",pp_images[set_position]))?a("height",pp_images[set_position]):settings.default_height.toString(),I=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(t(window).height()*parseFloat(movie_height)/100-150),I=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(t(window).width()*parseFloat(movie_width)/100-150),I=!0),$pp_pic_holder.fadeIn(function(){switch(settings.show_title&&""!=pp_titles[set_position]&&void 0!==pp_titles[set_position]?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("&nbsp;"),imgPreloader="",skipInjection=!1,c(pp_images[set_position])){case"image":imgPreloader=new Image,nextImage=new Image,isSet&&set_position<t(pp_images).size()-1&&(nextImage.src=pp_images[set_position+1]),prevImage=new Image,isSet&&pp_images[set_position-1]&&(prevImage.src=pp_images[set_position-1]),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]),imgPreloader.onload=function(){v=$.any()?s(Math.round(.9*M),Math.round(.9*z),imgPreloader.width,imgPreloader.height):d(imgPreloader.width,imgPreloader.height),n()},imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist."),t.prettyPhoto.close()},imgPreloader.src=pp_images[set_position];break;case"youtube":v=$.any()?s(Math.round(.9*M),Math.round(.9*z),movie_width,movie_height):d(movie_width,movie_height),movie_id=a("v",pp_images[set_position]),""==movie_id&&(movie_id=pp_images[set_position].split("youtu.be/"),movie_id=movie_id[1],movie_id.indexOf("?")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("?"))),movie_id.indexOf("&")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))),movie="//www.youtube.com/embed/"+movie_id,a("rel",pp_images[set_position])?movie+="?rel="+a("rel",pp_images[set_position]):movie+="?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,v.width).replace(/{height}/g,v.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":v=$.any()?s(Math.round(.9*M),Math.round(.9*z),movie_width,movie_height):d(movie_width,movie_height),movie_id=pp_images[set_position];var e=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,i=movie_id.match(e);movie="//player.vimeo.com/video/"+i[3]+"?title=0&amp;byline=0&amp;portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=v.width+"/embed/?moog_width="+v.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,v.height).replace(/{path}/g,movie);break;case"quicktime":(v=d(movie_width,movie_height)).height+=15,v.contentHeight+=15,v.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,v.width).replace(/{height}/g,v.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":v=$.any()?s(Math.round(.9*M),Math.round(.9*z),movie_width,movie_height):d(movie_width,movie_height),flash_vars=pp_images[set_position],flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length),filename=pp_images[set_position],filename=filename.substring(0,filename.indexOf("?")),toInject=settings.flash_markup.replace(/{width}/g,v.width).replace(/{height}/g,v.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":v=$.any()?s(Math.round(.9*M),Math.round(.9*z),movie_width,movie_height):d(movie_width,movie_height),frame_url=pp_images[set_position],frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1),toInject=settings.iframe_markup.replace(/{width}/g,v.width).replace(/{height}/g,v.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,v=$.any()?s(Math.round(.9*M),Math.round(.9*z),movie_width,movie_height):d(movie_width,movie_height),doresize=!0,skipInjection=!0,t.get(pp_images[set_position],function(t){toInject=settings.inline_markup.replace(/{content}/g,t),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,n()});break;case"custom":v=$.any()?s(Math.round(.9*M),Math.round(.9*z),movie_width,movie_height):d(movie_width,movie_height),toInject=settings.custom_markup;break;case"inline":myClone=t(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(t("body")).show(),doresize=!1,v=$.any()?s(Math.round(.9*M),Math.round(.9*z),t(myClone).width(),t(myClone).height()):d(t(myClone).width(),t(myClone).height()),doresize=!0,t(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,t(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,n())}),!1},t.prettyPhoto.changePage=function(e){currentGalleryPage=0,"previous"==e?--set_position<0&&(set_position=t(pp_images).size()-1):"next"==e?++set_position>t(pp_images).size()-1&&(set_position=0):set_position=e,rel_index=set_position,doresize||(doresize=!0),settings.allow_expand&&t(".pp_contract").removeClass("pp_contract").addClass("pp_expand"),r(function(){t.prettyPhoto.open()})},t.prettyPhoto.changeGalleryPage=function(t){"next"==t?++currentGalleryPage>totalPage&&(currentGalleryPage=0):"previous"==t?--currentGalleryPage<0&&(currentGalleryPage=totalPage):currentGalleryPage=t,slide_speed="next"==t||"previous"==t?settings.animation_speed:0,slide_to=currentGalleryPage*(itemsPerPage*itemWidth),$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)},t.prettyPhoto.startSlideshow=function(){void 0===x?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){return t.prettyPhoto.stopSlideshow(),!1}),x=setInterval(t.prettyPhoto.startSlideshow,settings.slideshow)):t.prettyPhoto.changePage("next")},t.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){return t.prettyPhoto.startSlideshow(),!1}),clearInterval(x),x=void 0},t.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(t.prettyPhoto.stopSlideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),t("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){t(this).remove()}),$pp_overlay.fadeOut(settings.animation_speed,function(){settings.hideflash&&t("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible"),t(this).remove(),t(window).unbind("scroll.prettyphoto"),o(),settings.callback(),doresize=!0,y=!1,delete settings}))},!pp_alreadyInitialized&&e()&&(pp_alreadyInitialized=!0,hashIndex=e(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){t("a["+p.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",t.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1;
assets/select2/css/select2.css ADDED
@@ -0,0 +1,500 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .select2-container {
2
+ box-sizing: border-box;
3
+ display: inline-block;
4
+ margin: 0;
5
+ position: relative;
6
+ vertical-align: middle; }
7
+ .select2-container .select2-selection--single {
8
+ box-sizing: border-box;
9
+ cursor: pointer;
10
+ display: block;
11
+ height: 28px;
12
+ user-select: none;
13
+ -webkit-user-select: none; }
14
+ .select2-container .select2-selection--single .select2-selection__rendered {
15
+ display: block;
16
+ padding-left: 8px;
17
+ padding-right: 20px;
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
20
+ white-space: nowrap; }
21
+ .select2-container .select2-selection--single .select2-selection__clear {
22
+ position: relative; }
23
+ .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
24
+ padding-right: 8px;
25
+ padding-left: 20px; }
26
+ .select2-container .select2-selection--multiple {
27
+ box-sizing: border-box;
28
+ cursor: pointer;
29
+ display: block;
30
+ min-height: 32px;
31
+ user-select: none;
32
+ -webkit-user-select: none; }
33
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
34
+ display: inline-block;
35
+ overflow: hidden;
36
+ padding-left: 8px;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap; }
39
+ .select2-container .select2-search--inline {
40
+ float: left; }
41
+ .select2-container .select2-search--inline .select2-search__field {
42
+ box-sizing: border-box;
43
+ border: none;
44
+ font-size: 100%;
45
+ margin-top: 5px;
46
+ padding: 0; }
47
+ .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
48
+ -webkit-appearance: none; }
49
+
50
+ .select2-dropdown {
51
+ background-color: #fff;
52
+ border: 1px solid #ddd;
53
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
54
+ border-radius: 0;
55
+ box-sizing: border-box;
56
+ display: block;
57
+ position: absolute;
58
+ left: -100000px;
59
+ width: 100%;
60
+ z-index: 1051; }
61
+
62
+ .select2-results {
63
+ display: block; }
64
+
65
+ .select2-results__options {
66
+ list-style: none;
67
+ margin: 0;
68
+ padding: 0; }
69
+
70
+ .select2-results__option {
71
+ padding: 6px;
72
+ margin-bottom: 0;
73
+ user-select: none;
74
+ -webkit-user-select: none; }
75
+ .select2-results__option[aria-selected] {
76
+ cursor: pointer; }
77
+
78
+ .select2-container--open .select2-dropdown {
79
+ left: 0; }
80
+
81
+ .select2-container--open .select2-dropdown--above {
82
+ border-bottom: none;
83
+ border-bottom-left-radius: 0;
84
+ border-bottom-right-radius: 0; }
85
+
86
+ .select2-container--open .select2-dropdown--below {
87
+ border-top: none;
88
+ border-top-left-radius: 0;
89
+ border-top-right-radius: 0; }
90
+
91
+ .select2-search--dropdown {
92
+ display: block;
93
+ padding: 4px; }
94
+ .select2-search--dropdown .select2-search__field {
95
+ padding: 4px;
96
+ width: 100%;
97
+ box-sizing: border-box; }
98
+ .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
99
+ -webkit-appearance: none; }
100
+ .select2-search--dropdown.select2-search--hide {
101
+ display: none; }
102
+
103
+ .select2-close-mask {
104
+ border: 0;
105
+ margin: 0;
106
+ padding: 0;
107
+ display: block;
108
+ position: fixed;
109
+ left: 0;
110
+ top: 0;
111
+ min-height: 100%;
112
+ min-width: 100%;
113
+ height: auto;
114
+ width: auto;
115
+ opacity: 0;
116
+ z-index: 99;
117
+ background-color: #fff;
118
+ filter: alpha(opacity=0); }
119
+
120
+ .select2-hidden-accessible {
121
+ border: 0 !important;
122
+ clip: rect(0 0 0 0) !important;
123
+ height: 1px !important;
124
+ margin: -1px !important;
125
+ overflow: hidden !important;
126
+ padding: 0 !important;
127
+ position: absolute !important;
128
+ width: 1px !important; }
129
+
130
+ .select2-container--default .select2-selection--single {
131
+ background-color: #fff;
132
+ border: 1px solid #ddd;
133
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
134
+ border-radius: 0; }
135
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
136
+ color: #444;
137
+ line-height: 28px; }
138
+ .select2-container--default .select2-selection--single .select2-selection__clear {
139
+ cursor: pointer;
140
+ float: right;
141
+ font-weight: bold; }
142
+ .select2-container--default .select2-selection--single .select2-selection__placeholder {
143
+ color: #999; }
144
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
145
+ height: 26px;
146
+ position: absolute;
147
+ top: 1px;
148
+ right: 1px;
149
+ width: 20px; }
150
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
151
+ border-color: #888 transparent transparent transparent;
152
+ border-style: solid;
153
+ border-width: 5px 4px 0 4px;
154
+ height: 0;
155
+ left: 50%;
156
+ margin-left: -4px;
157
+ margin-top: -2px;
158
+ position: absolute;
159
+ top: 50%;
160
+ width: 0; }
161
+
162
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
163
+ float: left; }
164
+
165
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
166
+ left: 1px;
167
+ right: auto; }
168
+
169
+ .select2-container--default.select2-container--disabled .select2-selection--single {
170
+ background-color: #ddd;
171
+ cursor: default; }
172
+ .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
173
+ display: none; }
174
+
175
+ .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
176
+ border-color: transparent transparent #888 transparent;
177
+ border-width: 0 4px 5px 4px; }
178
+
179
+ .select2-container--default .select2-selection--multiple {
180
+ background-color: #fff;
181
+ border: 1px solid #ddd;
182
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
183
+ border-radius: 0;
184
+ cursor: text;
185
+ padding-bottom: 2px; }
186
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered {
187
+ box-sizing: border-box;
188
+ list-style: none;
189
+ margin: 0;
190
+ padding: 0 5px;
191
+ width: 100%; }
192
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
193
+ list-style: none;
194
+ margin-bottom: 0; }
195
+ .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
196
+ color: #999;
197
+ margin-top: 5px;
198
+ float: left; }
199
+ .select2-container--default .select2-selection--multiple .select2-selection__clear {
200
+ cursor: pointer;
201
+ float: right;
202
+ font-weight: bold;
203
+ margin-top: 5px;
204
+ margin-right: 10px; }
205
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
206
+ background-color: #f1f1f1;
207
+ border: 1px solid #ddd;
208
+ border-radius: 2px;
209
+ cursor: default;
210
+ float: left;
211
+ margin-right: 5px;
212
+ margin-top: 5px;
213
+ margin-bottom: 0;
214
+ padding: 0 5px; }
215
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
216
+ color: #0073aa;
217
+ cursor: pointer;
218
+ display: inline-block;
219
+ font-weight: normal;
220
+ margin: 0 2px 1px 0; }
221
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
222
+ color: #5b9dd9; }
223
+
224
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
225
+ float: right; }
226
+
227
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
228
+ margin-left: 5px;
229
+ margin-right: auto; }
230
+
231
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
232
+ margin-left: 2px;
233
+ margin-right: auto; }
234
+
235
+ .select2-container--default.select2-container--focus .select2-selection--multiple {
236
+ border: solid #5b9dd9 1px;
237
+ box-shadow: 0 0 2px rgba(30,140,190,.8);
238
+ outline: 0; }
239
+
240
+ .select2-container--default.select2-container--disabled .select2-selection--multiple {
241
+ background-color: #ddd;
242
+ cursor: default; }
243
+
244
+ .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
245
+ display: none; }
246
+
247
+ .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
248
+ border-top-left-radius: 0;
249
+ border-top-right-radius: 0; }
250
+
251
+ .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
252
+ border-bottom-left-radius: 0;
253
+ border-bottom-right-radius: 0; }
254
+
255
+ .select2-container--default .select2-search--dropdown .select2-search__field {
256
+ border: 1px solid #ddd;
257
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07); }
258
+
259
+ .select2-container--default .select2-search--inline .select2-search__field {
260
+ background: transparent;
261
+ border: none;
262
+ outline: 0;
263
+ box-shadow: none;
264
+ -webkit-appearance: textfield; }
265
+
266
+ .select2-container--default .select2-results > .select2-results__options {
267
+ max-height: 200px;
268
+ overflow-y: auto; }
269
+
270
+ .select2-container--default .select2-results__option[role=group] {
271
+ padding: 0; }
272
+
273
+ .select2-container--default .select2-results__option[aria-disabled=true] {
274
+ color: #e5e5e5; }
275
+
276
+ .select2-container--default .select2-results__option[aria-selected=true] {
277
+ background-color: #f1f1f1; }
278
+
279
+ .select2-container--default .select2-results__option .select2-results__option {
280
+ padding-left: 1em; }
281
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
282
+ padding-left: 0; }
283
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
284
+ margin-left: -1em;
285
+ padding-left: 2em; }
286
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
287
+ margin-left: -2em;
288
+ padding-left: 3em; }
289
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
290
+ margin-left: -3em;
291
+ padding-left: 4em; }
292
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
293
+ margin-left: -4em;
294
+ padding-left: 5em; }
295
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
296
+ margin-left: -5em;
297
+ padding-left: 6em; }
298
+
299
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
300
+ background-color: #00a0d2;
301
+ color: #fff; }
302
+
303
+ .select2-container--default .select2-results__group {
304
+ cursor: default;
305
+ display: block;
306
+ padding: 6px; }
307
+
308
+ .select2-container--classic .select2-selection--single {
309
+ background-color: #f7f7f7;
310
+ border: 1px solid #ddd;
311
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
312
+ border-radius: 0;
313
+ outline: 0;
314
+ background-image: -webkit-linear-gradient(top, #fff 50%, #eeeeee 100%);
315
+ background-image: -o-linear-gradient(top, #fff 50%, #eeeeee 100%);
316
+ background-image: linear-gradient(to bottom, #fff 50%, #eeeeee 100%);
317
+ background-repeat: repeat-x;
318
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
319
+ .select2-container--classic .select2-selection--single:focus {
320
+ border: 1px solid #5897fb;
321
+ box-shadow: 0 0 2px rgba(30,140,190,.8); }
322
+ .select2-container--classic .select2-selection--single .select2-selection__rendered {
323
+ color: #444;
324
+ line-height: 28px; }
325
+ .select2-container--classic .select2-selection--single .select2-selection__clear {
326
+ cursor: pointer;
327
+ float: right;
328
+ font-weight: bold;
329
+ margin-right: 10px; }
330
+ .select2-container--classic .select2-selection--single .select2-selection__placeholder {
331
+ color: #999; }
332
+ .select2-container--classic .select2-selection--single .select2-selection__arrow {
333
+ background-color: #ddd;
334
+ border: none;
335
+ border-left: 1px solid #ddd;
336
+ border-top-right-radius: 4px;
337
+ border-bottom-right-radius: 4px;
338
+ height: 26px;
339
+ position: absolute;
340
+ top: 1px;
341
+ right: 1px;
342
+ width: 20px;
343
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
344
+ background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
345
+ background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
346
+ background-repeat: repeat-x;
347
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
348
+ .select2-container--classic .select2-selection--single .select2-selection__arrow b {
349
+ border-color: #888 transparent transparent transparent;
350
+ border-style: solid;
351
+ border-width: 5px 4px 0 4px;
352
+ height: 0;
353
+ left: 50%;
354
+ margin-left: -4px;
355
+ margin-top: -2px;
356
+ position: absolute;
357
+ top: 50%;
358
+ width: 0; }
359
+
360
+ .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
361
+ float: left; }
362
+
363
+ .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
364
+ border: none;
365
+ border-right: 1px solid #ddd;
366
+ border-radius: 0;
367
+ border-top-left-radius: 4px;
368
+ border-bottom-left-radius: 4px;
369
+ left: 1px;
370
+ right: auto; }
371
+
372
+ .select2-container--classic.select2-container--open .select2-selection--single {
373
+ border: 1px solid #5897fb; }
374
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
375
+ background: transparent;
376
+ border: none; }
377
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
378
+ border-color: transparent transparent #888 transparent;
379
+ border-width: 0 4px 5px 4px; }
380
+
381
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
382
+ border-top: none;
383
+ border-top-left-radius: 0;
384
+ border-top-right-radius: 0;
385
+ background-image: -webkit-linear-gradient(top, #fff 0%, #eeeeee 50%);
386
+ background-image: -o-linear-gradient(top, #fff 0%, #eeeeee 50%);
387
+ background-image: linear-gradient(to bottom, #fff 0%, #eeeeee 50%);
388
+ background-repeat: repeat-x;
389
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
390
+
391
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
392
+ border-bottom: none;
393
+ border-bottom-left-radius: 0;
394
+ border-bottom-right-radius: 0;
395
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, #fff 100%);
396
+ background-image: -o-linear-gradient(top, #eeeeee 50%, #fff 100%);
397
+ background-image: linear-gradient(to bottom, #eeeeee 50%, #fff 100%);
398
+ background-repeat: repeat-x;
399
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
400
+
401
+ .select2-container--classic .select2-selection--multiple {
402
+ background-color: #fff;
403
+ border: 1px solid #ddd;
404
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
405
+ border-radius: 0;
406
+ cursor: text;
407
+ outline: 0; }
408
+ .select2-container--classic .select2-selection--multiple:focus {
409
+ border: 1px solid #5897fb;
410
+ box-shadow: 0 0 2px rgba(30,140,190,.8); }
411
+ .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
412
+ list-style: none;
413
+ margin: 0;
414
+ padding: 0 5px; }
415
+ .select2-container--classic .select2-selection--multiple .select2-selection__clear {
416
+ display: none; }
417
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice {
418
+ background-color: #f1f1f1;
419
+ border: 1px solid #ddd;
420
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
421
+ border-radius: 0;
422
+ cursor: default;
423
+ float: left;
424
+ margin-right: 5px;
425
+ margin-top: 5px;
426
+ margin-bottom: 0;
427
+ padding: 0 5px; }
428
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
429
+ color: #888;
430
+ cursor: pointer;
431
+ display: inline-block;
432
+ font-weight: bold;
433
+ margin-right: 2px; }
434
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
435
+ color: #555; }
436
+
437
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
438
+ float: right; }
439
+
440
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
441
+ margin-left: 5px;
442
+ margin-right: auto; }
443
+
444
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
445
+ margin-left: 2px;
446
+ margin-right: auto; }
447
+
448
+ .select2-container--classic.select2-container--open .select2-selection--multiple {
449
+ border: 1px solid #5897fb; }
450
+
451
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
452
+ border-top: none;
453
+ border-top-left-radius: 0;
454
+ border-top-right-radius: 0; }
455
+
456
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
457
+ border-bottom: none;
458
+ border-bottom-left-radius: 0;
459
+ border-bottom-right-radius: 0; }
460
+
461
+ .select2-container--classic .select2-search--dropdown .select2-search__field {
462
+ border: 1px solid #ddd;
463
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
464
+ outline: 0; }
465
+
466
+ .select2-container--classic .select2-search--inline .select2-search__field {
467
+ outline: 0;
468
+ box-shadow: none; }
469
+
470
+ .select2-container--classic .select2-dropdown {
471
+ background-color: #fff;
472
+ border: 1px solid transparent; }
473
+
474
+ .select2-container--classic .select2-dropdown--above {
475
+ border-bottom: none; }
476
+
477
+ .select2-container--classic .select2-dropdown--below {
478
+ border-top: none; }
479
+
480
+ .select2-container--classic .select2-results > .select2-results__options {
481
+ max-height: 200px;
482
+ overflow-y: auto; }
483
+
484
+ .select2-container--classic .select2-results__option[role=group] {
485
+ padding: 0; }
486
+
487
+ .select2-container--classic .select2-results__option[aria-disabled=true] {
488
+ color: grey; }
489
+
490
+ .select2-container--classic .select2-results__option--highlighted[aria-selected] {
491
+ background-color: #5897fb;
492
+ color: #fff; }
493
+
494
+ .select2-container--classic .select2-results__group {
495
+ cursor: default;
496
+ display: block;
497
+ padding: 6px; }
498
+
499
+ .select2-container--classic.select2-container--open .select2-dropdown {
500
+ border-color: #5897fb; }
assets/select2/css/select2.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);border-radius:0;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;margin-bottom:0;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--classic .select2-results>.select2-results__options,.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);border-radius:0}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#ddd;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);border-radius:0;cursor:text;padding-bottom:2px}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none;margin-bottom:0}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#f1f1f1;border:1px solid #ddd;border-radius:2px;cursor:default;float:left;margin-right:5px;margin-top:5px;margin-bottom:0;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#0073aa;cursor:pointer;display:inline-block;font-weight:400;margin:0 2px 1px 0}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#5b9dd9}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__placeholder{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:1px solid #5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#ddd;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.select2-container--default .select2-search--inline .select2-search__field{background:0 0;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#e5e5e5}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#f1f1f1}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#00a0d2;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);border-radius:0;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb;box-shadow:0 0 2px rgba(30,140,190,.8)}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #ddd;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #ddd;border-radius:4px 0 0 4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);border-radius:0;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb;box-shadow:0 0 2px rgba(30,140,190,.8)}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#f1f1f1;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;margin-bottom:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
assets/select2/js/i18n/af.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Verwyders asseblief "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Voer asseblief "+t+" of meer karakters";return n},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var t="Kies asseblief net "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ar.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum;return"الرجاء حذف "+t+" عناصر"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"الرجاء إضافة "+t+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){return"تستطيع إختيار "+e.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/az.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/bg.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/bs.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bs",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ca.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/cs.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadejte o jeden znak méně.":n<=4?"Prosím, zadejte o "+e(n,!0)+" znaky méně.":"Prosím, zadejte o "+n+" znaků méně."},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadejte ještě jeden znak.":n<=4?"Prosím, zadejte ještě další "+e(n,!0)+" znaky.":"Prosím, zadejte ještě dalších "+n+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku.":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky.":"Můžete zvolit maximálně "+n+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/da.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/de.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/dsb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/dsb",[],function(){var e=["znamuško","znamušce","znamuška","znamuškow"],t=["zapisk","zapiska","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Pšosym lašuj "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Pšosym zapódaj nanejmjenjej "+r+" "+n(r,e)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(e){return"Móžoš jano "+e.maximum+" "+n(e.maximum,t)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/el.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/en.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/es.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/et.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/eu.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/fa.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/fi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/fr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Supprimez "+t+" caractère"+(t>1)?"s":""},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Saisissez au moins "+t+" caractère"+(t>1)?"s":""},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1)?"s":""},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/gl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/he.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/hi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/hr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/hsb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hsb",[],function(){var e=["znamješko","znamješce","znamješka","znamješkow"],t=["zapisk","zapiskaj","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Prošu zhašej "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Prošu zapodaj znajmjeńša "+r+" "+n(r,e)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(e){return"Móžeš jenož "+e.maximum+" "+n(e.maximum,t)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/hu.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/hy.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Խնդրում ենք հեռացնել "+t+" նշան";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Խնդրում ենք մուտքագրել "+t+" կամ ավել նշաններ";return n},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(e){var t="Դուք կարող եք ընտրել առավելագույնը "+e.maximum+" կետ";return t},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/id.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/is.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/it.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ja.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/km.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ko.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/lt.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/lv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/mk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ms.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/nb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn "+t+" tegn til";return n+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/nl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/pl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ps.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="د مهربانۍ لمخي "+t+" توری ړنګ کړئ";return t!=1&&(n=n.replace("توری","توري")),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لږ تر لږه "+t+" يا ډېر توري وليکئ";return n},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(e){var t="تاسو يوازي "+e.maximum+" قلم په نښه کولای سی";return e.maximum!=1&&(t=t.replace("قلم","قلمونه")),t},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/pt-BR.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/pt.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ro.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+" sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/ru.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/sk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/sl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbrišite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpišite še "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var t="Označite lahko največ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/sr-Cyrl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/sr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/sv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/th.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/tr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/uk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/vi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+" ký tự";return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/zh-CN.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/i18n/zh-TW.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
assets/select2/js/select2.js ADDED
@@ -0,0 +1,5833 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Select2 4.0.6-rc.0
3
+ * https://select2.github.io
4
+ *
5
+ * Released under the MIT license
6
+ * https://github.com/select2/select2/blob/master/LICENSE.md
7
+ */
8
+ ;(function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as an anonymous module.
11
+ define(['jquery'], factory);
12
+ } else if (typeof module === 'object' && module.exports) {
13
+ // Node/CommonJS
14
+ module.exports = function (root, jQuery) {
15
+ if (jQuery === undefined) {
16
+ // require('jQuery') returns a factory that requires window to
17
+ // build a jQuery instance, we normalize how we use modules
18
+ // that require this pattern but the window provided is a noop
19
+ // if it's defined (how jquery works)
20
+ if (typeof window !== 'undefined') {
21
+ jQuery = require('jquery');
22
+ }
23
+ else {
24
+ jQuery = require('jquery')(root);
25
+ }
26
+ }
27
+ factory(jQuery);
28
+ return jQuery;
29
+ };
30
+ } else {
31
+ // Browser globals
32
+ factory(jQuery);
33
+ }
34
+ } (function (jQuery) {
35
+ // This is needed so we can catch the AMD loader configuration and use it
36
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
37
+ // returns the AMD loader references.
38
+ var S2 =(function () {
39
+ // Restore the Select2 AMD loader so it can be used
40
+ // Needed mostly in the language files, where the loader is not inserted
41
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
42
+ var S2 = jQuery.fn.select2.amd;
43
+ }
44
+ var S2;(function () { if (!S2 || !S2.requirejs) {
45
+ if (!S2) { S2 = {}; } else { require = S2; }
46
+ /**
47
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
48
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
49
+ */
50
+ //Going sloppy to avoid 'use strict' string cost, but strict practices should
51
+ //be followed.
52
+ /*global setTimeout: false */
53
+
54
+ var requirejs, require, define;
55
+ (function (undef) {
56
+ var main, req, makeMap, handlers,
57
+ defined = {},
58
+ waiting = {},
59
+ config = {},
60
+ defining = {},
61
+ hasOwn = Object.prototype.hasOwnProperty,
62
+ aps = [].slice,
63
+ jsSuffixRegExp = /\.js$/;
64
+
65
+ function hasProp(obj, prop) {
66
+ return hasOwn.call(obj, prop);
67
+ }
68
+
69
+ /**
70
+ * Given a relative module name, like ./something, normalize it to
71
+ * a real name that can be mapped to a path.
72
+ * @param {String} name the relative name
73
+ * @param {String} baseName a real name that the name arg is relative
74
+ * to.
75
+ * @returns {String} normalized name
76
+ */
77
+ function normalize(name, baseName) {
78
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
79
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
80
+ baseParts = baseName && baseName.split("/"),
81
+ map = config.map,
82
+ starMap = (map && map['*']) || {};
83
+
84
+ //Adjust any relative paths.
85
+ if (name) {
86
+ name = name.split('/');
87
+ lastIndex = name.length - 1;
88
+
89
+ // If wanting node ID compatibility, strip .js from end
90
+ // of IDs. Have to do this here, and not in nameToUrl
91
+ // because node allows either .js or non .js to map
92
+ // to same file.
93
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
94
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
95
+ }
96
+
97
+ // Starts with a '.' so need the baseName
98
+ if (name[0].charAt(0) === '.' && baseParts) {
99
+ //Convert baseName to array, and lop off the last part,
100
+ //so that . matches that 'directory' and not name of the baseName's
101
+ //module. For instance, baseName of 'one/two/three', maps to
102
+ //'one/two/three.js', but we want the directory, 'one/two' for
103
+ //this normalization.
104
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
105
+ name = normalizedBaseParts.concat(name);
106
+ }
107
+
108
+ //start trimDots
109
+ for (i = 0; i < name.length; i++) {
110
+ part = name[i];
111
+ if (part === '.') {
112
+ name.splice(i, 1);
113
+ i -= 1;
114
+ } else if (part === '..') {
115
+ // If at the start, or previous value is still ..,
116
+ // keep them so that when converted to a path it may
117
+ // still work when converted to a path, even though
118
+ // as an ID it is less than ideal. In larger point
119
+ // releases, may be better to just kick out an error.
120
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
121
+ continue;
122
+ } else if (i > 0) {
123
+ name.splice(i - 1, 2);
124
+ i -= 2;
125
+ }
126
+ }
127
+ }
128
+ //end trimDots
129
+
130
+ name = name.join('/');
131
+ }
132
+
133
+ //Apply map config if available.
134
+ if ((baseParts || starMap) && map) {
135
+ nameParts = name.split('/');
136
+
137
+ for (i = nameParts.length; i > 0; i -= 1) {
138
+ nameSegment = nameParts.slice(0, i).join("/");
139
+
140
+ if (baseParts) {
141
+ //Find the longest baseName segment match in the config.
142
+ //So, do joins on the biggest to smallest lengths of baseParts.
143
+ for (j = baseParts.length; j > 0; j -= 1) {
144
+ mapValue = map[baseParts.slice(0, j).join('/')];
145
+
146
+ //baseName segment has config, find if it has one for
147
+ //this name.
148
+ if (mapValue) {
149
+ mapValue = mapValue[nameSegment];
150
+ if (mapValue) {
151
+ //Match, update name to the new value.
152
+ foundMap = mapValue;
153
+ foundI = i;
154
+ break;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ if (foundMap) {
161
+ break;
162
+ }
163
+
164
+ //Check for a star map match, but just hold on to it,
165
+ //if there is a shorter segment match later in a matching
166
+ //config, then favor over this star map.
167
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
168
+ foundStarMap = starMap[nameSegment];
169
+ starI = i;
170
+ }
171
+ }
172
+
173
+ if (!foundMap && foundStarMap) {
174
+ foundMap = foundStarMap;
175
+ foundI = starI;
176
+ }
177
+
178
+ if (foundMap) {
179
+ nameParts.splice(0, foundI, foundMap);
180
+ name = nameParts.join('/');
181
+ }
182
+ }
183
+
184
+ return name;
185
+ }
186
+
187
+ function makeRequire(relName, forceSync) {
188
+ return function () {
189
+ //A version of a require function that passes a moduleName
190
+ //value for items that may need to
191
+ //look up paths relative to the moduleName
192
+ var args = aps.call(arguments, 0);
193
+
194
+ //If first arg is not require('string'), and there is only
195
+ //one arg, it is the array form without a callback. Insert
196
+ //a null so that the following concat is correct.
197
+ if (typeof args[0] !== 'string' && args.length === 1) {
198
+ args.push(null);
199
+ }
200
+ return req.apply(undef, args.concat([relName, forceSync]));
201
+ };
202
+ }
203
+
204
+ function makeNormalize(relName) {
205
+ return function (name) {
206
+ return normalize(name, relName);
207
+ };
208
+ }
209
+
210
+ function makeLoad(depName) {
211
+ return function (value) {
212
+ defined[depName] = value;
213
+ };
214
+ }
215
+
216
+ function callDep(name) {
217
+ if (hasProp(waiting, name)) {
218
+ var args = waiting[name];
219
+ delete waiting[name];
220
+ defining[name] = true;
221
+ main.apply(undef, args);
222
+ }
223
+
224
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
225
+ throw new Error('No ' + name);
226
+ }
227
+ return defined[name];
228
+ }
229
+
230
+ //Turns a plugin!resource to [plugin, resource]
231
+ //with the plugin being undefined if the name
232
+ //did not have a plugin prefix.
233
+ function splitPrefix(name) {
234
+ var prefix,
235
+ index = name ? name.indexOf('!') : -1;
236
+ if (index > -1) {
237
+ prefix = name.substring(0, index);
238
+ name = name.substring(index + 1, name.length);
239
+ }
240
+ return [prefix, name];
241
+ }
242
+
243
+ //Creates a parts array for a relName where first part is plugin ID,
244
+ //second part is resource ID. Assumes relName has already been normalized.
245
+ function makeRelParts(relName) {
246
+ return relName ? splitPrefix(relName) : [];
247
+ }
248
+
249
+ /**
250
+ * Makes a name map, normalizing the name, and using a plugin
251
+ * for normalization if necessary. Grabs a ref to plugin
252
+ * too, as an optimization.
253
+ */
254
+ makeMap = function (name, relParts) {
255
+ var plugin,
256
+ parts = splitPrefix(name),
257
+ prefix = parts[0],
258
+ relResourceName = relParts[1];
259
+
260
+ name = parts[1];
261
+
262
+ if (prefix) {
263
+ prefix = normalize(prefix, relResourceName);
264
+ plugin = callDep(prefix);
265
+ }
266
+
267
+ //Normalize according
268
+ if (prefix) {
269
+ if (plugin && plugin.normalize) {
270
+ name = plugin.normalize(name, makeNormalize(relResourceName));
271
+ } else {
272
+ name = normalize(name, relResourceName);
273
+ }
274
+ } else {
275
+ name = normalize(name, relResourceName);
276
+ parts = splitPrefix(name);
277
+ prefix = parts[0];
278
+ name = parts[1];
279
+ if (prefix) {
280
+ plugin = callDep(prefix);
281
+ }
282
+ }
283
+
284
+ //Using ridiculous property names for space reasons
285
+ return {
286
+ f: prefix ? prefix + '!' + name : name, //fullName
287
+ n: name,
288
+ pr: prefix,
289
+ p: plugin
290
+ };
291
+ };
292
+
293
+ function makeConfig(name) {
294
+ return function () {
295
+ return (config && config.config && config.config[name]) || {};
296
+ };
297
+ }
298
+
299
+ handlers = {
300
+ require: function (name) {
301
+ return makeRequire(name);
302
+ },
303
+ exports: function (name) {
304
+ var e = defined[name];
305
+ if (typeof e !== 'undefined') {
306
+ return e;
307
+ } else {
308
+ return (defined[name] = {});
309
+ }
310
+ },
311
+ module: function (name) {
312
+ return {
313
+ id: name,
314
+ uri: '',
315
+ exports: defined[name],
316
+ config: makeConfig(name)
317
+ };
318
+ }
319
+ };
320
+
321
+ main = function (name, deps, callback, relName) {
322
+ var cjsModule, depName, ret, map, i, relParts,
323
+ args = [],
324
+ callbackType = typeof callback,
325
+ usingExports;
326
+
327
+ //Use name if no relName
328
+ relName = relName || name;
329
+ relParts = makeRelParts(relName);
330
+
331
+ //Call the callback to define the module, if necessary.
332
+ if (callbackType === 'undefined' || callbackType === 'function') {
333
+ //Pull out the defined dependencies and pass the ordered
334
+ //values to the callback.
335
+ //Default to [require, exports, module] if no deps
336
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
337
+ for (i = 0; i < deps.length; i += 1) {
338
+ map = makeMap(deps[i], relParts);
339
+ depName = map.f;
340
+
341
+ //Fast path CommonJS standard dependencies.
342
+ if (depName === "require") {
343
+ args[i] = handlers.require(name);
344
+ } else if (depName === "exports") {
345
+ //CommonJS module spec 1.1
346
+ args[i] = handlers.exports(name);
347
+ usingExports = true;
348
+ } else if (depName === "module") {
349
+ //CommonJS module spec 1.1
350
+ cjsModule = args[i] = handlers.module(name);
351
+ } else if (hasProp(defined, depName) ||
352
+ hasProp(waiting, depName) ||
353
+ hasProp(defining, depName)) {
354
+ args[i] = callDep(depName);
355
+ } else if (map.p) {
356
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
357
+ args[i] = defined[depName];
358
+ } else {
359
+ throw new Error(name + ' missing ' + depName);
360
+ }
361
+ }
362
+
363
+ ret = callback ? callback.apply(defined[name], args) : undefined;
364
+
365
+ if (name) {
366
+ //If setting exports via "module" is in play,
367
+ //favor that over return value and exports. After that,
368
+ //favor a non-undefined return value over exports use.
369
+ if (cjsModule && cjsModule.exports !== undef &&
370
+ cjsModule.exports !== defined[name]) {
371
+ defined[name] = cjsModule.exports;
372
+ } else if (ret !== undef || !usingExports) {
373
+ //Use the return value from the function.
374
+ defined[name] = ret;
375
+ }
376
+ }
377
+ } else if (name) {
378
+ //May just be an object definition for the module. Only
379
+ //worry about defining if have a module name.
380
+ defined[name] = callback;
381
+ }
382
+ };
383
+
384
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
385
+ if (typeof deps === "string") {
386
+ if (handlers[deps]) {
387
+ //callback in this case is really relName
388
+ return handlers[deps](callback);
389
+ }
390
+ //Just return the module wanted. In this scenario, the
391
+ //deps arg is the module name, and second arg (if passed)
392
+ //is just the relName.
393
+ //Normalize module name, if it contains . or ..
394
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
395
+ } else if (!deps.splice) {
396
+ //deps is a config object, not an array.
397
+ config = deps;
398
+ if (config.deps) {
399
+ req(config.deps, config.callback);
400
+ }
401
+ if (!callback) {
402
+ return;
403
+ }
404
+
405
+ if (callback.splice) {
406
+ //callback is an array, which means it is a dependency list.
407
+ //Adjust args if there are dependencies
408
+ deps = callback;
409
+ callback = relName;
410
+ relName = null;
411
+ } else {
412
+ deps = undef;
413
+ }
414
+ }
415
+
416
+ //Support require(['a'])
417
+ callback = callback || function () {};
418
+
419
+ //If relName is a function, it is an errback handler,
420
+ //so remove it.
421
+ if (typeof relName === 'function') {
422
+ relName = forceSync;
423
+ forceSync = alt;
424
+ }
425
+
426
+ //Simulate async callback;
427
+ if (forceSync) {
428
+ main(undef, deps, callback, relName);
429
+ } else {
430
+ //Using a non-zero value because of concern for what old browsers
431
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
432
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
433
+ //If want a value immediately, use require('id') instead -- something
434
+ //that works in almond on the global level, but not guaranteed and
435
+ //unlikely to work in other AMD implementations.
436
+ setTimeout(function () {
437
+ main(undef, deps, callback, relName);
438
+ }, 4);
439
+ }
440
+
441
+ return req;
442
+ };
443
+
444
+ /**
445
+ * Just drops the config on the floor, but returns req in case
446
+ * the config return value is used.
447
+ */
448
+ req.config = function (cfg) {
449
+ return req(cfg);
450
+ };
451
+
452
+ /**
453
+ * Expose module registry for debugging and tooling
454
+ */
455
+ requirejs._defined = defined;
456
+
457
+ define = function (name, deps, callback) {
458
+ if (typeof name !== 'string') {
459
+ throw new Error('See almond README: incorrect module build, no module name');
460
+ }
461
+
462
+ //This module may not have dependencies
463
+ if (!deps.splice) {
464
+ //deps is not an array, so probably means
465
+ //an object literal or factory function for
466
+ //the value. Adjust args.
467
+ callback = deps;
468
+ deps = [];
469
+ }
470
+
471
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
472
+ waiting[name] = [name, deps, callback];
473
+ }
474
+ };
475
+
476
+ define.amd = {
477
+ jQuery: true
478
+ };
479
+ }());
480
+
481
+ S2.requirejs = requirejs;S2.require = require;S2.define = define;
482
+ }
483
+ }());
484
+ S2.define("almond", function(){});
485
+
486
+ /* global jQuery:false, $:false */
487
+ S2.define('jquery',[],function () {
488
+ var _$ = jQuery || $;
489
+
490
+ if (_$ == null && console && console.error) {
491
+ console.error(
492
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
493
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
494
+ 'web page.'
495
+ );
496
+ }
497
+
498
+ return _$;
499
+ });
500
+
501
+ S2.define('select2/utils',[
502
+ 'jquery'
503
+ ], function ($) {
504
+ var Utils = {};
505
+
506
+ Utils.Extend = function (ChildClass, SuperClass) {
507
+ var __hasProp = {}.hasOwnProperty;
508
+
509
+ function BaseConstructor () {
510
+ this.constructor = ChildClass;
511
+ }
512
+
513
+ for (var key in SuperClass) {
514
+ if (__hasProp.call(SuperClass, key)) {
515
+ ChildClass[key] = SuperClass[key];
516
+ }
517
+ }
518
+
519
+ BaseConstructor.prototype = SuperClass.prototype;
520
+ ChildClass.prototype = new BaseConstructor();
521
+ ChildClass.__super__ = SuperClass.prototype;
522
+
523
+ return ChildClass;
524
+ };
525
+
526
+ function getMethods (theClass) {
527
+ var proto = theClass.prototype;
528
+
529
+ var methods = [];
530
+
531
+ for (var methodName in proto) {
532
+ var m = proto[methodName];
533
+
534
+ if (typeof m !== 'function') {
535
+ continue;
536
+ }
537
+
538
+ if (methodName === 'constructor') {
539
+ continue;
540
+ }
541
+
542
+ methods.push(methodName);
543
+ }
544
+
545
+ return methods;
546
+ }
547
+
548
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
549
+ var decoratedMethods = getMethods(DecoratorClass);
550
+ var superMethods = getMethods(SuperClass);
551
+
552
+ function DecoratedClass () {
553
+ var unshift = Array.prototype.unshift;
554
+
555
+ var argCount = DecoratorClass.prototype.constructor.length;
556
+
557
+ var calledConstructor = SuperClass.prototype.constructor;
558
+
559
+ if (argCount > 0) {
560
+ unshift.call(arguments, SuperClass.prototype.constructor);
561
+
562
+ calledConstructor = DecoratorClass.prototype.constructor;
563
+ }
564
+
565
+ calledConstructor.apply(this, arguments);
566
+ }
567
+
568
+ DecoratorClass.displayName = SuperClass.displayName;
569
+
570
+ function ctr () {
571
+ this.constructor = DecoratedClass;
572
+ }
573
+
574
+ DecoratedClass.prototype = new ctr();
575
+
576
+ for (var m = 0; m < superMethods.length; m++) {
577
+ var superMethod = superMethods[m];
578
+
579
+ DecoratedClass.prototype[superMethod] =
580
+ SuperClass.prototype[superMethod];
581
+ }
582
+
583
+ var calledMethod = function (methodName) {
584
+ // Stub out the original method if it's not decorating an actual method
585
+ var originalMethod = function () {};
586
+
587
+ if (methodName in DecoratedClass.prototype) {
588
+ originalMethod = DecoratedClass.prototype[methodName];
589
+ }
590
+
591
+ var decoratedMethod = DecoratorClass.prototype[methodName];
592
+
593
+ return function () {
594
+ var unshift = Array.prototype.unshift;
595
+
596
+ unshift.call(arguments, originalMethod);
597
+
598
+ return decoratedMethod.apply(this, arguments);
599
+ };
600
+ };
601
+
602
+ for (var d = 0; d < decoratedMethods.length; d++) {
603
+ var decoratedMethod = decoratedMethods[d];
604
+
605
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
606
+ }
607
+
608
+ return DecoratedClass;
609
+ };
610
+
611
+ var Observable = function () {
612
+ this.listeners = {};
613
+ };
614
+
615
+ Observable.prototype.on = function (event, callback) {
616
+ this.listeners = this.listeners || {};
617
+
618
+ if (event in this.listeners) {
619
+ this.listeners[event].push(callback);
620
+ } else {
621
+ this.listeners[event] = [callback];
622
+ }
623
+ };
624
+
625
+ Observable.prototype.trigger = function (event) {
626
+ var slice = Array.prototype.slice;
627
+ var params = slice.call(arguments, 1);
628
+
629
+ this.listeners = this.listeners || {};
630
+
631
+ // Params should always come in as an array
632
+ if (params == null) {
633
+ params = [];
634
+ }
635
+
636
+ // If there are no arguments to the event, use a temporary object
637
+ if (params.length === 0) {
638
+ params.push({});
639
+ }
640
+
641
+ // Set the `_type` of the first object to the event
642
+ params[0]._type = event;
643
+
644
+ if (event in this.listeners) {
645
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
646
+ }
647
+
648
+ if ('*' in this.listeners) {
649
+ this.invoke(this.listeners['*'], arguments);
650
+ }
651
+ };
652
+
653
+ Observable.prototype.invoke = function (listeners, params) {
654
+ for (var i = 0, len = listeners.length; i < len; i++) {
655
+ listeners[i].apply(this, params);
656
+ }
657
+ };
658
+
659
+ Utils.Observable = Observable;
660
+
661
+ Utils.generateChars = function (length) {
662
+ var chars = '';
663
+
664
+ for (var i = 0; i < length; i++) {
665
+ var randomChar = Math.floor(Math.random() * 36);
666
+ chars += randomChar.toString(36);
667
+ }
668
+
669
+ return chars;
670
+ };
671
+
672
+ Utils.bind = function (func, context) {
673
+ return function () {
674
+ func.apply(context, arguments);
675
+ };
676
+ };
677
+
678
+ Utils._convertData = function (data) {
679
+ for (var originalKey in data) {
680
+ var keys = originalKey.split('-');
681
+
682
+ var dataLevel = data;
683
+
684
+ if (keys.length === 1) {
685
+ continue;
686
+ }
687
+
688
+ for (var k = 0; k < keys.length; k++) {
689
+ var key = keys[k];
690
+
691
+ // Lowercase the first letter
692
+ // By default, dash-separated becomes camelCase
693
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
694
+
695
+ if (!(key in dataLevel)) {
696
+ dataLevel[key] = {};
697
+ }
698
+
699
+ if (k == keys.length - 1) {
700
+ dataLevel[key] = data[originalKey];
701
+ }
702
+
703
+ dataLevel = dataLevel[key];
704
+ }
705
+
706
+ delete data[originalKey];
707
+ }
708
+
709
+ return data;
710
+ };
711
+
712
+ Utils.hasScroll = function (index, el) {
713
+ // Adapted from the function created by @ShadowScripter
714
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
715
+ // The original code can be found at
716
+ // http://codereview.stackexchange.com/q/13338
717
+ // and was designed to be used with the Sizzle selector engine.
718
+
719
+ var $el = $(el);
720
+ var overflowX = el.style.overflowX;
721
+ var overflowY = el.style.overflowY;
722
+
723
+ //Check both x and y declarations
724
+ if (overflowX === overflowY &&
725
+ (overflowY === 'hidden' || overflowY === 'visible')) {
726
+ return false;
727
+ }
728
+
729
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
730
+ return true;
731
+ }
732
+
733
+ return ($el.innerHeight() < el.scrollHeight ||
734
+ $el.innerWidth() < el.scrollWidth);
735
+ };
736
+
737
+ Utils.escapeMarkup = function (markup) {
738
+ var replaceMap = {
739
+ '\\': '&#92;',
740
+ '&': '&amp;',
741
+ '<': '&lt;',
742
+ '>': '&gt;',
743
+ '"': '&quot;',
744
+ '\'': '&#39;',
745
+ '/': '&#47;'
746
+ };
747
+
748
+ // Do not try to escape the markup if it's not a string
749
+ if (typeof markup !== 'string') {
750
+ return markup;
751
+ }
752
+
753
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
754
+ return replaceMap[match];
755
+ });
756
+ };
757
+
758
+ // Append an array of jQuery nodes to a given element.
759
+ Utils.appendMany = function ($element, $nodes) {
760
+ // jQuery 1.7.x does not support $.fn.append() with an array
761
+ // Fall back to a jQuery object collection using $.fn.add()
762
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
763
+ var $jqNodes = $();
764
+
765
+ $.map($nodes, function (node) {
766
+ $jqNodes = $jqNodes.add(node);
767
+ });
768
+
769
+ $nodes = $jqNodes;
770
+ }
771
+
772
+ $element.append($nodes);
773
+ };
774
+
775
+ // Cache objects in Utils.__cache instead of $.data (see #4346)
776
+ Utils.__cache = {};
777
+
778
+ var id = 0;
779
+ Utils.GetUniqueElementId = function (element) {
780
+ // Get a unique element Id. If element has no id,
781
+ // creates a new unique number, stores it in the id
782
+ // attribute and returns the new id.
783
+ // If an id already exists, it simply returns it.
784
+
785
+ var select2Id = element.getAttribute('data-select2-id');
786
+ if (select2Id == null) {
787
+ // If element has id, use it.
788
+ if (element.id) {
789
+ select2Id = element.id;
790
+ element.setAttribute('data-select2-id', select2Id);
791
+ } else {
792
+ element.setAttribute('data-select2-id', ++id);
793
+ select2Id = id.toString();
794
+ }
795
+ }
796
+ return select2Id;
797
+ };
798
+
799
+ Utils.StoreData = function (element, name, value) {
800
+ // Stores an item in the cache for a specified element.
801
+ // name is the cache key.
802
+ var id = Utils.GetUniqueElementId(element);
803
+ if (!Utils.__cache[id]) {
804
+ Utils.__cache[id] = {};
805
+ }
806
+
807
+ Utils.__cache[id][name] = value;
808
+ };
809
+
810
+ Utils.GetData = function (element, name) {
811
+ // Retrieves a value from the cache by its key (name)
812
+ // name is optional. If no name specified, return
813
+ // all cache items for the specified element.
814
+ // and for a specified element.
815
+ var id = Utils.GetUniqueElementId(element);
816
+ if (name) {
817
+ if (Utils.__cache[id]) {
818
+ return Utils.__cache[id][name] != null ?
819
+ Utils.__cache[id][name]:
820
+ $(element).data(name); // Fallback to HTML5 data attribs.
821
+ }
822
+ return $(element).data(name); // Fallback to HTML5 data attribs.
823
+ } else {
824
+ return Utils.__cache[id];
825
+ }
826
+ };
827
+
828
+ Utils.RemoveData = function (element) {
829
+ // Removes all cached items for a specified element.
830
+ var id = Utils.GetUniqueElementId(element);
831
+ if (Utils.__cache[id] != null) {
832
+ delete Utils.__cache[id];
833
+ }
834
+ };
835
+
836
+ return Utils;
837
+ });
838
+
839
+ S2.define('select2/results',[
840
+ 'jquery',
841
+ './utils'
842
+ ], function ($, Utils) {
843
+ function Results ($element, options, dataAdapter) {
844
+ this.$element = $element;
845
+ this.data = dataAdapter;
846
+ this.options = options;
847
+
848
+ Results.__super__.constructor.call(this);
849
+ }
850
+
851
+ Utils.Extend(Results, Utils.Observable);
852
+
853
+ Results.prototype.render = function () {
854
+ var $results = $(
855
+ '<ul class="select2-results__options" role="tree"></ul>'
856
+ );
857
+
858
+ if (this.options.get('multiple')) {
859
+ $results.attr('aria-multiselectable', 'true');
860
+ }
861
+
862
+ this.$results = $results;
863
+
864
+ return $results;
865
+ };
866
+
867
+ Results.prototype.clear = function () {
868
+ this.$results.empty();
869
+ };
870
+
871
+ Results.prototype.displayMessage = function (params) {
872
+ var escapeMarkup = this.options.get('escapeMarkup');
873
+
874
+ this.clear();
875
+ this.hideLoading();
876
+
877
+ var $message = $(
878
+ '<li role="treeitem" aria-live="assertive"' +
879
+ ' class="select2-results__option"></li>'
880
+ );
881
+
882
+ var message = this.options.get('translations').get(params.message);
883
+
884
+ $message.append(
885
+ escapeMarkup(
886
+ message(params.args)
887
+ )
888
+ );
889
+
890
+ $message[0].className += ' select2-results__message';
891
+
892
+ this.$results.append($message);
893
+ };
894
+
895
+ Results.prototype.hideMessages = function () {
896
+ this.$results.find('.select2-results__message').remove();
897
+ };
898
+
899
+ Results.prototype.append = function (data) {
900
+ this.hideLoading();
901
+
902
+ var $options = [];
903
+
904
+ if (data.results == null || data.results.length === 0) {
905
+ if (this.$results.children().length === 0) {
906
+ this.trigger('results:message', {
907
+ message: 'noResults'
908
+ });
909
+ }
910
+
911
+ return;
912
+ }
913
+
914
+ data.results = this.sort(data.results);
915
+
916
+ for (var d = 0; d < data.results.length; d++) {
917
+ var item = data.results[d];
918
+
919
+ var $option = this.option(item);
920
+
921
+ $options.push($option);
922
+ }
923
+
924
+ this.$results.append($options);
925
+ };
926
+
927
+ Results.prototype.position = function ($results, $dropdown) {
928
+ var $resultsContainer = $dropdown.find('.select2-results');
929
+ $resultsContainer.append($results);
930
+ };
931
+
932
+ Results.prototype.sort = function (data) {
933
+ var sorter = this.options.get('sorter');
934
+
935
+ return sorter(data);
936
+ };
937
+
938
+ Results.prototype.highlightFirstItem = function () {
939
+ var $options = this.$results
940
+ .find('.select2-results__option[aria-selected]');
941
+
942
+ var $selected = $options.filter('[aria-selected=true]');
943
+
944
+ // Check if there are any selected options
945
+ if ($selected.length > 0) {
946
+ // If there are selected options, highlight the first
947
+ $selected.first().trigger('mouseenter');
948
+ } else {
949
+ // If there are no selected options, highlight the first option
950
+ // in the dropdown
951
+ $options.first().trigger('mouseenter');
952
+ }
953
+
954
+ this.ensureHighlightVisible();
955
+ };
956
+
957
+ Results.prototype.setClasses = function () {
958
+ var self = this;
959
+
960
+ this.data.current(function (selected) {
961
+ var selectedIds = $.map(selected, function (s) {
962
+ return s.id.toString();
963
+ });
964
+
965
+ var $options = self.$results
966
+ .find('.select2-results__option[aria-selected]');
967
+
968
+ $options.each(function () {
969
+ var $option = $(this);
970
+
971
+ var item = Utils.GetData(this, 'data');
972
+
973
+ // id needs to be converted to a string when comparing
974
+ var id = '' + item.id;
975
+
976
+ if ((item.element != null && item.element.selected) ||
977
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
978
+ $option.attr('aria-selected', 'true');
979
+ } else {
980
+ $option.attr('aria-selected', 'false');
981
+ }
982
+ });
983
+
984
+ });
985
+ };
986
+
987
+ Results.prototype.showLoading = function (params) {
988
+ this.hideLoading();
989
+
990
+ var loadingMore = this.options.get('translations').get('searching');
991
+
992
+ var loading = {
993
+ disabled: true,
994
+ loading: true,
995
+ text: loadingMore(params)
996
+ };
997
+ var $loading = this.option(loading);
998
+ $loading.className += ' loading-results';
999
+
1000
+ this.$results.prepend($loading);
1001
+ };
1002
+
1003
+ Results.prototype.hideLoading = function () {
1004
+ this.$results.find('.loading-results').remove();
1005
+ };
1006
+
1007
+ Results.prototype.option = function (data) {
1008
+ var option = document.createElement('li');
1009
+ option.className = 'select2-results__option';
1010
+
1011
+ var attrs = {
1012
+ 'role': 'treeitem',
1013
+ 'aria-selected': 'false'
1014
+ };
1015
+
1016
+ if (data.disabled) {
1017
+ delete attrs['aria-selected'];
1018
+ attrs['aria-disabled'] = 'true';
1019
+ }
1020
+
1021
+ if (data.id == null) {
1022
+ delete attrs['aria-selected'];
1023
+ }
1024
+
1025
+ if (data._resultId != null) {
1026
+ option.id = data._resultId;
1027
+ }
1028
+
1029
+ if (data.title) {
1030
+ option.title = data.title;
1031
+ }
1032
+
1033
+ if (data.children) {
1034
+ attrs.role = 'group';
1035
+ attrs['aria-label'] = data.text;
1036
+ delete attrs['aria-selected'];
1037
+ }
1038
+
1039
+ for (var attr in attrs) {
1040
+ var val = attrs[attr];
1041
+
1042
+ option.setAttribute(attr, val);
1043
+ }
1044
+
1045
+ if (data.children) {
1046
+ var $option = $(option);
1047
+
1048
+ var label = document.createElement('strong');
1049
+ label.className = 'select2-results__group';
1050
+
1051
+ var $label = $(label);
1052
+ this.template(data, label);
1053
+
1054
+ var $children = [];
1055
+
1056
+ for (var c = 0; c < data.children.length; c++) {
1057
+ var child = data.children[c];
1058
+
1059
+ var $child = this.option(child);
1060
+
1061
+ $children.push($child);
1062
+ }
1063
+
1064
+ var $childrenContainer = $('<ul></ul>', {
1065
+ 'class': 'select2-results__options select2-results__options--nested'
1066
+ });
1067
+
1068
+ $childrenContainer.append($children);
1069
+
1070
+ $option.append(label);
1071
+ $option.append($childrenContainer);
1072
+ } else {
1073
+ this.template(data, option);
1074
+ }
1075
+
1076
+ Utils.StoreData(option, 'data', data);
1077
+
1078
+ return option;
1079
+ };
1080
+
1081
+ Results.prototype.bind = function (container, $container) {
1082
+ var self = this;
1083
+
1084
+ var id = container.id + '-results';
1085
+
1086
+ this.$results.attr('id', id);
1087
+
1088
+ container.on('results:all', function (params) {
1089
+ self.clear();
1090
+ self.append(params.data);
1091
+
1092
+ if (container.isOpen()) {
1093
+ self.setClasses();
1094
+ self.highlightFirstItem();
1095
+ }
1096
+ });
1097
+
1098
+ container.on('results:append', function (params) {
1099
+ self.append(params.data);
1100
+
1101
+ if (container.isOpen()) {
1102
+ self.setClasses();
1103
+ }
1104
+ });
1105
+
1106
+ container.on('query', function (params) {
1107
+ self.hideMessages();
1108
+ self.showLoading(params);
1109
+ });
1110
+
1111
+ container.on('select', function () {
1112
+ if (!container.isOpen()) {
1113
+ return;
1114
+ }
1115
+
1116
+ self.setClasses();
1117
+ self.highlightFirstItem();
1118
+ });
1119
+
1120
+ container.on('unselect', function () {
1121
+ if (!container.isOpen()) {
1122
+ return;
1123
+ }
1124
+
1125
+ self.setClasses();
1126
+ self.highlightFirstItem();
1127
+ });
1128
+
1129
+ container.on('open', function () {
1130
+ // When the dropdown is open, aria-expended="true"
1131
+ self.$results.attr('aria-expanded', 'true');
1132
+ self.$results.attr('aria-hidden', 'false');
1133
+
1134
+ self.setClasses();
1135
+ self.ensureHighlightVisible();
1136
+ });
1137
+
1138
+ container.on('close', function () {
1139
+ // When the dropdown is closed, aria-expended="false"
1140
+ self.$results.attr('aria-expanded', 'false');
1141
+ self.$results.attr('aria-hidden', 'true');
1142
+ self.$results.removeAttr('aria-activedescendant');
1143
+ });
1144
+
1145
+ container.on('results:toggle', function () {
1146
+ var $highlighted = self.getHighlightedResults();
1147
+
1148
+ if ($highlighted.length === 0) {
1149
+ return;
1150
+ }
1151
+
1152
+ $highlighted.trigger('mouseup');
1153
+ });
1154
+
1155
+ container.on('results:select', function () {
1156
+ var $highlighted = self.getHighlightedResults();
1157
+
1158
+ if ($highlighted.length === 0) {
1159
+ return;
1160
+ }
1161
+
1162
+ var data = Utils.GetData($highlighted[0], 'data');
1163
+
1164
+ if ($highlighted.attr('aria-selected') == 'true') {
1165
+ self.trigger('close', {});
1166
+ } else {
1167
+ self.trigger('select', {
1168
+ data: data
1169
+ });
1170
+ }
1171
+ });
1172
+
1173
+ container.on('results:previous', function () {
1174
+ var $highlighted = self.getHighlightedResults();
1175
+
1176
+ var $options = self.$results.find('[aria-selected]');
1177
+
1178
+ var currentIndex = $options.index($highlighted);
1179
+
1180
+ // If we are already at te top, don't move further
1181
+ if (currentIndex === 0) {
1182
+ return;
1183
+ }
1184
+
1185
+ var nextIndex = currentIndex - 1;
1186
+
1187
+ // If none are highlighted, highlight the first
1188
+ if ($highlighted.length === 0) {
1189
+ nextIndex = 0;
1190
+ }
1191
+
1192
+ var $next = $options.eq(nextIndex);
1193
+
1194
+ $next.trigger('mouseenter');
1195
+
1196
+ var currentOffset = self.$results.offset().top;
1197
+ var nextTop = $next.offset().top;
1198
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1199
+
1200
+ if (nextIndex === 0) {
1201
+ self.$results.scrollTop(0);
1202
+ } else if (nextTop - currentOffset < 0) {
1203
+ self.$results.scrollTop(nextOffset);
1204
+ }
1205
+ });
1206
+
1207
+ container.on('results:next', function () {
1208
+ var $highlighted = self.getHighlightedResults();
1209
+
1210
+ var $options = self.$results.find('[aria-selected]');
1211
+
1212
+ var currentIndex = $options.index($highlighted);
1213
+
1214
+ var nextIndex = currentIndex + 1;
1215
+
1216
+ // If we are at the last option, stay there
1217
+ if (nextIndex >= $options.length) {
1218
+ return;
1219
+ }
1220
+
1221
+ var $next = $options.eq(nextIndex);
1222
+
1223
+ $next.trigger('mouseenter');
1224
+
1225
+ var currentOffset = self.$results.offset().top +
1226
+ self.$results.outerHeight(false);
1227
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
1228
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1229
+
1230
+ if (nextIndex === 0) {
1231
+ self.$results.scrollTop(0);
1232
+ } else if (nextBottom > currentOffset) {
1233
+ self.$results.scrollTop(nextOffset);
1234
+ }
1235
+ });
1236
+
1237
+ container.on('results:focus', function (params) {
1238
+ params.element.addClass('select2-results__option--highlighted');
1239
+ });
1240
+
1241
+ container.on('results:message', function (params) {
1242
+ self.displayMessage(params);
1243
+ });
1244
+
1245
+ if ($.fn.mousewheel) {
1246
+ this.$results.on('mousewheel', function (e) {
1247
+ var top = self.$results.scrollTop();
1248
+
1249
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
1250
+
1251
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1252
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
1253
+
1254
+ if (isAtTop) {
1255
+ self.$results.scrollTop(0);
1256
+
1257
+ e.preventDefault();
1258
+ e.stopPropagation();
1259
+ } else if (isAtBottom) {
1260
+ self.$results.scrollTop(
1261
+ self.$results.get(0).scrollHeight - self.$results.height()
1262
+ );
1263
+
1264
+ e.preventDefault();
1265
+ e.stopPropagation();
1266
+ }
1267
+ });
1268
+ }
1269
+
1270
+ this.$results.on('mouseup', '.select2-results__option[aria-selected]',
1271
+ function (evt) {
1272
+ var $this = $(this);
1273
+
1274
+ var data = Utils.GetData(this, 'data');
1275
+
1276
+ if ($this.attr('aria-selected') === 'true') {
1277
+ if (self.options.get('multiple')) {
1278
+ self.trigger('unselect', {
1279
+ originalEvent: evt,
1280
+ data: data
1281
+ });
1282
+ } else {
1283
+ self.trigger('close', {});
1284
+ }
1285
+
1286
+ return;
1287
+ }
1288
+
1289
+ self.trigger('select', {
1290
+ originalEvent: evt,
1291
+ data: data
1292
+ });
1293
+ });
1294
+
1295
+ this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
1296
+ function (evt) {
1297
+ var data = Utils.GetData(this, 'data');
1298
+
1299
+ self.getHighlightedResults()
1300
+ .removeClass('select2-results__option--highlighted');
1301
+
1302
+ self.trigger('results:focus', {
1303
+ data: data,
1304
+ element: $(this)
1305
+ });
1306
+ });
1307
+ };
1308
+
1309
+ Results.prototype.getHighlightedResults = function () {
1310
+ var $highlighted = this.$results
1311
+ .find('.select2-results__option--highlighted');
1312
+
1313
+ return $highlighted;
1314
+ };
1315
+
1316
+ Results.prototype.destroy = function () {
1317
+ this.$results.remove();
1318
+ };
1319
+
1320
+ Results.prototype.ensureHighlightVisible = function () {
1321
+ var $highlighted = this.getHighlightedResults();
1322
+
1323
+ if ($highlighted.length === 0) {
1324
+ return;
1325
+ }
1326
+
1327
+ var $options = this.$results.find('[aria-selected]');
1328
+
1329
+ var currentIndex = $options.index($highlighted);
1330
+
1331
+ var currentOffset = this.$results.offset().top;
1332
+ var nextTop = $highlighted.offset().top;
1333
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1334
+
1335
+ var offsetDelta = nextTop - currentOffset;
1336
+ nextOffset -= $highlighted.outerHeight(false) * 2;
1337
+
1338
+ if (currentIndex <= 2) {
1339
+ this.$results.scrollTop(0);
1340
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1341
+ this.$results.scrollTop(nextOffset);
1342
+ }
1343
+ };
1344
+
1345
+ Results.prototype.template = function (result, container) {
1346
+ var template = this.options.get('templateResult');
1347
+ var escapeMarkup = this.options.get('escapeMarkup');
1348
+
1349
+ var content = template(result, container);
1350
+
1351
+ if (content == null) {
1352
+ container.style.display = 'none';
1353
+ } else if (typeof content === 'string') {
1354
+ container.innerHTML = escapeMarkup(content);
1355
+ } else {
1356
+ $(container).append(content);
1357
+ }
1358
+ };
1359
+
1360
+ return Results;
1361
+ });
1362
+
1363
+ S2.define('select2/keys',[
1364
+
1365
+ ], function () {
1366
+ var KEYS = {
1367
+ BACKSPACE: 8,
1368
+ TAB: 9,
1369
+ ENTER: 13,
1370
+ SHIFT: 16,
1371
+ CTRL: 17,
1372
+ ALT: 18,
1373
+ ESC: 27,
1374
+ SPACE: 32,
1375
+ PAGE_UP: 33,
1376
+ PAGE_DOWN: 34,
1377
+ END: 35,
1378
+ HOME: 36,
1379
+ LEFT: 37,
1380
+ UP: 38,
1381
+ RIGHT: 39,
1382
+ DOWN: 40,
1383
+ DELETE: 46
1384
+ };
1385
+
1386
+ return KEYS;
1387
+ });
1388
+
1389
+ S2.define('select2/selection/base',[
1390
+ 'jquery',
1391
+ '../utils',
1392
+ '../keys'
1393
+ ], function ($, Utils, KEYS) {
1394
+ function BaseSelection ($element, options) {
1395
+ this.$element = $element;
1396
+ this.options = options;
1397
+
1398
+ BaseSelection.__super__.constructor.call(this);
1399
+ }
1400
+
1401
+ Utils.Extend(BaseSelection, Utils.Observable);
1402
+
1403
+ BaseSelection.prototype.render = function () {
1404
+ var $selection = $(
1405
+ '<span class="select2-selection" role="combobox" ' +
1406
+ ' aria-haspopup="true" aria-expanded="false">' +
1407
+ '</span>'
1408
+ );
1409
+
1410
+ this._tabindex = 0;
1411
+
1412
+ if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
1413
+ this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
1414
+ } else if (this.$element.attr('tabindex') != null) {
1415
+ this._tabindex = this.$element.attr('tabindex');
1416
+ }
1417
+
1418
+ $selection.attr('title', this.$element.attr('title'));
1419
+ $selection.attr('tabindex', this._tabindex);
1420
+
1421
+ this.$selection = $selection;
1422
+
1423
+ return $selection;
1424
+ };
1425
+
1426
+ BaseSelection.prototype.bind = function (container, $container) {
1427
+ var self = this;
1428
+
1429
+ var id = container.id + '-container';
1430
+ var resultsId = container.id + '-results';
1431
+
1432
+ this.container = container;
1433
+
1434
+ this.$selection.on('focus', function (evt) {
1435
+ self.trigger('focus', evt);
1436
+ });
1437
+
1438
+ this.$selection.on('blur', function (evt) {
1439
+ self._handleBlur(evt);
1440
+ });
1441
+
1442
+ this.$selection.on('keydown', function (evt) {
1443
+ self.trigger('keypress', evt);
1444
+
1445
+ if (evt.which === KEYS.SPACE) {
1446
+ evt.preventDefault();
1447
+ }
1448
+ });
1449
+
1450
+ container.on('results:focus', function (params) {
1451
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
1452
+ });
1453
+
1454
+ container.on('selection:update', function (params) {
1455
+ self.update(params.data);
1456
+ });
1457
+
1458
+ container.on('open', function () {
1459
+ // When the dropdown is open, aria-expanded="true"
1460
+ self.$selection.attr('aria-expanded', 'true');
1461
+ self.$selection.attr('aria-owns', resultsId);
1462
+
1463
+ self._attachCloseHandler(container);
1464
+ });
1465
+
1466
+ container.on('close', function () {
1467
+ // When the dropdown is closed, aria-expanded="false"
1468
+ self.$selection.attr('aria-expanded', 'false');
1469
+ self.$selection.removeAttr('aria-activedescendant');
1470
+ self.$selection.removeAttr('aria-owns');
1471
+
1472
+ self.$selection.focus();
1473
+
1474
+ self._detachCloseHandler(container);
1475
+ });
1476
+
1477
+ container.on('enable', function () {
1478
+ self.$selection.attr('tabindex', self._tabindex);
1479
+ });
1480
+
1481
+ container.on('disable', function () {
1482
+ self.$selection.attr('tabindex', '-1');
1483
+ });
1484
+ };
1485
+
1486
+ BaseSelection.prototype._handleBlur = function (evt) {
1487
+ var self = this;
1488
+
1489
+ // This needs to be delayed as the active element is the body when the tab
1490
+ // key is pressed, possibly along with others.
1491
+ window.setTimeout(function () {
1492
+ // Don't trigger `blur` if the focus is still in the selection
1493
+ if (
1494
+ (document.activeElement == self.$selection[0]) ||
1495
+ ($.contains(self.$selection[0], document.activeElement))
1496
+ ) {
1497
+ return;
1498
+ }
1499
+
1500
+ self.trigger('blur', evt);
1501
+ }, 1);
1502
+ };
1503
+
1504
+ BaseSelection.prototype._attachCloseHandler = function (container) {
1505
+ var self = this;
1506
+
1507
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
1508
+ var $target = $(e.target);
1509
+
1510
+ var $select = $target.closest('.select2');
1511
+
1512
+ var $all = $('.select2.select2-container--open');
1513
+
1514
+ $all.each(function () {
1515
+ var $this = $(this);
1516
+
1517
+ if (this == $select[0]) {
1518
+ return;
1519
+ }
1520
+
1521
+ var $element = Utils.GetData(this, 'element');
1522
+
1523
+ $element.select2('close');
1524
+ });
1525
+ });
1526
+ };
1527
+
1528
+ BaseSelection.prototype._detachCloseHandler = function (container) {
1529
+ $(document.body).off('mousedown.select2.' + container.id);
1530
+ };
1531
+
1532
+ BaseSelection.prototype.position = function ($selection, $container) {
1533
+ var $selectionContainer = $container.find('.selection');
1534
+ $selectionContainer.append($selection);
1535
+ };
1536
+
1537
+ BaseSelection.prototype.destroy = function () {
1538
+ this._detachCloseHandler(this.container);
1539
+ };
1540
+
1541
+ BaseSelection.prototype.update = function (data) {
1542
+ throw new Error('The `update` method must be defined in child classes.');
1543
+ };
1544
+
1545
+ return BaseSelection;
1546
+ });
1547
+
1548
+ S2.define('select2/selection/single',[
1549
+ 'jquery',
1550
+ './base',
1551
+ '../utils',
1552
+ '../keys'
1553
+ ], function ($, BaseSelection, Utils, KEYS) {
1554
+ function SingleSelection () {
1555
+ SingleSelection.__super__.constructor.apply(this, arguments);
1556
+ }
1557
+
1558
+ Utils.Extend(SingleSelection, BaseSelection);
1559
+
1560
+ SingleSelection.prototype.render = function () {
1561
+ var $selection = SingleSelection.__super__.render.call(this);
1562
+
1563
+ $selection.addClass('select2-selection--single');
1564
+
1565
+ $selection.html(
1566
+ '<span class="select2-selection__rendered"></span>' +
1567
+ '<span class="select2-selection__arrow" role="presentation">' +
1568
+ '<b role="presentation"></b>' +
1569
+ '</span>'
1570
+ );
1571
+
1572
+ return $selection;
1573
+ };
1574
+
1575
+ SingleSelection.prototype.bind = function (container, $container) {
1576
+ var self = this;
1577
+
1578
+ SingleSelection.__super__.bind.apply(this, arguments);
1579
+
1580
+ var id = container.id + '-container';
1581
+
1582
+ this.$selection.find('.select2-selection__rendered')
1583
+ .attr('id', id)
1584
+ .attr('role', 'textbox')
1585
+ .attr('aria-readonly', 'true');
1586
+ this.$selection.attr('aria-labelledby', id);
1587
+
1588
+ this.$selection.on('mousedown', function (evt) {
1589
+ // Only respond to left clicks
1590
+ if (evt.which !== 1) {
1591
+ return;
1592
+ }
1593
+
1594
+ self.trigger('toggle', {
1595
+ originalEvent: evt
1596
+ });
1597
+ });
1598
+
1599
+ this.$selection.on('focus', function (evt) {
1600
+ // User focuses on the container
1601
+ });
1602
+
1603
+ this.$selection.on('blur', function (evt) {
1604
+ // User exits the container
1605
+ });
1606
+
1607
+ container.on('focus', function (evt) {
1608
+ if (!container.isOpen()) {
1609
+ self.$selection.focus();
1610
+ }
1611
+ });
1612
+ };
1613
+
1614
+ SingleSelection.prototype.clear = function () {
1615
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1616
+ $rendered.empty();
1617
+ $rendered.removeAttr('title'); // clear tooltip on empty
1618
+ };
1619
+
1620
+ SingleSelection.prototype.display = function (data, container) {
1621
+ var template = this.options.get('templateSelection');
1622
+ var escapeMarkup = this.options.get('escapeMarkup');
1623
+
1624
+ return escapeMarkup(template(data, container));
1625
+ };
1626
+
1627
+ SingleSelection.prototype.selectionContainer = function () {
1628
+ return $('<span></span>');
1629
+ };
1630
+
1631
+ SingleSelection.prototype.update = function (data) {
1632
+ if (data.length === 0) {
1633
+ this.clear();
1634
+ return;
1635
+ }
1636
+
1637
+ var selection = data[0];
1638
+
1639
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1640
+ var formatted = this.display(selection, $rendered);
1641
+
1642
+ $rendered.empty().append(formatted);
1643
+ $rendered.attr('title', selection.title || selection.text);
1644
+ };
1645
+
1646
+ return SingleSelection;
1647
+ });
1648
+
1649
+ S2.define('select2/selection/multiple',[
1650
+ 'jquery',
1651
+ './base',
1652
+ '../utils'
1653
+ ], function ($, BaseSelection, Utils) {
1654
+ function MultipleSelection ($element, options) {
1655
+ MultipleSelection.__super__.constructor.apply(this, arguments);
1656
+ }
1657
+
1658
+ Utils.Extend(MultipleSelection, BaseSelection);
1659
+
1660
+ MultipleSelection.prototype.render = function () {
1661
+ var $selection = MultipleSelection.__super__.render.call(this);
1662
+
1663
+ $selection.addClass('select2-selection--multiple');
1664
+
1665
+ $selection.html(
1666
+ '<ul class="select2-selection__rendered"></ul>'
1667
+ );
1668
+
1669
+ return $selection;
1670
+ };
1671
+
1672
+ MultipleSelection.prototype.bind = function (container, $container) {
1673
+ var self = this;
1674
+
1675
+ MultipleSelection.__super__.bind.apply(this, arguments);
1676
+
1677
+ this.$selection.on('click', function (evt) {
1678
+ self.trigger('toggle', {
1679
+ originalEvent: evt
1680
+ });
1681
+ });
1682
+
1683
+ this.$selection.on(
1684
+ 'click',
1685
+ '.select2-selection__choice__remove',
1686
+ function (evt) {
1687
+ // Ignore the event if it is disabled
1688
+ if (self.options.get('disabled')) {
1689
+ return;
1690
+ }
1691
+
1692
+ var $remove = $(this);
1693
+ var $selection = $remove.parent();
1694
+
1695
+ var data = Utils.GetData($selection[0], 'data');
1696
+
1697
+ self.trigger('unselect', {
1698
+ originalEvent: evt,
1699
+ data: data
1700
+ });
1701
+ }
1702
+ );
1703
+ };
1704
+
1705
+ MultipleSelection.prototype.clear = function () {
1706
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1707
+ $rendered.empty();
1708
+ $rendered.removeAttr('title');
1709
+ };
1710
+
1711
+ MultipleSelection.prototype.display = function (data, container) {
1712
+ var template = this.options.get('templateSelection');
1713
+ var escapeMarkup = this.options.get('escapeMarkup');
1714
+
1715
+ return escapeMarkup(template(data, container));
1716
+ };
1717
+
1718
+ MultipleSelection.prototype.selectionContainer = function () {
1719
+ var $container = $(
1720
+ '<li class="select2-selection__choice">' +
1721
+ '<span class="select2-selection__choice__remove" role="presentation">' +
1722
+ '&times;' +
1723
+ '</span>' +
1724
+ '</li>'
1725
+ );
1726
+
1727
+ return $container;
1728
+ };
1729
+
1730
+ MultipleSelection.prototype.update = function (data) {
1731
+ this.clear();
1732
+
1733
+ if (data.length === 0) {
1734
+ return;
1735
+ }
1736
+
1737
+ var $selections = [];
1738
+
1739
+ for (var d = 0; d < data.length; d++) {
1740
+ var selection = data[d];
1741
+
1742
+ var $selection = this.selectionContainer();
1743
+ var formatted = this.display(selection, $selection);
1744
+
1745
+ $selection.append(formatted);
1746
+ $selection.attr('title', selection.title || selection.text);
1747
+
1748
+ Utils.StoreData($selection[0], 'data', selection);
1749
+
1750
+ $selections.push($selection);
1751
+ }
1752
+
1753
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1754
+
1755
+ Utils.appendMany($rendered, $selections);
1756
+ };
1757
+
1758
+ return MultipleSelection;
1759
+ });
1760
+
1761
+ S2.define('select2/selection/placeholder',[
1762
+ '../utils'
1763
+ ], function (Utils) {
1764
+ function Placeholder (decorated, $element, options) {
1765
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1766
+
1767
+ decorated.call(this, $element, options);
1768
+ }
1769
+
1770
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1771
+ if (typeof placeholder === 'string') {
1772
+ placeholder = {
1773
+ id: '',
1774
+ text: placeholder
1775
+ };
1776
+ }
1777
+
1778
+ return placeholder;
1779
+ };
1780
+
1781
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1782
+ var $placeholder = this.selectionContainer();
1783
+
1784
+ $placeholder.html(this.display(placeholder));
1785
+ $placeholder.addClass('select2-selection__placeholder')
1786
+ .removeClass('select2-selection__choice');
1787
+
1788
+ return $placeholder;
1789
+ };
1790
+
1791
+ Placeholder.prototype.update = function (decorated, data) {
1792
+ var singlePlaceholder = (
1793
+ data.length == 1 && data[0].id != this.placeholder.id
1794
+ );
1795
+ var multipleSelections = data.length > 1;
1796
+
1797
+ if (multipleSelections || singlePlaceholder) {
1798
+ return decorated.call(this, data);
1799
+ }
1800
+
1801
+ this.clear();
1802
+
1803
+ var $placeholder = this.createPlaceholder(this.placeholder);
1804
+
1805
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
1806
+ };
1807
+
1808
+ return Placeholder;
1809
+ });
1810
+
1811
+ S2.define('select2/selection/allowClear',[
1812
+ 'jquery',
1813
+ '../keys',
1814
+ '../utils'
1815
+ ], function ($, KEYS, Utils) {
1816
+ function AllowClear () { }
1817
+
1818
+ AllowClear.prototype.bind = function (decorated, container, $container) {
1819
+ var self = this;
1820
+
1821
+ decorated.call(this, container, $container);
1822
+
1823
+ if (this.placeholder == null) {
1824
+ if (this.options.get('debug') && window.console && console.error) {
1825
+ console.error(
1826
+ 'Select2: The `allowClear` option should be used in combination ' +
1827
+ 'with the `placeholder` option.'
1828
+ );
1829
+ }
1830
+ }
1831
+
1832
+ this.$selection.on('mousedown', '.select2-selection__clear',
1833
+ function (evt) {
1834
+ self._handleClear(evt);
1835
+ });
1836
+
1837
+ container.on('keypress', function (evt) {
1838
+ self._handleKeyboardClear(evt, container);
1839
+ });
1840
+ };
1841
+
1842
+ AllowClear.prototype._handleClear = function (_, evt) {
1843
+ // Ignore the event if it is disabled
1844
+ if (this.options.get('disabled')) {
1845
+ return;
1846
+ }
1847
+
1848
+ var $clear = this.$selection.find('.select2-selection__clear');
1849
+
1850
+ // Ignore the event if nothing has been selected
1851
+ if ($clear.length === 0) {
1852
+ return;
1853
+ }
1854
+
1855
+ evt.stopPropagation();
1856
+
1857
+ var data = Utils.GetData($clear[0], 'data');
1858
+
1859
+ var previousVal = this.$element.val();
1860
+ this.$element.val(this.placeholder.id);
1861
+
1862
+ var unselectData = {
1863
+ data: data
1864
+ };
1865
+ this.trigger('clear', unselectData);
1866
+ if (unselectData.prevented) {
1867
+ this.$element.val(previousVal);
1868
+ return;
1869
+ }
1870
+
1871
+ for (var d = 0; d < data.length; d++) {
1872
+ unselectData = {
1873
+ data: data[d]
1874
+ };
1875
+
1876
+ // Trigger the `unselect` event, so people can prevent it from being
1877
+ // cleared.
1878
+ this.trigger('unselect', unselectData);
1879
+
1880
+ // If the event was prevented, don't clear it out.
1881
+ if (unselectData.prevented) {
1882
+ this.$element.val(previousVal);
1883
+ return;
1884
+ }
1885
+ }
1886
+
1887
+ this.$element.trigger('change');
1888
+
1889
+ this.trigger('toggle', {});
1890
+ };
1891
+
1892
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1893
+ if (container.isOpen()) {
1894
+ return;
1895
+ }
1896
+
1897
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1898
+ this._handleClear(evt);
1899
+ }
1900
+ };
1901
+
1902
+ AllowClear.prototype.update = function (decorated, data) {
1903
+ decorated.call(this, data);
1904
+
1905
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1906
+ data.length === 0) {
1907
+ return;
1908
+ }
1909
+
1910
+ var $remove = $(
1911
+ '<span class="select2-selection__clear">' +
1912
+ '&times;' +
1913
+ '</span>'
1914
+ );
1915
+ Utils.StoreData($remove[0], 'data', data);
1916
+
1917
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
1918
+ };
1919
+
1920
+ return AllowClear;
1921
+ });
1922
+
1923
+ S2.define('select2/selection/search',[
1924
+ 'jquery',
1925
+ '../utils',
1926
+ '../keys'
1927
+ ], function ($, Utils, KEYS) {
1928
+ function Search (decorated, $element, options) {
1929
+ decorated.call(this, $element, options);
1930
+ }
1931
+
1932
+ Search.prototype.render = function (decorated) {
1933
+ var $search = $(
1934
+ '<li class="select2-search select2-search--inline">' +
1935
+ '<input class="select2-search__field" type="search" tabindex="-1"' +
1936
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
1937
+ ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1938
+ '</li>'
1939
+ );
1940
+
1941
+ this.$searchContainer = $search;
1942
+ this.$search = $search.find('input');
1943
+
1944
+ var $rendered = decorated.call(this);
1945
+
1946
+ this._transferTabIndex();
1947
+
1948
+ return $rendered;
1949
+ };
1950
+
1951
+ Search.prototype.bind = function (decorated, container, $container) {
1952
+ var self = this;
1953
+
1954
+ decorated.call(this, container, $container);
1955
+
1956
+ container.on('open', function () {
1957
+ self.$search.trigger('focus');
1958
+ });
1959
+
1960
+ container.on('close', function () {
1961
+ self.$search.val('');
1962
+ self.$search.removeAttr('aria-activedescendant');
1963
+ self.$search.trigger('focus');
1964
+ });
1965
+
1966
+ container.on('enable', function () {
1967
+ self.$search.prop('disabled', false);
1968
+
1969
+ self._transferTabIndex();
1970
+ });
1971
+
1972
+ container.on('disable', function () {
1973
+ self.$search.prop('disabled', true);
1974
+ });
1975
+
1976
+ container.on('focus', function (evt) {
1977
+ self.$search.trigger('focus');
1978
+ });
1979
+
1980
+ container.on('results:focus', function (params) {
1981
+ self.$search.attr('aria-activedescendant', params.id);
1982
+ });
1983
+
1984
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
1985
+ self.trigger('focus', evt);
1986
+ });
1987
+
1988
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
1989
+ self._handleBlur(evt);
1990
+ });
1991
+
1992
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
1993
+ evt.stopPropagation();
1994
+
1995
+ self.trigger('keypress', evt);
1996
+
1997
+ self._keyUpPrevented = evt.isDefaultPrevented();
1998
+
1999
+ var key = evt.which;
2000
+
2001
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
2002
+ var $previousChoice = self.$searchContainer
2003
+ .prev('.select2-selection__choice');
2004
+
2005
+ if ($previousChoice.length > 0) {
2006
+ var item = Utils.GetData($previousChoice[0], 'data');
2007
+
2008
+ self.searchRemoveChoice(item);
2009
+
2010
+ evt.preventDefault();
2011
+ }
2012
+ }
2013
+ });
2014
+
2015
+ // Try to detect the IE version should the `documentMode` property that
2016
+ // is stored on the document. This is only implemented in IE and is
2017
+ // slightly cleaner than doing a user agent check.
2018
+ // This property is not available in Edge, but Edge also doesn't have
2019
+ // this bug.
2020
+ var msie = document.documentMode;
2021
+ var disableInputEvents = msie && msie <= 11;
2022
+
2023
+ // Workaround for browsers which do not support the `input` event
2024
+ // This will prevent double-triggering of events for browsers which support
2025
+ // both the `keyup` and `input` events.
2026
+ this.$selection.on(
2027
+ 'input.searchcheck',
2028
+ '.select2-search--inline',
2029
+ function (evt) {
2030
+ // IE will trigger the `input` event when a placeholder is used on a
2031
+ // search box. To get around this issue, we are forced to ignore all
2032
+ // `input` events in IE and keep using `keyup`.
2033
+ if (disableInputEvents) {
2034
+ self.$selection.off('input.search input.searchcheck');
2035
+ return;
2036
+ }
2037
+
2038
+ // Unbind the duplicated `keyup` event
2039
+ self.$selection.off('keyup.search');
2040
+ }
2041
+ );
2042
+
2043
+ this.$selection.on(
2044
+ 'keyup.search input.search',
2045
+ '.select2-search--inline',
2046
+ function (evt) {
2047
+ // IE will trigger the `input` event when a placeholder is used on a
2048
+ // search box. To get around this issue, we are forced to ignore all
2049
+ // `input` events in IE and keep using `keyup`.
2050
+ if (disableInputEvents && evt.type === 'input') {
2051
+ self.$selection.off('input.search input.searchcheck');
2052
+ return;
2053
+ }
2054
+
2055
+ var key = evt.which;
2056
+
2057
+ // We can freely ignore events from modifier keys
2058
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
2059
+ return;
2060
+ }
2061
+
2062
+ // Tabbing will be handled during the `keydown` phase
2063
+ if (key == KEYS.TAB) {
2064
+ return;
2065
+ }
2066
+
2067
+ self.handleSearch(evt);
2068
+ }
2069
+ );
2070
+ };
2071
+
2072
+ /**
2073
+ * This method will transfer the tabindex attribute from the rendered
2074
+ * selection to the search box. This allows for the search box to be used as
2075
+ * the primary focus instead of the selection container.
2076
+ *
2077
+ * @private
2078
+ */
2079
+ Search.prototype._transferTabIndex = function (decorated) {
2080
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
2081
+ this.$selection.attr('tabindex', '-1');
2082
+ };
2083
+
2084
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
2085
+ this.$search.attr('placeholder', placeholder.text);
2086
+ };
2087
+
2088
+ Search.prototype.update = function (decorated, data) {
2089
+ var searchHadFocus = this.$search[0] == document.activeElement;
2090
+
2091
+ this.$search.attr('placeholder', '');
2092
+
2093
+ decorated.call(this, data);
2094
+
2095
+ this.$selection.find('.select2-selection__rendered')
2096
+ .append(this.$searchContainer);
2097
+
2098
+ this.resizeSearch();
2099
+ if (searchHadFocus) {
2100
+ this.$search.focus();
2101
+ }
2102
+ };
2103
+
2104
+ Search.prototype.handleSearch = function () {
2105
+ this.resizeSearch();
2106
+
2107
+ if (!this._keyUpPrevented) {
2108
+ var input = this.$search.val();
2109
+
2110
+ this.trigger('query', {
2111
+ term: input
2112
+ });
2113
+ }
2114
+
2115
+ this._keyUpPrevented = false;
2116
+ };
2117
+
2118
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
2119
+ this.trigger('unselect', {
2120
+ data: item
2121
+ });
2122
+
2123
+ this.$search.val(item.text);
2124
+ this.handleSearch();
2125
+ };
2126
+
2127
+ Search.prototype.resizeSearch = function () {
2128
+ this.$search.css('width', '25px');
2129
+
2130
+ var width = '';
2131
+
2132
+ if (this.$search.attr('placeholder') !== '') {
2133
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
2134
+ } else {
2135
+ var minimumWidth = this.$search.val().length + 1;
2136
+
2137
+ width = (minimumWidth * 0.75) + 'em';
2138
+ }
2139
+
2140
+ this.$search.css('width', width);
2141
+ };
2142
+
2143
+ return Search;
2144
+ });
2145
+
2146
+ S2.define('select2/selection/eventRelay',[
2147
+ 'jquery'
2148
+ ], function ($) {
2149
+ function EventRelay () { }
2150
+
2151
+ EventRelay.prototype.bind = function (decorated, container, $container) {
2152
+ var self = this;
2153
+ var relayEvents = [
2154
+ 'open', 'opening',
2155
+ 'close', 'closing',
2156
+ 'select', 'selecting',
2157
+ 'unselect', 'unselecting',
2158
+ 'clear', 'clearing'
2159
+ ];
2160
+
2161
+ var preventableEvents = [
2162
+ 'opening', 'closing', 'selecting', 'unselecting', 'clearing'
2163
+ ];
2164
+
2165
+ decorated.call(this, container, $container);
2166
+
2167
+ container.on('*', function (name, params) {
2168
+ // Ignore events that should not be relayed
2169
+ if ($.inArray(name, relayEvents) === -1) {
2170
+ return;
2171
+ }
2172
+
2173
+ // The parameters should always be an object
2174
+ params = params || {};
2175
+
2176
+ // Generate the jQuery event for the Select2 event
2177
+ var evt = $.Event('select2:' + name, {
2178
+ params: params
2179
+ });
2180
+
2181
+ self.$element.trigger(evt);
2182
+
2183
+ // Only handle preventable events if it was one
2184
+ if ($.inArray(name, preventableEvents) === -1) {
2185
+ return;
2186
+ }
2187
+
2188
+ params.prevented = evt.isDefaultPrevented();
2189
+ });
2190
+ };
2191
+
2192
+ return EventRelay;
2193
+ });
2194
+
2195
+ S2.define('select2/translation',[
2196
+ 'jquery',
2197
+ 'require'
2198
+ ], function ($, require) {
2199
+ function Translation (dict) {
2200
+ this.dict = dict || {};
2201
+ }
2202
+
2203
+ Translation.prototype.all = function () {
2204
+ return this.dict;
2205
+ };
2206
+
2207
+ Translation.prototype.get = function (key) {
2208
+ return this.dict[key];
2209
+ };
2210
+
2211
+ Translation.prototype.extend = function (translation) {
2212
+ this.dict = $.extend({}, translation.all(), this.dict);
2213
+ };
2214
+
2215
+ // Static functions
2216
+
2217
+ Translation._cache = {};
2218
+
2219
+ Translation.loadPath = function (path) {
2220
+ if (!(path in Translation._cache)) {
2221
+ var translations = require(path);
2222
+
2223
+ Translation._cache[path] = translations;
2224
+ }
2225
+
2226
+ return new Translation(Translation._cache[path]);
2227
+ };
2228
+
2229
+ return Translation;
2230
+ });
2231
+
2232
+ S2.define('select2/diacritics',[
2233
+
2234
+ ], function () {
2235
+ var diacritics = {
2236
+ '\u24B6': 'A',
2237
+ '\uFF21': 'A',
2238
+ '\u00C0': 'A',
2239
+ '\u00C1': 'A',
2240
+ '\u00C2': 'A',
2241
+ '\u1EA6': 'A',
2242
+ '\u1EA4': 'A',
2243
+ '\u1EAA': 'A',
2244
+ '\u1EA8': 'A',
2245
+ '\u00C3': 'A',
2246
+ '\u0100': 'A',
2247
+ '\u0102': 'A',
2248
+ '\u1EB0': 'A',
2249
+ '\u1EAE': 'A',
2250
+ '\u1EB4': 'A',
2251
+ '\u1EB2': 'A',
2252
+ '\u0226': 'A',
2253
+ '\u01E0': 'A',
2254
+ '\u00C4': 'A',
2255
+ '\u01DE': 'A',
2256
+ '\u1EA2': 'A',
2257
+ '\u00C5': 'A',
2258
+ '\u01FA': 'A',
2259
+ '\u01CD': 'A',
2260
+ '\u0200': 'A',
2261
+ '\u0202': 'A',
2262
+ '\u1EA0': 'A',
2263
+ '\u1EAC': 'A',
2264
+ '\u1EB6': 'A',
2265
+ '\u1E00': 'A',
2266
+ '\u0104': 'A',
2267
+ '\u023A': 'A',
2268
+ '\u2C6F': 'A',
2269
+ '\uA732': 'AA',
2270
+ '\u00C6': 'AE',
2271
+ '\u01FC': 'AE',
2272
+ '\u01E2': 'AE',
2273
+ '\uA734': 'AO',
2274
+ '\uA736': 'AU',
2275
+ '\uA738': 'AV',
2276
+ '\uA73A': 'AV',
2277
+ '\uA73C': 'AY',
2278
+ '\u24B7': 'B',
2279
+ '\uFF22': 'B',
2280
+ '\u1E02': 'B',
2281
+ '\u1E04': 'B',
2282
+ '\u1E06': 'B',
2283
+ '\u0243': 'B',
2284
+ '\u0182': 'B',
2285
+ '\u0181': 'B',
2286
+ '\u24B8': 'C',
2287
+ '\uFF23': 'C',
2288
+ '\u0106': 'C',
2289
+ '\u0108': 'C',
2290
+ '\u010A': 'C',
2291
+ '\u010C': 'C',
2292
+ '\u00C7': 'C',
2293
+ '\u1E08': 'C',
2294
+ '\u0187': 'C',
2295
+ '\u023B': 'C',
2296
+ '\uA73E': 'C',
2297
+ '\u24B9': 'D',
2298
+ '\uFF24': 'D',
2299
+ '\u1E0A': 'D',
2300
+ '\u010E': 'D',
2301
+ '\u1E0C': 'D',
2302
+ '\u1E10': 'D',
2303
+ '\u1E12': 'D',
2304
+ '\u1E0E': 'D',
2305
+ '\u0110': 'D',
2306
+ '\u018B': 'D',
2307
+ '\u018A': 'D',
2308
+ '\u0189': 'D',
2309
+ '\uA779': 'D',
2310
+ '\u01F1': 'DZ',
2311
+ '\u01C4': 'DZ',
2312
+ '\u01F2': 'Dz',
2313
+ '\u01C5': 'Dz',
2314
+ '\u24BA': 'E',
2315
+ '\uFF25': 'E',
2316
+ '\u00C8': 'E',
2317
+ '\u00C9': 'E',
2318
+ '\u00CA': 'E',
2319
+ '\u1EC0': 'E',
2320
+ '\u1EBE': 'E',
2321
+ '\u1EC4': 'E',
2322
+ '\u1EC2': 'E',
2323
+ '\u1EBC': 'E',
2324
+ '\u0112': 'E',
2325
+ '\u1E14': 'E',
2326
+ '\u1E16': 'E',
2327
+ '\u0114': 'E',
2328
+ '\u0116': 'E',
2329
+ '\u00CB': 'E',
2330
+ '\u1EBA': 'E',
2331
+ '\u011A': 'E',
2332
+ '\u0204': 'E',
2333
+ '\u0206': 'E',
2334
+ '\u1EB8': 'E',
2335
+ '\u1EC6': 'E',
2336
+ '\u0228': 'E',
2337
+ '\u1E1C': 'E',
2338
+ '\u0118': 'E',
2339
+ '\u1E18': 'E',
2340
+ '\u1E1A': 'E',
2341
+ '\u0190': 'E',
2342
+ '\u018E': 'E',
2343
+ '\u24BB': 'F',
2344
+ '\uFF26': 'F',
2345
+ '\u1E1E': 'F',
2346
+ '\u0191': 'F',
2347
+ '\uA77B': 'F',
2348
+ '\u24BC': 'G',
2349
+ '\uFF27': 'G',
2350
+ '\u01F4': 'G',
2351
+ '\u011C': 'G',
2352
+ '\u1E20': 'G',
2353
+ '\u011E': 'G',
2354
+ '\u0120': 'G',
2355
+ '\u01E6': 'G',
2356
+ '\u0122': 'G',
2357
+ '\u01E4': 'G',
2358
+ '\u0193': 'G',
2359
+ '\uA7A0': 'G',
2360
+ '\uA77D': 'G',
2361
+ '\uA77E': 'G',
2362
+ '\u24BD': 'H',
2363
+ '\uFF28': 'H',
2364
+ '\u0124': 'H',
2365
+ '\u1E22': 'H',
2366
+ '\u1E26': 'H',
2367
+ '\u021E': 'H',
2368
+ '\u1E24': 'H',
2369
+ '\u1E28': 'H',
2370
+ '\u1E2A': 'H',
2371
+ '\u0126': 'H',
2372
+ '\u2C67': 'H',
2373
+ '\u2C75': 'H',
2374
+ '\uA78D': 'H',
2375
+ '\u24BE': 'I',
2376
+ '\uFF29': 'I',
2377
+ '\u00CC': 'I',
2378
+ '\u00CD': 'I',
2379
+ '\u00CE': 'I',
2380
+ '\u0128': 'I',
2381
+ '\u012A': 'I',
2382
+ '\u012C': 'I',
2383
+ '\u0130': 'I',
2384
+ '\u00CF': 'I',
2385
+ '\u1E2E': 'I',
2386
+ '\u1EC8': 'I',
2387
+ '\u01CF': 'I',
2388
+ '\u0208': 'I',
2389
+ '\u020A': 'I',
2390
+ '\u1ECA': 'I',
2391
+ '\u012E': 'I',
2392
+ '\u1E2C': 'I',
2393
+ '\u0197': 'I',
2394
+ '\u24BF': 'J',
2395
+ '\uFF2A': 'J',
2396
+ '\u0134': 'J',
2397
+ '\u0248': 'J',
2398
+ '\u24C0': 'K',
2399
+ '\uFF2B': 'K',
2400
+ '\u1E30': 'K',
2401
+ '\u01E8': 'K',
2402
+ '\u1E32': 'K',
2403
+ '\u0136': 'K',
2404
+ '\u1E34': 'K',
2405
+ '\u0198': 'K',
2406
+ '\u2C69': 'K',
2407
+ '\uA740': 'K',
2408
+ '\uA742': 'K',
2409
+ '\uA744': 'K',
2410
+ '\uA7A2': 'K',
2411
+ '\u24C1': 'L',
2412
+ '\uFF2C': 'L',
2413
+ '\u013F': 'L',
2414
+ '\u0139': 'L',
2415
+ '\u013D': 'L',
2416
+ '\u1E36': 'L',
2417
+ '\u1E38': 'L',
2418
+ '\u013B': 'L',
2419
+ '\u1E3C': 'L',
2420
+ '\u1E3A': 'L',
2421
+ '\u0141': 'L',
2422
+ '\u023D': 'L',
2423
+ '\u2C62': 'L',
2424
+ '\u2C60': 'L',
2425
+ '\uA748': 'L',
2426
+ '\uA746': 'L',
2427
+ '\uA780': 'L',
2428
+ '\u01C7': 'LJ',
2429
+ '\u01C8': 'Lj',
2430
+ '\u24C2': 'M',
2431
+ '\uFF2D': 'M',
2432
+ '\u1E3E': 'M',
2433
+ '\u1E40': 'M',
2434
+ '\u1E42': 'M',
2435
+ '\u2C6E': 'M',
2436
+ '\u019C': 'M',
2437
+ '\u24C3': 'N',
2438
+ '\uFF2E': 'N',
2439
+ '\u01F8': 'N',
2440
+ '\u0143': 'N',
2441
+ '\u00D1': 'N',
2442
+ '\u1E44': 'N',
2443
+ '\u0147': 'N',
2444
+ '\u1E46': 'N',
2445
+ '\u0145': 'N',
2446
+ '\u1E4A': 'N',
2447
+ '\u1E48': 'N',
2448
+ '\u0220': 'N',
2449
+ '\u019D': 'N',
2450
+ '\uA790': 'N',
2451
+ '\uA7A4': 'N',
2452
+ '\u01CA': 'NJ',
2453
+ '\u01CB': 'Nj',
2454
+ '\u24C4': 'O',
2455
+ '\uFF2F': 'O',
2456
+ '\u00D2': 'O',
2457
+ '\u00D3': 'O',
2458
+ '\u00D4': 'O',
2459
+ '\u1ED2': 'O',
2460
+ '\u1ED0': 'O',
2461
+ '\u1ED6': 'O',
2462
+ '\u1ED4': 'O',
2463
+ '\u00D5': 'O',
2464
+ '\u1E4C': 'O',
2465
+ '\u022C': 'O',
2466
+ '\u1E4E': 'O',
2467
+ '\u014C': 'O',
2468
+ '\u1E50': 'O',
2469
+ '\u1E52': 'O',
2470
+ '\u014E': 'O',
2471
+ '\u022E': 'O',
2472
+ '\u0230': 'O',
2473
+ '\u00D6': 'O',
2474
+ '\u022A': 'O',
2475
+ '\u1ECE': 'O',
2476
+ '\u0150': 'O',
2477
+ '\u01D1': 'O',
2478
+ '\u020C': 'O',
2479
+ '\u020E': 'O',
2480
+ '\u01A0': 'O',
2481
+ '\u1EDC': 'O',
2482
+ '\u1EDA': 'O',
2483
+ '\u1EE0': 'O',
2484
+ '\u1EDE': 'O',
2485
+ '\u1EE2': 'O',
2486
+ '\u1ECC': 'O',
2487
+ '\u1ED8': 'O',
2488
+ '\u01EA': 'O',
2489
+ '\u01EC': 'O',
2490
+ '\u00D8': 'O',
2491
+ '\u01FE': 'O',
2492
+ '\u0186': 'O',
2493
+ '\u019F': 'O',
2494
+ '\uA74A': 'O',
2495
+ '\uA74C': 'O',
2496
+ '\u01A2': 'OI',
2497
+ '\uA74E': 'OO',
2498
+ '\u0222': 'OU',
2499
+ '\u24C5': 'P',
2500
+ '\uFF30': 'P',
2501
+ '\u1E54': 'P',
2502
+ '\u1E56': 'P',
2503
+ '\u01A4': 'P',
2504
+ '\u2C63': 'P',
2505
+ '\uA750': 'P',
2506
+ '\uA752': 'P',
2507
+ '\uA754': 'P',
2508
+ '\u24C6': 'Q',
2509
+ '\uFF31': 'Q',
2510
+ '\uA756': 'Q',
2511
+ '\uA758': 'Q',
2512
+ '\u024A': 'Q',
2513
+ '\u24C7': 'R',
2514
+ '\uFF32': 'R',
2515
+ '\u0154': 'R',
2516
+ '\u1E58': 'R',
2517
+ '\u0158': 'R',
2518
+ '\u0210': 'R',
2519
+ '\u0212': 'R',
2520
+ '\u1E5A': 'R',
2521
+ '\u1E5C': 'R',
2522
+ '\u0156': 'R',
2523
+ '\u1E5E': 'R',
2524
+ '\u024C': 'R',
2525
+ '\u2C64': 'R',
2526
+ '\uA75A': 'R',
2527
+ '\uA7A6': 'R',
2528
+ '\uA782': 'R',
2529
+ '\u24C8': 'S',
2530
+ '\uFF33': 'S',
2531
+ '\u1E9E': 'S',
2532
+ '\u015A': 'S',
2533
+ '\u1E64': 'S',
2534
+ '\u015C': 'S',
2535
+ '\u1E60': 'S',
2536
+ '\u0160': 'S',
2537
+ '\u1E66': 'S',
2538
+ '\u1E62': 'S',
2539
+ '\u1E68': 'S',
2540
+ '\u0218': 'S',
2541
+ '\u015E': 'S',
2542
+ '\u2C7E': 'S',
2543
+ '\uA7A8': 'S',
2544
+ '\uA784': 'S',
2545
+ '\u24C9': 'T',
2546
+ '\uFF34': 'T',
2547
+ '\u1E6A': 'T',
2548
+ '\u0164': 'T',
2549
+ '\u1E6C': 'T',
2550
+ '\u021A': 'T',
2551
+ '\u0162': 'T',
2552
+ '\u1E70': 'T',
2553
+ '\u1E6E': 'T',
2554
+ '\u0166': 'T',
2555
+ '\u01AC': 'T',
2556
+ '\u01AE': 'T',
2557
+ '\u023E': 'T',
2558
+ '\uA786': 'T',
2559
+ '\uA728': 'TZ',
2560
+ '\u24CA': 'U',
2561
+ '\uFF35': 'U',
2562
+ '\u00D9': 'U',
2563
+ '\u00DA': 'U',
2564
+ '\u00DB': 'U',
2565
+ '\u0168': 'U',
2566
+ '\u1E78': 'U',
2567
+ '\u016A': 'U',
2568
+ '\u1E7A': 'U',
2569
+ '\u016C': 'U',
2570
+ '\u00DC': 'U',
2571
+ '\u01DB': 'U',
2572
+ '\u01D7': 'U',
2573
+ '\u01D5': 'U',
2574
+ '\u01D9': 'U',
2575
+ '\u1EE6': 'U',
2576
+ '\u016E': 'U',
2577
+ '\u0170': 'U',
2578
+ '\u01D3': 'U',
2579
+ '\u0214': 'U',
2580
+ '\u0216': 'U',
2581
+ '\u01AF': 'U',
2582
+ '\u1EEA': 'U',
2583
+ '\u1EE8': 'U',
2584
+ '\u1EEE': 'U',
2585
+ '\u1EEC': 'U',
2586
+ '\u1EF0': 'U',
2587
+ '\u1EE4': 'U',
2588
+ '\u1E72': 'U',
2589
+ '\u0172': 'U',
2590
+ '\u1E76': 'U',
2591
+ '\u1E74': 'U',
2592
+ '\u0244': 'U',
2593
+ '\u24CB': 'V',
2594
+ '\uFF36': 'V',
2595
+ '\u1E7C': 'V',
2596
+ '\u1E7E': 'V',
2597
+ '\u01B2': 'V',
2598
+ '\uA75E': 'V',
2599
+ '\u0245': 'V',
2600
+ '\uA760': 'VY',
2601
+ '\u24CC': 'W',
2602
+ '\uFF37': 'W',
2603
+ '\u1E80': 'W',
2604
+ '\u1E82': 'W',
2605
+ '\u0174': 'W',
2606
+ '\u1E86': 'W',
2607
+ '\u1E84': 'W',
2608
+ '\u1E88': 'W',
2609
+ '\u2C72': 'W',
2610
+ '\u24CD': 'X',
2611
+ '\uFF38': 'X',
2612
+ '\u1E8A': 'X',
2613
+ '\u1E8C': 'X',
2614
+ '\u24CE': 'Y',
2615
+ '\uFF39': 'Y',
2616
+ '\u1EF2': 'Y',
2617
+ '\u00DD': 'Y',
2618
+ '\u0176': 'Y',
2619
+ '\u1EF8': 'Y',
2620
+ '\u0232': 'Y',
2621
+ '\u1E8E': 'Y',
2622
+ '\u0178': 'Y',
2623
+ '\u1EF6': 'Y',
2624
+ '\u1EF4': 'Y',
2625
+ '\u01B3': 'Y',
2626
+ '\u024E': 'Y',
2627
+ '\u1EFE': 'Y',
2628
+ '\u24CF': 'Z',
2629
+ '\uFF3A': 'Z',
2630
+ '\u0179': 'Z',
2631
+ '\u1E90': 'Z',
2632
+ '\u017B': 'Z',
2633
+ '\u017D': 'Z',
2634
+ '\u1E92': 'Z',
2635
+ '\u1E94': 'Z',
2636
+ '\u01B5': 'Z',
2637
+ '\u0224': 'Z',
2638
+ '\u2C7F': 'Z',
2639
+ '\u2C6B': 'Z',
2640
+ '\uA762': 'Z',
2641
+ '\u24D0': 'a',
2642
+ '\uFF41': 'a',
2643
+ '\u1E9A': 'a',
2644
+ '\u00E0': 'a',
2645
+ '\u00E1': 'a',
2646
+ '\u00E2': 'a',
2647
+ '\u1EA7': 'a',
2648
+ '\u1EA5': 'a',
2649
+ '\u1EAB': 'a',
2650
+ '\u1EA9': 'a',
2651
+ '\u00E3': 'a',
2652
+ '\u0101': 'a',
2653
+ '\u0103': 'a',
2654
+ '\u1EB1': 'a',
2655
+ '\u1EAF': 'a',
2656
+ '\u1EB5': 'a',
2657
+ '\u1EB3': 'a',
2658
+ '\u0227': 'a',
2659
+ '\u01E1': 'a',
2660
+ '\u00E4': 'a',
2661
+ '\u01DF': 'a',
2662
+ '\u1EA3': 'a',
2663
+ '\u00E5': 'a',
2664
+ '\u01FB': 'a',
2665
+ '\u01CE': 'a',
2666
+ '\u0201': 'a',
2667
+ '\u0203': 'a',
2668
+ '\u1EA1': 'a',
2669
+ '\u1EAD': 'a',
2670
+ '\u1EB7': 'a',
2671
+ '\u1E01': 'a',
2672
+ '\u0105': 'a',
2673
+ '\u2C65': 'a',
2674
+ '\u0250': 'a',
2675
+ '\uA733': 'aa',
2676
+ '\u00E6': 'ae',
2677
+ '\u01FD': 'ae',
2678
+ '\u01E3': 'ae',
2679
+ '\uA735': 'ao',
2680
+ '\uA737': 'au',
2681
+ '\uA739': 'av',
2682
+ '\uA73B': 'av',
2683
+ '\uA73D': 'ay',
2684
+ '\u24D1': 'b',
2685
+ '\uFF42': 'b',
2686
+ '\u1E03': 'b',
2687
+ '\u1E05': 'b',
2688
+ '\u1E07': 'b',
2689
+ '\u0180': 'b',
2690
+ '\u0183': 'b',
2691
+ '\u0253': 'b',
2692
+ '\u24D2': 'c',
2693
+ '\uFF43': 'c',
2694
+ '\u0107': 'c',
2695
+ '\u0109': 'c',
2696
+ '\u010B': 'c',
2697
+ '\u010D': 'c',
2698
+ '\u00E7': 'c',
2699
+ '\u1E09': 'c',
2700
+ '\u0188': 'c',
2701
+ '\u023C': 'c',
2702
+ '\uA73F': 'c',
2703
+ '\u2184': 'c',
2704
+ '\u24D3': 'd',
2705
+ '\uFF44': 'd',
2706
+ '\u1E0B': 'd',
2707
+ '\u010F': 'd',
2708
+ '\u1E0D': 'd',
2709
+ '\u1E11': 'd',
2710
+ '\u1E13': 'd',
2711
+ '\u1E0F': 'd',
2712
+ '\u0111': 'd',
2713
+ '\u018C': 'd',
2714
+ '\u0256': 'd',
2715
+ '\u0257': 'd',
2716
+ '\uA77A': 'd',
2717
+ '\u01F3': 'dz',
2718
+ '\u01C6': 'dz',
2719
+ '\u24D4': 'e',
2720
+ '\uFF45': 'e',
2721
+ '\u00E8': 'e',
2722
+ '\u00E9': 'e',
2723
+ '\u00EA': 'e',
2724
+ '\u1EC1': 'e',
2725
+ '\u1EBF': 'e',
2726
+ '\u1EC5': 'e',
2727
+ '\u1EC3': 'e',
2728
+ '\u1EBD': 'e',
2729
+ '\u0113': 'e',
2730
+ '\u1E15': 'e',
2731
+ '\u1E17': 'e',
2732
+ '\u0115': 'e',
2733
+ '\u0117': 'e',
2734
+ '\u00EB': 'e',
2735
+ '\u1EBB': 'e',
2736
+ '\u011B': 'e',
2737
+ '\u0205': 'e',
2738
+ '\u0207': 'e',
2739
+ '\u1EB9': 'e',
2740
+ '\u1EC7': 'e',
2741
+ '\u0229': 'e',
2742
+ '\u1E1D': 'e',
2743
+ '\u0119': 'e',
2744
+ '\u1E19': 'e',
2745
+ '\u1E1B': 'e',
2746
+ '\u0247': 'e',
2747
+ '\u025B': 'e',
2748
+ '\u01DD': 'e',
2749
+ '\u24D5': 'f',
2750
+ '\uFF46': 'f',
2751
+ '\u1E1F': 'f',
2752
+ '\u0192': 'f',
2753
+ '\uA77C': 'f',
2754
+ '\u24D6': 'g',
2755
+ '\uFF47': 'g',
2756
+ '\u01F5': 'g',
2757
+ '\u011D': 'g',
2758
+ '\u1E21': 'g',
2759
+ '\u011F': 'g',
2760
+ '\u0121': 'g',
2761
+ '\u01E7': 'g',
2762
+ '\u0123': 'g',
2763
+ '\u01E5': 'g',
2764
+ '\u0260': 'g',
2765
+ '\uA7A1': 'g',
2766
+ '\u1D79': 'g',
2767
+ '\uA77F': 'g',
2768
+ '\u24D7': 'h',
2769
+ '\uFF48': 'h',
2770
+ '\u0125': 'h',
2771
+ '\u1E23': 'h',
2772
+ '\u1E27': 'h',
2773
+ '\u021F': 'h',
2774
+ '\u1E25': 'h',
2775
+ '\u1E29': 'h',
2776
+ '\u1E2B': 'h',
2777
+ '\u1E96': 'h',
2778
+ '\u0127': 'h',
2779
+ '\u2C68': 'h',
2780
+ '\u2C76': 'h',
2781
+ '\u0265': 'h',
2782
+ '\u0195': 'hv',
2783
+ '\u24D8': 'i',
2784
+ '\uFF49': 'i',
2785
+ '\u00EC': 'i',
2786
+ '\u00ED': 'i',
2787
+ '\u00EE': 'i',
2788
+ '\u0129': 'i',
2789
+ '\u012B': 'i',
2790
+ '\u012D': 'i',
2791
+ '\u00EF': 'i',
2792
+ '\u1E2F': 'i',
2793
+ '\u1EC9': 'i',
2794
+ '\u01D0': 'i',
2795
+ '\u0209': 'i',
2796
+ '\u020B': 'i',
2797
+ '\u1ECB': 'i',
2798
+ '\u012F': 'i',
2799
+ '\u1E2D': 'i',
2800
+ '\u0268': 'i',
2801
+ '\u0131': 'i',
2802
+ '\u24D9': 'j',
2803
+ '\uFF4A': 'j',
2804
+ '\u0135': 'j',
2805
+ '\u01F0': 'j',
2806
+ '\u0249': 'j',
2807
+ '\u24DA': 'k',
2808
+ '\uFF4B': 'k',
2809
+ '\u1E31': 'k',
2810
+ '\u01E9': 'k',
2811
+ '\u1E33': 'k',
2812
+ '\u0137': 'k',
2813
+ '\u1E35': 'k',
2814
+ '\u0199': 'k',
2815
+ '\u2C6A': 'k',
2816
+ '\uA741': 'k',
2817
+ '\uA743': 'k',
2818
+ '\uA745': 'k',
2819
+ '\uA7A3': 'k',
2820
+ '\u24DB': 'l',
2821
+ '\uFF4C': 'l',
2822
+ '\u0140': 'l',
2823
+ '\u013A': 'l',
2824
+ '\u013E': 'l',
2825
+ '\u1E37': 'l',
2826
+ '\u1E39': 'l',
2827
+ '\u013C': 'l',
2828
+ '\u1E3D': 'l',
2829
+ '\u1E3B': 'l',
2830
+ '\u017F': 'l',
2831
+ '\u0142': 'l',
2832
+ '\u019A': 'l',
2833
+ '\u026B': 'l',
2834
+ '\u2C61': 'l',
2835
+ '\uA749': 'l',
2836
+ '\uA781': 'l',
2837
+ '\uA747': 'l',
2838
+ '\u01C9': 'lj',
2839
+ '\u24DC': 'm',
2840
+ '\uFF4D': 'm',
2841
+ '\u1E3F': 'm',
2842
+ '\u1E41': 'm',
2843
+ '\u1E43': 'm',
2844
+ '\u0271': 'm',
2845
+ '\u026F': 'm',
2846
+ '\u24DD': 'n',
2847
+ '\uFF4E': 'n',
2848
+ '\u01F9': 'n',
2849
+ '\u0144': 'n',
2850
+ '\u00F1': 'n',
2851
+ '\u1E45': 'n',
2852
+ '\u0148': 'n',
2853
+ '\u1E47': 'n',
2854
+ '\u0146': 'n',
2855
+ '\u1E4B': 'n',
2856
+ '\u1E49': 'n',
2857
+ '\u019E': 'n',
2858
+ '\u0272': 'n',
2859
+ '\u0149': 'n',
2860
+ '\uA791': 'n',
2861
+ '\uA7A5': 'n',
2862
+ '\u01CC': 'nj',
2863
+ '\u24DE': 'o',
2864
+ '\uFF4F': 'o',
2865
+ '\u00F2': 'o',
2866
+ '\u00F3': 'o',
2867
+ '\u00F4': 'o',
2868
+ '\u1ED3': 'o',
2869
+ '\u1ED1': 'o',
2870
+ '\u1ED7': 'o',
2871
+ '\u1ED5': 'o',
2872
+ '\u00F5': 'o',
2873
+ '\u1E4D': 'o',
2874
+ '\u022D': 'o',
2875
+ '\u1E4F': 'o',
2876
+ '\u014D': 'o',
2877
+ '\u1E51': 'o',
2878
+ '\u1E53': 'o',
2879
+ '\u014F': 'o',
2880
+ '\u022F': 'o',
2881
+ '\u0231': 'o',
2882
+ '\u00F6': 'o',
2883
+ '\u022B': 'o',
2884
+ '\u1ECF': 'o',
2885
+ '\u0151': 'o',
2886
+ '\u01D2': 'o',
2887
+ '\u020D': 'o',
2888
+ '\u020F': 'o',
2889
+ '\u01A1': 'o',
2890
+ '\u1EDD': 'o',
2891
+ '\u1EDB': 'o',
2892
+ '\u1EE1': 'o',
2893
+ '\u1EDF': 'o',
2894
+ '\u1EE3': 'o',
2895
+ '\u1ECD': 'o',
2896
+ '\u1ED9': 'o',
2897
+ '\u01EB': 'o',
2898
+ '\u01ED': 'o',
2899
+ '\u00F8': 'o',
2900
+ '\u01FF': 'o',
2901
+ '\u0254': 'o',
2902
+ '\uA74B': 'o',
2903
+ '\uA74D': 'o',
2904
+ '\u0275': 'o',
2905
+ '\u01A3': 'oi',
2906
+ '\u0223': 'ou',
2907
+ '\uA74F': 'oo',
2908
+ '\u24DF': 'p',
2909
+ '\uFF50': 'p',
2910
+ '\u1E55': 'p',
2911
+ '\u1E57': 'p',
2912
+ '\u01A5': 'p',
2913
+ '\u1D7D': 'p',
2914
+ '\uA751': 'p',
2915
+ '\uA753': 'p',
2916
+ '\uA755': 'p',
2917
+ '\u24E0': 'q',
2918
+ '\uFF51': 'q',
2919
+ '\u024B': 'q',
2920
+ '\uA757': 'q',
2921
+ '\uA759': 'q',
2922
+ '\u24E1': 'r',
2923
+ '\uFF52': 'r',
2924
+ '\u0155': 'r',
2925
+ '\u1E59': 'r',
2926
+ '\u0159': 'r',
2927
+ '\u0211': 'r',
2928
+ '\u0213': 'r',
2929
+ '\u1E5B': 'r',
2930
+ '\u1E5D': 'r',
2931
+ '\u0157': 'r',
2932
+ '\u1E5F': 'r',
2933
+ '\u024D': 'r',
2934
+ '\u027D': 'r',
2935
+ '\uA75B': 'r',
2936
+ '\uA7A7': 'r',
2937
+ '\uA783': 'r',
2938
+ '\u24E2': 's',
2939
+ '\uFF53': 's',
2940
+ '\u00DF': 's',
2941
+ '\u015B': 's',
2942
+ '\u1E65': 's',
2943
+ '\u015D': 's',
2944
+ '\u1E61': 's',
2945
+ '\u0161': 's',
2946
+ '\u1E67': 's',
2947
+ '\u1E63': 's',
2948
+ '\u1E69': 's',
2949
+ '\u0219': 's',
2950
+ '\u015F': 's',
2951
+ '\u023F': 's',
2952
+ '\uA7A9': 's',
2953
+ '\uA785': 's',
2954
+ '\u1E9B': 's',
2955
+ '\u24E3': 't',
2956
+ '\uFF54': 't',
2957
+ '\u1E6B': 't',
2958
+ '\u1E97': 't',
2959
+ '\u0165': 't',
2960
+ '\u1E6D': 't',
2961
+ '\u021B': 't',
2962
+ '\u0163': 't',
2963
+ '\u1E71': 't',
2964
+ '\u1E6F': 't',
2965
+ '\u0167': 't',
2966
+ '\u01AD': 't',
2967
+ '\u0288': 't',
2968
+ '\u2C66': 't',
2969
+ '\uA787': 't',
2970
+ '\uA729': 'tz',
2971
+ '\u24E4': 'u',
2972
+ '\uFF55': 'u',
2973
+ '\u00F9': 'u',
2974
+ '\u00FA': 'u',
2975
+ '\u00FB': 'u',
2976
+ '\u0169': 'u',
2977
+ '\u1E79': 'u',
2978
+ '\u016B': 'u',
2979
+ '\u1E7B': 'u',
2980
+ '\u016D': 'u',
2981
+ '\u00FC': 'u',
2982
+ '\u01DC': 'u',
2983
+ '\u01D8': 'u',
2984
+ '\u01D6': 'u',
2985
+ '\u01DA': 'u',
2986
+ '\u1EE7': 'u',
2987
+ '\u016F': 'u',
2988
+ '\u0171': 'u',
2989
+ '\u01D4': 'u',
2990
+ '\u0215': 'u',
2991
+ '\u0217': 'u',
2992
+ '\u01B0': 'u',
2993
+ '\u1EEB': 'u',
2994
+ '\u1EE9': 'u',
2995
+ '\u1EEF': 'u',
2996
+ '\u1EED': 'u',
2997
+ '\u1EF1': 'u',
2998
+ '\u1EE5': 'u',
2999
+ '\u1E73': 'u',
3000
+ '\u0173': 'u',
3001
+ '\u1E77': 'u',
3002
+ '\u1E75': 'u',
3003
+ '\u0289': 'u',
3004
+ '\u24E5': 'v',
3005
+ '\uFF56': 'v',
3006
+ '\u1E7D': 'v',
3007
+ '\u1E7F': 'v',
3008
+ '\u028B': 'v',
3009
+ '\uA75F': 'v',
3010
+ '\u028C': 'v',
3011
+ '\uA761': 'vy',
3012
+ '\u24E6': 'w',
3013
+ '\uFF57': 'w',
3014
+ '\u1E81': 'w',
3015
+ '\u1E83': 'w',
3016
+ '\u0175': 'w',
3017
+ '\u1E87': 'w',
3018
+ '\u1E85': 'w',
3019
+ '\u1E98': 'w',
3020
+ '\u1E89': 'w',
3021
+ '\u2C73': 'w',
3022
+ '\u24E7': 'x',
3023
+ '\uFF58': 'x',
3024
+ '\u1E8B': 'x',
3025
+ '\u1E8D': 'x',
3026
+ '\u24E8': 'y',
3027
+ '\uFF59': 'y',
3028
+ '\u1EF3': 'y',
3029
+ '\u00FD': 'y',
3030
+ '\u0177': 'y',
3031
+ '\u1EF9': 'y',
3032
+ '\u0233': 'y',
3033
+ '\u1E8F': 'y',
3034
+ '\u00FF': 'y',
3035
+ '\u1EF7': 'y',
3036
+ '\u1E99': 'y',
3037
+ '\u1EF5': 'y',
3038
+ '\u01B4': 'y',
3039
+ '\u024F': 'y',
3040
+ '\u1EFF': 'y',
3041
+ '\u24E9': 'z',
3042
+ '\uFF5A': 'z',
3043
+ '\u017A': 'z',
3044
+ '\u1E91': 'z',
3045
+ '\u017C': 'z',
3046
+ '\u017E': 'z',
3047
+ '\u1E93': 'z',
3048
+ '\u1E95': 'z',
3049
+ '\u01B6': 'z',
3050
+ '\u0225': 'z',
3051
+ '\u0240': 'z',
3052
+ '\u2C6C': 'z',
3053
+ '\uA763': 'z',
3054
+ '\u0386': '\u0391',
3055
+ '\u0388': '\u0395',
3056
+ '\u0389': '\u0397',
3057
+ '\u038A': '\u0399',
3058
+ '\u03AA': '\u0399',
3059
+ '\u038C': '\u039F',
3060
+ '\u038E': '\u03A5',
3061
+ '\u03AB': '\u03A5',
3062
+ '\u038F': '\u03A9',
3063
+ '\u03AC': '\u03B1',
3064
+ '\u03AD': '\u03B5',
3065
+ '\u03AE': '\u03B7',
3066
+ '\u03AF': '\u03B9',
3067
+ '\u03CA': '\u03B9',
3068
+ '\u0390': '\u03B9',
3069
+ '\u03CC': '\u03BF',
3070
+ '\u03CD': '\u03C5',
3071
+ '\u03CB': '\u03C5',
3072
+ '\u03B0': '\u03C5',
3073
+ '\u03C9': '\u03C9',
3074
+ '\u03C2': '\u03C3'
3075
+ };
3076
+
3077
+ return diacritics;
3078
+ });
3079
+
3080
+ S2.define('select2/data/base',[
3081
+ '../utils'
3082
+ ], function (Utils) {
3083
+ function BaseAdapter ($element, options) {
3084
+ BaseAdapter.__super__.constructor.call(this);
3085
+ }
3086
+
3087
+ Utils.Extend(BaseAdapter, Utils.Observable);
3088
+
3089
+ BaseAdapter.prototype.current = function (callback) {
3090
+ throw new Error('The `current` method must be defined in child classes.');
3091
+ };
3092
+
3093
+ BaseAdapter.prototype.query = function (params, callback) {
3094
+ throw new Error('The `query` method must be defined in child classes.');
3095
+ };
3096
+
3097
+ BaseAdapter.prototype.bind = function (container, $container) {
3098
+ // Can be implemented in subclasses
3099
+ };
3100
+
3101
+ BaseAdapter.prototype.destroy = function () {
3102
+ // Can be implemented in subclasses
3103
+ };
3104
+
3105
+ BaseAdapter.prototype.generateResultId = function (container, data) {
3106
+ var id = container.id + '-result-';
3107
+
3108
+ id += Utils.generateChars(4);
3109
+
3110
+ if (data.id != null) {
3111
+ id += '-' + data.id.toString();
3112
+ } else {
3113
+ id += '-' + Utils.generateChars(4);
3114
+ }
3115
+ return id;
3116
+ };
3117
+
3118
+ return BaseAdapter;
3119
+ });
3120
+
3121
+ S2.define('select2/data/select',[
3122
+ './base',
3123
+ '../utils',
3124
+ 'jquery'
3125
+ ], function (BaseAdapter, Utils, $) {
3126
+ function SelectAdapter ($element, options) {
3127
+ this.$element = $element;
3128
+ this.options = options;
3129
+
3130
+ SelectAdapter.__super__.constructor.call(this);
3131
+ }
3132
+
3133
+ Utils.Extend(SelectAdapter, BaseAdapter);
3134
+
3135
+ SelectAdapter.prototype.current = function (callback) {
3136
+ var data = [];
3137
+ var self = this;
3138
+
3139
+ this.$element.find(':selected').each(function () {
3140
+ var $option = $(this);
3141
+
3142
+ var option = self.item($option);
3143
+
3144
+ data.push(option);
3145
+ });
3146
+
3147
+ callback(data);
3148
+ };
3149
+
3150
+ SelectAdapter.prototype.select = function (data) {
3151
+ var self = this;
3152
+
3153
+ data.selected = true;
3154
+
3155
+ // If data.element is a DOM node, use it instead
3156
+ if ($(data.element).is('option')) {
3157
+ data.element.selected = true;
3158
+
3159
+ this.$element.trigger('change');
3160
+
3161
+ return;
3162
+ }
3163
+
3164
+ if (this.$element.prop('multiple')) {
3165
+ this.current(function (currentData) {
3166
+ var val = [];
3167
+
3168
+ data = [data];
3169
+ data.push.apply(data, currentData);
3170
+
3171
+ for (var d = 0; d < data.length; d++) {
3172
+ var id = data[d].id;
3173
+
3174
+ if ($.inArray(id, val) === -1) {
3175
+ val.push(id);
3176
+ }
3177
+ }
3178
+
3179
+ self.$element.val(val);
3180
+ self.$element.trigger('change');
3181
+ });
3182
+ } else {
3183
+ var val = data.id;
3184
+
3185
+ this.$element.val(val);
3186
+ this.$element.trigger('change');
3187
+ }
3188
+ };
3189
+
3190
+ SelectAdapter.prototype.unselect = function (data) {
3191
+ var self = this;
3192
+
3193
+ if (!this.$element.prop('multiple')) {
3194
+ return;
3195
+ }
3196
+
3197
+ data.selected = false;
3198
+
3199
+ if ($(data.element).is('option')) {
3200
+ data.element.selected = false;
3201
+
3202
+ this.$element.trigger('change');
3203
+
3204
+ return;
3205
+ }
3206
+
3207
+ this.current(function (currentData) {
3208
+ var val = [];
3209
+
3210
+ for (var d = 0; d < currentData.length; d++) {
3211
+ var id = currentData[d].id;
3212
+
3213
+ if (id !== data.id && $.inArray(id, val) === -1) {
3214
+ val.push(id);
3215
+ }
3216
+ }
3217
+
3218
+ self.$element.val(val);
3219
+
3220
+ self.$element.trigger('change');
3221
+ });
3222
+ };
3223
+
3224
+ SelectAdapter.prototype.bind = function (container, $container) {
3225
+ var self = this;
3226
+
3227
+ this.container = container;
3228
+
3229
+ container.on('select', function (params) {
3230
+ self.select(params.data);
3231
+ });
3232
+
3233
+ container.on('unselect', function (params) {
3234
+ self.unselect(params.data);
3235
+ });
3236
+ };
3237
+
3238
+ SelectAdapter.prototype.destroy = function () {
3239
+ // Remove anything added to child elements
3240
+ this.$element.find('*').each(function () {
3241
+ // Remove any custom data set by Select2
3242
+ Utils.RemoveData(this);
3243
+ });
3244
+ };
3245
+
3246
+ SelectAdapter.prototype.query = function (params, callback) {
3247
+ var data = [];
3248
+ var self = this;
3249
+
3250
+ var $options = this.$element.children();
3251
+
3252
+ $options.each(function () {
3253
+ var $option = $(this);
3254
+
3255
+ if (!$option.is('option') && !$option.is('optgroup')) {
3256
+ return;
3257
+ }
3258
+
3259
+ var option = self.item($option);
3260
+
3261
+ var matches = self.matches(params, option);
3262
+
3263
+ if (matches !== null) {
3264
+ data.push(matches);
3265
+ }
3266
+ });
3267
+
3268
+ callback({
3269
+ results: data
3270
+ });
3271
+ };
3272
+
3273
+ SelectAdapter.prototype.addOptions = function ($options) {
3274
+ Utils.appendMany(this.$element, $options);
3275
+ };
3276
+
3277
+ SelectAdapter.prototype.option = function (data) {
3278
+ var option;
3279
+
3280
+ if (data.children) {
3281
+ option = document.createElement('optgroup');
3282
+ option.label = data.text;
3283
+ } else {
3284
+ option = document.createElement('option');
3285
+
3286
+ if (option.textContent !== undefined) {
3287
+ option.textContent = data.text;
3288
+ } else {
3289
+ option.innerText = data.text;
3290
+ }
3291
+ }
3292
+
3293
+ if (data.id !== undefined) {
3294
+ option.value = data.id;
3295
+ }
3296
+
3297
+ if (data.disabled) {
3298
+ option.disabled = true;
3299
+ }
3300
+
3301
+ if (data.selected) {
3302
+ option.selected = true;
3303
+ }
3304
+
3305
+ if (data.title) {
3306
+ option.title = data.title;
3307
+ }
3308
+
3309
+ var $option = $(option);
3310
+
3311
+ var normalizedData = this._normalizeItem(data);
3312
+ normalizedData.element = option;
3313
+
3314
+ // Override the option's data with the combined data
3315
+ Utils.StoreData(option, 'data', normalizedData);
3316
+
3317
+ return $option;
3318
+ };
3319
+
3320
+ SelectAdapter.prototype.item = function ($option) {
3321
+ var data = {};
3322
+
3323
+ data = Utils.GetData($option[0], 'data');
3324
+
3325
+ if (data != null) {
3326
+ return data;
3327
+ }
3328
+
3329
+ if ($option.is('option')) {
3330
+ data = {
3331
+ id: $option.val(),
3332
+ text: $option.text(),
3333
+ disabled: $option.prop('disabled'),
3334
+ selected: $option.prop('selected'),
3335
+ title: $option.prop('title')
3336
+ };
3337
+ } else if ($option.is('optgroup')) {
3338
+ data = {
3339
+ text: $option.prop('label'),
3340
+ children: [],
3341
+ title: $option.prop('title')
3342
+ };
3343
+
3344
+ var $children = $option.children('option');
3345
+ var children = [];
3346
+
3347
+ for (var c = 0; c < $children.length; c++) {
3348
+ var $child = $($children[c]);
3349
+
3350
+ var child = this.item($child);
3351
+
3352
+ children.push(child);
3353
+ }
3354
+
3355
+ data.children = children;
3356
+ }
3357
+
3358
+ data = this._normalizeItem(data);
3359
+ data.element = $option[0];
3360
+
3361
+ Utils.StoreData($option[0], 'data', data);
3362
+
3363
+ return data;
3364
+ };
3365
+
3366
+ SelectAdapter.prototype._normalizeItem = function (item) {
3367
+ if (item !== Object(item)) {
3368
+ item = {
3369
+ id: item,
3370
+ text: item
3371
+ };
3372
+ }
3373
+
3374
+ item = $.extend({}, {
3375
+ text: ''
3376
+ }, item);
3377
+
3378
+ var defaults = {
3379
+ selected: false,
3380
+ disabled: false
3381
+ };
3382
+
3383
+ if (item.id != null) {
3384
+ item.id = item.id.toString();
3385
+ }
3386
+
3387
+ if (item.text != null) {
3388
+ item.text = item.text.toString();
3389
+ }
3390
+
3391
+ if (item._resultId == null && item.id && this.container != null) {
3392
+ item._resultId = this.generateResultId(this.container, item);
3393
+ }
3394
+
3395
+ return $.extend({}, defaults, item);
3396
+ };
3397
+
3398
+ SelectAdapter.prototype.matches = function (params, data) {
3399
+ var matcher = this.options.get('matcher');
3400
+
3401
+ return matcher(params, data);
3402
+ };
3403
+
3404
+ return SelectAdapter;
3405
+ });
3406
+
3407
+ S2.define('select2/data/array',[
3408
+ './select',
3409
+ '../utils',
3410
+ 'jquery'
3411
+ ], function (SelectAdapter, Utils, $) {
3412
+ function ArrayAdapter ($element, options) {
3413
+ var data = options.get('data') || [];
3414
+
3415
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
3416
+
3417
+ this.addOptions(this.convertToOptions(data));
3418
+ }
3419
+
3420
+ Utils.Extend(ArrayAdapter, SelectAdapter);
3421
+
3422
+ ArrayAdapter.prototype.select = function (data) {
3423
+ var $option = this.$element.find('option').filter(function (i, elm) {
3424
+ return elm.value == data.id.toString();
3425
+ });
3426
+
3427
+ if ($option.length === 0) {
3428
+ $option = this.option(data);
3429
+
3430
+ this.addOptions($option);
3431
+ }
3432
+
3433
+ ArrayAdapter.__super__.select.call(this, data);
3434
+ };
3435
+
3436
+ ArrayAdapter.prototype.convertToOptions = function (data) {
3437
+ var self = this;
3438
+
3439
+ var $existing = this.$element.find('option');
3440
+ var existingIds = $existing.map(function () {
3441
+ return self.item($(this)).id;
3442
+ }).get();
3443
+
3444
+ var $options = [];
3445
+
3446
+ // Filter out all items except for the one passed in the argument
3447
+ function onlyItem (item) {
3448
+ return function () {
3449
+ return $(this).val() == item.id;
3450
+ };
3451
+ }
3452
+
3453
+ for (var d = 0; d < data.length; d++) {
3454
+ var item = this._normalizeItem(data[d]);
3455
+
3456
+ // Skip items which were pre-loaded, only merge the data
3457
+ if ($.inArray(item.id, existingIds) >= 0) {
3458
+ var $existingOption = $existing.filter(onlyItem(item));
3459
+
3460
+ var existingData = this.item($existingOption);
3461
+ var newData = $.extend(true, {}, item, existingData);
3462
+
3463
+ var $newOption = this.option(newData);
3464
+
3465
+ $existingOption.replaceWith($newOption);
3466
+
3467
+ continue;
3468
+ }
3469
+
3470
+ var $option = this.option(item);
3471
+
3472
+ if (item.children) {
3473
+ var $children = this.convertToOptions(item.children);
3474
+
3475
+ Utils.appendMany($option, $children);
3476
+ }
3477
+
3478
+ $options.push($option);
3479
+ }
3480
+
3481
+ return $options;
3482
+ };
3483
+
3484
+ return ArrayAdapter;
3485
+ });
3486
+
3487
+ S2.define('select2/data/ajax',[
3488
+ './array',
3489
+ '../utils',
3490
+ 'jquery'
3491
+ ], function (ArrayAdapter, Utils, $) {
3492
+ function AjaxAdapter ($element, options) {
3493
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3494
+
3495
+ if (this.ajaxOptions.processResults != null) {
3496
+ this.processResults = this.ajaxOptions.processResults;
3497
+ }
3498
+
3499
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
3500
+ }
3501
+
3502
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
3503
+
3504
+ AjaxAdapter.prototype._applyDefaults = function (options) {
3505
+ var defaults = {
3506
+ data: function (params) {
3507
+ return $.extend({}, params, {
3508
+ q: params.term
3509
+ });
3510
+ },
3511
+ transport: function (params, success, failure) {
3512
+ var $request = $.ajax(params);
3513
+
3514
+ $request.then(success);
3515
+ $request.fail(failure);
3516
+
3517
+ return $request;
3518
+ }
3519
+ };
3520
+
3521
+ return $.extend({}, defaults, options, true);
3522
+ };
3523
+
3524
+ AjaxAdapter.prototype.processResults = function (results) {
3525
+ return results;
3526
+ };
3527
+
3528
+ AjaxAdapter.prototype.query = function (params, callback) {
3529
+ var matches = [];
3530
+ var self = this;
3531
+
3532
+ if (this._request != null) {
3533
+ // JSONP requests cannot always be aborted
3534
+ if ($.isFunction(this._request.abort)) {
3535
+ this._request.abort();
3536
+ }
3537
+
3538
+ this._request = null;
3539
+ }
3540
+
3541
+ var options = $.extend({
3542
+ type: 'GET'
3543
+ }, this.ajaxOptions);
3544
+
3545
+ if (typeof options.url === 'function') {
3546
+ options.url = options.url.call(this.$element, params);
3547
+ }
3548
+
3549
+ if (typeof options.data === 'function') {
3550
+ options.data = options.data.call(this.$element, params);
3551
+ }
3552
+
3553
+ function request () {
3554
+ var $request = options.transport(options, function (data) {
3555
+ var results = self.processResults(data, params);
3556
+
3557
+ if (self.options.get('debug') && window.console && console.error) {
3558
+ // Check to make sure that the response included a `results` key.
3559
+ if (!results || !results.results || !$.isArray(results.results)) {
3560
+ console.error(
3561
+ 'Select2: The AJAX results did not return an array in the ' +
3562
+ '`results` key of the response.'
3563
+ );
3564
+ }
3565
+ }
3566
+
3567
+ callback(results);
3568
+ }, function () {
3569
+ // Attempt to detect if a request was aborted
3570
+ // Only works if the transport exposes a status property
3571
+ if ('status' in $request &&
3572
+ ($request.status === 0 || $request.status === '0')) {
3573
+ return;
3574
+ }
3575
+
3576
+ self.trigger('results:message', {
3577
+ message: 'errorLoading'
3578
+ });
3579
+ });
3580
+
3581
+ self._request = $request;
3582
+ }
3583
+
3584
+ if (this.ajaxOptions.delay && params.term != null) {
3585
+ if (this._queryTimeout) {
3586
+ window.clearTimeout(this._queryTimeout);
3587
+ }
3588
+
3589
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3590
+ } else {
3591
+ request();
3592
+ }
3593
+ };
3594
+
3595
+ return AjaxAdapter;
3596
+ });
3597
+
3598
+ S2.define('select2/data/tags',[
3599
+ 'jquery'
3600
+ ], function ($) {
3601
+ function Tags (decorated, $element, options) {
3602
+ var tags = options.get('tags');
3603
+
3604
+ var createTag = options.get('createTag');
3605
+
3606
+ if (createTag !== undefined) {
3607
+ this.createTag = createTag;
3608
+ }
3609
+
3610
+ var insertTag = options.get('insertTag');
3611
+
3612
+ if (insertTag !== undefined) {
3613
+ this.insertTag = insertTag;
3614
+ }
3615
+
3616
+ decorated.call(this, $element, options);
3617
+
3618
+ if ($.isArray(tags)) {
3619
+ for (var t = 0; t < tags.length; t++) {
3620
+ var tag = tags[t];
3621
+ var item = this._normalizeItem(tag);
3622
+
3623
+ var $option = this.option(item);
3624
+
3625
+ this.$element.append($option);
3626
+ }
3627
+ }
3628
+ }
3629
+
3630
+ Tags.prototype.query = function (decorated, params, callback) {
3631
+ var self = this;
3632
+
3633
+ this._removeOldTags();
3634
+
3635
+ if (params.term == null || params.page != null) {
3636
+ decorated.call(this, params, callback);
3637
+ return;
3638
+ }
3639
+
3640
+ function wrapper (obj, child) {
3641
+ var data = obj.results;
3642
+
3643
+ for (var i = 0; i < data.length; i++) {
3644
+ var option = data[i];
3645
+
3646
+ var checkChildren = (
3647
+ option.children != null &&
3648
+ !wrapper({
3649
+ results: option.children
3650
+ }, true)
3651
+ );
3652
+
3653
+ var optionText = (option.text || '').toUpperCase();
3654
+ var paramsTerm = (params.term || '').toUpperCase();
3655
+
3656
+ var checkText = optionText === paramsTerm;
3657
+
3658
+ if (checkText || checkChildren) {
3659
+ if (child) {
3660
+ return false;
3661
+ }
3662
+
3663
+ obj.data = data;
3664
+ callback(obj);
3665
+
3666
+ return;
3667
+ }
3668
+ }
3669
+
3670
+ if (child) {
3671
+ return true;
3672
+ }
3673
+
3674
+ var tag = self.createTag(params);
3675
+
3676
+ if (tag != null) {
3677
+ var $option = self.option(tag);
3678
+ $option.attr('data-select2-tag', true);
3679
+
3680
+ self.addOptions([$option]);
3681
+
3682
+ self.insertTag(data, tag);
3683
+ }
3684
+
3685
+ obj.results = data;
3686
+
3687
+ callback(obj);
3688
+ }
3689
+
3690
+ decorated.call(this, params, wrapper);
3691
+ };
3692
+
3693
+ Tags.prototype.createTag = function (decorated, params) {
3694
+ var term = $.trim(params.term);
3695
+
3696
+ if (term === '') {
3697
+ return null;
3698
+ }
3699
+
3700
+ return {
3701
+ id: term,
3702
+ text: term
3703
+ };
3704
+ };
3705
+
3706
+ Tags.prototype.insertTag = function (_, data, tag) {
3707
+ data.unshift(tag);
3708
+ };
3709
+
3710
+ Tags.prototype._removeOldTags = function (_) {
3711
+ var tag = this._lastTag;
3712
+
3713
+ var $options = this.$element.find('option[data-select2-tag]');
3714
+
3715
+ $options.each(function () {
3716
+ if (this.selected) {
3717
+ return;
3718
+ }
3719
+
3720
+ $(this).remove();
3721
+ });
3722
+ };
3723
+
3724
+ return Tags;
3725
+ });
3726
+
3727
+ S2.define('select2/data/tokenizer',[
3728
+ 'jquery'
3729
+ ], function ($) {
3730
+ function Tokenizer (decorated, $element, options) {
3731
+ var tokenizer = options.get('tokenizer');
3732
+
3733
+ if (tokenizer !== undefined) {
3734
+ this.tokenizer = tokenizer;
3735
+ }
3736
+
3737
+ decorated.call(this, $element, options);
3738
+ }
3739
+
3740
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
3741
+ decorated.call(this, container, $container);
3742
+
3743
+ this.$search = container.dropdown.$search || container.selection.$search ||
3744
+ $container.find('.select2-search__field');
3745
+ };
3746
+
3747
+ Tokenizer.prototype.query = function (decorated, params, callback) {
3748
+ var self = this;
3749
+
3750
+ function createAndSelect (data) {
3751
+ // Normalize the data object so we can use it for checks
3752
+ var item = self._normalizeItem(data);
3753
+
3754
+ // Check if the data object already exists as a tag
3755
+ // Select it if it doesn't
3756
+ var $existingOptions = self.$element.find('option').filter(function () {
3757
+ return $(this).val() === item.id;
3758
+ });
3759
+
3760
+ // If an existing option wasn't found for it, create the option
3761
+ if (!$existingOptions.length) {
3762
+ var $option = self.option(item);
3763
+ $option.attr('data-select2-tag', true);
3764
+
3765
+ self._removeOldTags();
3766
+ self.addOptions([$option]);
3767
+ }
3768
+
3769
+ // Select the item, now that we know there is an option for it
3770
+ select(item);
3771
+ }
3772
+
3773
+ function select (data) {
3774
+ self.trigger('select', {
3775
+ data: data
3776
+ });
3777
+ }
3778
+
3779
+ params.term = params.term || '';
3780
+
3781
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
3782
+
3783
+ if (tokenData.term !== params.term) {
3784
+ // Replace the search term if we have the search box
3785
+ if (this.$search.length) {
3786
+ this.$search.val(tokenData.term);
3787
+ this.$search.focus();
3788
+ }
3789
+
3790
+ params.term = tokenData.term;
3791
+ }
3792
+
3793
+ decorated.call(this, params, callback);
3794
+ };
3795
+
3796
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3797
+ var separators = options.get('tokenSeparators') || [];
3798
+ var term = params.term;
3799
+ var i = 0;
3800
+
3801
+ var createTag = this.createTag || function (params) {
3802
+ return {
3803
+ id: params.term,
3804
+ text: params.term
3805
+ };
3806
+ };
3807
+
3808
+ while (i < term.length) {
3809
+ var termChar = term[i];
3810
+
3811
+ if ($.inArray(termChar, separators) === -1) {
3812
+ i++;
3813
+
3814
+ continue;
3815
+ }
3816
+
3817
+ var part = term.substr(0, i);
3818
+ var partParams = $.extend({}, params, {
3819
+ term: part
3820
+ });
3821
+
3822
+ var data = createTag(partParams);
3823
+
3824
+ if (data == null) {
3825
+ i++;
3826
+ continue;
3827
+ }
3828
+
3829
+ callback(data);
3830
+
3831
+ // Reset the term to not include the tokenized portion
3832
+ term = term.substr(i + 1) || '';
3833
+ i = 0;
3834
+ }
3835
+
3836
+ return {
3837
+ term: term
3838
+ };
3839
+ };
3840
+
3841
+ return Tokenizer;
3842
+ });
3843
+
3844
+ S2.define('select2/data/minimumInputLength',[
3845
+
3846
+ ], function () {
3847
+ function MinimumInputLength (decorated, $e, options) {
3848
+ this.minimumInputLength = options.get('minimumInputLength');
3849
+
3850
+ decorated.call(this, $e, options);
3851
+ }
3852
+
3853
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
3854
+ params.term = params.term || '';
3855
+
3856
+ if (params.term.length < this.minimumInputLength) {
3857
+ this.trigger('results:message', {
3858
+ message: 'inputTooShort',
3859
+ args: {
3860
+ minimum: this.minimumInputLength,
3861
+ input: params.term,
3862
+ params: params
3863
+ }
3864
+ });
3865
+
3866
+ return;
3867
+ }
3868
+
3869
+ decorated.call(this, params, callback);
3870
+ };
3871
+
3872
+ return MinimumInputLength;
3873
+ });
3874
+
3875
+ S2.define('select2/data/maximumInputLength',[
3876
+
3877
+ ], function () {
3878
+ function MaximumInputLength (decorated, $e, options) {
3879
+ this.maximumInputLength = options.get('maximumInputLength');
3880
+
3881
+ decorated.call(this, $e, options);
3882
+ }
3883
+
3884
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
3885
+ params.term = params.term || '';
3886
+
3887
+ if (this.maximumInputLength > 0 &&
3888
+ params.term.length > this.maximumInputLength) {
3889
+ this.trigger('results:message', {
3890
+ message: 'inputTooLong',
3891
+ args: {
3892
+ maximum: this.maximumInputLength,
3893
+ input: params.term,
3894
+ params: params
3895
+ }
3896
+ });
3897
+
3898
+ return;
3899
+ }
3900
+
3901
+ decorated.call(this, params, callback);
3902
+ };
3903
+
3904
+ return MaximumInputLength;
3905
+ });
3906
+
3907
+ S2.define('select2/data/maximumSelectionLength',[
3908
+
3909
+ ], function (){
3910
+ function MaximumSelectionLength (decorated, $e, options) {
3911
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
3912
+
3913
+ decorated.call(this, $e, options);
3914
+ }
3915
+
3916
+ MaximumSelectionLength.prototype.query =
3917
+ function (decorated, params, callback) {
3918
+ var self = this;
3919
+
3920
+ this.current(function (currentData) {
3921
+ var count = currentData != null ? currentData.length : 0;
3922
+ if (self.maximumSelectionLength > 0 &&
3923
+ count >= self.maximumSelectionLength) {
3924
+ self.trigger('results:message', {
3925
+ message: 'maximumSelected',
3926
+ args: {
3927
+ maximum: self.maximumSelectionLength
3928
+ }
3929
+ });
3930
+ return;
3931
+ }
3932
+ decorated.call(self, params, callback);
3933
+ });
3934
+ };
3935
+
3936
+ return MaximumSelectionLength;
3937
+ });
3938
+
3939
+ S2.define('select2/dropdown',[
3940
+ 'jquery',
3941
+ './utils'
3942
+ ], function ($, Utils) {
3943
+ function Dropdown ($element, options) {
3944
+ this.$element = $element;
3945
+ this.options = options;
3946
+
3947
+ Dropdown.__super__.constructor.call(this);
3948
+ }
3949
+
3950
+ Utils.Extend(Dropdown, Utils.Observable);
3951
+
3952
+ Dropdown.prototype.render = function () {
3953
+ var $dropdown = $(
3954
+ '<span class="select2-dropdown">' +
3955
+ '<span class="select2-results"></span>' +
3956
+ '</span>'
3957
+ );
3958
+
3959
+ $dropdown.attr('dir', this.options.get('dir'));
3960
+
3961
+ this.$dropdown = $dropdown;
3962
+
3963
+ return $dropdown;
3964
+ };
3965
+
3966
+ Dropdown.prototype.bind = function () {
3967
+ // Should be implemented in subclasses
3968
+ };
3969
+
3970
+ Dropdown.prototype.position = function ($dropdown, $container) {
3971
+ // Should be implmented in subclasses
3972
+ };
3973
+
3974
+ Dropdown.prototype.destroy = function () {
3975
+ // Remove the dropdown from the DOM
3976
+ this.$dropdown.remove();
3977
+ };
3978
+
3979
+ return Dropdown;
3980
+ });
3981
+
3982
+ S2.define('select2/dropdown/search',[
3983
+ 'jquery',
3984
+ '../utils'
3985
+ ], function ($, Utils) {
3986
+ function Search () { }
3987
+
3988
+ Search.prototype.render = function (decorated) {
3989
+ var $rendered = decorated.call(this);
3990
+
3991
+ var $search = $(
3992
+ '<span class="select2-search select2-search--dropdown">' +
3993
+ '<input class="select2-search__field" type="search" tabindex="-1"' +
3994
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
3995
+ ' spellcheck="false" role="textbox" />' +
3996
+ '</span>'
3997
+ );
3998
+
3999
+ this.$searchContainer = $search;
4000
+ this.$search = $search.find('input');
4001
+
4002
+ $rendered.prepend($search);
4003
+
4004
+ return $rendered;
4005
+ };
4006
+
4007
+ Search.prototype.bind = function (decorated, container, $container) {
4008
+ var self = this;
4009
+
4010
+ decorated.call(this, container, $container);
4011
+
4012
+ this.$search.on('keydown', function (evt) {
4013
+ self.trigger('keypress', evt);
4014
+
4015
+ self._keyUpPrevented = evt.isDefaultPrevented();
4016
+ });
4017
+
4018
+ // Workaround for browsers which do not support the `input` event
4019
+ // This will prevent double-triggering of events for browsers which support
4020
+ // both the `keyup` and `input` events.
4021
+ this.$search.on('input', function (evt) {
4022
+ // Unbind the duplicated `keyup` event
4023
+ $(this).off('keyup');
4024
+ });
4025
+
4026
+ this.$search.on('keyup input', function (evt) {
4027
+ self.handleSearch(evt);
4028
+ });
4029
+
4030
+ container.on('open', function () {
4031
+ self.$search.attr('tabindex', 0);
4032
+
4033
+ self.$search.focus();
4034
+
4035
+ window.setTimeout(function () {
4036
+ self.$search.focus();
4037
+ }, 0);
4038
+ });
4039
+
4040
+ container.on('close', function () {
4041
+ self.$search.attr('tabindex', -1);
4042
+
4043
+ self.$search.val('');
4044
+ self.$search.blur();
4045
+ });
4046
+
4047
+ container.on('focus', function () {
4048
+ if (!container.isOpen()) {
4049
+ self.$search.focus();
4050
+ }
4051
+ });
4052
+
4053
+ container.on('results:all', function (params) {
4054
+ if (params.query.term == null || params.query.term === '') {
4055
+ var showSearch = self.showSearch(params);
4056
+
4057
+ if (showSearch) {
4058
+ self.$searchContainer.removeClass('select2-search--hide');
4059
+ } else {
4060
+ self.$searchContainer.addClass('select2-search--hide');
4061
+ }
4062
+ }
4063
+ });
4064
+ };
4065
+
4066
+ Search.prototype.handleSearch = function (evt) {
4067
+ if (!this._keyUpPrevented) {
4068
+ var input = this.$search.val();
4069
+
4070
+ this.trigger('query', {
4071
+ term: input
4072
+ });
4073
+ }
4074
+
4075
+ this._keyUpPrevented = false;
4076
+ };
4077
+
4078
+ Search.prototype.showSearch = function (_, params) {
4079
+ return true;
4080
+ };
4081
+
4082
+ return Search;
4083
+ });
4084
+
4085
+ S2.define('select2/dropdown/hidePlaceholder',[
4086
+
4087
+ ], function () {
4088
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
4089
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4090
+
4091
+ decorated.call(this, $element, options, dataAdapter);
4092
+ }
4093
+
4094
+ HidePlaceholder.prototype.append = function (decorated, data) {
4095
+ data.results = this.removePlaceholder(data.results);
4096
+
4097
+ decorated.call(this, data);
4098
+ };
4099
+
4100
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
4101
+ if (typeof placeholder === 'string') {
4102
+ placeholder = {
4103
+ id: '',
4104
+ text: placeholder
4105
+ };
4106
+ }
4107
+
4108
+ return placeholder;
4109
+ };
4110
+
4111
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4112
+ var modifiedData = data.slice(0);
4113
+
4114
+ for (var d = data.length - 1; d >= 0; d--) {
4115
+ var item = data[d];
4116
+
4117
+ if (this.placeholder.id === item.id) {
4118
+ modifiedData.splice(d, 1);
4119
+ }
4120
+ }
4121
+
4122
+ return modifiedData;
4123
+ };
4124
+
4125
+ return HidePlaceholder;
4126
+ });
4127
+
4128
+ S2.define('select2/dropdown/infiniteScroll',[
4129
+ 'jquery'
4130
+ ], function ($) {
4131
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
4132
+ this.lastParams = {};
4133
+
4134
+ decorated.call(this, $element, options, dataAdapter);
4135
+
4136
+ this.$loadingMore = this.createLoadingMore();
4137
+ this.loading = false;
4138
+ }
4139
+
4140
+ InfiniteScroll.prototype.append = function (decorated, data) {
4141
+ this.$loadingMore.remove();
4142
+ this.loading = false;
4143
+
4144
+ decorated.call(this, data);
4145
+
4146
+ if (this.showLoadingMore(data)) {
4147
+ this.$results.append(this.$loadingMore);
4148
+ }
4149
+ };
4150
+
4151
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4152
+ var self = this;
4153
+
4154
+ decorated.call(this, container, $container);
4155
+
4156
+ container.on('query', function (params) {
4157
+ self.lastParams = params;
4158
+ self.loading = true;
4159
+ });
4160
+
4161
+ container.on('query:append', function (params) {
4162
+ self.lastParams = params;
4163
+ self.loading = true;
4164
+ });
4165
+
4166
+ this.$results.on('scroll', function () {
4167
+ var isLoadMoreVisible = $.contains(
4168
+ document.documentElement,
4169
+ self.$loadingMore[0]
4170
+ );
4171
+
4172
+ if (self.loading || !isLoadMoreVisible) {
4173
+ return;
4174
+ }
4175
+
4176
+ var currentOffset = self.$results.offset().top +
4177
+ self.$results.outerHeight(false);
4178
+ var loadingMoreOffset = self.$loadingMore.offset().top +
4179
+ self.$loadingMore.outerHeight(false);
4180
+
4181
+ if (currentOffset + 50 >= loadingMoreOffset) {
4182
+ self.loadMore();
4183
+ }
4184
+ });
4185
+ };
4186
+
4187
+ InfiniteScroll.prototype.loadMore = function () {
4188
+ this.loading = true;
4189
+
4190
+ var params = $.extend({}, {page: 1}, this.lastParams);
4191
+
4192
+ params.page++;
4193
+
4194
+ this.trigger('query:append', params);
4195
+ };
4196
+
4197
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4198
+ return data.pagination && data.pagination.more;
4199
+ };
4200
+
4201
+ InfiniteScroll.prototype.createLoadingMore = function () {
4202
+ var $option = $(
4203
+ '<li ' +
4204
+ 'class="select2-results__option select2-results__option--load-more"' +
4205
+ 'role="treeitem" aria-disabled="true"></li>'
4206
+ );
4207
+
4208
+ var message = this.options.get('translations').get('loadingMore');
4209
+
4210
+ $option.html(message(this.lastParams));
4211
+
4212
+ return $option;
4213
+ };
4214
+
4215
+ return InfiniteScroll;
4216
+ });
4217
+
4218
+ S2.define('select2/dropdown/attachBody',[
4219
+ 'jquery',
4220
+ '../utils'
4221
+ ], function ($, Utils) {
4222
+ function AttachBody (decorated, $element, options) {
4223
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
4224
+
4225
+ decorated.call(this, $element, options);
4226
+ }
4227
+
4228
+ AttachBody.prototype.bind = function (decorated, container, $container) {
4229
+ var self = this;
4230
+
4231
+ var setupResultsEvents = false;
4232
+
4233
+ decorated.call(this, container, $container);
4234
+
4235
+ container.on('open', function () {
4236
+ self._showDropdown();
4237
+ self._attachPositioningHandler(container);
4238
+
4239
+ if (!setupResultsEvents) {
4240
+ setupResultsEvents = true;
4241
+
4242
+ container.on('results:all', function () {
4243
+ self._positionDropdown();
4244
+ self._resizeDropdown();
4245
+ });
4246
+
4247
+ container.on('results:append', function () {
4248
+ self._positionDropdown();
4249
+ self._resizeDropdown();
4250
+ });
4251
+ }
4252
+ });
4253
+
4254
+ container.on('close', function () {
4255
+ self._hideDropdown();
4256
+ self._detachPositioningHandler(container);
4257
+ });
4258
+
4259
+ this.$dropdownContainer.on('mousedown', function (evt) {
4260
+ evt.stopPropagation();
4261
+ });
4262
+ };
4263
+
4264
+ AttachBody.prototype.destroy = function (decorated) {
4265
+ decorated.call(this);
4266
+
4267
+ this.$dropdownContainer.remove();
4268
+ };
4269
+
4270
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4271
+ // Clone all of the container classes
4272
+ $dropdown.attr('class', $container.attr('class'));
4273
+
4274
+ $dropdown.removeClass('select2');
4275
+ $dropdown.addClass('select2-container--open');
4276
+
4277
+ $dropdown.css({
4278
+ position: 'absolute',
4279
+ top: -999999
4280
+ });
4281
+
4282
+ this.$container = $container;
4283
+ };
4284
+
4285
+ AttachBody.prototype.render = function (decorated) {
4286
+ var $container = $('<span></span>');
4287
+
4288
+ var $dropdown = decorated.call(this);
4289
+ $container.append($dropdown);
4290
+
4291
+ this.$dropdownContainer = $container;
4292
+
4293
+ return $container;
4294
+ };
4295
+
4296
+ AttachBody.prototype._hideDropdown = function (decorated) {
4297
+ this.$dropdownContainer.detach();
4298
+ };
4299
+
4300
+ AttachBody.prototype._attachPositioningHandler =
4301
+ function (decorated, container) {
4302
+ var self = this;
4303
+
4304
+ var scrollEvent = 'scroll.select2.' + container.id;
4305
+ var resizeEvent = 'resize.select2.' + container.id;
4306
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4307
+
4308
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4309
+ $watchers.each(function () {
4310
+ Utils.StoreData(this, 'select2-scroll-position', {
4311
+ x: $(this).scrollLeft(),
4312
+ y: $(this).scrollTop()
4313
+ });
4314
+ });
4315
+
4316
+ $watchers.on(scrollEvent, function (ev) {
4317
+ var position = Utils.GetData(this, 'select2-scroll-position');
4318
+ $(this).scrollTop(position.y);
4319
+ });
4320
+
4321
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4322
+ function (e) {
4323
+ self._positionDropdown();
4324
+ self._resizeDropdown();
4325
+ });
4326
+ };
4327
+
4328
+ AttachBody.prototype._detachPositioningHandler =
4329
+ function (decorated, container) {
4330
+ var scrollEvent = 'scroll.select2.' + container.id;
4331
+ var resizeEvent = 'resize.select2.' + container.id;
4332
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4333
+
4334
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4335
+ $watchers.off(scrollEvent);
4336
+
4337
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4338
+ };
4339
+
4340
+ AttachBody.prototype._positionDropdown = function () {
4341
+ var $window = $(window);
4342
+
4343
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4344
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
4345
+
4346
+ var newDirection = null;
4347
+
4348
+ var offset = this.$container.offset();
4349
+
4350
+ offset.bottom = offset.top + this.$container.outerHeight(false);
4351
+
4352
+ var container = {
4353
+ height: this.$container.outerHeight(false)
4354
+ };
4355
+
4356
+ container.top = offset.top;
4357
+ container.bottom = offset.top + container.height;
4358
+
4359
+ var dropdown = {
4360
+ height: this.$dropdown.outerHeight(false)
4361
+ };
4362
+
4363
+ var viewport = {
4364
+ top: $window.scrollTop(),
4365
+ bottom: $window.scrollTop() + $window.height()
4366
+ };
4367
+
4368
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4369
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
4370
+
4371
+ var css = {
4372
+ left: offset.left,
4373
+ top: container.bottom
4374
+ };
4375
+
4376
+ // Determine what the parent element is to use for calciulating the offset
4377
+ var $offsetParent = this.$dropdownParent;
4378
+
4379
+ // For statically positoned elements, we need to get the element
4380
+ // that is determining the offset
4381
+ if ($offsetParent.css('position') === 'static') {
4382
+ $offsetParent = $offsetParent.offsetParent();
4383
+ }
4384
+
4385
+ var parentOffset = $offsetParent.offset();
4386
+
4387
+ css.top -= parentOffset.top;
4388
+ css.left -= parentOffset.left;
4389
+
4390
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
4391
+ newDirection = 'below';
4392
+ }
4393
+
4394
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4395
+ newDirection = 'above';
4396
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4397
+ newDirection = 'below';
4398
+ }
4399
+
4400
+ if (newDirection == 'above' ||
4401
+ (isCurrentlyAbove && newDirection !== 'below')) {
4402
+ css.top = container.top - parentOffset.top - dropdown.height;
4403
+ }
4404
+
4405
+ if (newDirection != null) {
4406
+ this.$dropdown
4407
+ .removeClass('select2-dropdown--below select2-dropdown--above')
4408
+ .addClass('select2-dropdown--' + newDirection);
4409
+ this.$container
4410
+ .removeClass('select2-container--below select2-container--above')
4411
+ .addClass('select2-container--' + newDirection);
4412
+ }
4413
+
4414
+ this.$dropdownContainer.css(css);
4415
+ };
4416
+
4417
+ AttachBody.prototype._resizeDropdown = function () {
4418
+ var css = {
4419
+ width: this.$container.outerWidth(false) + 'px'
4420
+ };
4421
+
4422
+ if (this.options.get('dropdownAutoWidth')) {
4423
+ css.minWidth = css.width;
4424
+ css.position = 'relative';
4425
+ css.width = 'auto';
4426
+ }
4427
+
4428
+ this.$dropdown.css(css);
4429
+ };
4430
+
4431
+ AttachBody.prototype._showDropdown = function (decorated) {
4432
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
4433
+
4434
+ this._positionDropdown();
4435
+ this._resizeDropdown();
4436
+ };
4437
+
4438
+ return AttachBody;
4439
+ });
4440
+
4441
+ S2.define('select2/dropdown/minimumResultsForSearch',[
4442
+
4443
+ ], function () {
4444
+ function countResults (data) {
4445
+ var count = 0;
4446
+
4447
+ for (var d = 0; d < data.length; d++) {
4448
+ var item = data[d];
4449
+
4450
+ if (item.children) {
4451
+ count += countResults(item.children);
4452
+ } else {
4453
+ count++;
4454
+ }
4455
+ }
4456
+
4457
+ return count;
4458
+ }
4459
+
4460
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4461
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
4462
+
4463
+ if (this.minimumResultsForSearch < 0) {
4464
+ this.minimumResultsForSearch = Infinity;
4465
+ }
4466
+
4467
+ decorated.call(this, $element, options, dataAdapter);
4468
+ }
4469
+
4470
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4471
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
4472
+ return false;
4473
+ }
4474
+
4475
+ return decorated.call(this, params);
4476
+ };
4477
+
4478
+ return MinimumResultsForSearch;
4479
+ });
4480
+
4481
+ S2.define('select2/dropdown/selectOnClose',[
4482
+ '../utils'
4483
+ ], function (Utils) {
4484
+ function SelectOnClose () { }
4485
+
4486
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
4487
+ var self = this;
4488
+
4489
+ decorated.call(this, container, $container);
4490
+
4491
+ container.on('close', function (params) {
4492
+ self._handleSelectOnClose(params);
4493
+ });
4494
+ };
4495
+
4496
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4497
+ if (params && params.originalSelect2Event != null) {
4498
+ var event = params.originalSelect2Event;
4499
+
4500
+ // Don't select an item if the close event was triggered from a select or
4501
+ // unselect event
4502
+ if (event._type === 'select' || event._type === 'unselect') {
4503
+ return;
4504
+ }
4505
+ }
4506
+
4507
+ var $highlightedResults = this.getHighlightedResults();
4508
+
4509
+ // Only select highlighted results
4510
+ if ($highlightedResults.length < 1) {
4511
+ return;
4512
+ }
4513
+
4514
+ var data = Utils.GetData($highlightedResults[0], 'data');
4515
+
4516
+ // Don't re-select already selected resulte
4517
+ if (
4518
+ (data.element != null && data.element.selected) ||
4519
+ (data.element == null && data.selected)
4520
+ ) {
4521
+ return;
4522
+ }
4523
+
4524
+ this.trigger('select', {
4525
+ data: data
4526
+ });
4527
+ };
4528
+
4529
+ return SelectOnClose;
4530
+ });
4531
+
4532
+ S2.define('select2/dropdown/closeOnSelect',[
4533
+
4534
+ ], function () {
4535
+ function CloseOnSelect () { }
4536
+
4537
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4538
+ var self = this;
4539
+
4540
+ decorated.call(this, container, $container);
4541
+
4542
+ container.on('select', function (evt) {
4543
+ self._selectTriggered(evt);
4544
+ });
4545
+
4546
+ container.on('unselect', function (evt) {
4547
+ self._selectTriggered(evt);
4548
+ });
4549
+ };
4550
+
4551
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4552
+ var originalEvent = evt.originalEvent;
4553
+
4554
+ // Don't close if the control key is being held
4555
+ if (originalEvent && originalEvent.ctrlKey) {
4556
+ return;
4557
+ }
4558
+
4559
+ this.trigger('close', {
4560
+ originalEvent: originalEvent,
4561
+ originalSelect2Event: evt
4562
+ });
4563
+ };
4564
+
4565
+ return CloseOnSelect;
4566
+ });
4567
+
4568
+ S2.define('select2/i18n/en',[],function () {
4569
+ // English
4570
+ return {
4571
+ errorLoading: function () {
4572
+ return 'The results could not be loaded.';
4573
+ },
4574
+ inputTooLong: function (args) {
4575
+ var overChars = args.input.length - args.maximum;
4576
+
4577
+ var message = 'Please delete ' + overChars + ' character';
4578
+
4579
+ if (overChars != 1) {
4580
+ message += 's';
4581
+ }
4582
+
4583
+ return message;
4584
+ },
4585
+ inputTooShort: function (args) {
4586
+ var remainingChars = args.minimum - args.input.length;
4587
+
4588
+ var message = 'Please enter ' + remainingChars + ' or more characters';
4589
+
4590
+ return message;
4591
+ },
4592
+ loadingMore: function () {
4593
+ return 'Loading more results…';
4594
+ },
4595
+ maximumSelected: function (args) {
4596
+ var message = 'You can only select ' + args.maximum + ' item';
4597
+
4598
+ if (args.maximum != 1) {
4599
+ message += 's';
4600
+ }
4601
+
4602
+ return message;
4603
+ },
4604
+ noResults: function () {
4605
+ return 'No results found';
4606
+ },
4607
+ searching: function () {
4608
+ return 'Searching…';
4609
+ }
4610
+ };
4611
+ });
4612
+
4613
+ S2.define('select2/defaults',[
4614
+ 'jquery',
4615
+ 'require',
4616
+
4617
+ './results',
4618
+
4619
+ './selection/single',
4620
+ './selection/multiple',
4621
+ './selection/placeholder',
4622
+ './selection/allowClear',
4623
+ './selection/search',
4624
+ './selection/eventRelay',
4625
+
4626
+ './utils',
4627
+ './translation',
4628
+ './diacritics',
4629
+
4630
+ './data/select',
4631
+ './data/array',
4632
+ './data/ajax',
4633
+ './data/tags',
4634
+ './data/tokenizer',
4635
+ './data/minimumInputLength',
4636
+ './data/maximumInputLength',
4637
+ './data/maximumSelectionLength',
4638
+
4639
+ './dropdown',
4640
+ './dropdown/search',
4641
+ './dropdown/hidePlaceholder',
4642
+ './dropdown/infiniteScroll',
4643
+ './dropdown/attachBody',
4644
+ './dropdown/minimumResultsForSearch',
4645
+ './dropdown/selectOnClose',
4646
+ './dropdown/closeOnSelect',
4647
+
4648
+ './i18n/en'
4649
+ ], function ($, require,
4650
+
4651
+ ResultsList,
4652
+
4653
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
4654
+ SelectionSearch, EventRelay,
4655
+
4656
+ Utils, Translation, DIACRITICS,
4657
+
4658
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4659
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4660
+
4661
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4662
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4663
+
4664
+ EnglishTranslation) {
4665
+ function Defaults () {
4666
+ this.reset();
4667
+ }
4668
+
4669
+ Defaults.prototype.apply = function (options) {
4670
+ options = $.extend(true, {}, this.defaults, options);
4671
+
4672
+ if (options.dataAdapter == null) {
4673
+ if (options.ajax != null) {
4674
+ options.dataAdapter = AjaxData;
4675
+ } else if (options.data != null) {
4676
+ options.dataAdapter = ArrayData;
4677
+ } else {
4678
+ options.dataAdapter = SelectData;
4679
+ }
4680
+
4681
+ if (options.minimumInputLength > 0) {
4682
+ options.dataAdapter = Utils.Decorate(
4683
+ options.dataAdapter,
4684
+ MinimumInputLength
4685
+ );
4686
+ }
4687
+
4688
+ if (options.maximumInputLength > 0) {
4689
+ options.dataAdapter = Utils.Decorate(
4690
+ options.dataAdapter,
4691
+ MaximumInputLength
4692
+ );
4693
+ }
4694
+
4695
+ if (options.maximumSelectionLength > 0) {
4696
+ options.dataAdapter = Utils.Decorate(
4697
+ options.dataAdapter,
4698
+ MaximumSelectionLength
4699
+ );
4700
+ }
4701
+
4702
+ if (options.tags) {
4703
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4704
+ }
4705
+
4706
+ if (options.tokenSeparators != null || options.tokenizer != null) {
4707
+ options.dataAdapter = Utils.Decorate(
4708
+ options.dataAdapter,
4709
+ Tokenizer
4710
+ );
4711
+ }
4712
+
4713
+ if (options.query != null) {
4714
+ var Query = require(options.amdBase + 'compat/query');
4715
+
4716
+ options.dataAdapter = Utils.Decorate(
4717
+ options.dataAdapter,
4718
+ Query
4719
+ );
4720
+ }
4721
+
4722
+ if (options.initSelection != null) {
4723
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
4724
+
4725
+ options.dataAdapter = Utils.Decorate(
4726
+ options.dataAdapter,
4727
+ InitSelection
4728
+ );
4729
+ }
4730
+ }
4731
+
4732
+ if (options.resultsAdapter == null) {
4733
+ options.resultsAdapter = ResultsList;
4734
+
4735
+ if (options.ajax != null) {
4736
+ options.resultsAdapter = Utils.Decorate(
4737
+ options.resultsAdapter,
4738
+ InfiniteScroll
4739
+ );
4740
+ }
4741
+
4742
+ if (options.placeholder != null) {
4743
+ options.resultsAdapter = Utils.Decorate(
4744
+ options.resultsAdapter,
4745
+ HidePlaceholder
4746
+ );
4747
+ }
4748
+
4749
+ if (options.selectOnClose) {
4750
+ options.resultsAdapter = Utils.Decorate(
4751
+ options.resultsAdapter,
4752
+ SelectOnClose
4753
+ );
4754
+ }
4755
+ }
4756
+
4757
+ if (options.dropdownAdapter == null) {
4758
+ if (options.multiple) {
4759
+ options.dropdownAdapter = Dropdown;
4760
+ } else {
4761
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4762
+
4763
+ options.dropdownAdapter = SearchableDropdown;
4764
+ }
4765
+
4766
+ if (options.minimumResultsForSearch !== 0) {
4767
+ options.dropdownAdapter = Utils.Decorate(
4768
+ options.dropdownAdapter,
4769
+ MinimumResultsForSearch
4770
+ );
4771
+ }
4772
+
4773
+ if (options.closeOnSelect) {
4774
+ options.dropdownAdapter = Utils.Decorate(
4775
+ options.dropdownAdapter,
4776
+ CloseOnSelect
4777
+ );
4778
+ }
4779
+
4780
+ if (
4781
+ options.dropdownCssClass != null ||
4782
+ options.dropdownCss != null ||
4783
+ options.adaptDropdownCssClass != null
4784
+ ) {
4785
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4786
+
4787
+ options.dropdownAdapter = Utils.Decorate(
4788
+ options.dropdownAdapter,
4789
+ DropdownCSS
4790
+ );
4791
+ }
4792
+
4793
+ options.dropdownAdapter = Utils.Decorate(
4794
+ options.dropdownAdapter,
4795
+ AttachBody
4796
+ );
4797
+ }
4798
+
4799
+ if (options.selectionAdapter == null) {
4800
+ if (options.multiple) {
4801
+ options.selectionAdapter = MultipleSelection;
4802
+ } else {
4803
+ options.selectionAdapter = SingleSelection;
4804
+ }
4805
+
4806
+ // Add the placeholder mixin if a placeholder was specified
4807
+ if (options.placeholder != null) {
4808
+ options.selectionAdapter = Utils.Decorate(
4809
+ options.selectionAdapter,
4810
+ Placeholder
4811
+ );
4812
+ }
4813
+
4814
+ if (options.allowClear) {
4815
+ options.selectionAdapter = Utils.Decorate(
4816
+ options.selectionAdapter,
4817
+ AllowClear
4818
+ );
4819
+ }
4820
+
4821
+ if (options.multiple) {
4822
+ options.selectionAdapter = Utils.Decorate(
4823
+ options.selectionAdapter,
4824
+ SelectionSearch
4825
+ );
4826
+ }
4827
+
4828
+ if (
4829
+ options.containerCssClass != null ||
4830
+ options.containerCss != null ||
4831
+ options.adaptContainerCssClass != null
4832
+ ) {
4833
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4834
+
4835
+ options.selectionAdapter = Utils.Decorate(
4836
+ options.selectionAdapter,
4837
+ ContainerCSS
4838
+ );
4839
+ }
4840
+
4841
+ options.selectionAdapter = Utils.Decorate(
4842
+ options.selectionAdapter,
4843
+ EventRelay
4844
+ );
4845
+ }
4846
+
4847
+ if (typeof options.language === 'string') {
4848
+ // Check if the language is specified with a region
4849
+ if (options.language.indexOf('-') > 0) {
4850
+ // Extract the region information if it is included
4851
+ var languageParts = options.language.split('-');
4852
+ var baseLanguage = languageParts[0];
4853
+
4854
+ options.language = [options.language, baseLanguage];
4855
+ } else {
4856
+ options.language = [options.language];
4857
+ }
4858
+ }
4859
+
4860
+ if ($.isArray(options.language)) {
4861
+ var languages = new Translation();
4862
+ options.language.push('en');
4863
+
4864
+ var languageNames = options.language;
4865
+
4866
+ for (var l = 0; l < languageNames.length; l++) {
4867
+ var name = languageNames[l];
4868
+ var language = {};
4869
+
4870
+ try {
4871
+ // Try to load it with the original name
4872
+ language = Translation.loadPath(name);
4873
+ } catch (e) {
4874
+ try {
4875
+ // If we couldn't load it, check if it wasn't the full path
4876
+ name = this.defaults.amdLanguageBase + name;
4877
+ language = Translation.loadPath(name);
4878
+ } catch (ex) {
4879
+ // The translation could not be loaded at all. Sometimes this is
4880
+ // because of a configuration problem, other times this can be
4881
+ // because of how Select2 helps load all possible translation files.
4882
+ if (options.debug && window.console && console.warn) {
4883
+ console.warn(
4884
+ 'Select2: The language file for "' + name + '" could not be ' +
4885
+ 'automatically loaded. A fallback will be used instead.'
4886
+ );
4887
+ }
4888
+
4889
+ continue;
4890
+ }
4891
+ }
4892
+
4893
+ languages.extend(language);
4894
+ }
4895
+
4896
+ options.translations = languages;
4897
+ } else {
4898
+ var baseTranslation = Translation.loadPath(
4899
+ this.defaults.amdLanguageBase + 'en'
4900
+ );
4901
+ var customTranslation = new Translation(options.language);
4902
+
4903
+ customTranslation.extend(baseTranslation);
4904
+
4905
+ options.translations = customTranslation;
4906
+ }
4907
+
4908
+ return options;
4909
+ };
4910
+
4911
+ Defaults.prototype.reset = function () {
4912
+ function stripDiacritics (text) {
4913
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
4914
+ function match(a) {
4915
+ return DIACRITICS[a] || a;
4916
+ }
4917
+
4918
+ return text.replace(/[^\u0000-\u007E]/g, match);
4919
+ }
4920
+
4921
+ function matcher (params, data) {
4922
+ // Always return the object if there is nothing to compare
4923
+ if ($.trim(params.term) === '') {
4924
+ return data;
4925
+ }
4926
+
4927
+ // Do a recursive check for options with children
4928
+ if (data.children && data.children.length > 0) {
4929
+ // Clone the data object if there are children
4930
+ // This is required as we modify the object to remove any non-matches
4931
+ var match = $.extend(true, {}, data);
4932
+
4933
+ // Check each child of the option
4934
+ for (var c = data.children.length - 1; c >= 0; c--) {
4935
+ var child = data.children[c];
4936
+
4937
+ var matches = matcher(params, child);
4938
+
4939
+ // If there wasn't a match, remove the object in the array
4940
+ if (matches == null) {
4941
+ match.children.splice(c, 1);
4942
+ }
4943
+ }
4944
+
4945
+ // If any children matched, return the new object
4946
+ if (match.children.length > 0) {
4947
+ return match;
4948
+ }
4949
+
4950
+ // If there were no matching children, check just the plain object
4951
+ return matcher(params, match);
4952
+ }
4953
+
4954
+ var original = stripDiacritics(data.text).toUpperCase();
4955
+ var term = stripDiacritics(params.term).toUpperCase();
4956
+
4957
+ // Check if the text contains the term
4958
+ if (original.indexOf(term) > -1) {
4959
+ return data;
4960
+ }
4961
+
4962
+ // If it doesn't contain the term, don't return anything
4963
+ return null;
4964
+ }
4965
+
4966
+ this.defaults = {
4967
+ amdBase: './',
4968
+ amdLanguageBase: './i18n/',
4969
+ closeOnSelect: true,
4970
+ debug: false,
4971
+ dropdownAutoWidth: false,
4972
+ escapeMarkup: Utils.escapeMarkup,
4973
+ language: EnglishTranslation,
4974
+ matcher: matcher,
4975
+ minimumInputLength: 0,
4976
+ maximumInputLength: 0,
4977
+ maximumSelectionLength: 0,
4978
+ minimumResultsForSearch: 0,
4979
+ selectOnClose: false,
4980
+ sorter: function (data) {
4981
+ return data;
4982
+ },
4983
+ templateResult: function (result) {
4984
+ return result.text;
4985
+ },
4986
+ templateSelection: function (selection) {
4987
+ return selection.text;
4988
+ },
4989
+ theme: 'default',
4990
+ width: 'resolve'
4991
+ };
4992
+ };
4993
+
4994
+ Defaults.prototype.set = function (key, value) {
4995
+ var camelKey = $.camelCase(key);
4996
+
4997
+ var data = {};
4998
+ data[camelKey] = value;
4999
+
5000
+ var convertedData = Utils._convertData(data);
5001
+
5002
+ $.extend(true, this.defaults, convertedData);
5003
+ };
5004
+
5005
+ var defaults = new Defaults();
5006
+
5007
+ return defaults;
5008
+ });
5009
+
5010
+ S2.define('select2/options',[
5011
+ 'require',
5012
+ 'jquery',
5013
+ './defaults',
5014
+ './utils'
5015
+ ], function (require, $, Defaults, Utils) {
5016
+ function Options (options, $element) {
5017
+ this.options = options;
5018
+
5019
+ if ($element != null) {
5020
+ this.fromElement($element);
5021
+ }
5022
+
5023
+ this.options = Defaults.apply(this.options);
5024
+
5025
+ if ($element && $element.is('input')) {
5026
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
5027
+
5028
+ this.options.dataAdapter = Utils.Decorate(
5029
+ this.options.dataAdapter,
5030
+ InputCompat
5031
+ );
5032
+ }
5033
+ }
5034
+
5035
+ Options.prototype.fromElement = function ($e) {
5036
+ var excludedData = ['select2'];
5037
+
5038
+ if (this.options.multiple == null) {
5039
+ this.options.multiple = $e.prop('multiple');
5040
+ }
5041
+
5042
+ if (this.options.disabled == null) {
5043
+ this.options.disabled = $e.prop('disabled');
5044
+ }
5045
+
5046
+ if (this.options.language == null) {
5047
+ if ($e.prop('lang')) {
5048
+ this.options.language = $e.prop('lang').toLowerCase();
5049
+ } else if ($e.closest('[lang]').prop('lang')) {
5050
+ this.options.language = $e.closest('[lang]').prop('lang');
5051
+ }
5052
+ }
5053
+
5054
+ if (this.options.dir == null) {
5055
+ if ($e.prop('dir')) {
5056
+ this.options.dir = $e.prop('dir');
5057
+ } else if ($e.closest('[dir]').prop('dir')) {
5058
+ this.options.dir = $e.closest('[dir]').prop('dir');
5059
+ } else {
5060
+ this.options.dir = 'ltr';
5061
+ }
5062
+ }
5063
+
5064
+ $e.prop('disabled', this.options.disabled);
5065
+ $e.prop('multiple', this.options.multiple);
5066
+
5067
+ if (Utils.GetData($e[0], 'select2Tags')) {
5068
+ if (this.options.debug && window.console && console.warn) {
5069
+ console.warn(
5070
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
5071
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
5072
+ 'removed in future versions of Select2.'
5073
+ );
5074
+ }
5075
+
5076
+ Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
5077
+ Utils.StoreData($e[0], 'tags', true);
5078
+ }
5079
+
5080
+ if (Utils.GetData($e[0], 'ajaxUrl')) {
5081
+ if (this.options.debug && window.console && console.warn) {
5082
+ console.warn(
5083
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
5084
+ '`data-ajax--url` and support for the old attribute will be removed' +
5085
+ ' in future versions of Select2.'
5086
+ );
5087
+ }
5088
+
5089
+ $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
5090
+ Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
5091
+
5092
+ }
5093
+
5094
+ var dataset = {};
5095
+
5096
+ // Prefer the element's `dataset` attribute if it exists
5097
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
5098
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
5099
+ dataset = $.extend(true, {}, $e[0].dataset, Utils.GetData($e[0]));
5100
+ } else {
5101
+ dataset = Utils.GetData($e[0]);
5102
+ }
5103
+
5104
+ var data = $.extend(true, {}, dataset);
5105
+
5106
+ data = Utils._convertData(data);
5107
+
5108
+ for (var key in data) {
5109
+ if ($.inArray(key, excludedData) > -1) {
5110
+ continue;
5111
+ }
5112
+
5113
+ if ($.isPlainObject(this.options[key])) {
5114
+ $.extend(this.options[key], data[key]);
5115
+ } else {
5116
+ this.options[key] = data[key];
5117
+ }
5118
+ }
5119
+
5120
+ return this;
5121
+ };
5122
+
5123
+ Options.prototype.get = function (key) {
5124
+ return this.options[key];
5125
+ };
5126
+
5127
+ Options.prototype.set = function (key, val) {
5128
+ this.options[key] = val;
5129
+ };
5130
+
5131
+ return Options;
5132
+ });
5133
+
5134
+ S2.define('select2/core',[
5135
+ 'jquery',
5136
+ './options',
5137
+ './utils',
5138
+ './keys'
5139
+ ], function ($, Options, Utils, KEYS) {
5140
+ var Select2 = function ($element, options) {
5141
+ if (Utils.GetData($element[0], 'select2') != null) {
5142
+ Utils.GetData($element[0], 'select2').destroy();
5143
+ }
5144
+
5145
+ this.$element = $element;
5146
+
5147
+ this.id = this._generateId($element);
5148
+
5149
+ options = options || {};
5150
+
5151
+ this.options = new Options(options, $element);
5152
+
5153
+ Select2.__super__.constructor.call(this);
5154
+
5155
+ // Set up the tabindex
5156
+
5157
+ var tabindex = $element.attr('tabindex') || 0;
5158
+ Utils.StoreData($element[0], 'old-tabindex', tabindex);
5159
+ $element.attr('tabindex', '-1');
5160
+
5161
+ // Set up containers and adapters
5162
+
5163
+ var DataAdapter = this.options.get('dataAdapter');
5164
+ this.dataAdapter = new DataAdapter($element, this.options);
5165
+
5166
+ var $container = this.render();
5167
+
5168
+ this._placeContainer($container);
5169
+
5170
+ var SelectionAdapter = this.options.get('selectionAdapter');
5171
+ this.selection = new SelectionAdapter($element, this.options);
5172
+ this.$selection = this.selection.render();
5173
+
5174
+ this.selection.position(this.$selection, $container);
5175
+
5176
+ var DropdownAdapter = this.options.get('dropdownAdapter');
5177
+ this.dropdown = new DropdownAdapter($element, this.options);
5178
+ this.$dropdown = this.dropdown.render();
5179
+
5180
+ this.dropdown.position(this.$dropdown, $container);
5181
+
5182
+ var ResultsAdapter = this.options.get('resultsAdapter');
5183
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5184
+ this.$results = this.results.render();
5185
+
5186
+ this.results.position(this.$results, this.$dropdown);
5187
+
5188
+ // Bind events
5189
+
5190
+ var self = this;
5191
+
5192
+ // Bind the container to all of the adapters
5193
+ this._bindAdapters();
5194
+
5195
+ // Register any DOM event handlers
5196
+ this._registerDomEvents();
5197
+
5198
+ // Register any internal event handlers
5199
+ this._registerDataEvents();
5200
+ this._registerSelectionEvents();
5201
+ this._registerDropdownEvents();
5202
+ this._registerResultsEvents();
5203
+ this._registerEvents();
5204
+
5205
+ // Set the initial state
5206
+ this.dataAdapter.current(function (initialData) {
5207
+ self.trigger('selection:update', {
5208
+ data: initialData
5209
+ });
5210
+ });
5211
+
5212
+ // Hide the original select
5213
+ $element.addClass('select2-hidden-accessible');
5214
+ $element.attr('aria-hidden', 'true');
5215
+
5216
+ // Synchronize any monitored attributes
5217
+ this._syncAttributes();
5218
+
5219
+ Utils.StoreData($element[0], 'select2', this);
5220
+ };
5221
+
5222
+ Utils.Extend(Select2, Utils.Observable);
5223
+
5224
+ Select2.prototype._generateId = function ($element) {
5225
+ var id = '';
5226
+
5227
+ if ($element.attr('id') != null) {
5228
+ id = $element.attr('id');
5229
+ } else if ($element.attr('name') != null) {
5230
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
5231
+ } else {
5232
+ id = Utils.generateChars(4);
5233
+ }
5234
+
5235
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
5236
+ id = 'select2-' + id;
5237
+
5238
+ return id;
5239
+ };
5240
+
5241
+ Select2.prototype._placeContainer = function ($container) {
5242
+ $container.insertAfter(this.$element);
5243
+
5244
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
5245
+
5246
+ if (width != null) {
5247
+ $container.css('width', width);
5248
+ }
5249
+ };
5250
+
5251
+ Select2.prototype._resolveWidth = function ($element, method) {
5252
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5253
+
5254
+ if (method == 'resolve') {
5255
+ var styleWidth = this._resolveWidth($element, 'style');
5256
+
5257
+ if (styleWidth != null) {
5258
+ return styleWidth;
5259
+ }
5260
+
5261
+ return this._resolveWidth($element, 'element');
5262
+ }
5263
+
5264
+ if (method == 'element') {
5265
+ var elementWidth = $element.outerWidth(false);
5266
+
5267
+ if (elementWidth <= 0) {
5268
+ return 'auto';
5269
+ }
5270
+
5271
+ return elementWidth + 'px';
5272
+ }
5273
+
5274
+ if (method == 'style') {
5275
+ var style = $element.attr('style');
5276
+
5277
+ if (typeof(style) !== 'string') {
5278
+ return null;
5279
+ }
5280
+
5281
+ var attrs = style.split(';');
5282
+
5283
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5284
+ var attr = attrs[i].replace(/\s/g, '');
5285
+ var matches = attr.match(WIDTH);
5286
+
5287
+ if (matches !== null && matches.length >= 1) {
5288
+ return matches[1];
5289
+ }
5290
+ }
5291
+
5292
+ return null;
5293
+ }
5294
+
5295
+ return method;
5296
+ };
5297
+
5298
+ Select2.prototype._bindAdapters = function () {
5299
+ this.dataAdapter.bind(this, this.$container);
5300
+ this.selection.bind(this, this.$container);
5301
+
5302
+ this.dropdown.bind(this, this.$container);
5303
+ this.results.bind(this, this.$container);
5304
+ };
5305
+
5306
+ Select2.prototype._registerDomEvents = function () {
5307
+ var self = this;
5308
+
5309
+ this.$element.on('change.select2', function () {
5310
+ self.dataAdapter.current(function (data) {
5311
+ self.trigger('selection:update', {
5312
+ data: data
5313
+ });
5314
+ });
5315
+ });
5316
+
5317
+ this.$element.on('focus.select2', function (evt) {
5318
+ self.trigger('focus', evt);
5319
+ });
5320
+
5321
+ this._syncA = Utils.bind(this._syncAttributes, this);
5322
+ this._syncS = Utils.bind(this._syncSubtree, this);
5323
+
5324
+ if (this.$element[0].attachEvent) {
5325
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
5326
+ }
5327
+
5328
+ var observer = window.MutationObserver ||
5329
+ window.WebKitMutationObserver ||
5330
+ window.MozMutationObserver
5331
+ ;
5332
+
5333
+ if (observer != null) {
5334
+ this._observer = new observer(function (mutations) {
5335
+ $.each(mutations, self._syncA);
5336
+ $.each(mutations, self._syncS);
5337
+ });
5338
+ this._observer.observe(this.$element[0], {
5339
+ attributes: true,
5340
+ childList: true,
5341
+ subtree: false
5342
+ });
5343
+ } else if (this.$element[0].addEventListener) {
5344
+ this.$element[0].addEventListener(
5345
+ 'DOMAttrModified',
5346
+ self._syncA,
5347
+ false
5348
+ );
5349
+ this.$element[0].addEventListener(
5350
+ 'DOMNodeInserted',
5351
+ self._syncS,
5352
+ false
5353
+ );
5354
+ this.$element[0].addEventListener(
5355
+ 'DOMNodeRemoved',
5356
+ self._syncS,
5357
+ false
5358
+ );
5359
+ }
5360
+ };
5361
+
5362
+ Select2.prototype._registerDataEvents = function () {
5363
+ var self = this;
5364
+
5365
+ this.dataAdapter.on('*', function (name, params) {
5366
+ self.trigger(name, params);
5367
+ });
5368
+ };
5369
+
5370
+ Select2.prototype._registerSelectionEvents = function () {
5371
+ var self = this;
5372
+ var nonRelayEvents = ['toggle', 'focus'];
5373
+
5374
+ this.selection.on('toggle', function () {
5375
+ self.toggleDropdown();
5376
+ });
5377
+
5378
+ this.selection.on('focus', function (params) {
5379
+ self.focus(params);
5380
+ });
5381
+
5382
+ this.selection.on('*', function (name, params) {
5383
+ if ($.inArray(name, nonRelayEvents) !== -1) {
5384
+ return;
5385
+ }
5386
+
5387
+ self.trigger(name, params);
5388
+ });
5389
+ };
5390
+
5391
+ Select2.prototype._registerDropdownEvents = function () {
5392
+ var self = this;
5393
+
5394
+ this.dropdown.on('*', function (name, params) {
5395
+ self.trigger(name, params);
5396
+ });
5397
+ };
5398
+
5399
+ Select2.prototype._registerResultsEvents = function () {
5400
+ var self = this;
5401
+
5402
+ this.results.on('*', function (name, params) {
5403
+ self.trigger(name, params);
5404
+ });
5405
+ };
5406
+
5407
+ Select2.prototype._registerEvents = function () {
5408
+ var self = this;
5409
+
5410
+ this.on('open', function () {
5411
+ self.$container.addClass('select2-container--open');
5412
+ });
5413
+
5414
+ this.on('close', function () {
5415
+ self.$container.removeClass('select2-container--open');
5416
+ });
5417
+
5418
+ this.on('enable', function () {
5419
+ self.$container.removeClass('select2-container--disabled');
5420
+ });
5421
+
5422
+ this.on('disable', function () {
5423
+ self.$container.addClass('select2-container--disabled');
5424
+ });
5425
+
5426
+ this.on('blur', function () {
5427
+ self.$container.removeClass('select2-container--focus');
5428
+ });
5429
+
5430
+ this.on('query', function (params) {
5431
+ if (!self.isOpen()) {
5432
+ self.trigger('open', {});
5433
+ }
5434
+
5435
+ this.dataAdapter.query(params, function (data) {
5436
+ self.trigger('results:all', {
5437
+ data: data,
5438
+ query: params
5439
+ });
5440
+ });
5441
+ });
5442
+
5443
+ this.on('query:append', function (params) {
5444
+ this.dataAdapter.query(params, function (data) {
5445
+ self.trigger('results:append', {
5446
+ data: data,
5447
+ query: params
5448
+ });
5449
+ });
5450
+ });
5451
+
5452
+ this.on('keypress', function (evt) {
5453
+ var key = evt.which;
5454
+
5455
+ if (self.isOpen()) {
5456
+ if (key === KEYS.ESC || key === KEYS.TAB ||
5457
+ (key === KEYS.UP && evt.altKey)) {
5458
+ self.close();
5459
+
5460
+ evt.preventDefault();
5461
+ } else if (key === KEYS.ENTER) {
5462
+ self.trigger('results:select', {});
5463
+
5464
+ evt.preventDefault();
5465
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5466
+ self.trigger('results:toggle', {});
5467
+
5468
+ evt.preventDefault();
5469
+ } else if (key === KEYS.UP) {
5470
+ self.trigger('results:previous', {});
5471
+
5472
+ evt.preventDefault();
5473
+ } else if (key === KEYS.DOWN) {
5474
+ self.trigger('results:next', {});
5475
+
5476
+ evt.preventDefault();
5477
+ }
5478
+ } else {
5479
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
5480
+ (key === KEYS.DOWN && evt.altKey)) {
5481
+ self.open();
5482
+
5483
+ evt.preventDefault();
5484
+ }
5485
+ }
5486
+ });
5487
+ };
5488
+
5489
+ Select2.prototype._syncAttributes = function () {
5490
+ this.options.set('disabled', this.$element.prop('disabled'));
5491
+
5492
+ if (this.options.get('disabled')) {
5493
+ if (this.isOpen()) {
5494
+ this.close();
5495
+ }
5496
+
5497
+ this.trigger('disable', {});
5498
+ } else {
5499
+ this.trigger('enable', {});
5500
+ }
5501
+ };
5502
+
5503
+ Select2.prototype._syncSubtree = function (evt, mutations) {
5504
+ var changed = false;
5505
+ var self = this;
5506
+
5507
+ // Ignore any mutation events raised for elements that aren't options or
5508
+ // optgroups. This handles the case when the select element is destroyed
5509
+ if (
5510
+ evt && evt.target && (
5511
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5512
+ )
5513
+ ) {
5514
+ return;
5515
+ }
5516
+
5517
+ if (!mutations) {
5518
+ // If mutation events aren't supported, then we can only assume that the
5519
+ // change affected the selections
5520
+ changed = true;
5521
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5522
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
5523
+ var node = mutations.addedNodes[n];
5524
+
5525
+ if (node.selected) {
5526
+ changed = true;
5527
+ }
5528
+ }
5529
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5530
+ changed = true;
5531
+ }
5532
+
5533
+ // Only re-pull the data if we think there is a change
5534
+ if (changed) {
5535
+ this.dataAdapter.current(function (currentData) {
5536
+ self.trigger('selection:update', {
5537
+ data: currentData
5538
+ });
5539
+ });
5540
+ }
5541
+ };
5542
+
5543
+ /**
5544
+ * Override the trigger method to automatically trigger pre-events when
5545
+ * there are events that can be prevented.
5546
+ */
5547
+ Select2.prototype.trigger = function (name, args) {
5548
+ var actualTrigger = Select2.__super__.trigger;
5549
+ var preTriggerMap = {
5550
+ 'open': 'opening',
5551
+ 'close': 'closing',
5552
+ 'select': 'selecting',
5553
+ 'unselect': 'unselecting',
5554
+ 'clear': 'clearing'
5555
+ };
5556
+
5557
+ if (args === undefined) {
5558
+ args = {};
5559
+ }
5560
+
5561
+ if (name in preTriggerMap) {
5562
+ var preTriggerName = preTriggerMap[name];
5563
+ var preTriggerArgs = {
5564
+ prevented: false,
5565
+ name: name,
5566
+ args: args
5567
+ };
5568
+
5569
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
5570
+
5571
+ if (preTriggerArgs.prevented) {
5572
+ args.prevented = true;
5573
+
5574
+ return;
5575
+ }
5576
+ }
5577
+
5578
+ actualTrigger.call(this, name, args);
5579
+ };
5580
+
5581
+ Select2.prototype.toggleDropdown = function () {
5582
+ if (this.options.get('disabled')) {
5583
+ return;
5584
+ }
5585
+
5586
+ if (this.isOpen()) {
5587
+ this.close();
5588
+ } else {
5589
+ this.open();
5590
+ }
5591
+ };
5592
+
5593
+ Select2.prototype.open = function () {
5594
+ if (this.isOpen()) {
5595
+ return;
5596
+ }
5597
+
5598
+ this.trigger('query', {});
5599
+ };
5600
+
5601
+ Select2.prototype.close = function () {
5602
+ if (!this.isOpen()) {
5603
+ return;
5604
+ }
5605
+
5606
+ this.trigger('close', {});
5607
+ };
5608
+
5609
+ Select2.prototype.isOpen = function () {
5610
+ return this.$container.hasClass('select2-container--open');
5611
+ };
5612
+
5613
+ Select2.prototype.hasFocus = function () {
5614
+ return this.$container.hasClass('select2-container--focus');
5615
+ };
5616
+
5617
+ Select2.prototype.focus = function (data) {
5618
+ // No need to re-trigger focus events if we are already focused
5619
+ if (this.hasFocus()) {
5620
+ return;
5621
+ }
5622
+
5623
+ this.$container.addClass('select2-container--focus');
5624
+ this.trigger('focus', {});
5625
+ };
5626
+
5627
+ Select2.prototype.enable = function (args) {
5628
+ if (this.options.get('debug') && window.console && console.warn) {
5629
+ console.warn(
5630
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
5631
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5632
+ ' instead.'
5633
+ );
5634
+ }
5635
+
5636
+ if (args == null || args.length === 0) {
5637
+ args = [true];
5638
+ }
5639
+
5640
+ var disabled = !args[0];
5641
+
5642
+ this.$element.prop('disabled', disabled);
5643
+ };
5644
+
5645
+ Select2.prototype.data = function () {
5646
+ if (this.options.get('debug') &&
5647
+ arguments.length > 0 && window.console && console.warn) {
5648
+ console.warn(
5649
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
5650
+ 'should consider setting the value instead using `$element.val()`.'
5651
+ );
5652
+ }
5653
+
5654
+ var data = [];
5655
+
5656
+ this.dataAdapter.current(function (currentData) {
5657
+ data = currentData;
5658
+ });
5659
+
5660
+ return data;
5661
+ };
5662
+
5663
+ Select2.prototype.val = function (args) {
5664
+ if (this.options.get('debug') && window.console && console.warn) {
5665
+ console.warn(
5666
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
5667
+ ' removed in later Select2 versions. Use $element.val() instead.'
5668
+ );
5669
+ }
5670
+
5671
+ if (args == null || args.length === 0) {
5672
+ return this.$element.val();
5673
+ }
5674
+
5675
+ var newVal = args[0];
5676
+
5677
+ if ($.isArray(newVal)) {
5678
+ newVal = $.map(newVal, function (obj) {
5679
+ return obj.toString();
5680
+ });
5681
+ }
5682
+
5683
+ this.$element.val(newVal).trigger('change');
5684
+ };
5685
+
5686
+ Select2.prototype.destroy = function () {
5687
+ this.$container.remove();
5688
+
5689
+ if (this.$element[0].detachEvent) {
5690
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
5691
+ }
5692
+
5693
+ if (this._observer != null) {
5694
+ this._observer.disconnect();
5695
+ this._observer = null;
5696
+ } else if (this.$element[0].removeEventListener) {
5697
+ this.$element[0]
5698
+ .removeEventListener('DOMAttrModified', this._syncA, false);
5699
+ this.$element[0]
5700
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
5701
+ this.$element[0]
5702
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
5703
+ }
5704
+
5705
+ this._syncA = null;
5706
+ this._syncS = null;
5707
+
5708
+ this.$element.off('.select2');
5709
+ this.$element.attr('tabindex',
5710
+ Utils.GetData(this.$element[0], 'old-tabindex'));
5711
+
5712
+ this.$element.removeClass('select2-hidden-accessible');
5713
+ this.$element.attr('aria-hidden', 'false');
5714
+ Utils.RemoveData(this.$element[0]);
5715
+
5716
+ this.dataAdapter.destroy();
5717
+ this.selection.destroy();
5718
+ this.dropdown.destroy();
5719
+ this.results.destroy();
5720
+
5721
+ this.dataAdapter = null;
5722
+ this.selection = null;
5723
+ this.dropdown = null;
5724
+ this.results = null;
5725
+ };
5726
+
5727
+ Select2.prototype.render = function () {
5728
+ var $container = $(
5729
+ '<span class="select2 select2-container">' +
5730
+ '<span class="selection"></span>' +
5731
+ '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
5732
+ '</span>'
5733
+ );
5734
+
5735
+ $container.attr('dir', this.options.get('dir'));
5736
+
5737
+ this.$container = $container;
5738
+
5739
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
5740
+
5741
+ Utils.StoreData($container[0], 'element', this.$element);
5742
+
5743
+ return $container;
5744
+ };
5745
+
5746
+ return Select2;
5747
+ });
5748
+
5749
+ S2.define('jquery-mousewheel',[
5750
+ 'jquery'
5751
+ ], function ($) {
5752
+ // Used to shim jQuery.mousewheel for non-full builds.
5753
+ return $;
5754
+ });
5755
+
5756
+ S2.define('jquery.select2',[
5757
+ 'jquery',
5758
+ 'jquery-mousewheel',
5759
+
5760
+ './select2/core',
5761
+ './select2/defaults',
5762
+ './select2/utils'
5763
+ ], function ($, _, Select2, Defaults, Utils) {
5764
+ if ($.fn.select2 == null) {
5765
+ // All methods that should return the element
5766
+ var thisMethods = ['open', 'close', 'destroy'];
5767
+
5768
+ $.fn.select2 = function (options) {
5769
+ options = options || {};
5770
+
5771
+ if (typeof options === 'object') {
5772
+ this.each(function () {
5773
+ var instanceOptions = $.extend(true, {}, options);
5774
+
5775
+ var instance = new Select2($(this), instanceOptions);
5776
+ });
5777
+
5778
+ return this;
5779
+ } else if (typeof options === 'string') {
5780
+ var ret;
5781
+ var args = Array.prototype.slice.call(arguments, 1);
5782
+
5783
+ this.each(function () {
5784
+ var instance = Utils.GetData(this, 'select2');
5785
+
5786
+ if (instance == null && window.console && console.error) {
5787
+ console.error(
5788
+ 'The select2(\'' + options + '\') method was called on an ' +
5789
+ 'element that is not using Select2.'
5790
+ );
5791
+ }
5792
+
5793
+ ret = instance[options].apply(instance, args);
5794
+ });
5795
+
5796
+ // Check if we should be returning `this`
5797
+ if ($.inArray(options, thisMethods) > -1) {
5798
+ return this;
5799
+ }
5800
+
5801
+ return ret;
5802
+ } else {
5803
+ throw new Error('Invalid arguments for Select2: ' + options);
5804
+ }
5805
+ };
5806
+ }
5807
+
5808
+ if ($.fn.select2.defaults == null) {
5809
+ $.fn.select2.defaults = Defaults;
5810
+ }
5811
+
5812
+ return Select2;
5813
+ });
5814
+
5815
+ // Return the AMD loader configuration so it can be used outside of this file
5816
+ return {
5817
+ define: S2.define,
5818
+ require: S2.require
5819
+ };
5820
+ }());
5821
+
5822
+ // Autoload the jQuery bindings
5823
+ // We know that all of the modules exist above this, so we're safe
5824
+ var select2 = S2.require('jquery.select2');
5825
+
5826
+ // Hold the AMD module references on the jQuery function that was just loaded
5827
+ // This allows Select2 to use the internal loader outside of this file, such
5828
+ // as in the language files.
5829
+ jQuery.fn.select2.amd = S2;
5830
+
5831
+ // Return the Select2 instance for anyone who is importing it.
5832
+ return select2;
5833
+ }));
assets/select2/js/select2.min.js ADDED
@@ -0,0 +1 @@
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.__cache={};var e=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null==b&&(a.id?(b=a.id,a.setAttribute("data-select2-id",b)):(a.setAttribute("data-select2-id",++e),b=e.toString())),b},c.StoreData=function(a,b,d){var e=c.GetUniqueElementId(a);c.__cache[e]||(c.__cache[e]={}),c.__cache[e][b]=d},c.GetData=function(b,d){var e=c.GetUniqueElementId(b);return d?c.__cache[e]&&null!=c.__cache[e][d]?c.__cache[e][d]:a(b).data(d):c.__cache[e]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b]},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(d){var e=a.map(d,function(a){return a.id.toString()});c.$results.find(".select2-results__option[aria-selected]").each(function(){var c=a(this),d=b.GetData(this,"data"),f=""+d.id;null!=d.element&&d.element.selected||null==d.element&&a.inArray(f,e)>-1?c.attr("aria-selected","true"):c.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var d=document.createElement("li");d.className="select2-results__option";var e={role:"treeitem","aria-selected":"false"};c.disabled&&(delete e["aria-selected"],e["aria-disabled"]="true"),null==c.id&&delete e["aria-selected"],null!=c._resultId&&(d.id=c._resultId),c.title&&(d.title=c.title),c.children&&(e.role="group",e["aria-label"]=c.text,delete e["aria-selected"]);for(var f in e){var g=e[f];d.setAttribute(f,g)}if(c.children){var h=a(d),i=document.createElement("strong");i.className="select2-results__group";a(i);this.template(c,i);for(var j=[],k=0;k<c.children.length;k++){var l=c.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});n.append(j),h.append(i),h.append(n)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var e=this,f=c.id+"-results";this.$results.attr("id",f),c.on("results:all",function(a){e.clear(),e.append(a.data),c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("results:append",function(a){e.append(a.data),c.isOpen()&&e.setClasses()}),c.on("query",function(a){e.hideMessages(),e.showLoading(a)}),c.on("select",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("unselect",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("open",function(){e.$results.attr("aria-expanded","true"),e.$results.attr("aria-hidden","false"),e.setClasses(),e.ensureHighlightVisible()}),c.on("close",function(){e.$results.attr("aria-expanded","false"),e.$results.attr("aria-hidden","true"),e.$results.removeAttr("aria-activedescendant")}),c.on("results:toggle",function(){var a=e.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),c.on("results:select",function(){var a=e.getHighlightedResults();if(0!==a.length){var c=b.GetData(a[0],"data");"true"==a.attr("aria-selected")?e.trigger("close",{}):e.trigger("select",{data:c})}}),c.on("results:previous",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var d=c-1;0===a.length&&(d=0);var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top,h=f.offset().top,i=e.$results.scrollTop()+(h-g);0===d?e.$results.scrollTop(0):h-g<0&&e.$results.scrollTop(i)}}),c.on("results:next",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a),d=c+1;if(!(d>=b.length)){var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top+e.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=e.$results.scrollTop()+h-g;0===d?e.$results.scrollTop(0):h>g&&e.$results.scrollTop(i)}}),c.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),c.on("results:message",function(a){e.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=e.$results.scrollTop(),c=e.$results.get(0).scrollHeight-b+a.deltaY,d=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=e.$results.height();d?(e.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(e.$results.scrollTop(e.$results.get(0).scrollHeight-e.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(c){var d=a(this),f=b.GetData(this,"data");if("true"===d.attr("aria-selected"))return void(e.options.get("multiple")?e.trigger("unselect",{originalEvent:c,data:f}):e.trigger("close",{}));e.trigger("select",{originalEvent:c,data:f})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(c){var d=b.GetData(this,"data");e.getHighlightedResults().removeClass("select2-results__option--highlighted"),e.trigger("results:focus",{data:d,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),this.$selection=c,c},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target),e=d.closest(".select2");a(".select2.select2-container--open").each(function(){a(this),this!=e[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()})},e.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.attr("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,e){var f=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){f.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!f.options.get("disabled")){var d=a(this),e=d.parent(),g=c.GetData(e[0],"data");f.trigger("unselect",{originalEvent:b,data:g})}})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.attr("title",e.title||e.text),c.StoreData(f[0],"data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var d=this.$selection.find(".select2-selection__clear");if(0!==d.length){b.stopPropagation();var e=c.GetData(d[0],"data"),f=this.$element.val();this.$element.val(this.placeholder.id);var g={data:e};if(this.trigger("clear",g),g.prevented)return void this.$element.val(f);for(var h=0;h<e.length;h++)if(g={data:e[h]},this.trigger("unselect",g),g.prevented)return void this.$element.val(f);this.$element.trigger("change"),this.trigger("toggle",{})}}},d.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},d.prototype.update=function(b,d){if(b.call(this,d),!(this.$selection.find(".select2-selection__placeholder").length>0||0===d.length)){var e=a('<span class="select2-selection__clear">&times;</span>');c.StoreData(e[0],"data",d),this.$selection.find(".select2-selection__rendered").prepend(e)}},d}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){b.RemoveData(this)})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var d;a.children?(d=document.createElement("optgroup"),d.label=a.text):(d=document.createElement("option"),void 0!==d.textContent?d.textContent=a.text:d.innerText=a.text),void 0!==a.id&&(d.value=a.id),a.disabled&&(d.disabled=!0),a.selected&&(d.selected=!0),a.title&&(d.title=a.title);var e=c(d),f=this._normalizeItem(a);return f.element=d,b.StoreData(d,"data",f),e},d.prototype.item=function(a){var d={};if(null!=(d=b.GetData(a[0],"data")))return d;if(a.is("option"))d={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){d={text:a.prop("label"),children:[],title:a.prop("title")};for(var e=a.children("option"),f=[],g=0;g<e.length;g++){var h=c(e[g]),i=this.item(h);f.push(i)}d.children=f}return d=this._normalizeItem(d),d.element=a[0],b.StoreData(a[0],"data",d),d},d.prototype._normalizeItem=function(a){a!==Object(a)&&(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",["../utils"],function(a){function b(){}return b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},b.prototype._handleSelectOnClose=function(b,c){if(c&&null!=c.originalSelect2Event){var d=c.originalSelect2Event;if("select"===d._type||"unselect"===d._type)return}var e=this.getHighlightedResults();if(!(e.length<1)){var f=a.GetData(e[0],"data");null!=f.element&&f.element.selected||null==f.element&&f.selected||this.trigger("select",{data:f})}},b}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(a,b,c,d,e){if(null==a.fn.select2){var f=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,g=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=a[b].apply(a,g)}),a.inArray(b,f)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
assets/slippry/images/arrows.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="100px" height="50px" viewBox="0 0 100 50" enable-background="new 0 0 100 50" xml:space="preserve">
6
+ <polyline fill="none" stroke="#4D4D4D" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
7
+ 26.232,35.01 15.039,23.817 25.865,12.99 "/>
8
+ <polyline fill="none" stroke="#4D4D4D" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
9
+ 73.693,35.69 85.578,23.805 74.083,12.31 "/>
10
+ </svg>
assets/slippry/images/sy-loader.gif ADDED
Binary file
assets/slippry/slippry.css ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * slippry v1.4.0 - Responsive content slider for jQuery
4
+ * http://slippry.com
5
+ *
6
+ * Authors: Lukas Jakob Hafner - @saftsaak
7
+ * Thomas Hurd - @SeenNotHurd
8
+ *
9
+ * Copyright 2016, booncon oy - http://booncon.com
10
+ *
11
+ *
12
+ * Released under the MIT license - http://opensource.org/licenses/MIT
13
+ */
14
+ /* kenBurns animations, very basic */
15
+ @-webkit-keyframes left-right {
16
+ 0% {
17
+ -webkit-transform: translateY(-20%) translateX(-10%);
18
+ transform: translateY(-20%) translateX(-10%); }
19
+ 100% {
20
+ -webkit-transform: translateY(0%) translateX(10%);
21
+ transform: translateY(0%) translateX(10%); } }
22
+ @-o-keyframes left-right {
23
+ 0% {
24
+ -o-transform: translateY(-20%) translateX(-10%);
25
+ transform: translateY(-20%) translateX(-10%); }
26
+ 100% {
27
+ -o-transform: translateY(0%) translateX(10%);
28
+ transform: translateY(0%) translateX(10%); } }
29
+ @keyframes left-right {
30
+ 0% {
31
+ -webkit-transform: translateY(-20%) translateX(-10%);
32
+ -o-transform: translateY(-20%) translateX(-10%);
33
+ transform: translateY(-20%) translateX(-10%); }
34
+ 100% {
35
+ -webkit-transform: translateY(0%) translateX(10%);
36
+ -o-transform: translateY(0%) translateX(10%);
37
+ transform: translateY(0%) translateX(10%); } }
38
+ @-webkit-keyframes right-left {
39
+ 0% {
40
+ -webkit-transform: translateY(0%) translateX(10%);
41
+ transform: translateY(0%) translateX(10%); }
42
+ 100% {
43
+ -webkit-transform: translateY(-20%) translateX(-10%);
44
+ transform: translateY(-20%) translateX(-10%); } }
45
+ @-o-keyframes right-left {
46
+ 0% {
47
+ -o-transform: translateY(0%) translateX(10%);
48
+ transform: translateY(0%) translateX(10%); }
49
+ 100% {
50
+ -o-transform: translateY(-20%) translateX(-10%);
51
+ transform: translateY(-20%) translateX(-10%); } }
52
+ @keyframes right-left {
53
+ 0% {
54
+ -webkit-transform: translateY(0%) translateX(10%);
55
+ -o-transform: translateY(0%) translateX(10%);
56
+ transform: translateY(0%) translateX(10%); }
57
+ 100% {
58
+ -webkit-transform: translateY(-20%) translateX(-10%);
59
+ -o-transform: translateY(-20%) translateX(-10%);
60
+ transform: translateY(-20%) translateX(-10%); } }
61
+ /* added to the original element calling slippry */
62
+ .sy-box.sy-loading {
63
+ background: url("images/sy-loader.gif") 50% 50% no-repeat;
64
+ -webkit-background-size: 32px 32px;
65
+ background-size: 32px;
66
+ min-height: 40px; }
67
+ .sy-box.sy-loading .sy-slides-wrap, .sy-box.sy-loading .sy-pager {
68
+ visibility: hidden; }
69
+
70
+ /* element that wraps the slides */
71
+ .sy-slides-wrap {
72
+ position: relative;
73
+ height: 100%;
74
+ width: 100%; }
75
+ .sy-slides-wrap:hover .sy-controls {
76
+ display: block; }
77
+
78
+ /* element that crops the visible area to the slides */
79
+ .sy-slides-crop {
80
+ height: 100%;
81
+ width: 100%;
82
+ position: absolute;
83
+ overflow: hidden; }
84
+
85
+ /* list containing the slides */
86
+ .sy-list {
87
+ width: 100%;
88
+ height: 100%;
89
+ list-style: none;
90
+ margin: 0;
91
+ padding: 0;
92
+ position: absolute; }
93
+ .sy-list.horizontal {
94
+ -webkit-transition: left ease;
95
+ -o-transition: left ease;
96
+ transition: left ease; }
97
+ .sy-list.vertical {
98
+ -webkit-transition: top ease;
99
+ -o-transition: top ease;
100
+ transition: top ease; }
101
+
102
+ /* single slide */
103
+ .sy-slide {
104
+ position: absolute;
105
+ width: 100%;
106
+ z-index: 2; }
107
+ .sy-slide.kenburns {
108
+ width: 140%;
109
+ left: -20%; }
110
+ .sy-slide.kenburns.useCSS {
111
+ -webkit-transition-property: opacity;
112
+ -o-transition-property: opacity;
113
+ transition-property: opacity; }
114
+ .sy-slide.kenburns.useCSS.sy-ken:nth-child(1n) {
115
+ -webkit-animation-name: left-right;
116
+ -o-animation-name: left-right;
117
+ animation-name: left-right;
118
+ -webkit-animation-fill-mode: forwards;
119
+ -o-animation-fill-mode: forwards;
120
+ animation-fill-mode: forwards; }
121
+ .sy-slide.kenburns.useCSS.sy-ken:nth-child(2n) {
122
+ -webkit-animation-name: right-left;
123
+ -o-animation-name: right-left;
124
+ animation-name: right-left;
125
+ -webkit-animation-fill-mode: forwards;
126
+ -o-animation-fill-mode: forwards;
127
+ animation-fill-mode: forwards; }
128
+ .sy-slide.sy-active {
129
+ z-index: 3; }
130
+ .sy-slide > img {
131
+ margin: 0;
132
+ padding: 0;
133
+ display: block;
134
+ width: 100%;
135
+ border: 0; }
136
+ .sy-slide > a {
137
+ margin: 0;
138
+ padding: 0;
139
+ display: block;
140
+ width: 100%; }
141
+ .sy-slide > a > img {
142
+ margin: 0;
143
+ padding: 0;
144
+ display: block;
145
+ width: 100%;
146
+ border: 0; }
147
+
148
+ /* next/ prev buttons, with arrows and clickable area a lot larger than the visible buttons */
149
+ .sy-controls {
150
+ display: none;
151
+ list-style: none;
152
+ height: 100%;
153
+ width: 100%;
154
+ position: absolute;
155
+ padding: 0;
156
+ margin: 0; }
157
+ .sy-controls li {
158
+ position: absolute;
159
+ width: 10%;
160
+ min-width: 4.2em;
161
+ height: 100%;
162
+ z-index: 33; }
163
+ .sy-controls li.sy-prev {
164
+ left: 0;
165
+ top: 0; }
166
+ .sy-controls li.sy-prev a:after {
167
+ background-position: -5% 0; }
168
+ .sy-controls li.sy-next {
169
+ right: 0;
170
+ top: 0; }
171
+ .sy-controls li.sy-next a:after {
172
+ background-position: 105% 0; }
173
+ .sy-controls li a {
174
+ position: relative;
175
+ width: 100%;
176
+ height: 100%;
177
+ display: block;
178
+ text-decoration: none;
179
+ box-shadow: none;
180
+ text-indent: -9999px; }
181
+ .sy-controls li a:link, .sy-controls li a:visited {
182
+ opacity: 0.4; }
183
+ .sy-controls li a:hover, .sy-controls li a:focus {
184
+ opacity: 0.8;
185
+ outline: none; }
186
+ .sy-controls li a:after {
187
+ content: "";
188
+ background-image: url("images/arrows.svg");
189
+ background-repeat: no-repeat;
190
+ -webkit-background-size: cover;
191
+ background-size: cover;
192
+ text-align: center;
193
+ text-indent: 0;
194
+ line-height: 2.8em;
195
+ color: #111;
196
+ font-weight: 800;
197
+ position: absolute;
198
+ background-color: #fff;
199
+ width: 2.8em;
200
+ height: 2.8em;
201
+ left: 50%;
202
+ top: 50%;
203
+ margin-top: -1.4em;
204
+ margin-left: -1.4em;
205
+ border-radius: 50%; }
206
+ @media only screen and (max-device-width: 600px) {
207
+ .sy-controls {
208
+ display: block; }
209
+ .sy-controls li {
210
+ min-width: 2.1em; }
211
+ .sy-controls li a:after {
212
+ width: 1.4em;
213
+ height: 1.4em;
214
+ margin-top: -0.7em;
215
+ margin-left: -0.7em; } }
216
+
217
+ /* captions, styled fo the overlay variant */
218
+ .sy-caption-wrap {
219
+ position: absolute;
220
+ bottom: 2em;
221
+ z-index: 12;
222
+ left: 50%; }
223
+ .sy-caption-wrap .sy-caption {
224
+ position: relative;
225
+ left: -50%;
226
+ background-color: rgba(0, 0, 0, 0.54);
227
+ color: #fff;
228
+ padding: 0.4em 1em;
229
+ border-radius: 1.2em; }
230
+ .sy-caption-wrap .sy-caption a:link, .sy-caption-wrap .sy-caption a:visited {
231
+ color: #e24b70;
232
+ font-weight: 600;
233
+ text-decoration: none; }
234
+ .sy-caption-wrap .sy-caption a:hover, .sy-caption-wrap .sy-caption a:focus {
235
+ text-decoration: underline; }
236
+ @media only screen and (max-device-width: 600px), screen and (max-width: 600px) {
237
+ .sy-caption-wrap {
238
+ left: 0;
239
+ bottom: 0.4em; }
240
+ .sy-caption-wrap .sy-caption {
241
+ left: 0;
242
+ padding: 0.2em 0.4em;
243
+ font-size: 0.92em;
244
+ border-radius: 0; } }
245
+
246
+ /* pager bubbles */
247
+ .sy-pager {
248
+ clear: both;
249
+ display: block;
250
+ width: 100%;
251
+ margin: 1em 0 0;
252
+ padding: 0;
253
+ list-style: none;
254
+ text-align: center; }
255
+ .sy-pager li {
256
+ display: inline-block;
257
+ width: 1.2em;
258
+ height: 1.2em;
259
+ margin: 0 1em 0 0;
260
+ border-radius: 50%; }
261
+ .sy-pager li.sy-active a {
262
+ background-color: #e24b70; }
263
+ .sy-pager li a {
264
+ width: 100%;
265
+ height: 100%;
266
+ display: block;
267
+ background-color: #ccc;
268
+ text-indent: -9999px;
269
+ -webkit-background-size: 2em 2em;
270
+ background-size: 2em;
271
+ border-radius: 50%;
272
+ text-decoration: none;
273
+ box-shadow: none; }
274
+ .sy-pager li a:link, .sy-pager li a:visited {
275
+ opacity: 1.0; }
276
+ .sy-pager li a:hover, .sy-pager li a:focus {
277
+ opacity: 0.6; }
278
+
279
+ /* element to "keep/ fill" the space of the content, gets intrinsic height via js */
280
+ .sy-filler {
281
+ width: 100%; }
282
+ .sy-filler.ready {
283
+ -webkit-transition: padding 600ms ease;
284
+ -o-transition: padding 600ms ease;
285
+ transition: padding 600ms ease; }
assets/slippry/slippry.js ADDED
@@ -0,0 +1,710 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @preserve
2
+ *
3
+ * slippry v1.4.0 - Responsive content slider for jQuery
4
+ * http://slippry.com
5
+ *
6
+ * Authors: Lukas Jakob Hafner - @saftsaak
7
+ * Thomas Hurd - @SeenNotHurd
8
+ *
9
+ * Copyright 2016, booncon oy - http://booncon.com
10
+ *
11
+ *
12
+ * Released under the MIT license - http://opensource.org/licenses/MIT
13
+ */
14
+
15
+ ( function ( $ ) {
16
+ "use strict";
17
+ var defaults;
18
+
19
+ defaults = {
20
+ // general elements & wrapper
21
+ slippryWrapper: '<div class="sy-box" />', // wrapper to wrap everything, including pager
22
+ slideWrapper: '<div class="sy-slides-wrap" />', // wrapper to wrap sildes & controls
23
+ slideCrop: '<div class="sy-slides-crop" />', //additional wrapper around just the slides
24
+ boxClass: 'sy-list', // class that goes to original element
25
+ elements: 'li', // elments cointaining slide content
26
+ activeClass: 'sy-active', // class for current slide
27
+ fillerClass: 'sy-filler', // class for element that acts as intrinsic placholder
28
+ loadingClass: 'sy-loading',
29
+
30
+ // options
31
+ adaptiveHeight: true, // height of the sliders adapts to current slide
32
+ start: 1, // num (starting from 1), random
33
+ loop: true, // first -> last & last -> first arrows
34
+ captionsSrc: 'img', // img, el [img takes caption from alt or title, el from title of slide element]
35
+ captions: 'overlay', // Position: overlay, below, custom, false
36
+ captionsEl: '.sy-caption', // $ selector for captions wrapper
37
+ initSingle: true, // initialise even if there is only one slide
38
+ responsive: true,
39
+ preload: 'visible', // visible, all | resources to wait for until showing slider
40
+
41
+ // pager
42
+ pager: true,
43
+ pagerClass: 'sy-pager',
44
+
45
+ // controls
46
+ controls: true,
47
+ controlClass: 'sy-controls',
48
+ prevClass: 'sy-prev',
49
+ prevText: 'Previous',
50
+ nextClass: 'sy-next',
51
+ nextText: 'Next',
52
+ hideOnEnd: true,
53
+
54
+ // transitions
55
+ transition: 'fade', // fade, horizontal, vertical, kenburns, false
56
+ kenZoom: 120, // max zoom for kenburns (in %)
57
+ slideMargin: 0, // spacing between slides (in %)
58
+ transClass: 'transition', // [Class applied to [element] while a transition is taking place.]
59
+ speed: 800, // time the transition takes (ms)
60
+ easing: 'swing', // easing to use in the animation [(see... [jquery www])]
61
+ continuous: true, // seamless first/ last transistion, only works with loop
62
+ useCSS: true, // true, false -> fallback to js if no browser support
63
+
64
+ //slideshow
65
+ auto: true,
66
+ autoDirection: 'next',
67
+ autoHover: true,
68
+ autoHoverDelay: 100,
69
+ autoDelay: 500,
70
+ pause: 4000,
71
+
72
+ // callback functions
73
+ onSliderLoad: function () { // when slider loaded
74
+ return this;
75
+ },
76
+ onSlideBefore: function () { // before page transition starts
77
+ return this;
78
+ },
79
+ onSlideAfter: function () { // after page transition happened
80
+ return this;
81
+ }
82
+ };
83
+
84
+ $.fn.slippry = function ( options ) {
85
+ var slip, el, prepareFiller, getFillerProportions, init, updateCaption, initPager, initControls, ready, transitionDone, whichTransitionEvent,
86
+ initCaptions, updatePager, setFillerProportions, doTransition, updateSlide, openSlide, updateControls, updatePos, supports, preload, start, elFromSel, doKens;
87
+
88
+ // reference to the object calling the function
89
+ el = this;
90
+
91
+ // if no elements just stop
92
+ if ( el.length === 0 ) {
93
+ return this;
94
+ }
95
+ // support mutltiple elements
96
+ if ( el.length > 1 ) {
97
+ el.each( function () {
98
+ $( this ).slippry( options );
99
+ } );
100
+ return this;
101
+ }
102
+
103
+ // variable to access the slider settings across the plugin
104
+ slip = { };
105
+ slip.vars = { };
106
+
107
+ whichTransitionEvent = function () { // Thanks! http://stackoverflow.com/a/18672988
108
+ var t, div, transitions;
109
+ div = document.createElement( 'div' );
110
+ transitions = {
111
+ 'WebkitTransition': 'webkitTransitionEnd',
112
+ 'MozTransition': 'transitionend',
113
+ 'MSTransition': 'msTransitionEnd',
114
+ 'OTransition': 'oTransitionEnd',
115
+ 'transition': 'transitionEnd transitionend'
116
+ };
117
+ for ( t in transitions ) {
118
+ if ( div.style[t] !== undefined ) {
119
+ return transitions[t];
120
+ }
121
+ }
122
+ };
123
+
124
+ supports = ( function () { // Thanks! http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-detect-css-support-in-browsers-with-javascript/
125
+ var div = document.createElement( 'div' ),
126
+ vendors = [ 'Khtml', 'Ms', 'O', 'Moz', 'Webkit' ],
127
+ len = vendors.length;
128
+ return function ( prop ) {
129
+ if ( prop in div.style ) {
130
+ return true;
131
+ }
132
+ prop = prop.replace( /^[a-z]/, function ( val ) {
133
+ return val.toUpperCase();
134
+ } );
135
+ while ( len-- ) {
136
+ if ( vendors[len] + prop in div.style ) {
137
+ return true;
138
+ }
139
+ }
140
+ return false;
141
+ };
142
+ }() );
143
+
144
+ elFromSel = function ( sel, prop ) {
145
+ var props, newelement, id, className;
146
+ props = prop.split( '.' );
147
+ newelement = $( sel );
148
+ id = '';
149
+ className = '';
150
+ $.each( props, function ( i, val ) {
151
+ if ( val.indexOf( '#' ) >= 0 ) {
152
+ id += val.replace( /^#/, '' );
153
+ } else {
154
+ className += val + ' ';
155
+ }
156
+ } );
157
+ if ( id.length ) {
158
+ newelement.attr( 'id', id );
159
+ }
160
+ if ( className.length ) {
161
+ newelement.attr( 'class', $.trim( className ) );
162
+ }
163
+ return newelement;
164
+ };
165
+
166
+ doKens = function () {
167
+ var kenStart, kenTime, animProp, cssProp;
168
+ animProp = { };
169
+ cssProp = { };
170
+ kenStart = 100 - slip.settings.kenZoom;
171
+ cssProp.width = slip.settings.kenZoom + '%';
172
+ if ( slip.vars.active.index() % 2 === 0 ) {
173
+ cssProp.left = kenStart + '%';
174
+ cssProp.top = kenStart + '%';
175
+ animProp.left = '0%';
176
+ animProp.top = '0%';
177
+ } else {
178
+ cssProp.left = '0%';
179
+ cssProp.top = '0%';
180
+ animProp.left = kenStart + '%';
181
+ animProp.top = kenStart + '%';
182
+ }
183
+ kenTime = slip.settings.pause + slip.settings.speed * 2;
184
+ slip.vars.active.css( cssProp );
185
+ slip.vars.active.animate( animProp, { duration: kenTime, easing: slip.settings.easing, queue: false } );
186
+ };
187
+
188
+ ready = function () {
189
+ if ( slip.vars.fresh ) {
190
+ slip.vars.slippryWrapper.removeClass( slip.settings.loadingClass );
191
+ slip.vars.fresh = false;
192
+ if ( slip.settings.auto ) {
193
+ el.startAuto();
194
+ }
195
+ if ( !slip.settings.useCSS && slip.settings.transition === 'kenburns' ) {
196
+ doKens();
197
+ }
198
+ slip.settings.onSliderLoad.call( undefined, slip.vars.active.index() );
199
+ } else {
200
+ $( '.' + slip.settings.fillerClass, slip.vars.slideWrapper ).addClass( 'ready' );
201
+ }
202
+ };
203
+
204
+ setFillerProportions = function ( width, height ) {
205
+ var ratio, p_top, $filler;
206
+ ratio = width / height;
207
+ p_top = 1 / ratio * 100 + '%'; //cool intrinsic trick: http://alistapart.com/article/creating-intrinsic-ratios-for-video
208
+ $filler = $( '.' + slip.settings.fillerClass, slip.vars.slideWrapper );
209
+ $filler.css( { paddingTop: p_top } ); // resizing without the need of js, true responsiveness :)
210
+ ready();
211
+ };
212
+
213
+ // gets the aspect ratio of the filler element
214
+ getFillerProportions = function ( $slide ) {
215
+ var width, height;
216
+ if ( ( $( 'img', $slide ).attr( "src" ) !== undefined ) ) {
217
+ $( "<img />" ).on( "load", function () {
218
+ width = $slide.width();
219
+ height = $slide.height();
220
+ setFillerProportions( width, height );
221
+ } ).attr( "src", $( 'img', $slide ).attr( "src" ) );
222
+ } else {
223
+ width = $slide.width();
224
+ height = $slide.height();
225
+ setFillerProportions( width, height );
226
+ }
227
+ };
228
+
229
+ // prepares a div to occupy the needed space
230
+ prepareFiller = function () {
231
+ if ( $( '.' + slip.settings.fillerClass, slip.vars.slideWrapper ).length === 0 ) {
232
+ slip.vars.slideWrapper.append( $( '<div class="' + slip.settings.fillerClass + '" />' ) );
233
+ }
234
+ if ( slip.settings.adaptiveHeight === true ) { // if the slides shoud alwas adapt to their content
235
+ getFillerProportions( $( '.' + slip.settings.activeClass, el ) ); // set the filler height on the active element
236
+ } else { // otherwise get the highest element
237
+ var $highest, height, loop;
238
+ height = 0;
239
+ loop = 0;
240
+ $( slip.vars.slides ).each( function () {
241
+ if ( $( this ).height() > height ) {
242
+ $highest = $( this );
243
+ height = $highest.height();
244
+ }
245
+ loop = loop + 1;
246
+ if ( loop === slip.vars.count ) {
247
+ if ( $highest === undefined ) {
248
+ $highest = $( $( slip.vars.slides )[0] );
249
+ }
250
+ getFillerProportions( $highest );
251
+ }
252
+ } );
253
+ }
254
+ };
255
+
256
+ updatePager = function () {
257
+ if ( slip.settings.pager ) {
258
+ $( '.' + slip.settings.pagerClass + ' li', slip.vars.slippryWrapper ).removeClass( slip.settings.activeClass );
259
+ $( $( '.' + slip.settings.pagerClass + ' li', slip.vars.slippryWrapper )[slip.vars.active.index()] ).addClass( slip.settings.activeClass );
260
+ }
261
+ };
262
+
263
+ updateControls = function () {
264
+ if ( !slip.settings.loop && slip.settings.hideOnEnd ) {
265
+ $( '.' + slip.settings.prevClass, slip.vars.slippryWrapper )[slip.vars.first ? 'hide' : 'show']();
266
+ $( '.' + slip.settings.nextClass, slip.vars.slippryWrapper )[slip.vars.last ? 'hide' : 'show']();
267
+ }
268
+ };
269
+
270
+ updateCaption = function () {
271
+ var caption, wrapper;
272
+ if ( slip.settings.captions !== false ) {
273
+ if ( slip.settings.captionsSrc !== 'img' ) {
274
+ caption = slip.vars.active.attr( 'title' );
275
+ } else {
276
+ caption = $( 'img', slip.vars.active ).attr( 'title' ) !== undefined ? $( 'img', slip.vars.active ).attr( 'title' ) : $( 'img', slip.vars.active ).attr( 'alt' );
277
+ }
278
+ if ( slip.settings.captions !== 'custom' ) {
279
+ wrapper = $( slip.settings.captionsEl, slip.vars.slippryWrapper );
280
+ } else {
281
+ wrapper = $( slip.settings.captionsEl );
282
+ }
283
+ if ( ( caption !== undefined ) && ( caption !== '' ) ) {
284
+ wrapper.html( caption ).show();
285
+ } else {
286
+ wrapper.hide();
287
+ }
288
+ }
289
+ };
290
+
291
+ el.startAuto = function () {
292
+ if ( ( slip.vars.timer === undefined ) && ( slip.vars.delay === undefined ) ) {
293
+ slip.vars.delay = window.setTimeout( function () {
294
+ slip.vars.autodelay = false;
295
+ slip.vars.timer = window.setInterval( function () {
296
+ slip.vars.trigger = 'auto';
297
+ openSlide( slip.settings.autoDirection );
298
+ }, slip.settings.pause );
299
+ }, slip.vars.autodelay ? slip.settings.autoHoverDelay : slip.settings.autoDelay );
300
+ if ( slip.settings.autoHover ) {
301
+ slip.vars.slideWrapper.unbind( 'mouseenter' ).unbind( 'mouseleave' ).bind( 'mouseenter', function () {
302
+ if ( slip.vars.timer !== undefined ) {
303
+ slip.vars.hoverStop = true;
304
+ el.stopAuto();
305
+ } else {
306
+ slip.vars.hoverStop = false;
307
+ }
308
+ } ).bind( 'mouseleave', function () {
309
+ if ( slip.vars.hoverStop ) {
310
+ slip.vars.autodelay = true;
311
+ el.startAuto();
312
+ }
313
+ } );
314
+ }
315
+ }
316
+ };
317
+
318
+ el.stopAuto = function () {
319
+ window.clearInterval( slip.vars.timer );
320
+ slip.vars.timer = undefined;
321
+ window.clearTimeout( slip.vars.delay );
322
+ slip.vars.delay = undefined;
323
+ };
324
+
325
+ // refreshes the already initialised slider
326
+ el.refresh = function () {
327
+ slip.vars.slides.removeClass( slip.settings.activeClass );
328
+ slip.vars.active.addClass( slip.settings.activeClass );
329
+ if ( slip.settings.responsive ) {
330
+ prepareFiller();
331
+ } else {
332
+ ready();
333
+ }
334
+ updateControls();
335
+ updatePager();
336
+ updateCaption();
337
+ };
338
+
339
+ updateSlide = function () {
340
+ el.refresh();
341
+ };
342
+
343
+ transitionDone = function () {
344
+ slip.vars.moving = false;
345
+ slip.vars.active.removeClass( slip.settings.transClass );
346
+ if ( !slip.vars.fresh ) {
347
+ slip.vars.old.removeClass( 'sy-ken' );
348
+ }
349
+ slip.vars.old.removeClass( slip.settings.transClass );
350
+ slip.settings.onSlideAfter.call( undefined, slip.vars.active, slip.vars.old.index(), slip.vars.active.index() );
351
+ if ( slip.settings.auto ) {
352
+ if ( !slip.vars.hoverStop || slip.vars.hoverStop === undefined ) {
353
+ el.startAuto();
354
+ }
355
+ }
356
+ };
357
+
358
+ doTransition = function () {
359
+ var pos, jump, old_left, old_pos, kenTime, ref, cssProp;
360
+ slip.settings.onSlideBefore.call( undefined, slip.vars.active, slip.vars.old.index(), slip.vars.active.index() );
361
+ if ( slip.settings.transition !== false ) {
362
+ slip.vars.moving = true;
363
+ if ( ( slip.settings.transition === 'fade' ) || ( slip.settings.transition === 'kenburns' ) ) {
364
+ if ( slip.vars.fresh ) {
365
+ if ( slip.settings.useCSS ) {
366
+ slip.vars.slides.css( { transitionDuration: slip.settings.speed + 'ms', opacity: 0 } );
367
+ } else {
368
+ slip.vars.slides.css( { opacity: 0 } );
369
+ }
370
+ slip.vars.active.css( 'opacity', 1 );
371
+ if ( slip.settings.transition === 'kenburns' ) {
372
+ if ( slip.settings.useCSS ) {
373
+ kenTime = slip.settings.pause + slip.settings.speed * 2;
374
+ slip.vars.slides.css( { animationDuration: kenTime + 'ms' } );
375
+ slip.vars.active.addClass( 'sy-ken' );
376
+ }
377
+ }
378
+ transitionDone();
379
+ } else {
380
+ if ( slip.settings.useCSS ) {
381
+ slip.vars.old.addClass( slip.settings.transClass ).css( 'opacity', 0 );
382
+ slip.vars.active.addClass( slip.settings.transClass ).css( 'opacity', 1 );
383
+ if ( slip.settings.transition === 'kenburns' ) {
384
+ slip.vars.active.addClass( 'sy-ken' );
385
+ }
386
+ $( window ).off( 'focus' ).on( 'focus', function () { // bugfix for safari 7 which doesn't always trigger ontransitionend when switching tab
387
+ if ( slip.vars.moving ) {
388
+ slip.vars.old.trigger( slip.vars.transition );
389
+ }
390
+ } );
391
+ slip.vars.old.one( slip.vars.transition, function () {
392
+ transitionDone();
393
+ return this;
394
+ } );
395
+ } else {
396
+ if ( slip.settings.transition === 'kenburns' ) {
397
+ doKens();
398
+ }
399
+ slip.vars.old.addClass( slip.settings.transClass ).animate( {
400
+ opacity: 0
401
+ }, slip.settings.speed, slip.settings.easing, function () {
402
+ transitionDone();
403
+ } );
404
+ slip.vars.active.addClass( slip.settings.transClass ).css( 'opacity', 0 ).animate( {
405
+ opacity: 1
406
+ }, slip.settings.speed, slip.settings.easing );
407
+ }
408
+ }
409
+ updateSlide();
410
+ } else if ( ( slip.settings.transition === 'horizontal' ) || ( slip.settings.transition === 'vertical' ) ) {
411
+ ref = ( slip.settings.transition === 'horizontal' ) ? 'left' : 'top';
412
+ pos = '-' + slip.vars.active.index() * ( 100 + slip.settings.slideMargin ) + '%';
413
+ if ( slip.vars.fresh ) {
414
+ el.css( ref, pos );
415
+ transitionDone();
416
+ } else {
417
+ cssProp = { };
418
+ if ( slip.settings.continuous ) {
419
+ if ( slip.vars.jump && ( ( slip.vars.trigger === 'controls' ) || ( slip.vars.trigger === 'auto' ) ) ) {
420
+ jump = true;
421
+ old_pos = pos;
422
+ if ( slip.vars.first ) {
423
+ old_left = 0;
424
+ slip.vars.active.css( ref, slip.vars.count * ( 100 + slip.settings.slideMargin ) + '%' );
425
+ pos = '-' + slip.vars.count * ( 100 + slip.settings.slideMargin ) + '%';
426
+ } else {
427
+ old_left = ( slip.vars.count - 1 ) * ( 100 + slip.settings.slideMargin ) + '%';
428
+ slip.vars.active.css( ref, -( 100 + slip.settings.slideMargin ) + '%' );
429
+ pos = ( 100 + slip.settings.slideMargin ) + '%';
430
+ }
431
+ }
432
+ }
433
+ slip.vars.active.addClass( slip.settings.transClass );
434
+ if ( slip.settings.useCSS ) {
435
+ cssProp[ref] = pos;
436
+ cssProp.transitionDuration = slip.settings.speed + 'ms';
437
+ el.addClass( slip.settings.transition );
438
+ el.css( cssProp );
439
+ $( window ).off( 'focus' ).on( 'focus', function () { // bugfix for safari 7 which doesn't always trigger ontransitionend when switching tab
440
+ if ( slip.vars.moving ) {
441
+ el.trigger( slip.vars.transition );
442
+ }
443
+ } );
444
+ el.one( slip.vars.transition, function () {
445
+ el.removeClass( slip.settings.transition );
446
+ if ( jump ) {
447
+ slip.vars.active.css( ref, old_left );
448
+ cssProp[ref] = old_pos;
449
+ cssProp.transitionDuration = '0ms';
450
+ el.css( cssProp );
451
+ }
452
+ transitionDone();
453
+ return this;
454
+ } );
455
+ } else {
456
+ cssProp[ref] = pos;
457
+ el.stop().animate( cssProp, slip.settings.speed, slip.settings.easing, function () {
458
+ if ( jump ) {
459
+ slip.vars.active.css( ref, old_left );
460
+ el.css( ref, old_pos );
461
+ }
462
+ transitionDone();
463
+ return this;
464
+ } );
465
+ }
466
+ }
467
+ updateSlide();
468
+ }
469
+ } else {
470
+ updateSlide();
471
+ transitionDone();
472
+ }
473
+ };
474
+
475
+ updatePos = function ( slide ) {
476
+ slip.vars.first = slip.vars.last = false;
477
+ if ( ( slide === 'prev' ) || ( slide === 0 ) ) {
478
+ slip.vars.first = true;
479
+ } else if ( ( slide === 'next' ) || ( slide === slip.vars.count - 1 ) ) {
480
+ slip.vars.last = true;
481
+ }
482
+ };
483
+
484
+ openSlide = function ( slide ) {
485
+ var current, direction;
486
+ if ( !slip.vars.moving ) {
487
+ if ( slip.vars.trigger !== 'auto' ) {
488
+ el.stopAuto();
489
+ }
490
+ current = slip.vars.active.index();
491
+ if ( slide === 'prev' ) {
492
+ direction = slide;
493
+ if ( current > 0 ) {
494
+ slide = current - 1;
495
+ } else if ( slip.settings.loop ) {
496
+ slide = slip.vars.count - 1;
497
+ }
498
+ } else if ( slide === 'next' ) {
499
+ direction = slide;
500
+ if ( current < slip.vars.count - 1 ) {
501
+ slide = current + 1;
502
+ } else if ( slip.settings.loop ) {
503
+ slide = 0;
504
+ }
505
+ } else {
506
+ slide = slide - 1;
507
+ direction = slide < current ? 'prev' : 'next';
508
+ }
509
+ slip.vars.jump = false;
510
+ if ( ( slide !== 'prev' ) && ( slide !== 'next' ) && ( ( slide !== current ) || ( slip.vars.fresh ) ) ) {
511
+ updatePos( slide );
512
+ slip.vars.old = slip.vars.active;
513
+ slip.vars.active = $( slip.vars.slides[slide] );
514
+ if ( ( ( current === 0 ) && ( direction === 'prev' ) ) || ( ( current === slip.vars.count - 1 ) && ( direction === 'next' ) ) ) {
515
+ slip.vars.jump = true;
516
+ }
517
+ doTransition();
518
+ }
519
+ }
520
+ };
521
+
522
+ el.goToSlide = function ( slide ) {
523
+ slip.vars.trigger = 'external';
524
+ openSlide( slide );
525
+ };
526
+
527
+ el.goToNextSlide = function () {
528
+ slip.vars.trigger = 'external';
529
+ openSlide( 'next' );
530
+ };
531
+
532
+ el.goToPrevSlide = function () {
533
+ slip.vars.trigger = 'external';
534
+ openSlide( 'prev' );
535
+ };
536
+
537
+ initPager = function () {
538
+ if ( ( slip.settings.pager ) && ( slip.vars.count > 1 ) ) {
539
+ var count, loop, pager;
540
+ count = slip.vars.slides.length;
541
+ pager = $( '<ul class="' + slip.settings.pagerClass + '" />' );
542
+ for ( loop = 1; loop < count + 1; loop = loop + 1 ) {
543
+ pager.append( $( '<li />' ).append( $( '<a href="#' + loop + '">' + loop + '</a>' ) ) );
544
+ }
545
+ slip.vars.slippryWrapper.append( pager );
546
+ $( '.' + slip.settings.pagerClass + ' a', slip.vars.slippryWrapper ).click( function () {
547
+ slip.vars.trigger = 'pager';
548
+ openSlide( parseInt( this.hash.split( '#' )[1], 10 ) );
549
+ return false;
550
+ } );
551
+ updatePager();
552
+ }
553
+ };
554
+
555
+ initControls = function () {
556
+ if ( ( slip.settings.controls ) && ( slip.vars.count > 1 ) ) {
557
+ slip.vars.slideWrapper.append(
558
+ $( '<ul class="' + slip.settings.controlClass + '" />' )
559
+ .append( '<li class="' + slip.settings.prevClass + '"><a href="#prev">' + slip.settings.prevText + '</a></li>' )
560
+ .append( '<li class="' + slip.settings.nextClass + '"><a href="#next">' + slip.settings.nextText + '</a></li>' )
561
+ );
562
+ $( '.' + slip.settings.controlClass + ' a', slip.vars.slippryWrapper ).click( function () {
563
+ slip.vars.trigger = 'controls';
564
+ openSlide( this.hash.split( '#' )[1] );
565
+ return false;
566
+ } );
567
+ updateControls();
568
+ }
569
+ };
570
+
571
+ initCaptions = function () {
572
+ if ( slip.settings.captions !== false ) {
573
+ if ( slip.settings.captions === 'overlay' ) {
574
+ slip.vars.slideWrapper.append( $( '<div class="sy-caption-wrap" />' ).html( elFromSel( '<div />', slip.settings.captionsEl ) ) );
575
+ } else if ( slip.settings.captions === 'below' ) {
576
+ slip.vars.slippryWrapper.append( $( '<div class="sy-caption-wrap" />' ).html( elFromSel( '<div />', slip.settings.captionsEl ) ) );
577
+ }
578
+ }
579
+ };
580
+
581
+ // actually show the first slide
582
+ start = function () {
583
+ openSlide( slip.vars.active.index() + 1 );
584
+ };
585
+
586
+ // wait for images, iframes to be loaded
587
+ preload = function ( slides ) {
588
+ var count, loop, elements, container;
589
+ container = ( slip.settings.preload === 'all' ) ? slides : slip.vars.active;
590
+ elements = $( 'img, iframe', container );
591
+ count = elements.length;
592
+ if ( count === 0 ) {
593
+ start();
594
+ return;
595
+ }
596
+ loop = 0;
597
+ elements.each( function () {
598
+ $( this ).one( 'load error', function () {
599
+ if ( ++loop === count ) {
600
+ start();
601
+ }
602
+ } ).each( function () {
603
+ if ( this.complete ) {
604
+ $( this ).trigger( 'load' );
605
+ }
606
+ } );
607
+ } );
608
+ };
609
+
610
+ el.getCurrentSlide = function () {
611
+ return slip.vars.active;
612
+ };
613
+
614
+ el.getSlideCount = function () {
615
+ return slip.vars.count;
616
+ };
617
+
618
+ el.destroySlider = function () {
619
+ if ( slip.vars.fresh === false ) {
620
+ el.stopAuto();
621
+ slip.vars.moving = false;
622
+ slip.vars.slides.each( function () {
623
+ if ( $( this ).data( "sy-cssBckup" ) !== undefined ) {
624
+ $( this ).attr( "style", $( this ).data( "sy-cssBckup" ) );
625
+ } else {
626
+ $( this ).removeAttr( 'style' );
627
+ }
628
+ if ( $( this ).data( "sy-classBckup" ) !== undefined ) {
629
+ $( this ).attr( "class", $( this ).data( "sy-classBckup" ) );
630
+ } else {
631
+ $( this ).removeAttr( 'class' );
632
+ }
633
+ } );
634
+ if ( el.data( "sy-cssBckup" ) !== undefined ) {
635
+ el.attr( "style", el.data( "sy-cssBckup" ) );
636
+ } else {
637
+ el.removeAttr( 'style' );
638
+ }
639
+ if ( el.data( "sy-classBckup" ) !== undefined ) {
640
+ el.attr( "class", el.data( "sy-classBckup" ) );
641
+ } else {
642
+ el.removeAttr( 'class' );
643
+ }
644
+ slip.vars.slippryWrapper.before( el );
645
+ slip.vars.slippryWrapper.remove();
646
+ slip.vars.fresh = undefined;
647
+ }
648
+ };
649
+
650
+ el.reloadSlider = function () {
651
+ el.destroySlider();
652
+ init();
653
+ };
654
+
655
+ // initialises the slider, creates needed markup
656
+ init = function () {
657
+ var first;
658
+ slip.settings = $.extend( { }, defaults, options );
659
+ slip.vars.slides = $( slip.settings.elements, el );
660
+ slip.vars.count = slip.vars.slides.length;
661
+ if ( slip.settings.useCSS ) { // deactivate css transitions on unsupported browsers
662
+ if ( !supports( 'transition' ) ) {
663
+ slip.settings.useCSS = false;
664
+ }
665
+ slip.vars.transition = whichTransitionEvent();
666
+ }
667
+ el.data( 'sy-cssBckup', el.attr( 'style' ) );
668
+ el.data( 'sy-classBackup', el.attr( 'class' ) );
669
+ el.addClass( slip.settings.boxClass ).wrap( slip.settings.slippryWrapper ).wrap( slip.settings.slideWrapper ).wrap( slip.settings.slideCrop );
670
+ slip.vars.slideWrapper = el.parent().parent();
671
+ slip.vars.slippryWrapper = slip.vars.slideWrapper.parent().addClass( slip.settings.loadingClass );
672
+ slip.vars.fresh = true;
673
+ slip.vars.slides.each( function () {
674
+ $( this ).addClass( 'sy-slide ' + slip.settings.transition );
675
+ if ( slip.settings.useCSS ) {
676
+ $( this ).addClass( 'useCSS' );
677
+ }
678
+ if ( slip.settings.transition === 'horizontal' ) {
679
+ $( this ).css( 'left', $( this ).index() * ( 100 + slip.settings.slideMargin ) + '%' );
680
+ } else if ( slip.settings.transition === 'vertical' ) {
681
+ $( this ).css( 'top', $( this ).index() * ( 100 + slip.settings.slideMargin ) + '%' );
682
+ }
683
+ } );
684
+ if ( ( slip.vars.count > 1 ) || ( slip.settings.initSingle ) ) {
685
+ if ( $( '.' + slip.settings.activeClass, el ).index() === -1 ) {
686
+ if ( slip.settings.start === 'random' ) {
687
+ first = Math.round( Math.random() * ( slip.vars.count - 1 ) );
688
+ } else if ( slip.settings.start > 0 && slip.settings.start <= slip.vars.count ) {
689
+ first = slip.settings.start - 1;
690
+ } else {
691
+ first = 0;
692
+ }
693
+ slip.vars.active = $( slip.vars.slides[first] ).addClass( slip.settings.activeClass );
694
+ } else {
695
+ slip.vars.active = $( '.' + slip.settings.activeClass, el );
696
+ }
697
+ initControls();
698
+ initPager();
699
+ initCaptions();
700
+ preload( slip.vars.slides );
701
+ } else {
702
+ return this;
703
+ }
704
+ };
705
+
706
+ init(); // on startup initialise the slider
707
+
708
+ return this;
709
+ };
710
+ }( jQuery ) );
assets/slippry/slippry.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .sy-slide>a>img,.sy-slide>img{display:block;border:0}.sy-controls,.sy-list,.sy-pager{list-style:none}@-webkit-keyframes left-right{0%{-webkit-transform:translateY(-20%) translateX(-10%);transform:translateY(-20%) translateX(-10%)}100%{-webkit-transform:translateY(0) translateX(10%);transform:translateY(0) translateX(10%)}}@-o-keyframes left-right{0%{-o-transform:translateY(-20%) translateX(-10%);transform:translateY(-20%) translateX(-10%)}100%{-o-transform:translateY(0) translateX(10%);transform:translateY(0) translateX(10%)}}@keyframes left-right{0%{-webkit-transform:translateY(-20%) translateX(-10%);-o-transform:translateY(-20%) translateX(-10%);transform:translateY(-20%) translateX(-10%)}100%{-webkit-transform:translateY(0) translateX(10%);-o-transform:translateY(0) translateX(10%);transform:translateY(0) translateX(10%)}}@-webkit-keyframes right-left{0%{-webkit-transform:translateY(0) translateX(10%);transform:translateY(0) translateX(10%)}100%{-webkit-transform:translateY(-20%) translateX(-10%);transform:translateY(-20%) translateX(-10%)}}@-o-keyframes right-left{0%{-o-transform:translateY(0) translateX(10%);transform:translateY(0) translateX(10%)}100%{-o-transform:translateY(-20%) translateX(-10%);transform:translateY(-20%) translateX(-10%)}}@keyframes right-left{0%{-webkit-transform:translateY(0) translateX(10%);-o-transform:translateY(0) translateX(10%);transform:translateY(0) translateX(10%)}100%{-webkit-transform:translateY(-20%) translateX(-10%);-o-transform:translateY(-20%) translateX(-10%);transform:translateY(-20%) translateX(-10%)}}.sy-box.sy-loading{background:url(images/sy-loader.gif) 50% 50% no-repeat;-webkit-background-size:32px 32px;background-size:32px;min-height:40px}.sy-box.sy-loading .sy-pager,.sy-box.sy-loading .sy-slides-wrap{visibility:hidden}.sy-slides-wrap{position:relative;height:100%;width:100%}.sy-controls,.sy-controls li,.sy-list,.sy-slide,.sy-slides-crop{position:absolute}.sy-slides-wrap:hover .sy-controls{display:block}.sy-slides-crop{height:100%;width:100%;overflow:hidden}.sy-list{width:100%;height:100%;margin:0;padding:0}.sy-list.horizontal{-webkit-transition:left ease;-o-transition:left ease;transition:left ease}.sy-list.vertical{-webkit-transition:top ease;-o-transition:top ease;transition:top ease}.sy-slide{width:100%;z-index:2}.sy-slide.kenburns{width:140%;left:-20%}.sy-controls,.sy-slide>a,.sy-slide>a>img,.sy-slide>img{width:100%;padding:0;margin:0}.sy-slide.kenburns.useCSS{-webkit-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.sy-slide.kenburns.useCSS.sy-ken:nth-child(1n){-webkit-animation-name:left-right;-o-animation-name:left-right;animation-name:left-right;-webkit-animation-fill-mode:forwards;-o-animation-fill-mode:forwards;animation-fill-mode:forwards}.sy-slide.kenburns.useCSS.sy-ken:nth-child(2n){-webkit-animation-name:right-left;-o-animation-name:right-left;animation-name:right-left;-webkit-animation-fill-mode:forwards;-o-animation-fill-mode:forwards;animation-fill-mode:forwards}.sy-slide.sy-active{z-index:3}.sy-slide>a{display:block}.sy-controls{display:none;height:100%}.sy-controls li{width:10%;min-width:4.2em;height:100%;z-index:33}.sy-controls li.sy-prev{left:0;top:0}.sy-controls li.sy-prev a:after{background-position:-5% 0}.sy-controls li.sy-next{right:0;top:0}.sy-controls li.sy-next a:after{background-position:105% 0}.sy-controls li a{position:relative;width:100%;height:100%;display:block;text-decoration:none;box-shadow:none;text-indent:-9999px}.sy-controls li a:link,.sy-controls li a:visited{opacity:.4}.sy-controls li a:focus,.sy-controls li a:hover{opacity:.8;outline:0}.sy-controls li a:after{content:"";background-image:url(images/arrows.svg);background-repeat:no-repeat;-webkit-background-size:cover;background-size:cover;text-align:center;text-indent:0;line-height:2.8em;color:#111;font-weight:800;position:absolute;background-color:#fff;width:2.8em;height:2.8em;left:50%;top:50%;margin-top:-1.4em;margin-left:-1.4em;border-radius:50%}@media only screen and (max-device-width:600px){.sy-controls{display:block}.sy-controls li{min-width:2.1em}.sy-controls li a:after{width:1.4em;height:1.4em;margin-top:-.7em;margin-left:-.7em}}.sy-caption-wrap{position:absolute;bottom:2em;z-index:12;left:50%}.sy-caption-wrap .sy-caption{position:relative;left:-50%;background-color:rgba(0,0,0,.54);color:#fff;padding:.4em 1em;border-radius:1.2em}.sy-caption-wrap .sy-caption a:link,.sy-caption-wrap .sy-caption a:visited{color:#e24b70;font-weight:600;text-decoration:none}.sy-caption-wrap .sy-caption a:focus,.sy-caption-wrap .sy-caption a:hover{text-decoration:underline}@media only screen and (max-device-width:600px),screen and (max-width:600px){.sy-caption-wrap{left:0;bottom:.4em}.sy-caption-wrap .sy-caption{left:0;padding:.2em .4em;font-size:.92em;border-radius:0}}.sy-pager{clear:both;display:block;width:100%;margin:1em 0 0;padding:0;text-align:center}.sy-pager li{display:inline-block;width:1.2em;height:1.2em;margin:0 1em 0 0;border-radius:50%}.sy-pager li.sy-active a{background-color:#e24b70}.sy-pager li a{width:100%;height:100%;display:block;background-color:#ccc;text-indent:-9999px;-webkit-background-size:2em 2em;background-size:2em;border-radius:50%;text-decoration:none;box-shadow:none}.sy-pager li a:link,.sy-pager li a:visited{opacity:1}.sy-pager li a:focus,.sy-pager li a:hover{opacity:.6}.sy-filler{width:100%}.sy-filler.ready{-webkit-transition:padding .6s ease;-o-transition:padding .6s ease;transition:padding .6s ease}
assets/slippry/slippry.min.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @preserve
2
+ *
3
+ * slippry v1.4.0 - Responsive content slider for jQuery
4
+ * http://slippry.com
5
+ *
6
+ * Authors: Lukas Jakob Hafner - @saftsaak
7
+ * Thomas Hurd - @SeenNotHurd
8
+ *
9
+ * Copyright 2016, booncon oy - http://booncon.com
10
+ *
11
+ *
12
+ * Released under the MIT license - http://opensource.org/licenses/MIT
13
+ */
14
+ !function(a){"use strict";var b;b={slippryWrapper:'<div class="sy-box" />',slideWrapper:'<div class="sy-slides-wrap" />',slideCrop:'<div class="sy-slides-crop" />',boxClass:"sy-list",elements:"li",activeClass:"sy-active",fillerClass:"sy-filler",loadingClass:"sy-loading",adaptiveHeight:!0,start:1,loop:!0,captionsSrc:"img",captions:"overlay",captionsEl:".sy-caption",initSingle:!0,responsive:!0,preload:"visible",pager:!0,pagerClass:"sy-pager",controls:!0,controlClass:"sy-controls",prevClass:"sy-prev",prevText:"Previous",nextClass:"sy-next",nextText:"Next",hideOnEnd:!0,transition:"fade",kenZoom:120,slideMargin:0,transClass:"transition",speed:800,easing:"swing",continuous:!0,useCSS:!0,auto:!0,autoDirection:"next",autoHover:!0,autoHoverDelay:100,autoDelay:500,pause:4e3,onSliderLoad:function(){return this},onSlideBefore:function(){return this},onSlideAfter:function(){return this}},a.fn.slippry=function(c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;return e=this,0===e.length?this:e.length>1?(e.each(function(){a(this).slippry(c)}),this):(d={},d.vars={},n=function(){var a,b,c;b=document.createElement("div"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionEnd transitionend"};for(a in c)if(void 0!==b.style[a])return c[a]},w=function(){var a=document.createElement("div"),b=["Khtml","Ms","O","Moz","Webkit"],c=b.length;return function(d){if(d in a.style)return!0;for(d=d.replace(/^[a-z]/,function(a){return a.toUpperCase()});c--;)if(b[c]+d in a.style)return!0;return!1}}(),z=function(b,c){var d,e,f,g;return d=c.split("."),e=a(b),f="",g="",a.each(d,function(a,b){b.indexOf("#")>=0?f+=b.replace(/^#/,""):g+=b+" "}),f.length&&e.attr("id",f),g.length&&e.attr("class",a.trim(g)),e},A=function(){var a,b,c,e;c={},e={},a=100-d.settings.kenZoom,e.width=d.settings.kenZoom+"%",d.vars.active.index()%2===0?(e.left=a+"%",e.top=a+"%",c.left="0%",c.top="0%"):(e.left="0%",e.top="0%",c.left=a+"%",c.top=a+"%"),b=d.settings.pause+2*d.settings.speed,d.vars.active.css(e),d.vars.active.animate(c,{duration:b,easing:d.settings.easing,queue:!1})},l=function(){d.vars.fresh?(d.vars.slippryWrapper.removeClass(d.settings.loadingClass),d.vars.fresh=!1,d.settings.auto&&e.startAuto(),d.settings.useCSS||"kenburns"!==d.settings.transition||A(),d.settings.onSliderLoad.call(void 0,d.vars.active.index())):a("."+d.settings.fillerClass,d.vars.slideWrapper).addClass("ready")},q=function(b,c){var e,f,g;e=b/c,f=1/e*100+"%",g=a("."+d.settings.fillerClass,d.vars.slideWrapper),g.css({paddingTop:f}),l()},g=function(b){var c,d;void 0!==a("img",b).attr("src")?a("<img />").on("load",function(){c=b.width(),d=b.height(),q(c,d)}).attr("src",a("img",b).attr("src")):(c=b.width(),d=b.height(),q(c,d))},f=function(){if(0===a("."+d.settings.fillerClass,d.vars.slideWrapper).length&&d.vars.slideWrapper.append(a('<div class="'+d.settings.fillerClass+'" />')),d.settings.adaptiveHeight===!0)g(a("."+d.settings.activeClass,e));else{var b,c,f;c=0,f=0,a(d.vars.slides).each(function(){a(this).height()>c&&(b=a(this),c=b.height()),f+=1,f===d.vars.count&&(void 0===b&&(b=a(a(d.vars.slides)[0])),g(b))})}},p=function(){d.settings.pager&&(a("."+d.settings.pagerClass+" li",d.vars.slippryWrapper).removeClass(d.settings.activeClass),a(a("."+d.settings.pagerClass+" li",d.vars.slippryWrapper)[d.vars.active.index()]).addClass(d.settings.activeClass))},u=function(){!d.settings.loop&&d.settings.hideOnEnd&&(a("."+d.settings.prevClass,d.vars.slippryWrapper)[d.vars.first?"hide":"show"](),a("."+d.settings.nextClass,d.vars.slippryWrapper)[d.vars.last?"hide":"show"]())},i=function(){var b,c;d.settings.captions!==!1&&(b="img"!==d.settings.captionsSrc?d.vars.active.attr("title"):void 0!==a("img",d.vars.active).attr("title")?a("img",d.vars.active).attr("title"):a("img",d.vars.active).attr("alt"),c="custom"!==d.settings.captions?a(d.settings.captionsEl,d.vars.slippryWrapper):a(d.settings.captionsEl),void 0!==b&&""!==b?c.html(b).show():c.hide())},e.startAuto=function(){void 0===d.vars.timer&&void 0===d.vars.delay&&(d.vars.delay=window.setTimeout(function(){d.vars.autodelay=!1,d.vars.timer=window.setInterval(function(){d.vars.trigger="auto",t(d.settings.autoDirection)},d.settings.pause)},d.vars.autodelay?d.settings.autoHoverDelay:d.settings.autoDelay),d.settings.autoHover&&d.vars.slideWrapper.unbind("mouseenter").unbind("mouseleave").bind("mouseenter",function(){void 0!==d.vars.timer?(d.vars.hoverStop=!0,e.stopAuto()):d.vars.hoverStop=!1}).bind("mouseleave",function(){d.vars.hoverStop&&(d.vars.autodelay=!0,e.startAuto())}))},e.stopAuto=function(){window.clearInterval(d.vars.timer),d.vars.timer=void 0,window.clearTimeout(d.vars.delay),d.vars.delay=void 0},e.refresh=function(){d.vars.slides.removeClass(d.settings.activeClass),d.vars.active.addClass(d.settings.activeClass),d.settings.responsive?f():l(),u(),p(),i()},s=function(){e.refresh()},m=function(){d.vars.moving=!1,d.vars.active.removeClass(d.settings.transClass),d.vars.fresh||d.vars.old.removeClass("sy-ken"),d.vars.old.removeClass(d.settings.transClass),d.settings.onSlideAfter.call(void 0,d.vars.active,d.vars.old.index(),d.vars.active.index()),d.settings.auto&&(d.vars.hoverStop&&void 0!==d.vars.hoverStop||e.startAuto())},r=function(){var b,c,f,g,h,i,j;d.settings.onSlideBefore.call(void 0,d.vars.active,d.vars.old.index(),d.vars.active.index()),d.settings.transition!==!1?(d.vars.moving=!0,"fade"===d.settings.transition||"kenburns"===d.settings.transition?(d.vars.fresh?(d.settings.useCSS?d.vars.slides.css({transitionDuration:d.settings.speed+"ms",opacity:0}):d.vars.slides.css({opacity:0}),d.vars.active.css("opacity",1),"kenburns"===d.settings.transition&&d.settings.useCSS&&(h=d.settings.pause+2*d.settings.speed,d.vars.slides.css({animationDuration:h+"ms"}),d.vars.active.addClass("sy-ken")),m()):d.settings.useCSS?(d.vars.old.addClass(d.settings.transClass).css("opacity",0),d.vars.active.addClass(d.settings.transClass).css("opacity",1),"kenburns"===d.settings.transition&&d.vars.active.addClass("sy-ken"),a(window).off("focus").on("focus",function(){d.vars.moving&&d.vars.old.trigger(d.vars.transition)}),d.vars.old.one(d.vars.transition,function(){return m(),this})):("kenburns"===d.settings.transition&&A(),d.vars.old.addClass(d.settings.transClass).animate({opacity:0},d.settings.speed,d.settings.easing,function(){m()}),d.vars.active.addClass(d.settings.transClass).css("opacity",0).animate({opacity:1},d.settings.speed,d.settings.easing)),s()):("horizontal"===d.settings.transition||"vertical"===d.settings.transition)&&(i="horizontal"===d.settings.transition?"left":"top",b="-"+d.vars.active.index()*(100+d.settings.slideMargin)+"%",d.vars.fresh?(e.css(i,b),m()):(j={},d.settings.continuous&&(!d.vars.jump||"controls"!==d.vars.trigger&&"auto"!==d.vars.trigger||(c=!0,g=b,d.vars.first?(f=0,d.vars.active.css(i,d.vars.count*(100+d.settings.slideMargin)+"%"),b="-"+d.vars.count*(100+d.settings.slideMargin)+"%"):(f=(d.vars.count-1)*(100+d.settings.slideMargin)+"%",d.vars.active.css(i,-(100+d.settings.slideMargin)+"%"),b=100+d.settings.slideMargin+"%"))),d.vars.active.addClass(d.settings.transClass),d.settings.useCSS?(j[i]=b,j.transitionDuration=d.settings.speed+"ms",e.addClass(d.settings.transition),e.css(j),a(window).off("focus").on("focus",function(){d.vars.moving&&e.trigger(d.vars.transition)}),e.one(d.vars.transition,function(){return e.removeClass(d.settings.transition),c&&(d.vars.active.css(i,f),j[i]=g,j.transitionDuration="0ms",e.css(j)),m(),this})):(j[i]=b,e.stop().animate(j,d.settings.speed,d.settings.easing,function(){return c&&(d.vars.active.css(i,f),e.css(i,g)),m(),this}))),s())):(s(),m())},v=function(a){d.vars.first=d.vars.last=!1,"prev"===a||0===a?d.vars.first=!0:("next"===a||a===d.vars.count-1)&&(d.vars.last=!0)},t=function(b){var c,f;d.vars.moving||("auto"!==d.vars.trigger&&e.stopAuto(),c=d.vars.active.index(),"prev"===b?(f=b,c>0?b=c-1:d.settings.loop&&(b=d.vars.count-1)):"next"===b?(f=b,c<d.vars.count-1?b=c+1:d.settings.loop&&(b=0)):(b-=1,f=c>b?"prev":"next"),d.vars.jump=!1,"prev"===b||"next"===b||b===c&&!d.vars.fresh||(v(b),d.vars.old=d.vars.active,d.vars.active=a(d.vars.slides[b]),(0===c&&"prev"===f||c===d.vars.count-1&&"next"===f)&&(d.vars.jump=!0),r()))},e.goToSlide=function(a){d.vars.trigger="external",t(a)},e.goToNextSlide=function(){d.vars.trigger="external",t("next")},e.goToPrevSlide=function(){d.vars.trigger="external",t("prev")},j=function(){if(d.settings.pager&&d.vars.count>1){var b,c,e;for(b=d.vars.slides.length,e=a('<ul class="'+d.settings.pagerClass+'" />'),c=1;b+1>c;c+=1)e.append(a("<li />").append(a('<a href="#'+c+'">'+c+"</a>")));d.vars.slippryWrapper.append(e),a("."+d.settings.pagerClass+" a",d.vars.slippryWrapper).click(function(){return d.vars.trigger="pager",t(parseInt(this.hash.split("#")[1],10)),!1}),p()}},k=function(){d.settings.controls&&d.vars.count>1&&(d.vars.slideWrapper.append(a('<ul class="'+d.settings.controlClass+'" />').append('<li class="'+d.settings.prevClass+'"><a href="#prev">'+d.settings.prevText+"</a></li>").append('<li class="'+d.settings.nextClass+'"><a href="#next">'+d.settings.nextText+"</a></li>")),a("."+d.settings.controlClass+" a",d.vars.slippryWrapper).click(function(){return d.vars.trigger="controls",t(this.hash.split("#")[1]),!1}),u())},o=function(){d.settings.captions!==!1&&("overlay"===d.settings.captions?d.vars.slideWrapper.append(a('<div class="sy-caption-wrap" />').html(z("<div />",d.settings.captionsEl))):"below"===d.settings.captions&&d.vars.slippryWrapper.append(a('<div class="sy-caption-wrap" />').html(z("<div />",d.settings.captionsEl))))},y=function(){t(d.vars.active.index()+1)},x=function(b){var c,e,f,g;return g="all"===d.settings.preload?b:d.vars.active,f=a("img, iframe",g),c=f.length,0===c?void y():(e=0,void f.each(function(){a(this).one("load error",function(){++e===c&&y()}).each(function(){this.complete&&a(this).trigger("load")})}))},e.getCurrentSlide=function(){return d.vars.active},e.getSlideCount=function(){return d.vars.count},e.destroySlider=function(){d.vars.fresh===!1&&(e.stopAuto(),d.vars.moving=!1,d.vars.slides.each(function(){void 0!==a(this).data("sy-cssBckup")?a(this).attr("style",a(this).data("sy-cssBckup")):a(this).removeAttr("style"),void 0!==a(this).data("sy-classBckup")?a(this).attr("class",a(this).data("sy-classBckup")):a(this).removeAttr("class")}),void 0!==e.data("sy-cssBckup")?e.attr("style",e.data("sy-cssBckup")):e.removeAttr("style"),void 0!==e.data("sy-classBckup")?e.attr("class",e.data("sy-classBckup")):e.removeAttr("class"),d.vars.slippryWrapper.before(e),d.vars.slippryWrapper.remove(),d.vars.fresh=void 0)},e.reloadSlider=function(){e.destroySlider(),h()},h=function(){var f;return d.settings=a.extend({},b,c),d.vars.slides=a(d.settings.elements,e),d.vars.count=d.vars.slides.length,d.settings.useCSS&&(w("transition")||(d.settings.useCSS=!1),d.vars.transition=n()),e.data("sy-cssBckup",e.attr("style")),e.data("sy-classBackup",e.attr("class")),e.addClass(d.settings.boxClass).wrap(d.settings.slippryWrapper).wrap(d.settings.slideWrapper).wrap(d.settings.slideCrop),d.vars.slideWrapper=e.parent().parent(),d.vars.slippryWrapper=d.vars.slideWrapper.parent().addClass(d.settings.loadingClass),d.vars.fresh=!0,d.vars.slides.each(function(){a(this).addClass("sy-slide "+d.settings.transition),d.settings.useCSS&&a(this).addClass("useCSS"),"horizontal"===d.settings.transition?a(this).css("left",a(this).index()*(100+d.settings.slideMargin)+"%"):"vertical"===d.settings.transition&&a(this).css("top",a(this).index()*(100+d.settings.slideMargin)+"%")}),d.vars.count>1||d.settings.initSingle?(-1===a("."+d.settings.activeClass,e).index()?(f="random"===d.settings.start?Math.round(Math.random()*(d.vars.count-1)):d.settings.start>0&&d.settings.start<=d.vars.count?d.settings.start-1:0,d.vars.active=a(d.vars.slides[f]).addClass(d.settings.activeClass)):d.vars.active=a("."+d.settings.activeClass,e),k(),j(),o(),x(d.vars.slides),void 0):this},h(),this)}}(jQuery);
assets/swipebox/README.md CHANGED
@@ -16,11 +16,10 @@ Swipebox is a jQuery "lightbox" plugin for desktop, mobile and tablet.
16
  - CSS transitions with jQuery fallback
17
  - Retina support for UI icons
18
  - Easy CSS customization
19
- - Video, Images and Inline content
20
 
21
  ###Compatibility
22
 
23
- Chrome, Safari, Firefox, Opera, IE9+, IOS4+, Android, windows phone.
24
 
25
  ##Usage
26
 
@@ -30,7 +29,7 @@ Include jquery and the swipebox script in your head tags or right before your bo
30
 
31
  ```html
32
  <script src="lib/jquery-1.9.0.js"></script>
33
- <script src="src/js/jquery.swipebox.js"></script>
34
  ```
35
 
36
  ###CSS
@@ -38,7 +37,7 @@ Include jquery and the swipebox script in your head tags or right before your bo
38
  Include the swipebox CSS style in your head tags.
39
 
40
  ```html
41
- <link rel="stylesheet" href="src/css/swipebox.css">
42
  ```
43
 
44
  ###HTML
@@ -54,30 +53,18 @@ Use a specific class for your links and use the title attribute as caption.
54
  Bind the swipebox behaviour on every link with the "swipebox" class.
55
 
56
  ```javascript
57
- $( '.swipebox' ).swipebox();
58
  ```
59
 
60
  ###Options
61
 
62
  ```javascript
63
  useCSS : true, // false will force the use of jQuery for animations
64
- initialIndexOnArray: 0, // which image index to init when a array is passed
65
- hideCloseButtonOnMobile : false, // true will hide the close button on mobile devices
66
- hideBarsDelay : 3000, // delay before hiding bars on desktop
67
  videoMaxWidth : 1140, // videos max width
68
  beforeOpen: function(){} , // called before opening
69
- afterOpen: null, // called after opening
70
- afterClose: function(){}, // called after closing
71
- loopAtEnd: false, // true will return to the first image after the last image is reached
72
- autoplayVideos: false // true will autoplay Youtube and Vimeo videos
73
- queryStringData: {} // plain object with custom query string arguments to pass/override for video URLs,
74
- toggleClassOnLoad: '' // CSS class that can be toggled when the slide will be loaded (like 'hidden' of Bootstrap)
75
  ```
76
 
77
- ###Pull Requests
78
-
79
- I want to keep this plugin as simple as possible. I won't merge pull requests for additional features such as download buttons, social like buttons, IE8 compatibility etc... But feel free to fork the project and customize it to suit to your needs. Most wanted PR are for bug fixes. Also, a future improvement will be to allow zoom on touchable devices.
80
-
81
- If you want to submit a pull request please be sure to grunt the whole thing (mostly jshintrc validation and minified file) and send me a demo URL. Also, please comment your code.
82
-
83
- Thanks for your understanding and thank you all for your helpful support!
16
  - CSS transitions with jQuery fallback
17
  - Retina support for UI icons
18
  - Easy CSS customization
 
19
 
20
  ###Compatibility
21
 
22
+ Chrome, Safari, Firefox, Opera, IE8+, IOS4+, Android, windows phone.
23
 
24
  ##Usage
25
 
29
 
30
  ```html
31
  <script src="lib/jquery-1.9.0.js"></script>
32
+ <script src="source/jquery.swipebox.js"></script>
33
  ```
34
 
35
  ###CSS
37
  Include the swipebox CSS style in your head tags.
38
 
39
  ```html
40
+ <link rel="stylesheet" href="source/swipebox.css">
41
  ```
42
 
43
  ###HTML
53
  Bind the swipebox behaviour on every link with the "swipebox" class.
54
 
55
  ```javascript
56
+ $(".swipebox").swipebox();
57
  ```
58
 
59
  ###Options
60
 
61
  ```javascript
62
  useCSS : true, // false will force the use of jQuery for animations
63
+ hideBarsDelay : 3000, // 0 to always show caption and action bar
 
 
64
  videoMaxWidth : 1140, // videos max width
65
  beforeOpen: function(){} , // called before opening
66
+ afterClose: function(){} // called after closing
 
 
 
 
 
67
  ```
68
 
69
+ ####Credits
70
+ Photos by [Daniele Zedda](http://www.flickr.com/photos/astragony/)
 
 
 
 
 
assets/tosrus/css/jquery.tosrus.all.css CHANGED
@@ -1,117 +1,600 @@
1
- .tos-slide,.tos-slider,.tos-wrapper{width:100%;height:100%}
2
- .tos-noanimation{-webkit-transition-property:none!important;transition-property:none!important}
3
- .tos-fastanimation{-webkit-transition-duration:.2s!important;transition-duration:.2s!important;-webkit-transition-timing-function:ease-out!important;transition-timing-function:ease-out!important}
4
- .tos-wrapper{opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;display:none;padding:0;margin:0;overflow:hidden}
5
- .tos-wrapper.tos-opened{display:block}
6
- .tos-slide,.tos-slide:before,.tos-slide>*{display:inline-block}
7
- .tos-wrapper.tos-opening{opacity:1}
8
- .tos-wrapper.tos-fixed{background-color:#000;position:fixed;top:0;left:0;z-index:9000}
9
- .tos-slider,.tos-wrapper.tos-inline{position:relative}
10
- .tos-slider{white-space:nowrap;padding:0;margin:0}
11
- .tos-uibg,.tos-wrapper.tos-fx-slide.tos-fixed .tos-slider{position:absolute}
12
- .tos-wrapper.tos-fx-slide .tos-slider{left:0;-webkit-transition:left .4s ease;transition:left .4s ease}
13
- .tos-wrapper.tos-fx-fade .tos-slider{opacity:1;-webkit-transition:opacity .4s ease;transition:opacity .4s ease}
14
- .tos-uibg{opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;width:100%;left:0;bottom:0;z-index:1}
15
- .tos-fill .tos-uibg{background:-webkit-linear-gradient(bottom,rgba(0,0,0,.5),transparent);background:linear-gradient(to top,rgba(0,0,0,.5),transparent)}
16
- .tos-desktop .tos-wrapper:hover .tos-uibg,.tos-touch .tos-wrapper.tos-hover .tos-uibg{opacity:1}
17
- .tos-slide{-webkit-overflow-scrolling:touch;line-height:1px;text-align:center;box-sizing:border-box;overflow:hidden;position:relative}
18
- .tos-slide:before{content:"";height:50%;width:1px;margin-right:-1px}
19
- .tos-slide.tos-loading>*{opacity:0}
20
- .tos-slide>*{opacity:1;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;vertical-align:middle;max-height:100%;max-width:100%;box-sizing:border-box}
21
- .tos-slide.tos-html>div{-webkit-overflow-scrolling:touch;white-space:normal;text-align:left;line-height:1.5}
22
- .tos-slide.tos-html>div *{-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}
23
- .tos-wrapper.tos-fill .tos-slide.tos-image>img{max-height:none;max-width:none;min-height:100%;min-width:100%}
24
- .tos-wrapper.tos-fixed .tos-slide.tos-html>div{background-color:#fff;color:#333;box-sizing:border-box;display:inline-block;padding:40px;overflow:auto}
25
- .tos-desktop .tos-wrapper.tos-fixed{background-color:rgba(0,0,0,.85)}
26
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit .tos-slide{padding:20px}
27
- .tos-close,.tos-next{right:20px}
28
- .tos-close,.tos-next,.tos-prev{background:#000;border-radius:3px;opacity:0;display:block;width:40px;position:absolute;z-index:1;-webkit-transition:opacity .4s ease;transition:opacity .4s ease}
29
- .tos-next,.tos-prev{height:80px;margin-top:-40px;top:50%}
30
- .tos-next.tos-disabled,.tos-prev.tos-disabled{cursor:default}
31
- .tos-prev{left:20px}
32
- .tos-close{height:40px;top:20px}
33
- .tos-desktop .tos-wrapper:hover .tos-close,.tos-desktop .tos-wrapper:hover .tos-next,.tos-desktop .tos-wrapper:hover .tos-prev,.tos-touch .tos-wrapper.tos-hover .tos-close,.tos-touch .tos-wrapper.tos-hover .tos-next,.tos-touch .tos-wrapper.tos-hover .tos-prev{opacity:.5}
34
- .tos-desktop .tos-wrapper:hover .tos-close:hover,.tos-desktop .tos-wrapper:hover .tos-next:hover,.tos-desktop .tos-wrapper:hover .tos-prev:hover,.tos-touch .tos-wrapper.tos-hover .tos-close:hover,.tos-touch .tos-wrapper.tos-hover .tos-next:hover,.tos-touch .tos-wrapper.tos-hover .tos-prev:hover{opacity:.9}
35
- .tos-desktop .tos-wrapper:hover .tos-close.tos-disabled,.tos-desktop .tos-wrapper:hover .tos-next.tos-disabled,.tos-desktop .tos-wrapper:hover .tos-prev.tos-disabled,.tos-touch .tos-wrapper.tos-hover .tos-close.tos-disabled,.tos-touch .tos-wrapper.tos-hover .tos-next.tos-disabled,.tos-touch .tos-wrapper.tos-hover .tos-prev.tos-disabled{opacity:.2}
36
- .tos-close span:after,.tos-close span:before,.tos-next span,.tos-prev span{content:'';display:block;width:12px;height:12px;margin:-5px;position:absolute;top:50%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}
37
- .tos-close span:after,.tos-close span:before{width:6px;height:6px;margin-top:-4px;margin-left:0;margin-right:0}
38
- .tos-close span:before,.tos-prev span{border-bottom:3px solid #fff;border-left:3px solid #fff;left:50%}
39
- .tos-close span:after,.tos-next span{border-top:3px solid #fff;border-right:3px solid #fff;right:50%}
40
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-close .tos-slide,.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-next .tos-slide,.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-prev .tos-slide{padding-left:80px;padding-right:80px}
41
- .tos-inline{opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;display:inline-block;margin:0;position:relative;top:auto;left:auto;right:auto}
42
- .tos-inline.tos-prev{margin-right:-60px}
43
- .tos-inline.tos-next{margin-left:-60px}
44
- .tos-loading .tos-inline{opacity:0!important}
45
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-close,.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-next,.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-prev{-webkit-transform:scale(2);-ms-transform:scale(2);transform:scale(2)}
46
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-close,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-next,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-prev{-webkit-transform:scale(3);-ms-transform:scale(3);transform:scale(3)}
47
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-prev,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-prev{-webkit-transform-origin:left center;-ms-transform-origin:left center;transform-origin:left center}
48
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-next,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-next{-webkit-transform-origin:right center;-ms-transform-origin:right center;transform-origin:right center}
49
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-close,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-close{-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}
50
- .tos-caption{color:#fff;text-align:center;opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;width:100%;position:absolute;left:0;bottom:0;z-index:1}
51
- .tos-caption:after{content:'';display:block;clear:both}
52
- .tos-caption>div{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%;box-sizing:border-box;padding:0 20px;float:left}
53
- .tos-caption>div:last-child{float:right;margin-right:-2px}
54
- .tos-desktop .tos-wrapper:hover .tos-caption,.tos-touch .tos-wrapper.tos-hover .tos-caption{opacity:1}
55
- .tos-wrapper .tos-caption{line-height:20px;font-size:15px;text-shadow:0 1px 2px rgba(0,0,0,.8);height:40px}
56
- .tos-wrapper.tos-has-caption .tos-uibg{height:100px}
57
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-caption .tos-slide{padding-bottom:60px}
58
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-caption{line-height:40px;font-size:30px;text-shadow:0 2px 4px rgba(0,0,0,.8);height:80px}
59
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-caption .tos-uibg{height:200px}
60
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-caption{line-height:60px;font-size:45px;text-shadow:0 3px 6px rgba(0,0,0,.8);height:120px}
61
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-caption .tos-uibg{height:300px}
62
- .tos-wrapper.tos-fx-slide .tos-slider{-webkit-transition-property:left,margin;transition-property:left,margin}
63
- .tos-pagination{text-align:center;white-space:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;overflow-scrolling:touch;opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;width:100%;position:absolute;bottom:0;left:0;z-index:1}
64
- .tos-pagination a{display:inline-block}
65
- .tos-pagination.tos-bullets a{background-color:rgba(255,255,255,.2)}
66
- .tos-pagination.tos-bullets a:hover{background-color:rgba(255,255,255,.5)}
67
- .tos-pagination.tos-bullets a.tos-selected{background-color:rgba(255,255,255,.9)}
68
- .tos-desktop .tos-wrapper:hover .tos-pagination,.tos-touch .tos-wrapper.tos-hover .tos-pagination{opacity:1}
69
- .tos-wrapper .tos-pagination:after,.tos-wrapper .tos-pagination:before{content:'';display:inline-block;width:20px;height:10px}
70
- .tos-wrapper.tos-has-bullets .tos-pagination{height:30px}
71
- .tos-wrapper.tos-has-bullets .tos-pagination a{border-radius:10px;width:10px;height:10px;margin:0 5px}
72
- .tos-wrapper.tos-has-bullets .tos-caption{bottom:30px}
73
- .tos-wrapper.tos-has-bullets .tos-uibg{height:90px}
74
- .tos-wrapper.tos-has-bullets.tos-has-caption .tos-uibg{height:130px}
75
- .tos-wrapper.tos-has-thumbnails .tos-pagination{height:70px}
76
- .tos-wrapper.tos-has-thumbnails .tos-pagination a{background-position:center center;background-size:cover;width:50px;height:50px;margin:0 5px}
77
- .tos-wrapper.tos-has-thumbnails .tos-caption{bottom:70px}
78
- .tos-wrapper.tos-has-thumbnails .tos-uibg{height:130px}
79
- .tos-wrapper.tos-has-thumbnails.tos-has-caption .tos-uibg{height:170px}
80
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-bullets .tos-slide{padding-bottom:50px}
81
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-bullets.tos-has-caption .tos-slide{padding-bottom:80px}
82
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-thumbnails .tos-slide{padding-bottom:90px}
83
- .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-thumbnails.tos-has-caption .tos-slide{padding-bottom:120px}
84
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-pagination:after,.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-pagination:before{content:'';display:inline-block;width:40px;height:20px}
85
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination{height:60px}
86
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination a{border-radius:20px;width:20px;height:20px;margin:0 10px}
87
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-caption{bottom:60px}
88
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-uibg{height:180px}
89
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets.tos-has-caption .tos-uibg{height:260px}
90
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination{height:140px}
91
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination a{background-position:center center;background-size:cover;width:100px;height:100px;margin:0 10px}
92
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-caption{bottom:140px}
93
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-uibg{height:260px}
94
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails.tos-has-caption .tos-uibg{height:340px}
95
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-pagination:after,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-pagination:before{content:'';display:inline-block;width:60px;height:30px}
96
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination{height:90px}
97
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination a{border-radius:30px;width:30px;height:30px;margin:0 15px}
98
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-caption{bottom:90px}
99
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-uibg{height:270px}
100
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets.tos-has-caption .tos-uibg{height:390px}
101
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination{height:210px}
102
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination a{background-position:center center;background-size:cover;width:150px;height:150px;margin:0 15px}
103
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-caption{bottom:210px}
104
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-uibg{height:390px}
105
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails.tos-has-caption .tos-uibg{height:510px}
106
- .tos-slide .tos-html{-webkit-overflow-scrolling:touch}
107
- .tos-play,.tos-play:after{display:block;position:absolute;top:50%;left:50%}
108
- .tos-play{background:#000;opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease}
109
- .tos-play:after{content:''}
110
- .tos-desktop .tos-wrapper:hover .tos-play,.tos-touch .tos-wrapper.tos-hover .tos-play{opacity:.5}
111
- .tos-desktop .tos-wrapper:hover .tos-play:hover,.tos-touch .tos-wrapper.tos-hover .tos-play:hover{opacity:.9}
112
- .tos-wrapper .tos-play{border-radius:80px;width:80px;height:80px;margin:-40px}
113
- .tos-wrapper .tos-play:after{border:20px solid transparent;border-left-color:#fff;border-left-width:30px;margin-top:-20px;margin-left:-10.5px}
114
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-play{border-radius:160px;width:160px;height:160px;margin:-80px}
115
- .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-play:after{border:40px solid transparent;border-left-color:#fff;border-left-width:60px;margin-top:-40px;margin-left:-21px}
116
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-play{border-radius:240px;width:240px;height:240px;margin:-120px}
117
- .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-play:after{border:60px solid transparent;border-left-color:#fff;border-left-width:90px;margin-top:-60px;margin-left:-31.5px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .tos-slide,
2
+ .tos-slider,
3
+ .tos-wrapper {
4
+ width: 100%;
5
+ height: 100%
6
+ }
7
+ .tos-noanimation {
8
+ -webkit-transition-property: none!important;
9
+ transition-property: none!important
10
+ }
11
+ .tos-fastanimation {
12
+ -webkit-transition-duration: .2s!important;
13
+ transition-duration: .2s!important;
14
+ -webkit-transition-timing-function: ease-out!important;
15
+ transition-timing-function: ease-out!important
16
+ }
17
+ .tos-wrapper {
18
+ opacity: 0;
19
+ -webkit-transition: opacity .4s ease;
20
+ transition: opacity .4s ease;
21
+ display: none;
22
+ padding: 0;
23
+ margin: 0;
24
+ overflow: hidden
25
+ }
26
+ .tos-wrapper.tos-opened {
27
+ display: block
28
+ }
29
+ .tos-slide,
30
+ .tos-slide:before,
31
+ .tos-slide>* {
32
+ display: inline-block
33
+ }
34
+ .tos-wrapper.tos-opening {
35
+ opacity: 1
36
+ }
37
+ .tos-wrapper.tos-fixed {
38
+ background-color: #000;
39
+ position: fixed;
40
+ top: 0;
41
+ left: 0;
42
+ z-index: 9000
43
+ }
44
+ .tos-slider,
45
+ .tos-wrapper.tos-inline {
46
+ position: relative
47
+ }
48
+ .tos-slider {
49
+ white-space: nowrap;
50
+ padding: 0;
51
+ margin: 0
52
+ }
53
+ .tos-uibg,
54
+ .tos-wrapper.tos-fx-slide.tos-fixed .tos-slider {
55
+ position: absolute
56
+ }
57
+ .tos-wrapper.tos-fx-slide .tos-slider {
58
+ left: 0;
59
+ -webkit-transition: left .4s ease;
60
+ transition: left .4s ease
61
+ }
62
+ .tos-wrapper.tos-fx-fade .tos-slider {
63
+ opacity: 1;
64
+ -webkit-transition: opacity .4s ease;
65
+ transition: opacity .4s ease
66
+ }
67
+ .tos-uibg {
68
+ opacity: 0;
69
+ -webkit-transition: opacity .4s ease;
70
+ transition: opacity .4s ease;
71
+ width: 100%;
72
+ left: 0;
73
+ bottom: 0;
74
+ z-index: 1
75
+ }
76
+ .tos-fill .tos-uibg {
77
+ background: -webkit-linear-gradient(bottom, rgba(0, 0, 0, .5), transparent);
78
+ background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent)
79
+ }
80
+ .tos-desktop .tos-wrapper:hover .tos-uibg,
81
+ .tos-touch .tos-wrapper.tos-hover .tos-uibg {
82
+ opacity: 1
83
+ }
84
+ .tos-slide {
85
+ -webkit-overflow-scrolling: touch;
86
+ line-height: 1px;
87
+ text-align: center;
88
+ box-sizing: border-box;
89
+ overflow: hidden;
90
+ position: relative
91
+ }
92
+ .tos-slide:before {
93
+ content: "";
94
+ height: 50%;
95
+ width: 1px;
96
+ margin-right: -1px
97
+ }
98
+ .tos-slide.tos-loading>* {
99
+ opacity: 0
100
+ }
101
+ .tos-slide>* {
102
+ opacity: 1;
103
+ -webkit-transition: opacity .4s ease;
104
+ transition: opacity .4s ease;
105
+ vertical-align: middle;
106
+ max-height: 100%;
107
+ max-width: 100%;
108
+ box-sizing: border-box
109
+ }
110
+ .tos-slide.tos-html>div {
111
+ -webkit-overflow-scrolling: touch;
112
+ white-space: normal;
113
+ text-align: left;
114
+ line-height: 1.5
115
+ }
116
+ .tos-slide.tos-html>div * {
117
+ -webkit-text-size-adjust: none;
118
+ -ms-text-size-adjust: none;
119
+ text-size-adjust: none
120
+ }
121
+ .tos-wrapper.tos-fill .tos-slide.tos-image>img {
122
+ max-height: none;
123
+ max-width: none;
124
+ min-height: 100%;
125
+ min-width: 100%
126
+ }
127
+ .tos-wrapper.tos-fixed .tos-slide.tos-html>div {
128
+ background-color: #fff;
129
+ color: #333;
130
+ box-sizing: border-box;
131
+ display: inline-block;
132
+ padding: 40px;
133
+ overflow: auto
134
+ }
135
+ .tos-desktop .tos-wrapper.tos-fixed {
136
+ background-color: rgba(0, 0, 0, .85)
137
+ }
138
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit .tos-slide {
139
+ padding: 20px
140
+ }
141
+ .tos-close,
142
+ .tos-next {
143
+ right: 20px
144
+ }
145
+ .tos-close,
146
+ .tos-next,
147
+ .tos-prev {
148
+ background: #000;
149
+ border-radius: 3px;
150
+ opacity: 0;
151
+ display: block;
152
+ width: 40px;
153
+ position: absolute;
154
+ z-index: 1;
155
+ -webkit-transition: opacity .4s ease;
156
+ transition: opacity .4s ease
157
+ }
158
+ .tos-next,
159
+ .tos-prev {
160
+ height: 80px;
161
+ margin-top: -40px;
162
+ top: 50%
163
+ }
164
+ .tos-next.tos-disabled,
165
+ .tos-prev.tos-disabled {
166
+ cursor: default
167
+ }
168
+ .tos-prev {
169
+ left: 20px
170
+ }
171
+ .tos-close {
172
+ height: 40px;
173
+ top: 20px
174
+ }
175
+ .tos-desktop .tos-wrapper:hover .tos-close,
176
+ .tos-desktop .tos-wrapper:hover .tos-next,
177
+ .tos-desktop .tos-wrapper:hover .tos-prev,
178
+ .tos-touch .tos-wrapper.tos-hover .tos-close,
179
+ .tos-touch .tos-wrapper.tos-hover .tos-next,
180
+ .tos-touch .tos-wrapper.tos-hover .tos-prev {
181
+ opacity: .5
182
+ }
183
+ .tos-desktop .tos-wrapper:hover .tos-close:hover,
184
+ .tos-desktop .tos-wrapper:hover .tos-next:hover,
185
+ .tos-desktop .tos-wrapper:hover .tos-prev:hover,
186
+ .tos-touch .tos-wrapper.tos-hover .tos-close:hover,
187
+ .tos-touch .tos-wrapper.tos-hover .tos-next:hover,
188
+ .tos-touch .tos-wrapper.tos-hover .tos-prev:hover {
189
+ opacity: .9
190
+ }
191
+ .tos-desktop .tos-wrapper:hover .tos-close.tos-disabled,
192
+ .tos-desktop .tos-wrapper:hover .tos-next.tos-disabled,
193
+ .tos-desktop .tos-wrapper:hover .tos-prev.tos-disabled,
194
+ .tos-touch .tos-wrapper.tos-hover .tos-close.tos-disabled,
195
+ .tos-touch .tos-wrapper.tos-hover .tos-next.tos-disabled,
196
+ .tos-touch .tos-wrapper.tos-hover .tos-prev.tos-disabled {
197
+ opacity: .2
198
+ }
199
+ .tos-close span:after,
200
+ .tos-close span:before,
201
+ .tos-next span,
202
+ .tos-prev span {
203
+ content: '';
204
+ display: block;
205
+ width: 12px;
206
+ height: 12px;
207
+ margin: -5px;
208
+ position: absolute;
209
+ top: 50%;
210
+ -webkit-transform: rotate(45deg);
211
+ -ms-transform: rotate(45deg);
212
+ transform: rotate(45deg)
213
+ }
214
+ .tos-close span:after,
215
+ .tos-close span:before {
216
+ width: 6px;
217
+ height: 6px;
218
+ margin-top: -4px;
219
+ margin-left: 0;
220
+ margin-right: 0
221
+ }
222
+ .tos-close span:before,
223
+ .tos-prev span {
224
+ border-bottom: 3px solid #fff;
225
+ border-left: 3px solid #fff;
226
+ left: 50%
227
+ }
228
+ .tos-close span:after,
229
+ .tos-next span {
230
+ border-top: 3px solid #fff;
231
+ border-right: 3px solid #fff;
232
+ right: 50%
233
+ }
234
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-close .tos-slide,
235
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-next .tos-slide,
236
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-prev .tos-slide {
237
+ padding-left: 80px;
238
+ padding-right: 80px
239
+ }
240
+ .tos-inline {
241
+ opacity: 0;
242
+ -webkit-transition: opacity .4s ease;
243
+ transition: opacity .4s ease;
244
+ display: inline-block;
245
+ margin: 0;
246
+ position: relative;
247
+ top: auto;
248
+ left: auto;
249
+ right: auto
250
+ }
251
+ .tos-inline.tos-prev {
252
+ margin-right: -60px
253
+ }
254
+ .tos-inline.tos-next {
255
+ margin-left: -60px
256
+ }
257
+ .tos-loading .tos-inline {
258
+ opacity: 0!important
259
+ }
260
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-close,
261
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-next,
262
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-prev {
263
+ -webkit-transform: scale(2);
264
+ -ms-transform: scale(2);
265
+ transform: scale(2)
266
+ }
267
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-close,
268
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-next,
269
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-prev {
270
+ -webkit-transform: scale(3);
271
+ -ms-transform: scale(3);
272
+ transform: scale(3)
273
+ }
274
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-prev,
275
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-prev {
276
+ -webkit-transform-origin: left center;
277
+ -ms-transform-origin: left center;
278
+ transform-origin: left center
279
+ }
280
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-next,
281
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-next {
282
+ -webkit-transform-origin: right center;
283
+ -ms-transform-origin: right center;
284
+ transform-origin: right center
285
+ }
286
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-close,
287
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-close {
288
+ -webkit-transform-origin: right top;
289
+ -ms-transform-origin: right top;
290
+ transform-origin: right top
291
+ }
292
+ .tos-caption {
293
+ color: #fff;
294
+ text-align: center;
295
+ opacity: 0;
296
+ -webkit-transition: opacity .4s ease;
297
+ transition: opacity .4s ease;
298
+ width: 100%;
299
+ position: absolute;
300
+ left: 0;
301
+ bottom: 0;
302
+ z-index: 1
303
+ }
304
+ .tos-caption:after {
305
+ content: '';
306
+ display: block;
307
+ clear: both
308
+ }
309
+ .tos-caption>div {
310
+ white-space: nowrap;
311
+ text-overflow: ellipsis;
312
+ overflow: hidden;
313
+ width: 100%;
314
+ box-sizing: border-box;
315
+ padding: 0 20px;
316
+ float: left
317
+ }
318
+ .tos-caption>div:last-child {
319
+ float: right;
320
+ margin-right: -2px
321
+ }
322
+ .tos-desktop .tos-wrapper:hover .tos-caption,
323
+ .tos-touch .tos-wrapper.tos-hover .tos-caption {
324
+ opacity: 1
325
+ }
326
+ .tos-wrapper .tos-caption {
327
+ line-height: 20px;
328
+ font-size: 15px;
329
+ text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
330
+ height: 40px
331
+ }
332
+ .tos-wrapper.tos-has-caption .tos-uibg {
333
+ height: 100px
334
+ }
335
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-caption .tos-slide {
336
+ padding-bottom: 60px
337
+ }
338
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-caption {
339
+ line-height: 40px;
340
+ font-size: 30px;
341
+ text-shadow: 0 2px 4px rgba(0, 0, 0, .8);
342
+ height: 80px
343
+ }
344
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-caption .tos-uibg {
345
+ height: 200px
346
+ }
347
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-caption {
348
+ line-height: 60px;
349
+ font-size: 45px;
350
+ text-shadow: 0 3px 6px rgba(0, 0, 0, .8);
351
+ height: 120px
352
+ }
353
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-caption .tos-uibg {
354
+ height: 300px
355
+ }
356
+ .tos-wrapper.tos-fx-slide .tos-slider {
357
+ -webkit-transition-property: left, margin;
358
+ transition-property: left, margin
359
+ }
360
+ .tos-pagination {
361
+ text-align: center;
362
+ white-space: nowrap;
363
+ overflow-x: auto;
364
+ -webkit-overflow-scrolling: touch;
365
+ overflow-scrolling: touch;
366
+ opacity: 0;
367
+ -webkit-transition: opacity .4s ease;
368
+ transition: opacity .4s ease;
369
+ width: 100%;
370
+ position: absolute;
371
+ bottom: 0;
372
+ left: 0;
373
+ z-index: 1
374
+ }
375
+ .tos-pagination a {
376
+ display: inline-block
377
+ }
378
+ .tos-pagination.tos-bullets a {
379
+ background-color: rgba(255, 255, 255, .2)
380
+ }
381
+ .tos-pagination.tos-bullets a:hover {
382
+ background-color: rgba(255, 255, 255, .5)
383
+ }
384
+ .tos-pagination.tos-bullets a.tos-selected {
385
+ background-color: rgba(255, 255, 255, .9)
386
+ }
387
+ .tos-desktop .tos-wrapper:hover .tos-pagination,
388
+ .tos-touch .tos-wrapper.tos-hover .tos-pagination {
389
+ opacity: 1
390
+ }
391
+ .tos-wrapper .tos-pagination:after,
392
+ .tos-wrapper .tos-pagination:before {
393
+ content: '';
394
+ display: inline-block;
395
+ width: 20px;
396
+ height: 10px
397
+ }
398
+ .tos-wrapper.tos-has-bullets .tos-pagination {
399
+ height: 30px
400
+ }
401
+ .tos-wrapper.tos-has-bullets .tos-pagination a {
402
+ border-radius: 10px;
403
+ width: 10px;
404
+ height: 10px;
405
+ margin: 0 5px
406
+ }
407
+ .tos-wrapper.tos-has-bullets .tos-caption {
408
+ bottom: 30px
409
+ }
410
+ .tos-wrapper.tos-has-bullets .tos-uibg {
411
+ height: 90px
412
+ }
413
+ .tos-wrapper.tos-has-bullets.tos-has-caption .tos-uibg {
414
+ height: 130px
415
+ }
416
+ .tos-wrapper.tos-has-thumbnails .tos-pagination {
417
+ height: 70px
418
+ }
419
+ .tos-wrapper.tos-has-thumbnails .tos-pagination a {
420
+ background-position: center center;
421
+ background-size: cover;
422
+ width: 50px;
423
+ height: 50px;
424
+ margin: 0 5px
425
+ }
426
+ .tos-wrapper.tos-has-thumbnails .tos-caption {
427
+ bottom: 70px
428
+ }
429
+ .tos-wrapper.tos-has-thumbnails .tos-uibg {
430
+ height: 130px
431
+ }
432
+ .tos-wrapper.tos-has-thumbnails.tos-has-caption .tos-uibg {
433
+ height: 170px
434
+ }
435
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-bullets .tos-slide {
436
+ padding-bottom: 50px
437
+ }
438
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-bullets.tos-has-caption .tos-slide {
439
+ padding-bottom: 80px
440
+ }
441
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-thumbnails .tos-slide {
442
+ padding-bottom: 90px
443
+ }
444
+ .tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-thumbnails.tos-has-caption .tos-slide {
445
+ padding-bottom: 120px
446
+ }
447
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-pagination:after,
448
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-pagination:before {
449
+ content: '';
450
+ display: inline-block;
451
+ width: 40px;
452
+ height: 20px
453
+ }
454
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination {
455
+ height: 60px
456
+ }
457
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination a {
458
+ border-radius: 20px;
459
+ width: 20px;
460
+ height: 20px;
461
+ margin: 0 10px
462
+ }
463
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-caption {
464
+ bottom: 60px
465
+ }
466
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-uibg {
467
+ height: 180px
468
+ }
469
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets.tos-has-caption .tos-uibg {
470
+ height: 260px
471
+ }
472
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination {
473
+ height: 140px
474
+ }
475
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination a {
476
+ background-position: center center;
477
+ background-size: cover;
478
+ width: 100px;
479
+ height: 100px;
480
+ margin: 0 10px
481
+ }
482
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-caption {
483
+ bottom: 140px
484
+ }
485
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-uibg {
486
+ height: 260px
487
+ }
488
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails.tos-has-caption .tos-uibg {
489
+ height: 340px
490
+ }
491
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-pagination:after,
492
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-pagination:before {
493
+ content: '';
494
+ display: inline-block;
495
+ width: 60px;
496
+ height: 30px
497
+ }
498
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination {
499
+ height: 90px
500
+ }
501
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination a {
502
+ border-radius: 30px;
503
+ width: 30px;
504
+ height: 30px;
505
+ margin: 0 15px
506
+ }
507
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-caption {
508
+ bottom: 90px
509
+ }
510
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-uibg {
511
+ height: 270px
512
+ }
513
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets.tos-has-caption .tos-uibg {
514
+ height: 390px
515
+ }
516
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination {
517
+ height: 210px
518
+ }
519
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination a {
520
+ background-position: center center;
521
+ background-size: cover;
522
+ width: 150px;
523
+ height: 150px;
524
+ margin: 0 15px
525
+ }
526
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-caption {
527
+ bottom: 210px
528
+ }
529
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-uibg {
530
+ height: 390px
531
+ }
532
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails.tos-has-caption .tos-uibg {
533
+ height: 510px
534
+ }
535
+ .tos-slide .tos-html {
536
+ -webkit-overflow-scrolling: touch
537
+ }
538
+ .tos-play,
539
+ .tos-play:after {
540
+ display: block;
541
+ position: absolute;
542
+ top: 50%;
543
+ left: 50%
544
+ }
545
+ .tos-play {
546
+ background: #000;
547
+ opacity: 0;
548
+ -webkit-transition: opacity .4s ease;
549
+ transition: opacity .4s ease
550
+ }
551
+ .tos-play:after {
552
+ content: ''
553
+ }
554
+ .tos-desktop .tos-wrapper:hover .tos-play,
555
+ .tos-touch .tos-wrapper.tos-hover .tos-play {
556
+ opacity: .5
557
+ }
558
+ .tos-desktop .tos-wrapper:hover .tos-play:hover,
559
+ .tos-touch .tos-wrapper.tos-hover .tos-play:hover {
560
+ opacity: .9
561
+ }
562
+ .tos-wrapper .tos-play {
563
+ border-radius: 80px;
564
+ width: 80px;
565
+ height: 80px;
566
+ margin: -40px
567
+ }
568
+ .tos-wrapper .tos-play:after {
569
+ border: 20px solid transparent;
570
+ border-left-color: #fff;
571
+ border-left-width: 30px;
572
+ margin-top: -20px;
573
+ margin-left: -10.5px
574
+ }
575
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-play {
576
+ border-radius: 160px;
577
+ width: 160px;
578
+ height: 160px;
579
+ margin: -80px
580
+ }
581
+ .tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-play:after {
582
+ border: 40px solid transparent;
583
+ border-left-color: #fff;
584
+ border-left-width: 60px;
585
+ margin-top: -40px;
586
+ margin-left: -21px
587
+ }
588
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-play {
589
+ border-radius: 240px;
590
+ width: 240px;
591
+ height: 240px;
592
+ margin: -120px
593
+ }
594
+ .tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-play:after {
595
+ border: 60px solid transparent;
596
+ border-left-color: #fff;
597
+ border-left-width: 90px;
598
+ margin-top: -60px;
599
+ margin-left: -31.5px
600
+ }
assets/tosrus/css/jquery.tosrus.min.all.css ADDED
@@ -0,0 +1 @@
 
1
+ .tos-caption>div,.tos-slide,.tos-slide>*{box-sizing:border-box}.tos-slide,.tos-slider,.tos-wrapper{width:100%;height:100%}.tos-noanimation{-webkit-transition-property:none!important;transition-property:none!important}.tos-fastanimation{-webkit-transition-duration:.2s!important;transition-duration:.2s!important;-webkit-transition-timing-function:ease-out!important;transition-timing-function:ease-out!important}.tos-wrapper{opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;display:none;padding:0;margin:0;overflow:hidden}.tos-wrapper.tos-opened{display:block}.tos-slide,.tos-slide:before,.tos-slide>*{display:inline-block}.tos-wrapper.tos-opening{opacity:1}.tos-wrapper.tos-fixed{background-color:#000;position:fixed;top:0;left:0;z-index:9000}.tos-slider,.tos-wrapper.tos-inline{position:relative}.tos-slider{white-space:nowrap;padding:0;margin:0}.tos-uibg,.tos-wrapper.tos-fx-slide.tos-fixed .tos-slider{position:absolute}.tos-wrapper.tos-fx-slide .tos-slider{left:0;-webkit-transition:left .4s ease;transition:left .4s ease}.tos-wrapper.tos-fx-fade .tos-slider{opacity:1;-webkit-transition:opacity .4s ease;transition:opacity .4s ease}.tos-uibg{opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;width:100%;left:0;bottom:0;z-index:1}.tos-fill .tos-uibg{background:-webkit-linear-gradient(bottom,rgba(0,0,0,.5),transparent);background:linear-gradient(to top,rgba(0,0,0,.5),transparent)}.tos-desktop .tos-wrapper:hover .tos-uibg,.tos-touch .tos-wrapper.tos-hover .tos-uibg{opacity:1}.tos-slide{-webkit-overflow-scrolling:touch;line-height:1px;text-align:center;overflow:hidden;position:relative}.tos-slide:before{content:"";height:50%;width:1px;margin-right:-1px}.tos-slide.tos-loading>*{opacity:0}.tos-slide>*{opacity:1;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;vertical-align:middle;max-height:100%;max-width:100%}.tos-slide.tos-html>div{-webkit-overflow-scrolling:touch;white-space:normal;text-align:left;line-height:1.5}.tos-slide.tos-html>div *{-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}.tos-wrapper.tos-fill .tos-slide.tos-image>img{max-height:none;max-width:none;min-height:100%;min-width:100%}.tos-wrapper.tos-fixed .tos-slide.tos-html>div{background-color:#fff;color:#333;box-sizing:border-box;display:inline-block;padding:40px;overflow:auto}.tos-desktop .tos-wrapper.tos-fixed{background-color:rgba(0,0,0,.85)}.tos-desktop .tos-wrapper.tos-fixed.tos-fit .tos-slide{padding:20px}.tos-close,.tos-next{right:20px}.tos-close,.tos-next,.tos-prev{background:#000;border-radius:3px;opacity:0;display:block;width:40px;position:absolute;z-index:1;-webkit-transition:opacity .4s ease;transition:opacity .4s ease}.tos-next,.tos-prev{height:80px;margin-top:-40px;top:50%}.tos-next.tos-disabled,.tos-prev.tos-disabled{cursor:default}.tos-prev{left:20px}.tos-close{height:40px;top:20px}.tos-desktop .tos-wrapper:hover .tos-close,.tos-desktop .tos-wrapper:hover .tos-next,.tos-desktop .tos-wrapper:hover .tos-prev,.tos-touch .tos-wrapper.tos-hover .tos-close,.tos-touch .tos-wrapper.tos-hover .tos-next,.tos-touch .tos-wrapper.tos-hover .tos-prev{opacity:.5}.tos-desktop .tos-wrapper:hover .tos-close:hover,.tos-desktop .tos-wrapper:hover .tos-next:hover,.tos-desktop .tos-wrapper:hover .tos-prev:hover,.tos-touch .tos-wrapper.tos-hover .tos-close:hover,.tos-touch .tos-wrapper.tos-hover .tos-next:hover,.tos-touch .tos-wrapper.tos-hover .tos-prev:hover{opacity:.9}.tos-desktop .tos-wrapper:hover .tos-close.tos-disabled,.tos-desktop .tos-wrapper:hover .tos-next.tos-disabled,.tos-desktop .tos-wrapper:hover .tos-prev.tos-disabled,.tos-touch .tos-wrapper.tos-hover .tos-close.tos-disabled,.tos-touch .tos-wrapper.tos-hover .tos-next.tos-disabled,.tos-touch .tos-wrapper.tos-hover .tos-prev.tos-disabled{opacity:.2}.tos-close span:after,.tos-close span:before,.tos-next span,.tos-prev span{content:'';display:block;width:12px;height:12px;margin:-5px;position:absolute;top:50%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.tos-close span:after,.tos-close span:before{width:6px;height:6px;margin-top:-4px;margin-left:0;margin-right:0}.tos-close span:before,.tos-prev span{border-bottom:3px solid #fff;border-left:3px solid #fff;left:50%}.tos-close span:after,.tos-next span{border-top:3px solid #fff;border-right:3px solid #fff;right:50%}.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-close .tos-slide,.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-next .tos-slide,.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-prev .tos-slide{padding-left:80px;padding-right:80px}.tos-inline{opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease;display:inline-block;margin:0;position:relative;top:auto;left:auto;right:auto}.tos-caption,.tos-pagination{text-align:center;-webkit-transition:opacity .4s ease;width:100%;bottom:0;left:0;z-index:1;position:absolute}.tos-inline.tos-prev{margin-right:-60px}.tos-inline.tos-next{margin-left:-60px}.tos-loading .tos-inline{opacity:0!important}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-close,.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-next,.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-prev{-webkit-transform:scale(2);-ms-transform:scale(2);transform:scale(2)}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-close,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-next,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-prev{-webkit-transform:scale(3);-ms-transform:scale(3);transform:scale(3)}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-prev,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-prev{-webkit-transform-origin:left center;-ms-transform-origin:left center;transform-origin:left center}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-next,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-next{-webkit-transform-origin:right center;-ms-transform-origin:right center;transform-origin:right center}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-close,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-close{-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.tos-caption{color:#fff;opacity:0;transition:opacity .4s ease}.tos-caption:after{content:'';display:block;clear:both}.tos-caption>div{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%;padding:0 20px;float:left}.tos-caption>div:last-child{float:right;margin-right:-2px}.tos-desktop .tos-wrapper:hover .tos-caption,.tos-touch .tos-wrapper.tos-hover .tos-caption{opacity:1}.tos-wrapper .tos-caption{line-height:20px;font-size:15px;text-shadow:0 1px 2px rgba(0,0,0,.8);height:40px}.tos-wrapper.tos-has-caption .tos-uibg{height:100px}.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-caption .tos-slide{padding-bottom:60px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-caption{line-height:40px;font-size:30px;text-shadow:0 2px 4px rgba(0,0,0,.8);height:80px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-caption .tos-uibg{height:200px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-caption{line-height:60px;font-size:45px;text-shadow:0 3px 6px rgba(0,0,0,.8);height:120px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-caption .tos-uibg{height:300px}.tos-wrapper.tos-fx-slide .tos-slider{-webkit-transition-property:left,margin;transition-property:left,margin}.tos-pagination{white-space:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;overflow-scrolling:touch;opacity:0;transition:opacity .4s ease}.tos-pagination a{display:inline-block}.tos-pagination.tos-bullets a{background-color:rgba(255,255,255,.2)}.tos-pagination.tos-bullets a:hover{background-color:rgba(255,255,255,.5)}.tos-pagination.tos-bullets a.tos-selected{background-color:rgba(255,255,255,.9)}.tos-desktop .tos-wrapper:hover .tos-pagination,.tos-touch .tos-wrapper.tos-hover .tos-pagination{opacity:1}.tos-wrapper .tos-pagination:after,.tos-wrapper .tos-pagination:before{content:'';display:inline-block;width:20px;height:10px}.tos-wrapper.tos-has-bullets .tos-pagination{height:30px}.tos-wrapper.tos-has-bullets .tos-pagination a{border-radius:10px;width:10px;height:10px;margin:0 5px}.tos-wrapper.tos-has-bullets .tos-caption{bottom:30px}.tos-wrapper.tos-has-bullets .tos-uibg{height:90px}.tos-wrapper.tos-has-bullets.tos-has-caption .tos-uibg{height:130px}.tos-wrapper.tos-has-thumbnails .tos-pagination{height:70px}.tos-wrapper.tos-has-thumbnails .tos-pagination a{background-position:center center;background-size:cover;width:50px;height:50px;margin:0 5px}.tos-wrapper.tos-has-thumbnails .tos-caption{bottom:70px}.tos-wrapper.tos-has-thumbnails .tos-uibg{height:130px}.tos-wrapper.tos-has-thumbnails.tos-has-caption .tos-uibg{height:170px}.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-bullets .tos-slide{padding-bottom:50px}.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-bullets.tos-has-caption .tos-slide{padding-bottom:80px}.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-thumbnails .tos-slide{padding-bottom:90px}.tos-desktop .tos-wrapper.tos-fixed.tos-fit.tos-has-thumbnails.tos-has-caption .tos-slide{padding-bottom:120px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-pagination:after,.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-pagination:before{content:'';display:inline-block;width:40px;height:20px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination{height:60px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination a{border-radius:20px;width:20px;height:20px;margin:0 10px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-caption{bottom:60px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets .tos-uibg{height:180px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-bullets.tos-has-caption .tos-uibg{height:260px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination{height:140px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination a{background-position:center center;background-size:cover;width:100px;height:100px;margin:0 10px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-caption{bottom:140px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-uibg{height:260px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed.tos-has-thumbnails.tos-has-caption .tos-uibg{height:340px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-pagination:after,.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-pagination:before{content:'';display:inline-block;width:60px;height:30px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination{height:90px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-pagination a{border-radius:30px;width:30px;height:30px;margin:0 15px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-caption{bottom:90px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets .tos-uibg{height:270px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-bullets.tos-has-caption .tos-uibg{height:390px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination{height:210px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-pagination a{background-position:center center;background-size:cover;width:150px;height:150px;margin:0 15px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-caption{bottom:210px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails .tos-uibg{height:390px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed.tos-has-thumbnails.tos-has-caption .tos-uibg{height:510px}.tos-slide .tos-html{-webkit-overflow-scrolling:touch}.tos-play,.tos-play:after{display:block;position:absolute;top:50%;left:50%}.tos-play{background:#000;opacity:0;-webkit-transition:opacity .4s ease;transition:opacity .4s ease}.tos-play:after{content:''}.tos-desktop .tos-wrapper:hover .tos-play,.tos-touch .tos-wrapper.tos-hover .tos-play{opacity:.5}.tos-desktop .tos-wrapper:hover .tos-play:hover,.tos-touch .tos-wrapper.tos-hover .tos-play:hover{opacity:.9}.tos-wrapper .tos-play{border-radius:80px;width:80px;height:80px;margin:-40px}.tos-wrapper .tos-play:after{border:20px solid transparent;border-left-color:#fff;border-left-width:30px;margin-top:-20px;margin-left:-10.5px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-play{border-radius:160px;width:160px;height:160px;margin:-80px}.tos-touch.tos-scale-2 .tos-wrapper.tos-fixed .tos-play:after{border:40px solid transparent;border-left-color:#fff;border-left-width:60px;margin-top:-40px;margin-left:-21px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-play{border-radius:240px;width:240px;height:240px;margin:-120px}.tos-touch.tos-scale-3 .tos-wrapper.tos-fixed .tos-play:after{border:60px solid transparent;border-left-color:#fff;border-left-width:90px;margin-top:-60px;margin-left:-31.5px}
assets/tosrus/js/hammer.js ADDED
@@ -0,0 +1,2643 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Hammer.JS - v2.0.8 - 2016-04-23
2
+ * http://hammerjs.github.io/
3
+ *
4
+ * Copyright (c) 2016 Jorik Tangelder;
5
+ * Licensed under the MIT license */
6
+ (function(window, document, exportName, undefined) {
7
+ 'use strict';
8
+
9
+ var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
10
+ var TEST_ELEMENT = document.createElement('div');
11
+
12
+ var TYPE_FUNCTION = 'function';
13
+
14
+ var round = Math.round;
15
+ var abs = Math.abs;
16
+ var now = Date.now;
17
+
18
+ /**
19
+ * set a timeout with a given scope
20
+ * @param {Function} fn
21
+ * @param {Number} timeout
22
+ * @param {Object} context
23
+ * @returns {number}
24
+ */
25
+ function setTimeoutContext(fn, timeout, context) {
26
+ return setTimeout(bindFn(fn, context), timeout);
27
+ }
28
+
29
+ /**
30
+ * if the argument is an array, we want to execute the fn on each entry
31
+ * if it aint an array we don't want to do a thing.
32
+ * this is used by all the methods that accept a single and array argument.
33
+ * @param {*|Array} arg
34
+ * @param {String} fn
35
+ * @param {Object} [context]
36
+ * @returns {Boolean}
37
+ */
38
+ function invokeArrayArg(arg, fn, context) {
39
+ if (Array.isArray(arg)) {
40
+ each(arg, context[fn], context);
41
+ return true;
42
+ }
43
+ return false;
44
+ }
45
+
46
+ /**
47
+ * walk objects and arrays
48
+ * @param {Object} obj
49
+ * @param {Function} iterator
50
+ * @param {Object} context
51
+ */
52
+ function each(obj, iterator, context) {
53
+ var i;
54
+
55
+ if (!obj) {
56
+ return;
57
+ }
58
+
59
+ if (obj.forEach) {
60
+ obj.forEach(iterator, context);
61
+ } else if (obj.length !== undefined) {
62
+ i = 0;
63
+ while (i < obj.length) {
64
+ iterator.call(context, obj[i], i, obj);
65
+ i++;
66
+ }
67
+ } else {
68
+ for (i in obj) {
69
+ obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
70
+ }
71
+ }
72
+ }
73
+
74
+ /**
75
+ * wrap a method with a deprecation warning and stack trace
76
+ * @param {Function} method
77
+ * @param {String} name
78
+ * @param {String} message
79
+ * @returns {Function} A new function wrapping the supplied method.
80
+ */
81
+ function deprecate(method, name, message) {
82
+ var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
83
+ return function() {
84
+ var e = new Error('get-stack-trace');
85
+ var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
86
+ .replace(/^\s+at\s+/gm, '')
87
+ .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
88
+
89
+ var log = window.console && (window.console.warn || window.console.log);
90
+ if (log) {
91
+ log.call(window.console, deprecationMessage, stack);
92
+ }
93
+ return method.apply(this, arguments);
94
+ };
95
+ }
96
+
97
+ /**
98
+ * extend object.
99
+ * means that properties in dest will be overwritten by the ones in src.
100
+ * @param {Object} target
101
+ * @param {...Object} objects_to_assign
102
+ * @returns {Object} target
103
+ */
104
+ var assign;
105
+ if (typeof Object.assign !== 'function') {
106
+ assign = function assign(target) {
107
+ if (target === undefined || target === null) {
108
+ throw new TypeError('Cannot convert undefined or null to object');
109
+ }
110
+
111
+ var output = Object(target);
112
+ for (var index = 1; index < arguments.length; index++) {
113
+ var source = arguments[index];
114
+ if (source !== undefined && source !== null) {
115
+ for (var nextKey in source) {
116
+ if (source.hasOwnProperty(nextKey)) {
117
+ output[nextKey] = source[nextKey];
118
+ }
119
+ }
120
+ }
121
+ }
122
+ return output;
123
+ };
124
+ } else {
125
+ assign = Object.assign;
126
+ }
127
+
128
+ /**
129
+ * extend object.
130
+ * means that properties in dest will be overwritten by the ones in src.
131
+ * @param {Object} dest
132
+ * @param {Object} src
133
+ * @param {Boolean} [merge=false]
134
+ * @returns {Object} dest
135
+ */
136
+ var extend = deprecate(function extend(dest, src, merge) {
137
+ var keys = Object.keys(src);
138
+ var i = 0;
139
+ while (i < keys.length) {
140
+ if (!merge || (merge && dest[keys[i]] === undefined)) {
141
+ dest[keys[i]] = src[keys[i]];
142
+ }
143
+ i++;
144
+ }
145
+ return dest;
146
+ }, 'extend', 'Use `assign`.');
147
+
148
+ /**
149
+ * merge the values from src in the dest.
150
+ * means that properties that exist in dest will not be overwritten by src
151
+ * @param {Object} dest
152
+ * @param {Object} src
153
+ * @returns {Object} dest
154
+ */
155
+ var merge = deprecate(function merge(dest, src) {
156
+ return extend(dest, src, true);
157
+ }, 'merge', 'Use `assign`.');
158
+
159
+ /**
160
+ * simple class inheritance
161
+ * @param {Function} child
162
+ * @param {Function} base
163
+ * @param {Object} [properties]
164
+ */
165
+ function inherit(child, base, properties) {
166
+ var baseP = base.prototype,
167
+ childP;
168
+
169
+ childP = child.prototype = Object.create(baseP);
170
+ childP.constructor = child;
171
+ childP._super = baseP;
172
+
173
+ if (properties) {
174
+ assign(childP, properties);
175
+ }
176
+ }
177
+
178
+ /**
179
+ * simple function bind
180
+ * @param {Function} fn
181
+ * @param {Object} context
182
+ * @returns {Function}
183
+ */
184
+ function bindFn(fn, context) {
185
+ return function boundFn() {
186
+ return fn.apply(context, arguments);
187
+ };
188
+ }
189
+
190
+ /**
191
+ * let a boolean value also be a function that must return a boolean
192
+ * this first item in args will be used as the context
193
+ * @param {Boolean|Function} val
194
+ * @param {Array} [args]
195
+ * @returns {Boolean}
196
+ */
197
+ function boolOrFn(val, args) {
198
+ if (typeof val == TYPE_FUNCTION) {
199
+ return val.apply(args ? args[0] || undefined : undefined, args);
200
+ }
201
+ return val;
202
+ }
203
+
204
+ /**
205
+ * use the val2 when val1 is undefined
206
+ * @param {*} val1
207
+ * @param {*} val2
208
+ * @returns {*}
209
+ */
210
+ function ifUndefined(val1, val2) {
211
+ return (val1 === undefined) ? val2 : val1;
212
+ }
213
+
214
+ /**
215
+ * addEventListener with multiple events at once
216
+ * @param {EventTarget} target
217
+ * @param {String} types
218
+ * @param {Function} handler
219
+ */
220
+ function addEventListeners(target, types, handler) {
221
+ each(splitStr(types), function(type) {
222
+ target.addEventListener(type, handler, false);
223
+ });
224
+ }
225
+
226
+ /**
227
+ * removeEventListener with multiple events at once
228
+ * @param {EventTarget} target
229
+ * @param {String} types
230
+ * @param {Function} handler
231
+ */
232
+ function removeEventListeners(target, types, handler) {
233
+ each(splitStr(types), function(type) {
234
+ target.removeEventListener(type, handler, false);
235
+ });
236
+ }
237
+
238
+ /**
239
+ * find if a node is in the given parent
240
+ * @method hasParent
241
+ * @param {HTMLElement} node
242
+ * @param {HTMLElement} parent
243
+ * @return {Boolean} found
244
+ */
245
+ function hasParent(node, parent) {
246
+ while (node) {
247
+ if (node == parent) {
248
+ return true;
249
+ }
250
+ node = node.parentNode;
251
+ }
252
+ return false;
253
+ }
254
+
255
+ /**
256
+ * small indexOf wrapper
257
+ * @param {String} str
258
+ * @param {String} find
259
+ * @returns {Boolean} found
260
+ */
261
+ function inStr(str, find) {
262
+ return str.indexOf(find) > -1;
263
+ }
264
+
265
+ /**
266
+ * split string on whitespace
267
+ * @param {String} str
268
+ * @returns {Array} words
269
+ */
270
+ function splitStr(str) {
271
+ return str.trim().split(/\s+/g);
272
+ }
273
+
274
+ /**
275
+ * find if a array contains the object using indexOf or a simple polyFill
276
+ * @param {Array} src
277
+ * @param {String} find
278
+ * @param {String} [findByKey]
279
+ * @return {Boolean|Number} false when not found, or the index
280
+ */
281
+ function inArray(src, find, findByKey) {
282
+ if (src.indexOf && !findByKey) {
283
+ return src.indexOf(find);
284
+ } else {
285
+ var i = 0;
286
+ while (i < src.length) {
287
+ if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
288
+ return i;
289
+ }
290
+ i++;
291
+ }
292
+ return -1;
293
+ }
294
+ }
295
+
296
+ /**
297
+ * convert array-like objects to real arrays
298
+ * @param {Object} obj
299
+ * @returns {Array}
300
+ */
301
+ function toArray(obj) {
302
+ return Array.prototype.slice.call(obj, 0);
303
+ }
304
+
305
+ /**
306
+ * unique array with objects based on a key (like 'id') or just by the array's value
307
+ * @param {Array} src [{id:1},{id:2},{id:1}]
308
+ * @param {String} [key]
309
+ * @param {Boolean} [sort=False]
310
+ * @returns {Array} [{id:1},{id:2}]
311
+ */
312
+ function uniqueArray(src, key, sort) {
313
+ var results = [];
314
+ var values = [];
315
+ var i = 0;
316
+
317
+ while (i < src.length) {
318
+ var val = key ? src[i][key] : src[i];
319
+ if (inArray(values, val) < 0) {
320
+ results.push(src[i]);
321
+ }
322
+ values[i] = val;
323
+ i++;
324
+ }
325
+
326
+ if (sort) {
327
+ if (!key) {
328
+ results = results.sort();
329
+ } else {
330
+ results = results.sort(function sortUniqueArray(a, b) {
331
+ return a[key] > b[key];
332
+ });
333
+ }
334
+ }
335
+
336
+ return results;
337
+ }
338
+
339
+ /**
340
+ * get the prefixed property
341
+ * @param {Object} obj
342
+ * @param {String} property
343
+ * @returns {String|Undefined} prefixed
344
+ */
345
+ function prefixed(obj, property) {
346
+ var prefix, prop;
347
+ var camelProp = property[0].toUpperCase() + property.slice(1);
348
+
349
+ var i = 0;
350
+ while (i < VENDOR_PREFIXES.length) {
351
+ prefix = VENDOR_PREFIXES[i];
352
+ prop = (prefix) ? prefix + camelProp : property;
353
+
354
+ if (prop in obj) {
355
+ return prop;
356
+ }
357
+ i++;
358
+ }
359
+ return undefined;
360
+ }
361
+
362
+ /**
363
+ * get a unique id
364
+ * @returns {number} uniqueId
365
+ */
366
+ var _uniqueId = 1;
367
+ function uniqueId() {
368
+ return _uniqueId++;
369
+ }
370
+
371
+ /**
372
+ * get the window object of an element
373
+ * @param {HTMLElement} element
374
+ * @returns {DocumentView|Window}
375
+ */
376
+ function getWindowForElement(element) {
377
+ var doc = element.ownerDocument || element;
378
+ return (doc.defaultView || doc.parentWindow || window);
379
+ }
380
+
381
+ var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
382
+
383
+ var SUPPORT_TOUCH = ('ontouchstart' in window);
384
+ var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
385
+ var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
386
+
387
+ var INPUT_TYPE_TOUCH = 'touch';
388
+ var INPUT_TYPE_PEN = 'pen';
389
+ var INPUT_TYPE_MOUSE = 'mouse';
390
+ var INPUT_TYPE_KINECT = 'kinect';
391
+
392
+ var COMPUTE_INTERVAL = 25;
393
+
394
+ var INPUT_START = 1;
395
+ var INPUT_MOVE = 2;
396
+ var INPUT_END = 4;
397
+ var INPUT_CANCEL = 8;
398
+
399
+ var DIRECTION_NONE = 1;
400
+ var DIRECTION_LEFT = 2;
401
+ var DIRECTION_RIGHT = 4;
402
+ var DIRECTION_UP = 8;
403
+ var DIRECTION_DOWN = 16;
404
+
405
+ var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
406
+ var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
407
+ var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
408
+
409
+ var PROPS_XY = ['x', 'y'];
410
+ var PROPS_CLIENT_XY = ['clientX', 'clientY'];
411
+
412
+ /**
413
+ * create new input type manager
414
+ * @param {Manager} manager
415
+ * @param {Function} callback
416
+ * @returns {Input}
417
+ * @constructor
418
+ */
419
+ function Input(manager, callback) {
420
+ var self = this;
421
+ this.manager = manager;
422
+ this.callback = callback;
423
+ this.element = manager.element;
424
+ this.target = manager.options.inputTarget;
425
+
426
+ // smaller wrapper around the handler, for the scope and the enabled state of the manager,
427
+ // so when disabled the input events are completely bypassed.
428
+ this.domHandler = function(ev) {
429
+ if (boolOrFn(manager.options.enable, [manager])) {
430
+ self.handler(ev);
431
+ }
432
+ };
433
+
434
+ this.init();
435
+
436
+ }
437
+
438
+ Input.prototype = {
439
+ /**
440
+ * should handle the inputEvent data and trigger the callback
441
+ * @virtual
442
+ */
443
+ handler: function() { },
444
+
445
+ /**
446
+ * bind the events
447
+ */
448
+ init: function() {
449
+ this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
450
+ this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
451
+ this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
452
+ },
453
+
454
+ /**
455
+ * unbind the events
456
+ */
457
+ destroy: function() {
458
+ this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
459
+ this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
460
+ this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
461
+ }
462
+ };
463
+
464
+ /**
465
+ * create new input type manager
466
+ * called by the Manager constructor
467
+ * @param {Hammer} manager
468
+ * @returns {Input}
469
+ */
470
+ function createInputInstance(manager) {
471
+ var Type;
472
+ var inputClass = manager.options.inputClass;
473
+
474
+ if (inputClass) {
475
+ Type = inputClass;
476
+ } else if (SUPPORT_POINTER_EVENTS) {
477
+ Type = PointerEventInput;
478
+ } else if (SUPPORT_ONLY_TOUCH) {
479
+ Type = TouchInput;
480
+ } else if (!SUPPORT_TOUCH) {
481
+ Type = MouseInput;
482
+ } else {
483
+ Type = TouchMouseInput;
484
+ }
485
+ return new (Type)(manager, inputHandler);
486
+ }
487
+
488
+ /**
489
+ * handle input events
490
+ * @param {Manager} manager
491
+ * @param {String} eventType
492
+ * @param {Object} input
493
+ */
494
+ function inputHandler(manager, eventType, input) {
495
+ var pointersLen = input.pointers.length;
496
+ var changedPointersLen = input.changedPointers.length;
497
+ var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
498
+ var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
499
+
500
+ input.isFirst = !!isFirst;
501
+ input.isFinal = !!isFinal;
502
+
503
+ if (isFirst) {
504
+ manager.session = {};
505
+ }
506
+
507
+ // source event is the normalized value of the domEvents
508
+ // like 'touchstart, mouseup, pointerdown'
509
+ input.eventType = eventType;
510
+
511
+ // compute scale, rotation etc
512
+ computeInputData(manager, input);
513
+
514
+ // emit secret event
515
+ manager.emit('hammer.input', input);
516
+
517
+ manager.recognize(input);
518
+ manager.session.prevInput = input;
519
+ }
520
+
521
+ /**
522
+ * extend the data with some usable properties like scale, rotate, velocity etc
523
+ * @param {Object} manager
524
+ * @param {Object} input
525
+ */
526
+ function computeInputData(manager, input) {
527
+ var session = manager.session;
528
+ var pointers = input.pointers;
529
+ var pointersLength = pointers.length;
530
+
531
+ // store the first input to calculate the distance and direction
532
+ if (!session.firstInput) {
533
+ session.firstInput = simpleCloneInputData(input);
534
+ }
535
+
536
+ // to compute scale and rotation we need to store the multiple touches
537
+ if (pointersLength > 1 && !session.firstMultiple) {
538
+ session.firstMultiple = simpleCloneInputData(input);
539
+ } else if (pointersLength === 1) {
540
+ session.firstMultiple = false;
541
+ }
542
+
543
+ var firstInput = session.firstInput;
544
+ var firstMultiple = session.firstMultiple;
545
+ var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
546
+
547
+ var center = input.center = getCenter(pointers);
548
+ input.timeStamp = now();
549
+ input.deltaTime = input.timeStamp - firstInput.timeStamp;
550
+
551
+ input.angle = getAngle(offsetCenter, center);
552
+ input.distance = getDistance(offsetCenter, center);
553
+
554
+ computeDeltaXY(session, input);
555
+ input.offsetDirection = getDirection(input.deltaX, input.deltaY);
556
+
557
+ var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
558
+ input.overallVelocityX = overallVelocity.x;
559
+ input.overallVelocityY = overallVelocity.y;
560
+ input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
561
+
562
+ input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
563
+ input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
564
+
565
+ input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
566
+ session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
567
+
568
+ computeIntervalInputData(session, input);
569
+
570
+ // find the correct target
571
+ var target = manager.element;
572
+ if (hasParent(input.srcEvent.target, target)) {
573
+ target = input.srcEvent.target;
574
+ }
575
+ input.target = target;
576
+ }
577
+
578
+ function computeDeltaXY(session, input) {
579
+ var center = input.center;
580
+ var offset = session.offsetDelta || {};
581
+ var prevDelta = session.prevDelta || {};
582
+ var prevInput = session.prevInput || {};
583
+
584
+ if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
585
+ prevDelta = session.prevDelta = {
586
+ x: prevInput.deltaX || 0,
587
+ y: prevInput.deltaY || 0
588
+ };
589
+
590
+ offset = session.offsetDelta = {
591
+ x: center.x,
592
+ y: center.y
593
+ };
594
+ }
595
+
596
+ input.deltaX = prevDelta.x + (center.x - offset.x);
597
+ input.deltaY = prevDelta.y + (center.y - offset.y);
598
+ }
599
+
600
+ /**
601
+ * velocity is calculated every x ms
602
+ * @param {Object} session
603
+ * @param {Object} input
604
+ */
605
+ function computeIntervalInputData(session, input) {
606
+ var last = session.lastInterval || input,
607
+ deltaTime = input.timeStamp - last.timeStamp,
608
+ velocity, velocityX, velocityY, direction;
609
+
610
+ if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
611
+ var deltaX = input.deltaX - last.deltaX;
612
+ var deltaY = input.deltaY - last.deltaY;
613
+
614
+ var v = getVelocity(deltaTime, deltaX, deltaY);
615
+ velocityX = v.x;
616
+ velocityY = v.y;
617
+ velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
618
+ direction = getDirection(deltaX, deltaY);
619
+
620
+ session.lastInterval = input;
621
+ } else {
622
+ // use latest velocity info if it doesn't overtake a minimum period
623
+ velocity = last.velocity;
624
+ velocityX = last.velocityX;
625
+ velocityY = last.velocityY;
626
+ direction = last.direction;
627
+ }
628
+
629
+ input.velocity = velocity;
630
+ input.velocityX = velocityX;
631
+ input.velocityY = velocityY;
632
+ input.direction = direction;
633
+ }
634
+
635
+ /**
636
+ * create a simple clone from the input used for storage of firstInput and firstMultiple
637
+ * @param {Object} input
638
+ * @returns {Object} clonedInputData
639
+ */
640
+ function simpleCloneInputData(input) {
641
+ // make a simple copy of the pointers because we will get a reference if we don't
642
+ // we only need clientXY for the calculations
643
+ var pointers = [];
644
+ var i = 0;
645
+ while (i < input.pointers.length) {
646
+ pointers[i] = {
647
+ clientX: round(input.pointers[i].clientX),
648
+ clientY: round(input.pointers[i].clientY)
649
+ };
650
+ i++;
651
+ }
652
+
653
+ return {
654
+ timeStamp: now(),
655
+ pointers: pointers,
656
+ center: getCenter(pointers),
657
+ deltaX: input.deltaX,
658
+ deltaY: input.deltaY
659
+ };
660
+ }
661
+
662
+ /**
663
+ * get the center of all the pointers
664
+ * @param {Array} pointers
665
+ * @return {Object} center contains `x` and `y` properties
666
+ */
667
+ function getCenter(pointers) {
668
+ var pointersLength = pointers.length;
669
+
670
+ // no need to loop when only one touch
671
+ if (pointersLength === 1) {
672
+ return {
673
+ x: round(pointers[0].clientX),
674
+ y: round(pointers[0].clientY)
675
+ };
676
+ }
677
+
678
+ var x = 0, y = 0, i = 0;
679
+ while (i < pointersLength) {
680
+ x += pointers[i].clientX;
681
+ y += pointers[i].clientY;
682
+ i++;
683
+ }
684
+
685
+ return {
686
+ x: round(x / pointersLength),
687
+ y: round(y / pointersLength)
688
+ };
689
+ }
690
+
691
+ /**
692
+ * calculate the velocity between two points. unit is in px per ms.
693
+ * @param {Number} deltaTime
694
+ * @param {Number} x
695
+ * @param {Number} y
696
+ * @return {Object} velocity `x` and `y`
697
+ */
698
+ function getVelocity(deltaTime, x, y) {
699
+ return {
700
+ x: x / deltaTime || 0,
701
+ y: y / deltaTime || 0
702
+ };
703
+ }
704
+
705
+ /**
706
+ * get the direction between two points
707
+ * @param {Number} x
708
+ * @param {Number} y
709
+ * @return {Number} direction
710
+ */
711
+ function getDirection(x, y) {
712
+ if (x === y) {
713
+ return DIRECTION_NONE;
714
+ }
715
+
716
+ if (abs(x) >= abs(y)) {
717
+ return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
718
+ }
719
+ return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
720
+ }
721
+
722
+ /**
723
+ * calculate the absolute distance between two points
724
+ * @param {Object} p1 {x, y}
725
+ * @param {Object} p2 {x, y}
726
+ * @param {Array} [props] containing x and y keys
727
+ * @return {Number} distance
728
+ */
729
+ function getDistance(p1, p2, props) {
730
+ if (!props) {
731
+ props = PROPS_XY;
732
+ }
733
+ var x = p2[props[0]] - p1[props[0]],
734
+ y = p2[props[1]] - p1[props[1]];
735
+
736
+ return Math.sqrt((x * x) + (y * y));
737
+ }
738
+
739
+ /**
740
+ * calculate the angle between two coordinates
741
+ * @param {Object} p1
742
+ * @param {Object} p2
743
+ * @param {Array} [props] containing x and y keys
744
+ * @return {Number} angle
745
+ */
746
+ function getAngle(p1, p2, props) {
747
+ if (!props) {
748
+ props = PROPS_XY;
749
+ }
750
+ var x = p2[props[0]] - p1[props[0]],
751
+ y = p2[props[1]] - p1[props[1]];
752
+ return Math.atan2(y, x) * 180 / Math.PI;
753
+ }
754
+
755
+ /**
756
+ * calculate the rotation degrees between two pointersets
757
+ * @param {Array} start array of pointers
758
+ * @param {Array} end array of pointers
759
+ * @return {Number} rotation
760
+ */
761
+ function getRotation(start, end) {
762
+ return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
763
+ }
764
+
765
+ /**
766
+ * calculate the scale factor between two pointersets
767
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
768
+ * @param {Array} start array of pointers
769
+ * @param {Array} end array of pointers
770
+ * @return {Number} scale
771
+ */
772
+ function getScale(start, end) {
773
+ return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
774
+ }
775
+
776
+ var MOUSE_INPUT_MAP = {
777
+ mousedown: INPUT_START,
778
+ mousemove: INPUT_MOVE,
779
+ mouseup: INPUT_END
780
+ };
781
+
782
+ var MOUSE_ELEMENT_EVENTS = 'mousedown';
783
+ var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
784
+
785
+ /**
786
+ * Mouse events input
787
+ * @constructor
788
+ * @extends Input
789
+ */
790
+ function MouseInput() {
791
+ this.evEl = MOUSE_ELEMENT_EVENTS;
792
+ this.evWin = MOUSE_WINDOW_EVENTS;
793
+
794
+ this.pressed = false; // mousedown state
795
+
796
+ Input.apply(this, arguments);
797
+ }
798
+
799
+ inherit(MouseInput, Input, {
800
+ /**
801
+ * handle mouse events
802
+ * @param {Object} ev
803
+ */
804
+ handler: function MEhandler(ev) {
805
+ var eventType = MOUSE_INPUT_MAP[ev.type];
806
+
807
+ // on start we want to have the left mouse button down
808
+ if (eventType & INPUT_START && ev.button === 0) {
809
+ this.pressed = true;
810
+ }
811
+
812
+ if (eventType & INPUT_MOVE && ev.which !== 1) {
813
+ eventType = INPUT_END;
814
+ }
815
+
816
+ // mouse must be down
817
+ if (!this.pressed) {
818
+ return;
819
+ }
820
+
821
+ if (eventType & INPUT_END) {
822
+ this.pressed = false;
823
+ }
824
+
825
+ this.callback(this.manager, eventType, {
826
+ pointers: [ev],
827
+ changedPointers: [ev],
828
+ pointerType: INPUT_TYPE_MOUSE,
829
+ srcEvent: ev
830
+ });
831
+ }
832
+ });
833
+
834
+ var POINTER_INPUT_MAP = {
835
+ pointerdown: INPUT_START,
836
+ pointermove: INPUT_MOVE,
837
+ pointerup: INPUT_END,
838
+ pointercancel: INPUT_CANCEL,
839
+ pointerout: INPUT_CANCEL
840
+ };
841
+
842
+ // in IE10 the pointer types is defined as an enum
843
+ var IE10_POINTER_TYPE_ENUM = {
844
+ 2: INPUT_TYPE_TOUCH,
845
+ 3: INPUT_TYPE_PEN,
846
+ 4: INPUT_TYPE_MOUSE,
847
+ 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
848
+ };
849
+
850
+ var POINTER_ELEMENT_EVENTS = 'pointerdown';
851
+ var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
852
+
853
+ // IE10 has prefixed support, and case-sensitive
854
+ if (window.MSPointerEvent && !window.PointerEvent) {
855
+ POINTER_ELEMENT_EVENTS = 'MSPointerDown';
856
+ POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
857
+ }
858
+
859
+ /**
860
+ * Pointer events input
861
+ * @constructor
862
+ * @extends Input
863
+ */
864
+ function PointerEventInput() {
865
+ this.evEl = POINTER_ELEMENT_EVENTS;
866
+ this.evWin = POINTER_WINDOW_EVENTS;
867
+
868
+ Input.apply(this, arguments);
869
+
870
+ this.store = (this.manager.session.pointerEvents = []);
871
+ }
872
+
873
+ inherit(PointerEventInput, Input, {
874
+ /**
875
+ * handle mouse events
876
+ * @param {Object} ev
877
+ */
878
+ handler: function PEhandler(ev) {
879
+ var store = this.store;
880
+ var removePointer = false;
881
+
882
+ var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
883
+ var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
884
+ var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
885
+
886
+ var isTouch = (pointerType == INPUT_TYPE_TOUCH);
887
+
888
+ // get index of the event in the store
889
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
890
+
891
+ // start and mouse must be down
892
+ if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
893
+ if (storeIndex < 0) {
894
+ store.push(ev);
895
+ storeIndex = store.length - 1;
896
+ }
897
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
898
+ removePointer = true;
899
+ }
900
+
901
+ // it not found, so the pointer hasn't been down (so it's probably a hover)
902
+ if (storeIndex < 0) {
903
+ return;
904
+ }
905
+
906
+ // update the event in the store
907
+ store[storeIndex] = ev;
908
+
909
+ this.callback(this.manager, eventType, {
910
+ pointers: store,
911
+ changedPointers: [ev],
912
+ pointerType: pointerType,
913
+ srcEvent: ev
914
+ });
915
+
916
+ if (removePointer) {
917
+ // remove from the store
918
+ store.splice(storeIndex, 1);
919
+ }
920
+ }
921
+ });
922
+
923
+ var SINGLE_TOUCH_INPUT_MAP = {
924
+ touchstart: INPUT_START,
925
+ touchmove: INPUT_MOVE,
926
+ touchend: INPUT_END,
927
+ touchcancel: INPUT_CANCEL
928
+ };
929
+
930
+ var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
931
+ var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
932
+
933
+ /**
934
+ * Touch events input
935
+ * @constructor
936
+ * @extends Input
937
+ */
938
+ function SingleTouchInput() {
939
+ this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
940
+ this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
941
+ this.started = false;
942
+
943
+ Input.apply(this, arguments);
944
+ }
945
+
946
+ inherit(SingleTouchInput, Input, {
947
+ handler: function TEhandler(ev) {
948
+ var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
949
+
950
+ // should we handle the touch events?
951
+ if (type === INPUT_START) {
952
+ this.started = true;
953
+ }
954
+
955
+ if (!this.started) {
956
+ return;
957
+ }
958
+
959
+ var touches = normalizeSingleTouches.call(this, ev, type);
960
+
961
+ // when done, reset the started state
962
+ if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
963
+ this.started = false;
964
+ }
965
+
966
+ this.callback(this.manager, type, {
967
+ pointers: touches[0],
968
+ changedPointers: touches[1],
969
+ pointerType: INPUT_TYPE_TOUCH,
970
+ srcEvent: ev
971
+ });
972
+ }
973
+ });
974
+
975
+ /**
976
+ * @this {TouchInput}
977
+ * @param {Object} ev
978
+ * @param {Number} type flag
979
+ * @returns {undefined|Array} [all, changed]
980
+ */
981
+ function normalizeSingleTouches(ev, type) {
982
+ var all = toArray(ev.touches);
983
+ var changed = toArray(ev.changedTouches);
984
+
985
+ if (type & (INPUT_END | INPUT_CANCEL)) {
986
+ all = uniqueArray(all.concat(changed), 'identifier', true);
987
+ }
988
+
989
+ return [all, changed];
990
+ }
991
+
992
+ var TOUCH_INPUT_MAP = {
993
+ touchstart: INPUT_START,
994
+ touchmove: INPUT_MOVE,
995
+ touchend: INPUT_END,
996
+ touchcancel: INPUT_CANCEL
997
+ };
998
+
999
+ var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
1000
+
1001
+ /**
1002
+ * Multi-user touch events input
1003
+ * @constructor
1004
+ * @extends Input
1005
+ */
1006
+ function TouchInput() {
1007
+ this.evTarget = TOUCH_TARGET_EVENTS;
1008
+ this.targetIds = {};
1009
+
1010
+ Input.apply(this, arguments);
1011
+ }
1012
+
1013
+ inherit(TouchInput, Input, {
1014
+ handler: function MTEhandler(ev) {
1015
+ var type = TOUCH_INPUT_MAP[ev.type];
1016
+ var touches = getTouches.call(this, ev, type);
1017
+ if (!touches) {
1018
+ return;
1019
+ }
1020
+
1021
+ this.callback(this.manager, type, {
1022
+ pointers: touches[0],
1023
+ changedPointers: touches[1],
1024
+ pointerType: INPUT_TYPE_TOUCH,
1025
+ srcEvent: ev
1026
+ });
1027
+ }
1028
+ });
1029
+
1030
+ /**
1031
+ * @this {TouchInput}
1032
+ * @param {Object} ev
1033
+ * @param {Number} type flag
1034
+ * @returns {undefined|Array} [all, changed]
1035
+ */
1036
+ function getTouches(ev, type) {
1037
+ var allTouches = toArray(ev.touches);
1038
+ var targetIds = this.targetIds;
1039
+
1040
+ // when there is only one touch, the process can be simplified
1041
+ if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
1042
+ targetIds[allTouches[0].identifier] = true;
1043
+ return [allTouches, allTouches];
1044
+ }
1045
+
1046
+ var i,
1047
+ targetTouches,
1048
+ changedTouches = toArray(ev.changedTouches),
1049
+ changedTargetTouches = [],
1050
+ target = this.target;
1051
+
1052
+ // get target touches from touches
1053
+ targetTouches = allTouches.filter(function(touch) {
1054
+ return hasParent(touch.target, target);
1055
+ });
1056
+
1057
+ // collect touches
1058
+ if (type === INPUT_START) {
1059
+ i = 0;
1060
+ while (i < targetTouches.length) {
1061
+ targetIds[targetTouches[i].identifier] = true;
1062
+ i++;
1063
+ }
1064
+ }
1065
+
1066
+ // filter changed touches to only contain touches that exist in the collected target ids
1067
+ i = 0;
1068
+ while (i < changedTouches.length) {
1069
+ if (targetIds[changedTouches[i].identifier]) {
1070
+ changedTargetTouches.push(changedTouches[i]);
1071
+ }
1072
+
1073
+ // cleanup removed touches
1074
+ if (type & (INPUT_END | INPUT_CANCEL)) {
1075
+ delete targetIds[changedTouches[i].identifier];
1076
+ }
1077
+ i++;
1078
+ }
1079
+
1080
+ if (!changedTargetTouches.length) {
1081
+ return;
1082
+ }
1083
+
1084
+ return [
1085
+ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
1086
+ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
1087
+ changedTargetTouches
1088
+ ];
1089
+ }
1090
+
1091
+ /**
1092
+ * Combined touch and mouse input
1093
+ *
1094
+ * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
1095
+ * This because touch devices also emit mouse events while doing a touch.
1096
+ *
1097
+ * @constructor
1098
+ * @extends Input
1099
+ */
1100
+
1101
+ var DEDUP_TIMEOUT = 2500;
1102
+ var DEDUP_DISTANCE = 25;
1103
+
1104
+ function TouchMouseInput() {
1105
+ Input.apply(this, arguments);
1106
+
1107
+ var handler = bindFn(this.handler, this);
1108
+ this.touch = new TouchInput(this.manager, handler);
1109
+ this.mouse = new MouseInput(this.manager, handler);
1110
+
1111
+ this.primaryTouch = null;
1112
+ this.lastTouches = [];
1113
+ }
1114
+
1115
+ inherit(TouchMouseInput, Input, {
1116
+ /**
1117
+ * handle mouse and touch events
1118
+ * @param {Hammer} manager
1119
+ * @param {String} inputEvent
1120
+ * @param {Object} inputData
1121
+ */
1122
+ handler: function TMEhandler(manager, inputEvent, inputData) {
1123
+ var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
1124
+ isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
1125
+
1126
+ if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
1127
+ return;
1128
+ }
1129
+
1130
+ // when we're in a touch event, record touches to de-dupe synthetic mouse event
1131
+ if (isTouch) {
1132
+ recordTouches.call(this, inputEvent, inputData);
1133
+ } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
1134
+ return;
1135
+ }
1136
+
1137
+ this.callback(manager, inputEvent, inputData);
1138
+ },
1139
+
1140
+ /**
1141
+ * remove the event listeners
1142
+ */
1143
+ destroy: function destroy() {
1144
+ this.touch.destroy();
1145
+ this.mouse.destroy();
1146
+ }
1147
+ });
1148
+
1149
+ function recordTouches(eventType, eventData) {
1150
+ if (eventType & INPUT_START) {
1151
+ this.primaryTouch = eventData.changedPointers[0].identifier;
1152
+ setLastTouch.call(this, eventData);
1153
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
1154
+ setLastTouch.call(this, eventData);
1155
+ }
1156
+ }
1157
+
1158
+ function setLastTouch(eventData) {
1159
+ var touch = eventData.changedPointers[0];
1160
+
1161
+ if (touch.identifier === this.primaryTouch) {
1162
+ var lastTouch = {x: touch.clientX, y: touch.clientY};
1163
+ this.lastTouches.push(lastTouch);
1164
+ var lts = this.lastTouches;
1165
+ var removeLastTouch = function() {
1166
+ var i = lts.indexOf(lastTouch);
1167
+ if (i > -1) {
1168
+ lts.splice(i, 1);
1169
+ }
1170
+ };
1171
+ setTimeout(removeLastTouch, DEDUP_TIMEOUT);
1172
+ }
1173
+ }
1174
+
1175
+ function isSyntheticEvent(eventData) {
1176
+ var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
1177
+ for (var i = 0; i < this.lastTouches.length; i++) {
1178
+ var t = this.lastTouches[i];
1179
+ var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
1180
+ if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
1181
+ return true;
1182
+ }
1183
+ }
1184
+ return false;
1185
+ }
1186
+
1187
+ var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
1188
+ var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
1189
+
1190
+ // magical touchAction value
1191
+ var TOUCH_ACTION_COMPUTE = 'compute';
1192
+ var TOUCH_ACTION_AUTO = 'auto';
1193
+ var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
1194
+ var TOUCH_ACTION_NONE = 'none';
1195
+ var TOUCH_ACTION_PAN_X = 'pan-x';
1196
+ var TOUCH_ACTION_PAN_Y = 'pan-y';
1197
+ var TOUCH_ACTION_MAP = getTouchActionProps();
1198
+
1199
+ /**
1200
+ * Touch Action
1201
+ * sets the touchAction property or uses the js alternative
1202
+ * @param {Manager} manager
1203
+ * @param {String} value
1204
+ * @constructor
1205
+ */
1206
+ function TouchAction(manager, value) {
1207
+ this.manager = manager;
1208
+ this.set(value);
1209
+ }
1210
+
1211
+ TouchAction.prototype = {
1212
+ /**
1213
+ * set the touchAction value on the element or enable the polyfill
1214
+ * @param {String} value
1215
+ */
1216
+ set: function(value) {
1217
+ // find out the touch-action by the event handlers
1218
+ if (value == TOUCH_ACTION_COMPUTE) {
1219
+ value = this.compute();
1220
+ }
1221
+
1222
+ if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
1223
+ this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
1224
+ }
1225
+ this.actions = value.toLowerCase().trim();
1226
+ },
1227
+
1228
+ /**
1229
+ * just re-set the touchAction value
1230
+ */
1231
+ update: function() {
1232
+ this.set(this.manager.options.touchAction);
1233
+ },
1234
+
1235
+ /**
1236
+ * compute the value for the touchAction property based on the recognizer's settings
1237
+ * @returns {String} value
1238
+ */
1239
+ compute: function() {
1240
+ var actions = [];
1241
+ each(this.manager.recognizers, function(recognizer) {
1242
+ if (boolOrFn(recognizer.options.enable, [recognizer])) {
1243
+ actions = actions.concat(recognizer.getTouchAction());
1244
+ }
1245
+ });
1246
+ return cleanTouchActions(actions.join(' '));
1247
+ },
1248
+
1249
+ /**
1250
+ * this method is called on each input cycle and provides the preventing of the browser behavior
1251
+ * @param {Object} input
1252
+ */
1253
+ preventDefaults: function(input) {
1254
+ var srcEvent = input.srcEvent;
1255
+ var direction = input.offsetDirection;
1256
+
1257
+ // if the touch action did prevented once this session
1258
+ if (this.manager.session.prevented) {
1259
+ srcEvent.preventDefault();
1260
+ return;
1261
+ }
1262
+
1263
+ var actions = this.actions;
1264
+ var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
1265
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
1266
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
1267
+
1268
+ if (hasNone) {
1269
+ //do not prevent defaults if this is a tap gesture
1270
+
1271
+ var isTapPointer = input.pointers.length === 1;
1272
+ var isTapMovement = input.distance < 2;
1273
+ var isTapTouchTime = input.deltaTime < 250;
1274
+
1275
+ if (isTapPointer && isTapMovement && isTapTouchTime) {
1276
+ return;
1277
+ }
1278
+ }
1279
+
1280
+ if (hasPanX && hasPanY) {
1281
+ // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
1282
+ return;
1283
+ }
1284
+
1285
+ if (hasNone ||
1286
+ (hasPanY && direction & DIRECTION_HORIZONTAL) ||
1287
+ (hasPanX && direction & DIRECTION_VERTICAL)) {
1288
+ return this.preventSrc(srcEvent);
1289
+ }
1290
+ },
1291
+
1292
+ /**
1293
+ * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
1294
+ * @param {Object} srcEvent
1295
+ */
1296
+ preventSrc: function(srcEvent) {
1297
+ this.manager.session.prevented = true;
1298
+ srcEvent.preventDefault();
1299
+ }
1300
+ };
1301
+
1302
+ /**
1303
+ * when the touchActions are collected they are not a valid value, so we need to clean things up. *
1304
+ * @param {String} actions
1305
+ * @returns {*}
1306
+ */
1307
+ function cleanTouchActions(actions) {
1308
+ // none
1309
+ if (inStr(actions, TOUCH_ACTION_NONE)) {
1310
+ return TOUCH_ACTION_NONE;
1311
+ }
1312
+
1313
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
1314
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
1315
+
1316
+ // if both pan-x and pan-y are set (different recognizers
1317
+ // for different directions, e.g. horizontal pan but vertical swipe?)
1318
+ // we need none (as otherwise with pan-x pan-y combined none of these
1319
+ // recognizers will work, since the browser would handle all panning
1320
+ if (hasPanX && hasPanY) {
1321
+ return TOUCH_ACTION_NONE;
1322
+ }
1323
+
1324
+ // pan-x OR pan-y
1325
+ if (hasPanX || hasPanY) {
1326
+ return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
1327
+ }
1328
+
1329
+ // manipulation
1330
+ if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
1331
+ return TOUCH_ACTION_MANIPULATION;
1332
+ }
1333
+
1334
+ return TOUCH_ACTION_AUTO;
1335
+ }
1336
+
1337
+ function getTouchActionProps() {
1338
+ if (!NATIVE_TOUCH_ACTION) {
1339
+ return false;
1340
+ }
1341
+ var touchMap = {};
1342
+ var cssSupports = window.CSS && window.CSS.supports;
1343
+ ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
1344
+
1345
+ // If css.supports is not supported but there is native touch-action assume it supports
1346
+ // all values. This is the case for IE 10 and 11.
1347
+ touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
1348
+ });
1349
+ return touchMap;
1350
+ }
1351
+
1352
+ /**
1353
+ * Recognizer flow explained; *
1354
+ * All recognizers have the initial state of POSSIBLE when a input session starts.
1355
+ * The definition of a input session is from the first input until the last input, with all it's movement in it. *
1356
+ * Example session for mouse-input: mousedown -> mousemove -> mouseup
1357
+ *
1358
+ * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
1359
+ * which determines with state it should be.
1360
+ *
1361
+ * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
1362
+ * POSSIBLE to give it another change on the next cycle.
1363
+ *
1364
+ * Possible
1365
+ * |
1366
+ * +-----+---------------+
1367
+ * | |
1368
+ * +-----+-----+ |
1369
+ * | | |
1370
+ * Failed Cancelled |
1371
+ * +-------+------+
1372
+ * | |
1373
+ * Recognized Began
1374
+ * |
1375
+ * Changed
1376
+ * |
1377
+ * Ended/Recognized
1378
+ */
1379
+ var STATE_POSSIBLE = 1;
1380
+ var STATE_BEGAN = 2;
1381
+ var STATE_CHANGED = 4;
1382
+ var STATE_ENDED = 8;
1383
+ var STATE_RECOGNIZED = STATE_ENDED;
1384
+ var STATE_CANCELLED = 16;
1385
+ var STATE_FAILED = 32;
1386
+
1387
+ /**
1388
+ * Recognizer
1389
+ * Every recognizer needs to extend from this class.
1390
+ * @constructor
1391
+ * @param {Object} options
1392
+ */
1393
+ function Recognizer(options) {
1394
+ this.options = assign({}, this.defaults, options || {});
1395
+
1396
+ this.id = uniqueId();
1397
+
1398
+ this.manager = null;
1399
+
1400
+ // default is enable true
1401
+ this.options.enable = ifUndefined(this.options.enable, true);
1402
+
1403
+ this.state = STATE_POSSIBLE;
1404
+
1405
+ this.simultaneous = {};
1406
+ this.requireFail = [];
1407
+ }
1408
+
1409
+ Recognizer.prototype = {
1410
+ /**
1411
+ * @virtual
1412
+ * @type {Object}
1413
+ */
1414
+ defaults: {},
1415
+
1416
+ /**
1417
+ * set options
1418
+ * @param {Object} options
1419
+ * @return {Recognizer}
1420
+ */
1421
+ set: function(options) {
1422
+ assign(this.options, options);
1423
+
1424
+ // also update the touchAction, in case something changed about the directions/enabled state
1425
+ this.manager && this.manager.touchAction.update();
1426
+ return this;
1427
+ },
1428
+
1429
+ /**
1430
+ * recognize simultaneous with an other recognizer.
1431
+ * @param {Recognizer} otherRecognizer
1432
+ * @returns {Recognizer} this
1433
+ */
1434
+ recognizeWith: function(otherRecognizer) {
1435
+ if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
1436
+ return this;
1437
+ }
1438
+
1439
+ var simultaneous = this.simultaneous;
1440
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1441
+ if (!simultaneous[otherRecognizer.id]) {
1442
+ simultaneous[otherRecognizer.id] = otherRecognizer;
1443
+ otherRecognizer.recognizeWith(this);
1444
+ }
1445
+ return this;
1446
+ },
1447
+
1448
+ /**
1449
+ * drop the simultaneous link. it doesnt remove the link on the other recognizer.
1450
+ * @param {Recognizer} otherRecognizer
1451
+ * @returns {Recognizer} this
1452
+ */
1453
+ dropRecognizeWith: function(otherRecognizer) {
1454
+ if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
1455
+ return this;
1456
+ }
1457
+
1458
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1459
+ delete this.simultaneous[otherRecognizer.id];
1460
+ return this;
1461
+ },
1462
+
1463
+ /**
1464
+ * recognizer can only run when an other is failing
1465
+ * @param {Recognizer} otherRecognizer
1466
+ * @returns {Recognizer} this
1467
+ */
1468
+ requireFailure: function(otherRecognizer) {
1469
+ if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
1470
+ return this;
1471
+ }
1472
+
1473
+ var requireFail = this.requireFail;
1474
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1475
+ if (inArray(requireFail, otherRecognizer) === -1) {
1476
+ requireFail.push(otherRecognizer);
1477
+ otherRecognizer.requireFailure(this);
1478
+ }
1479
+ return this;
1480
+ },
1481
+
1482
+ /**
1483
+ * drop the requireFailure link. it does not remove the link on the other recognizer.
1484
+ * @param {Recognizer} otherRecognizer
1485
+ * @returns {Recognizer} this
1486
+ */
1487
+ dropRequireFailure: function(otherRecognizer) {
1488
+ if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
1489
+ return this;
1490
+ }
1491
+
1492
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1493
+ var index = inArray(this.requireFail, otherRecognizer);
1494
+ if (index > -1) {
1495
+ this.requireFail.splice(index, 1);
1496
+ }
1497
+ return this;
1498
+ },
1499
+
1500
+ /**
1501
+ * has require failures boolean
1502
+ * @returns {boolean}
1503
+ */
1504
+ hasRequireFailures: function() {
1505
+ return this.requireFail.length > 0;
1506
+ },
1507
+
1508
+ /**
1509
+ * if the recognizer can recognize simultaneous with an other recognizer
1510
+ * @param {Recognizer} otherRecognizer
1511
+ * @returns {Boolean}
1512
+ */
1513
+ canRecognizeWith: function(otherRecognizer) {
1514
+ return !!this.simultaneous[otherRecognizer.id];
1515
+ },
1516
+
1517
+ /**
1518
+ * You should use `tryEmit` instead of `emit` directly to check
1519
+ * that all the needed recognizers has failed before emitting.
1520
+ * @param {Object} input
1521
+ */
1522
+ emit: function(input) {
1523
+ var self = this;
1524
+ var state = this.state;
1525
+
1526
+ function emit(event) {
1527
+ self.manager.emit(event, input);
1528
+ }
1529
+
1530
+ // 'panstart' and 'panmove'
1531
+ if (state < STATE_ENDED) {
1532
+ emit(self.options.event + stateStr(state));
1533
+ }
1534
+
1535
+ emit(self.options.event); // simple 'eventName' events
1536
+
1537
+ if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
1538
+ emit(input.additionalEvent);
1539
+ }
1540
+
1541
+ // panend and pancancel
1542
+ if (state >= STATE_ENDED) {
1543
+ emit(self.options.event + stateStr(state));
1544
+ }
1545
+ },
1546
+
1547
+ /**
1548
+ * Check that all the require failure recognizers has failed,
1549
+ * if true, it emits a gesture event,
1550
+ * otherwise, setup the state to FAILED.
1551
+ * @param {Object} input
1552
+ */
1553
+ tryEmit: function(input) {
1554
+ if (this.canEmit()) {
1555
+ return this.emit(input);
1556
+ }
1557
+ // it's failing anyway
1558
+ this.state = STATE_FAILED;
1559
+ },
1560
+
1561
+ /**
1562
+ * can we emit?
1563
+ * @returns {boolean}
1564
+ */
1565
+ canEmit: function() {
1566
+ var i = 0;
1567
+ while (i < this.requireFail.length) {
1568
+ if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
1569
+ return false;
1570
+ }
1571
+ i++;
1572
+ }
1573
+ return true;
1574
+ },
1575
+
1576
+ /**
1577
+ * update the recognizer
1578
+ * @param {Object} inputData
1579
+ */
1580
+ recognize: function(inputData) {
1581
+ // make a new copy of the inputData
1582
+ // so we can change the inputData without messing up the other recognizers
1583
+ var inputDataClone = assign({}, inputData);
1584
+
1585
+ // is is enabled and allow recognizing?
1586
+ if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
1587
+ this.reset();
1588
+ this.state = STATE_FAILED;
1589
+ return;
1590
+ }
1591
+
1592
+ // reset when we've reached the end
1593
+ if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
1594
+ this.state = STATE_POSSIBLE;
1595
+ }
1596
+
1597
+ this.state = this.process(inputDataClone);
1598
+
1599
+ // the recognizer has recognized a gesture
1600
+ // so trigger an event
1601
+ if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
1602
+ this.tryEmit(inputDataClone);
1603
+ }
1604
+ },
1605
+
1606
+ /**
1607
+ * return the state of the recognizer
1608
+ * the actual recognizing happens in this method
1609
+ * @virtual
1610
+ * @param {Object} inputData
1611
+ * @returns {Const} STATE
1612
+ */
1613
+ process: function(inputData) { }, // jshint ignore:line
1614
+
1615
+ /**
1616
+ * return the preferred touch-action
1617
+ * @virtual
1618
+ * @returns {Array}
1619
+ */
1620
+ getTouchAction: function() { },
1621
+
1622
+ /**
1623
+ * called when the gesture isn't allowed to recognize
1624
+ * like when another is being recognized or it is disabled
1625
+ * @virtual
1626
+ */
1627
+ reset: function() { }
1628
+ };
1629
+
1630
+ /**
1631
+ * get a usable string, used as event postfix
1632
+ * @param {Const} state
1633
+ * @returns {String} state
1634
+ */
1635
+ function stateStr(state) {
1636
+ if (state & STATE_CANCELLED) {
1637
+ return 'cancel';
1638
+ } else if (state & STATE_ENDED) {
1639
+ return 'end';
1640
+ } else if (state & STATE_CHANGED) {
1641
+ return 'move';
1642
+ } else if (state & STATE_BEGAN) {
1643
+ return 'start';
1644
+ }
1645
+ return '';
1646
+ }
1647
+
1648
+ /**
1649
+ * direction cons to string
1650
+ * @param {Const} direction
1651
+ * @returns {String}
1652
+ */
1653
+ function directionStr(direction) {
1654
+ if (direction == DIRECTION_DOWN) {
1655
+ return 'down';
1656
+ } else if (direction == DIRECTION_UP) {
1657
+ return 'up';
1658
+ } else if (direction == DIRECTION_LEFT) {
1659
+ return 'left';
1660
+ } else if (direction == DIRECTION_RIGHT) {
1661
+ return 'right';
1662
+ }
1663
+ return '';
1664
+ }
1665
+
1666
+ /**
1667
+ * get a recognizer by name if it is bound to a manager
1668
+ * @param {Recognizer|String} otherRecognizer
1669
+ * @param {Recognizer} recognizer
1670
+ * @returns {Recognizer}
1671
+ */
1672
+ function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
1673
+ var manager = recognizer.manager;
1674
+ if (manager) {
1675
+ return manager.get(otherRecognizer);
1676
+ }
1677
+ return otherRecognizer;
1678
+ }
1679
+
1680
+ /**
1681
+ * This recognizer is just used as a base for the simple attribute recognizers.
1682
+ * @constructor
1683
+ * @extends Recognizer
1684
+ */
1685
+ function AttrRecognizer() {
1686
+ Recognizer.apply(this, arguments);
1687
+ }
1688
+
1689
+ inherit(AttrRecognizer, Recognizer, {
1690
+ /**
1691
+ * @namespace
1692
+ * @memberof AttrRecognizer
1693
+ */
1694
+ defaults: {
1695
+ /**
1696
+ * @type {Number}
1697
+ * @default 1
1698
+ */
1699
+ pointers: 1
1700
+ },
1701
+
1702
+ /**
1703
+ * Used to check if it the recognizer receives valid input, like input.distance > 10.
1704
+ * @memberof AttrRecognizer
1705
+ * @param {Object} input
1706
+ * @returns {Boolean} recognized
1707
+ */
1708
+ attrTest: function(input) {
1709
+ var optionPointers = this.options.pointers;
1710
+ return optionPointers === 0 || input.pointers.length === optionPointers;
1711
+ },
1712
+
1713
+ /**
1714
+ * Process the input and return the state for the recognizer
1715
+ * @memberof AttrRecognizer
1716
+ * @param {Object} input
1717
+ * @returns {*} State
1718
+ */
1719
+ process: function(input) {
1720
+ var state = this.state;
1721
+ var eventType = input.eventType;
1722
+
1723
+ var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
1724
+ var isValid = this.attrTest(input);
1725
+
1726
+ // on cancel input and we've recognized before, return STATE_CANCELLED
1727
+ if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
1728
+ return state | STATE_CANCELLED;
1729
+ } else if (isRecognized || isValid) {
1730
+ if (eventType & INPUT_END) {
1731
+ return state | STATE_ENDED;
1732
+ } else if (!(state & STATE_BEGAN)) {
1733
+ return STATE_BEGAN;
1734
+ }
1735
+ return state | STATE_CHANGED;
1736
+ }
1737
+ return STATE_FAILED;
1738
+ }
1739
+ });
1740
+
1741
+ /**
1742
+ * Pan
1743
+ * Recognized when the pointer is down and moved in the allowed direction.
1744
+ * @constructor
1745
+ * @extends AttrRecognizer
1746
+ */
1747
+ function PanRecognizer() {
1748
+ AttrRecognizer.apply(this, arguments);
1749
+
1750
+ this.pX = null;
1751
+ this.pY = null;
1752
+ }
1753
+
1754
+ inherit(PanRecognizer, AttrRecognizer, {
1755
+ /**
1756
+ * @namespace
1757
+ * @memberof PanRecognizer
1758
+ */
1759
+ defaults: {
1760
+ event: 'pan',
1761
+ threshold: 10,
1762
+ pointers: 1,
1763
+ direction: DIRECTION_ALL
1764
+ },
1765
+
1766
+ getTouchAction: function() {
1767
+ var direction = this.options.direction;
1768
+ var actions = [];
1769
+ if (direction & DIRECTION_HORIZONTAL) {
1770
+ actions.push(TOUCH_ACTION_PAN_Y);
1771
+ }
1772
+ if (direction & DIRECTION_VERTICAL) {
1773
+ actions.push(TOUCH_ACTION_PAN_X);
1774
+ }
1775
+ return actions;
1776
+ },
1777
+
1778
+ directionTest: function(input) {
1779
+ var options = this.options;
1780
+ var hasMoved = true;
1781
+ var distance = input.distance;
1782
+ var direction = input.direction;
1783
+ var x = input.deltaX;
1784
+ var y = input.deltaY;
1785
+
1786
+ // lock to axis?
1787
+ if (!(direction & options.direction)) {
1788
+ if (options.direction & DIRECTION_HORIZONTAL) {
1789
+ direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
1790
+ hasMoved = x != this.pX;
1791
+ distance = Math.abs(input.deltaX);
1792
+ } else {
1793
+ direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
1794
+ hasMoved = y != this.pY;
1795
+ distance = Math.abs(input.deltaY);
1796
+ }
1797
+ }
1798
+ input.direction = direction;
1799
+ return hasMoved && distance > options.threshold && direction & options.direction;
1800
+ },
1801
+
1802
+ attrTest: function(input) {
1803
+ return AttrRecognizer.prototype.attrTest.call(this, input) &&
1804
+ (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
1805
+ },
1806
+
1807
+ emit: function(input) {
1808
+
1809
+ this.pX = input.deltaX;
1810
+ this.pY = input.deltaY;
1811
+
1812
+ var direction = directionStr(input.direction);
1813
+
1814
+ if (direction) {
1815
+ input.additionalEvent = this.options.event + direction;
1816
+ }
1817
+ this._super.emit.call(this, input);
1818
+ }
1819
+ });
1820
+
1821
+ /**
1822
+ * Pinch
1823
+ * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
1824
+ * @constructor
1825
+ * @extends AttrRecognizer
1826
+ */
1827
+ function PinchRecognizer() {
1828
+ AttrRecognizer.apply(this, arguments);
1829
+ }
1830
+
1831
+ inherit(PinchRecognizer, AttrRecognizer, {
1832
+ /**
1833
+ * @namespace
1834
+ * @memberof PinchRecognizer
1835
+ */
1836
+ defaults: {
1837
+ event: 'pinch',
1838
+ threshold: 0,
1839
+ pointers: 2
1840
+ },
1841
+
1842
+ getTouchAction: function() {
1843
+ return [TOUCH_ACTION_NONE];
1844
+ },
1845
+
1846
+ attrTest: function(input) {
1847
+ return this._super.attrTest.call(this, input) &&
1848
+ (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
1849
+ },
1850
+
1851
+ emit: function(input) {
1852
+ if (input.scale !== 1) {
1853
+ var inOut = input.scale < 1 ? 'in' : 'out';
1854
+ input.additionalEvent = this.options.event + inOut;
1855
+ }
1856
+ this._super.emit.call(this, input);
1857
+ }
1858
+ });
1859
+
1860
+ /**
1861
+ * Press
1862
+ * Recognized when the pointer is down for x ms without any movement.
1863
+ * @constructor
1864
+ * @extends Recognizer
1865
+ */
1866
+ function PressRecognizer() {
1867
+ Recognizer.apply(this, arguments);
1868
+
1869
+ this._timer = null;
1870
+ this._input = null;
1871
+ }
1872
+
1873
+ inherit(PressRecognizer, Recognizer, {
1874
+ /**
1875
+ * @namespace
1876
+ * @memberof PressRecognizer
1877
+ */
1878
+ defaults: {
1879
+ event: 'press',
1880
+ pointers: 1,
1881
+ time: 251, // minimal time of the pointer to be pressed
1882
+ threshold: 9 // a minimal movement is ok, but keep it low
1883
+ },
1884
+
1885
+ getTouchAction: function() {
1886
+ return [TOUCH_ACTION_AUTO];
1887
+ },
1888
+
1889
+ process: function(input) {
1890
+ var options = this.options;
1891
+ var validPointers = input.pointers.length === options.pointers;
1892
+ var validMovement = input.distance < options.threshold;
1893
+ var validTime = input.deltaTime > options.time;
1894
+
1895
+ this._input = input;
1896
+
1897
+ // we only allow little movement
1898
+ // and we've reached an end event, so a tap is possible
1899
+ if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
1900
+ this.reset();
1901
+ } else if (input.eventType & INPUT_START) {
1902
+ this.reset();
1903
+ this._timer = setTimeoutContext(function() {
1904
+ this.state = STATE_RECOGNIZED;
1905
+ this.tryEmit();
1906
+ }, options.time, this);
1907
+ } else if (input.eventType & INPUT_END) {
1908
+ return STATE_RECOGNIZED;
1909
+ }
1910
+ return STATE_FAILED;
1911
+ },
1912
+
1913
+ reset: function() {
1914
+ clearTimeout(this._timer);
1915
+ },
1916
+
1917
+ emit: function(input) {
1918
+ if (this.state !== STATE_RECOGNIZED) {
1919
+ return;
1920
+ }
1921
+
1922
+ if (input && (input.eventType & INPUT_END)) {
1923
+ this.manager.emit(this.options.event + 'up', input);
1924
+ } else {
1925
+ this._input.timeStamp = now();
1926
+ this.manager.emit(this.options.event, this._input);
1927
+ }
1928
+ }
1929
+ });
1930
+
1931
+ /**
1932
+ * Rotate
1933
+ * Recognized when two or more pointer are moving in a circular motion.
1934
+ * @constructor
1935
+ * @extends AttrRecognizer
1936
+ */
1937
+ function RotateRecognizer() {
1938
+ AttrRecognizer.apply(this, arguments);
1939
+ }
1940
+
1941
+ inherit(RotateRecognizer, AttrRecognizer, {
1942
+ /**
1943
+ * @namespace
1944
+ * @memberof RotateRecognizer
1945
+ */
1946
+ defaults: {
1947
+ event: 'rotate',
1948
+ threshold: 0,
1949
+ pointers: 2
1950
+ },
1951
+
1952
+ getTouchAction: function() {
1953
+ return [TOUCH_ACTION_NONE];
1954
+ },
1955
+
1956
+ attrTest: function(input) {
1957
+ return this._super.attrTest.call(this, input) &&
1958
+ (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
1959
+ }
1960
+ });
1961
+
1962
+ /**
1963
+ * Swipe
1964
+ * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
1965
+ * @constructor
1966
+ * @extends AttrRecognizer
1967
+ */
1968
+ function SwipeRecognizer() {
1969
+ AttrRecognizer.apply(this, arguments);
1970
+ }
1971
+
1972
+ inherit(SwipeRecognizer, AttrRecognizer, {
1973
+ /**
1974
+ * @namespace
1975
+ * @memberof SwipeRecognizer
1976
+ */
1977
+ defaults: {
1978
+ event: 'swipe',
1979
+ threshold: 10,
1980
+ velocity: 0.3,
1981
+ direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
1982
+ pointers: 1
1983
+ },
1984
+
1985
+ getTouchAction: function() {
1986
+ return PanRecognizer.prototype.getTouchAction.call(this);
1987
+ },
1988
+
1989
+ attrTest: function(input) {
1990
+ var direction = this.options.direction;
1991
+ var velocity;
1992
+
1993
+ if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
1994
+ velocity = input.overallVelocity;
1995
+ } else if (direction & DIRECTION_HORIZONTAL) {
1996
+ velocity = input.overallVelocityX;
1997
+ } else if (direction & DIRECTION_VERTICAL) {
1998
+ velocity = input.overallVelocityY;
1999
+ }
2000
+
2001
+ return this._super.attrTest.call(this, input) &&
2002
+ direction & input.offsetDirection &&
2003
+ input.distance > this.options.threshold &&
2004
+ input.maxPointers == this.options.pointers &&
2005
+ abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
2006
+ },
2007
+
2008
+ emit: function(input) {
2009
+ var direction = directionStr(input.offsetDirection);
2010
+ if (direction) {
2011
+ this.manager.emit(this.options.event + direction, input);
2012
+ }
2013
+
2014
+ this.manager.emit(this.options.event, input);
2015
+ }
2016
+ });
2017
+
2018
+ /**
2019
+ * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
2020
+ * between the given interval and position. The delay option can be used to recognize multi-taps without firing
2021
+ * a single tap.
2022
+ *
2023
+ * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
2024
+ * multi-taps being recognized.
2025
+ * @constructor
2026
+ * @extends Recognizer
2027
+ */
2028
+ function TapRecognizer() {
2029
+ Recognizer.apply(this, arguments);
2030
+
2031
+ // previous time and center,
2032
+ // used for tap counting
2033
+ this.pTime = false;
2034
+ this.pCenter = false;
2035
+
2036
+ this._timer = null;
2037
+ this._input = null;
2038
+ this.count = 0;
2039
+ }
2040
+
2041
+ inherit(TapRecognizer, Recognizer, {
2042
+ /**
2043
+ * @namespace
2044
+ * @memberof PinchRecognizer
2045
+ */
2046
+ defaults: {
2047
+ event: 'tap',
2048
+ pointers: 1,
2049
+ taps: 1,
2050
+ interval: 300, // max time between the multi-tap taps
2051
+ time: 250, // max time of the pointer to be down (like finger on the screen)
2052
+ threshold: 9, // a minimal movement is ok, but keep it low
2053
+ posThreshold: 10 // a multi-tap can be a bit off the initial position
2054
+ },
2055
+
2056
+ getTouchAction: function() {
2057
+ return [TOUCH_ACTION_MANIPULATION];
2058
+ },
2059
+
2060
+ process: function(input) {
2061
+ var options = this.options;
2062
+
2063
+ var validPointers = input.pointers.length === options.pointers;
2064
+ var validMovement = input.distance < options.threshold;
2065
+ var validTouchTime = input.deltaTime < options.time;
2066
+
2067
+ this.reset();
2068
+
2069
+ if ((input.eventType & INPUT_START) && (this.count === 0)) {
2070
+ return this.failTimeout();
2071
+ }
2072
+
2073
+ // we only allow little movement
2074
+ // and we've reached an end event, so a tap is possible
2075
+ if (validMovement && validTouchTime && validPointers) {
2076
+ if (input.eventType != INPUT_END) {
2077
+ return this.failTimeout();
2078
+ }
2079
+
2080
+ var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
2081
+ var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
2082
+
2083
+ this.pTime = input.timeStamp;
2084
+ this.pCenter = input.center;
2085
+
2086
+ if (!validMultiTap || !validInterval) {
2087
+ this.count = 1;
2088
+ } else {
2089
+ this.count += 1;
2090
+ }
2091
+
2092
+ this._input = input;
2093
+
2094
+ // if tap count matches we have recognized it,
2095
+ // else it has began recognizing...
2096
+ var tapCount = this.count % options.taps;
2097
+ if (tapCount === 0) {
2098
+ // no failing requirements, immediately trigger the tap event
2099
+ // or wait as long as the multitap interval to trigger
2100
+ if (!this.hasRequireFailures()) {
2101
+ return STATE_RECOGNIZED;
2102
+ } else {
2103
+ this._timer = setTimeoutContext(function() {
2104
+ this.state = STATE_RECOGNIZED;
2105
+ this.tryEmit();
2106
+ }, options.interval, this);
2107
+ return STATE_BEGAN;
2108
+ }
2109
+ }
2110
+ }
2111
+ return STATE_FAILED;
2112
+ },
2113
+
2114
+ failTimeout: function() {
2115
+ this._timer = setTimeoutContext(function() {
2116
+ this.state = STATE_FAILED;
2117
+ }, this.options.interval, this);
2118
+ return STATE_FAILED;
2119
+ },
2120
+
2121
+ reset: function() {
2122
+ clearTimeout(this._timer);
2123
+ },
2124
+
2125
+ emit: function() {
2126
+ if (this.state == STATE_RECOGNIZED) {
2127
+ this._input.tapCount = this.count;
2128
+ this.manager.emit(this.options.event, this._input);
2129
+ }
2130
+ }
2131
+ });
2132
+
2133
+ /**
2134
+ * Simple way to create a manager with a default set of recognizers.
2135
+ * @param {HTMLElement} element
2136
+ * @param {Object} [options]
2137
+ * @constructor
2138
+ */
2139
+ function Hammer(element, options) {
2140
+ options = options || {};
2141
+ options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
2142
+ return new Manager(element, options);
2143
+ }
2144
+
2145
+ /**
2146
+ * @const {string}
2147
+ */
2148
+ Hammer.VERSION = '2.0.8';
2149
+
2150
+ /**
2151
+ * default settings
2152
+ * @namespace
2153
+ */
2154
+ Hammer.defaults = {
2155
+ /**
2156
+ * set if DOM events are being triggered.
2157
+ * But this is slower and unused by simple implementations, so disabled by default.
2158
+ * @type {Boolean}
2159
+ * @default false
2160
+ */
2161
+ domEvents: false,
2162
+
2163
+ /**
2164
+ * The value for the touchAction property/fallback.
2165
+ * When set to `compute` it will magically set the correct value based on the added recognizers.
2166
+ * @type {String}
2167
+ * @default compute
2168
+ */
2169
+ touchAction: TOUCH_ACTION_COMPUTE,
2170
+
2171
+ /**
2172
+ * @type {Boolean}
2173
+ * @default true
2174
+ */
2175
+ enable: true,
2176
+
2177
+ /**
2178
+ * EXPERIMENTAL FEATURE -- can be removed/changed
2179
+ * Change the parent input target element.
2180
+ * If Null, then it is being set the to main element.
2181
+ * @type {Null|EventTarget}
2182
+ * @default null
2183
+ */
2184
+ inputTarget: null,
2185
+
2186
+ /**
2187
+ * force an input class
2188
+ * @type {Null|Function}
2189
+ * @default null
2190
+ */
2191
+ inputClass: null,
2192
+
2193
+ /**
2194
+ * Default recognizer setup when calling `Hammer()`
2195
+ * When creating a new Manager these will be skipped.
2196
+ * @type {Array}
2197
+ */
2198
+ preset: [
2199
+ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
2200
+ [RotateRecognizer, {enable: false}],
2201
+ [PinchRecognizer, {enable: false}, ['rotate']],
2202
+ [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
2203
+ [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
2204
+ [TapRecognizer],
2205
+ [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
2206
+ [PressRecognizer]
2207
+ ],
2208
+
2209
+ /**
2210
+ * Some CSS properties can be used to improve the working of Hammer.
2211
+ * Add them to this method and they will be set when creating a new Manager.
2212
+ * @namespace
2213
+ */
2214
+ cssProps: {
2215
+ /**
2216
+ * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
2217
+ * @type {String}
2218
+ * @default 'none'
2219
+ */
2220
+ userSelect: 'none',
2221
+
2222
+ /**
2223
+ * Disable the Windows Phone grippers when pressing an element.
2224
+ * @type {String}
2225
+ * @default 'none'
2226
+ */
2227
+ touchSelect: 'none',
2228
+
2229
+ /**
2230
+ * Disables the default callout shown when you touch and hold a touch target.
2231
+ * On iOS, when you touch and hold a touch target such as a link, Safari displays
2232
+ * a callout containing information about the link. This property allows you to disable that callout.
2233
+ * @type {String}
2234
+ * @default 'none'
2235
+ */
2236
+ touchCallout: 'none',
2237
+
2238
+ /**
2239
+ * Specifies whether zooming is enabled. Used by IE10>
2240
+ * @type {String}
2241
+ * @default 'none'
2242
+ */
2243
+ contentZooming: 'none',
2244
+
2245
+ /**
2246
+ * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
2247
+ * @type {String}
2248
+ * @default 'none'
2249
+ */
2250
+ userDrag: 'none',
2251
+
2252
+ /**
2253
+ * Overrides the highlight color shown when the user taps a link or a JavaScript
2254
+ * clickable element in iOS. This property obeys the alpha value, if specified.
2255
+ * @type {String}
2256
+ * @default 'rgba(0,0,0,0)'
2257
+ */
2258
+ tapHighlightColor: 'rgba(0,0,0,0)'
2259
+ }
2260
+ };
2261
+
2262
+ var STOP = 1;
2263
+ var FORCED_STOP = 2;
2264
+
2265
+ /**
2266
+ * Manager
2267
+ * @param {HTMLElement} element
2268
+ * @param {Object} [options]
2269
+ * @constructor
2270
+ */
2271
+ function Manager(element, options) {
2272
+ this.options = assign({}, Hammer.defaults, options || {});
2273
+
2274
+ this.options.inputTarget = this.options.inputTarget || element;
2275
+
2276
+ this.handlers = {};
2277
+ this.session = {};
2278
+ this.recognizers = [];
2279
+ this.oldCssProps = {};
2280
+
2281
+ this.element = element;
2282
+ this.input = createInputInstance(this);
2283
+ this.touchAction = new TouchAction(this, this.options.touchAction);
2284
+
2285
+ toggleCssProps(this, true);
2286
+
2287
+ each(this.options.recognizers, function(item) {
2288
+ var recognizer = this.add(new (item[0])(item[1]));
2289
+ item[2] && recognizer.recognizeWith(item[2]);
2290
+ item[3] && recognizer.requireFailure(item[3]);
2291
+ }, this);
2292
+ }
2293
+
2294
+ Manager.prototype = {
2295
+ /**
2296
+ * set options
2297
+ * @param {Object} options
2298
+ * @returns {Manager}
2299
+ */
2300
+ set: function(options) {
2301
+ assign(this.options, options);
2302
+
2303
+ // Options that need a little more setup
2304
+ if (options.touchAction) {
2305
+ this.touchAction.update();
2306
+ }
2307
+ if (options.inputTarget) {
2308
+ // Clean up existing event listeners and reinitialize
2309
+ this.input.destroy();
2310
+ this.input.target = options.inputTarget;
2311
+ this.input.init();
2312
+ }
2313
+ return this;
2314
+ },
2315
+
2316
+ /**
2317
+ * stop recognizing for this session.
2318
+ * This session will be discarded, when a new [input]start event is fired.
2319
+ * When forced, the recognizer cycle is stopped immediately.
2320
+ * @param {Boolean} [force]
2321
+ */
2322
+ stop: function(force) {
2323
+ this.session.stopped = force ? FORCED_STOP : STOP;
2324
+ },
2325
+
2326
+ /**
2327
+ * run the recognizers!
2328
+ * called by the inputHandler function on every movement of the pointers (touches)
2329
+ * it walks through all the recognizers and tries to detect the gesture that is being made
2330
+ * @param {Object} inputData
2331
+ */
2332
+ recognize: function(inputData) {
2333
+ var session = this.session;
2334
+ if (session.stopped) {
2335
+ return;
2336
+ }
2337
+
2338
+ // run the touch-action polyfill
2339
+ this.touchAction.preventDefaults(inputData);
2340
+
2341
+ var recognizer;
2342
+ var recognizers = this.recognizers;
2343
+
2344
+ // this holds the recognizer that is being recognized.
2345
+ // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
2346
+ // if no recognizer is detecting a thing, it is set to `null`
2347
+ var curRecognizer = session.curRecognizer;
2348
+
2349
+ // reset when the last recognizer is recognized
2350
+ // or when we're in a new session
2351
+ if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
2352
+ curRecognizer = session.curRecognizer = null;
2353
+ }
2354
+
2355
+ var i = 0;
2356
+ while (i < recognizers.length) {
2357
+ recognizer = recognizers[i];
2358
+
2359
+ // find out if we are allowed try to recognize the input for this one.
2360
+ // 1. allow if the session is NOT forced stopped (see the .stop() method)
2361
+ // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
2362
+ // that is being recognized.
2363
+ // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
2364
+ // this can be setup with the `recognizeWith()` method on the recognizer.
2365
+ if (session.stopped !== FORCED_STOP && ( // 1
2366
+ !curRecognizer || recognizer == curRecognizer || // 2
2367
+ recognizer.canRecognizeWith(curRecognizer))) { // 3
2368
+ recognizer.recognize(inputData);
2369
+ } else {
2370
+ recognizer.reset();
2371
+ }
2372
+
2373
+ // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
2374
+ // current active recognizer. but only if we don't already have an active recognizer
2375
+ if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
2376
+ curRecognizer = session.curRecognizer = recognizer;
2377
+ }
2378
+ i++;
2379
+ }
2380
+ },
2381
+
2382
+ /**
2383
+ * get a recognizer by its event name.
2384
+ * @param {Recognizer|String} recognizer
2385
+ * @returns {Recognizer|Null}
2386
+ */
2387
+ get: function(recognizer) {
2388
+ if (recognizer instanceof Recognizer) {
2389
+ return recognizer;
2390
+ }
2391
+
2392
+ var recognizers = this.recognizers;
2393
+ for (var i = 0; i < recognizers.length; i++) {
2394
+ if (recognizers[i].options.event == recognizer) {
2395
+ return recognizers[i];
2396
+ }
2397
+ }
2398
+ return null;
2399
+ },
2400
+
2401
+ /**
2402
+ * add a recognizer to the manager
2403
+ * existing recognizers with the same event name will be removed
2404
+ * @param {Recognizer} recognizer
2405
+ * @returns {Recognizer|Manager}
2406
+ */
2407
+ add: function(recognizer) {
2408
+ if (invokeArrayArg(recognizer, 'add', this)) {
2409
+ return this;
2410
+ }
2411
+
2412
+ // remove existing
2413
+ var existing = this.get(recognizer.options.event);
2414
+ if (existing) {
2415
+ this.remove(existing);
2416
+ }
2417
+
2418
+ this.recognizers.push(recognizer);
2419
+ recognizer.manager = this;
2420
+
2421
+ this.touchAction.update();
2422
+ return recognizer;
2423
+ },
2424
+
2425
+ /**
2426
+ * remove a recognizer by name or instance
2427
+ * @param {Recognizer|String} recognizer
2428
+ * @returns {Manager}
2429
+ */
2430
+ remove: function(recognizer) {
2431
+ if (invokeArrayArg(recognizer, 'remove', this)) {
2432
+ return this;
2433
+ }
2434
+
2435
+ recognizer = this.get(recognizer);
2436
+
2437
+ // let's make sure this recognizer exists
2438
+ if (recognizer) {
2439
+ var recognizers = this.recognizers;
2440
+ var index = inArray(recognizers, recognizer);
2441
+
2442
+ if (index !== -1) {
2443
+ recognizers.splice(index, 1);
2444
+ this.touchAction.update();
2445
+ }
2446
+ }
2447
+
2448
+ return this;
2449
+ },
2450
+
2451
+ /**
2452
+ * bind event
2453
+ * @param {String} events
2454
+ * @param {Function} handler
2455
+ * @returns {EventEmitter} this
2456
+ */
2457
+ on: function(events, handler) {
2458
+ if (events === undefined) {
2459
+ return;
2460
+ }
2461
+ if (handler === undefined) {
2462
+ return;
2463
+ }
2464
+
2465
+ var handlers = this.handlers;
2466
+ each(splitStr(events), function(event) {
2467
+ handlers[event] = handlers[event] || [];
2468
+ handlers[event].push(handler);
2469
+ });
2470
+ return this;
2471
+ },
2472
+
2473
+ /**
2474
+ * unbind event, leave emit blank to remove all handlers
2475
+ * @param {String} events
2476
+ * @param {Function} [handler]
2477
+ * @returns {EventEmitter} this
2478
+ */
2479
+ off: function(events, handler) {
2480
+ if (events === undefined) {
2481
+ return;
2482
+ }
2483
+
2484
+ var handlers = this.handlers;
2485
+ each(splitStr(events), function(event) {
2486
+ if (!handler) {
2487
+ delete handlers[event];
2488
+ } else {
2489
+ handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
2490
+ }
2491
+ });
2492
+ return this;
2493
+ },
2494
+
2495
+ /**
2496
+ * emit event to the listeners
2497
+ * @param {String} event
2498
+ * @param {Object} data
2499
+ */
2500
+ emit: function(event, data) {
2501
+ // we also want to trigger dom events
2502
+ if (this.options.domEvents) {
2503
+ triggerDomEvent(event, data);
2504
+ }
2505
+
2506
+ // no handlers, so skip it all
2507
+ var handlers = this.handlers[event] && this.handlers[event].slice();
2508
+ if (!handlers || !handlers.length) {
2509
+ return;
2510
+ }
2511
+
2512
+ data.type = event;
2513
+ data.preventDefault = function() {
2514
+ data.srcEvent.preventDefault();
2515
+ };
2516
+
2517
+ var i = 0;
2518
+ while (i < handlers.length) {
2519
+ handlers[i](data);
2520
+ i++;
2521
+ }
2522
+ },
2523
+
2524
+ /**
2525
+ * destroy the manager and unbinds all events
2526
+ * it doesn't unbind dom events, that is the user own responsibility
2527
+ */
2528
+ destroy: function() {
2529
+ this.element && toggleCssProps(this, false);
2530
+
2531
+ this.handlers = {};
2532
+ this.session = {};
2533
+ this.input.destroy();
2534
+ this.element = null;
2535
+ }
2536
+ };
2537
+
2538
+ /**
2539
+ * add/remove the css properties as defined in manager.options.cssProps
2540
+ * @param {Manager} manager
2541
+ * @param {Boolean} add
2542
+ */
2543
+ function toggleCssProps(manager, add) {
2544
+ var element = manager.element;
2545
+ if (!element.style) {
2546
+ return;
2547
+ }
2548
+ var prop;
2549
+ each(manager.options.cssProps, function(value, name) {
2550
+ prop = prefixed(element.style, name);
2551
+ if (add) {
2552
+ manager.oldCssProps[prop] = element.style[prop];
2553
+ element.style[prop] = value;
2554
+ } else {
2555
+ element.style[prop] = manager.oldCssProps[prop] || '';
2556
+ }
2557
+ });
2558
+ if (!add) {
2559
+ manager.oldCssProps = {};
2560
+ }
2561
+ }
2562
+
2563
+ /**
2564
+ * trigger dom event
2565
+ * @param {String} event
2566
+ * @param {Object} data
2567
+ */
2568
+ function triggerDomEvent(event, data) {
2569
+ var gestureEvent = document.createEvent('Event');
2570
+ gestureEvent.initEvent(event, true, true);
2571
+ gestureEvent.gesture = data;
2572
+ data.target.dispatchEvent(gestureEvent);
2573
+ }
2574
+
2575
+ assign(Hammer, {
2576
+ INPUT_START: INPUT_START,
2577
+ INPUT_MOVE: INPUT_MOVE,
2578
+ INPUT_END: INPUT_END,
2579
+ INPUT_CANCEL: INPUT_CANCEL,
2580
+
2581
+ STATE_POSSIBLE: STATE_POSSIBLE,
2582
+ STATE_BEGAN: STATE_BEGAN,
2583
+ STATE_CHANGED: STATE_CHANGED,
2584
+ STATE_ENDED: STATE_ENDED,
2585
+ STATE_RECOGNIZED: STATE_RECOGNIZED,
2586
+ STATE_CANCELLED: STATE_CANCELLED,
2587
+ STATE_FAILED: STATE_FAILED,
2588
+
2589
+ DIRECTION_NONE: DIRECTION_NONE,
2590
+ DIRECTION_LEFT: DIRECTION_LEFT,
2591
+ DIRECTION_RIGHT: DIRECTION_RIGHT,
2592
+ DIRECTION_UP: DIRECTION_UP,
2593
+ DIRECTION_DOWN: DIRECTION_DOWN,
2594
+ DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
2595
+ DIRECTION_VERTICAL: DIRECTION_VERTICAL,
2596
+ DIRECTION_ALL: DIRECTION_ALL,
2597
+
2598
+ Manager: Manager,
2599
+ Input: Input,
2600
+ TouchAction: TouchAction,
2601
+
2602
+ TouchInput: TouchInput,
2603
+ MouseInput: MouseInput,
2604
+ PointerEventInput: PointerEventInput,
2605
+ TouchMouseInput: TouchMouseInput,
2606
+ SingleTouchInput: SingleTouchInput,
2607
+
2608
+ Recognizer: Recognizer,
2609
+ AttrRecognizer: AttrRecognizer,
2610
+ Tap: TapRecognizer,
2611
+ Pan: PanRecognizer,
2612
+ Swipe: SwipeRecognizer,
2613
+ Pinch: PinchRecognizer,
2614
+ Rotate: RotateRecognizer,
2615
+ Press: PressRecognizer,
2616
+
2617
+ on: addEventListeners,
2618
+ off: removeEventListeners,
2619
+ each: each,
2620
+ merge: merge,
2621
+ extend: extend,
2622
+ assign: assign,
2623
+ inherit: inherit,
2624
+ bindFn: bindFn,
2625
+ prefixed: prefixed
2626
+ });
2627
+
2628
+ // this prevents errors when Hammer is loaded in the presence of an AMD
2629
+ // style loader but by script tag, not by the loader.
2630
+ var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
2631
+ freeGlobal.Hammer = Hammer;
2632
+
2633
+ if (typeof define === 'function' && define.amd) {
2634
+ define(function() {
2635
+ return Hammer;
2636
+ });
2637
+ } else if (typeof module != 'undefined' && module.exports) {
2638
+ module.exports = Hammer;
2639
+ } else {
2640
+ window[exportName] = Hammer;
2641
+ }
2642
+
2643
+ })(window, document, 'Hammer');
assets/tosrus/js/hammer.min.js CHANGED
@@ -1,7 +1,7 @@
1
- /*! Hammer.JS - v2.0.4 - 2014-09-28
2
  * http://hammerjs.github.io/
3
  *
4
- * Copyright (c) 2014 Jorik Tangelder;
5
  * Licensed under the MIT license */
6
- !function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function i(a,b){return h(a,b,!0)}function j(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&h(d,c)}function k(a,b){return function(){return a.apply(b,arguments)}}function l(a,b){return typeof a==kb?a.apply(b?b[0]||d:d,b):a}function m(a,b){return a===d?b:a}function n(a,b,c){g(r(b),function(b){a.addEventListener(b,c,!1)})}function o(a,b,c){g(r(b),function(b){a.removeEventListener(b,c,!1)})}function p(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function q(a,b){return a.indexOf(b)>-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function t(a){return Array.prototype.slice.call(a,0)}function u(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];s(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ib.length;){if(c=ib[g],e=c?c+f:b,e in a)return e;g++}return d}function w(){return ob++}function x(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function y(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){l(a.options.enable,[a])&&c.handler(b)},this.init()}function z(a){var b,c=a.options.inputClass;return new(b=c?c:rb?N:sb?Q:qb?S:M)(a,A)}function A(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&yb&&d-e===0,g=b&(Ab|Bb)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,B(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function B(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=E(b)),e>1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:lb(a.pointers[c].clientX),clientY:lb(a.pointers[c].clientY)},c++;return{timeStamp:nb(),pointers:b,center:F(b),deltaX:a.deltaX,deltaY:a.deltaY}}function F(a){var b=a.length;if(1===b)return{x:lb(a[0].clientX),y:lb(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ab|Bb)&&delete d[g[e].identifier],e++;return h.length?[u(f.concat(h),"identifier",!0),h]:void 0}function S(){y.apply(this,arguments);var a=k(this.handler,this);this.touch=new Q(this.manager,a),this.mouse=new M(this.manager,a)}function T(a,b){this.manager=a,this.set(b)}function U(a){if(q(a,bc))return bc;var b=q(a,cc),c=q(a,dc);return b&&c?cc+" "+dc:b||c?b?cc:dc:q(a,ac)?ac:_b}function V(a){this.id=w(),this.manager=null,this.options=i(a||{},this.defaults),this.options.enable=m(this.options.enable,!0),this.state=ec,this.simultaneous={},this.requireFail=[]}function W(a){return a&jc?"cancel":a&hc?"end":a&gc?"move":a&fc?"start":""}function X(a){return a==Gb?"down":a==Fb?"up":a==Db?"left":a==Eb?"right":""}function Y(a,b){var c=b.manager;return c?c.get(a):a}function Z(){V.apply(this,arguments)}function $(){Z.apply(this,arguments),this.pX=null,this.pY=null}function _(){Z.apply(this,arguments)}function ab(){V.apply(this,arguments),this._timer=null,this._input=null}function bb(){Z.apply(this,arguments)}function cb(){Z.apply(this,arguments)}function db(){V.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function eb(a,b){return b=b||{},b.recognizers=m(b.recognizers,eb.defaults.preset),new fb(a,b)}function fb(a,b){b=b||{},this.options=i(b,eb.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=z(this),this.touchAction=new T(this,this.options.touchAction),gb(this,!0),g(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function gb(a,b){var c=a.element;g(a.options.cssProps,function(a,d){c.style[v(c.style,d)]=b?a:""})}function hb(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var ib=["","webkit","moz","MS","ms","o"],jb=b.createElement("div"),kb="function",lb=Math.round,mb=Math.abs,nb=Date.now,ob=1,pb=/mobile|tablet|ip(ad|hone|od)|android/i,qb="ontouchstart"in a,rb=v(a,"PointerEvent")!==d,sb=qb&&pb.test(navigator.userAgent),tb="touch",ub="pen",vb="mouse",wb="kinect",xb=25,yb=1,zb=2,Ab=4,Bb=8,Cb=1,Db=2,Eb=4,Fb=8,Gb=16,Hb=Db|Eb,Ib=Fb|Gb,Jb=Hb|Ib,Kb=["x","y"],Lb=["clientX","clientY"];y.prototype={handler:function(){},init:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(x(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&o(this.element,this.evEl,this.domHandler),this.evTarget&&o(this.target,this.evTarget,this.domHandler),this.evWin&&o(x(this.element),this.evWin,this.domHandler)}};var Mb={mousedown:yb,mousemove:zb,mouseup:Ab},Nb="mousedown",Ob="mousemove mouseup";j(M,y,{handler:function(a){var b=Mb[a.type];b&yb&&0===a.button&&(this.pressed=!0),b&zb&&1!==a.which&&(b=Ab),this.pressed&&this.allow&&(b&Ab&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:vb,srcEvent:a}))}});var Pb={pointerdown:yb,pointermove:zb,pointerup:Ab,pointercancel:Bb,pointerout:Bb},Qb={2:tb,3:ub,4:vb,5:wb},Rb="pointerdown",Sb="pointermove pointerup pointercancel";a.MSPointerEvent&&(Rb="MSPointerDown",Sb="MSPointerMove MSPointerUp MSPointerCancel"),j(N,y,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Pb[d],f=Qb[a.pointerType]||a.pointerType,g=f==tb,h=s(b,a.pointerId,"pointerId");e&yb&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(kc|ec)))return!1;a++}return!0},recognize:function(a){var b=h({},a);return l(this.options.enable,[this,b])?(this.state&(ic|jc|kc)&&(this.state=ec),this.state=this.process(b),void(this.state&(fc|gc|hc|jc)&&this.tryEmit(b))):(this.reset(),void(this.state=kc))},process:function(){},getTouchAction:function(){},reset:function(){}},j(Z,V,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(fc|gc),e=this.attrTest(a);return d&&(c&Bb||!e)?b|jc:d||e?c&Ab?b|hc:b&fc?b|gc:fc:kc}}),j($,Z,{defaults:{event:"pan",threshold:10,pointers:1,direction:Jb},getTouchAction:function(){var a=this.options.direction,b=[];return a&Hb&&b.push(dc),a&Ib&&b.push(cc),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Hb?(e=0===f?Cb:0>f?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&yb&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ab)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||I(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=ic,this.tryEmit()},b.interval,this),fc):ic}return kc},failTimeout:function(){return this._timer=e(function(){this.state=kc},this.options.interval,this),kc},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ic&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),eb.VERSION="2.0.4",eb.defaults={domEvents:!1,touchAction:$b,enable:!0,inputTarget:null,inputClass:null,preset:[[bb,{enable:!1}],[_,{enable:!1},["rotate"]],[cb,{direction:Hb}],[$,{direction:Hb},["swipe"]],[db],[db,{event:"doubletap",taps:2},["tap"]],[ab]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var lc=1,mc=2;fb.prototype={set:function(a){return h(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?mc:lc},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&ic)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===mc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(fc|gc|hc)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof V)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(s(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return g(r(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return g(r(a),function(a){b?c[a].splice(s(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&hb(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&gb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h(eb,{INPUT_START:yb,INPUT_MOVE:zb,INPUT_END:Ab,INPUT_CANCEL:Bb,STATE_POSSIBLE:ec,STATE_BEGAN:fc,STATE_CHANGED:gc,STATE_ENDED:hc,STATE_RECOGNIZED:ic,STATE_CANCELLED:jc,STATE_FAILED:kc,DIRECTION_NONE:Cb,DIRECTION_LEFT:Db,DIRECTION_RIGHT:Eb,DIRECTION_UP:Fb,DIRECTION_DOWN:Gb,DIRECTION_HORIZONTAL:Hb,DIRECTION_VERTICAL:Ib,DIRECTION_ALL:Jb,Manager:fb,Input:y,TouchAction:T,TouchInput:Q,MouseInput:M,PointerEventInput:N,TouchMouseInput:S,SingleTouchInput:O,Recognizer:V,AttrRecognizer:Z,Tap:db,Pan:$,Swipe:cb,Pinch:_,Rotate:bb,Press:ab,on:n,off:o,each:g,merge:i,extend:h,inherit:j,bindFn:k,prefixed:v}),typeof define==kb&&define.amd?define(function(){return eb}):"undefined"!=typeof module&&module.exports?module.exports=eb:a[c]=eb}(window,document,"Hammer");
7
- //# sourceMappingURL=hammer.min.map
1
+ /*! Hammer.JS - v2.0.8 - 2016-04-23
2
  * http://hammerjs.github.io/
3
  *
4
+ * Copyright (c) 2016 Jorik Tangelder;
5
  * Licensed under the MIT license */
6
+ !function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIREC