@macallumharvey/first-test-wet 2.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/dist/WetButton.d.ts +1 -1
  2. package/dist/first-test-wet.cjs.development.js +5 -0
  3. package/dist/first-test-wet.cjs.development.js.map +1 -1
  4. package/dist/first-test-wet.cjs.production.min.js +1 -1
  5. package/dist/first-test-wet.cjs.production.min.js.map +1 -1
  6. package/dist/first-test-wet.esm.js +5 -1
  7. package/dist/first-test-wet.esm.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/package.json +1 -1
  10. package/src/WetButton.tsx +1 -1
  11. package/src/WetModal.tsx +1 -0
  12. package/src/index.tsx +1 -0
  13. package/src/theme-wet-boew/assets/favicon-mobile.png +0 -0
  14. package/src/theme-wet-boew/assets/favicon.ico +0 -0
  15. package/src/theme-wet-boew/assets/logo.png +0 -0
  16. package/src/theme-wet-boew/assets/logo.svg +14 -0
  17. package/src/theme-wet-boew/css/ie8-theme.css +17370 -0
  18. package/src/theme-wet-boew/css/ie8-theme.min.css +193 -0
  19. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.js → theme-wet-boew/css/ie8-wet-boew.css} +12 -10
  20. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.min.js → theme-wet-boew/css/ie8-wet-boew.min.css} +7 -7
  21. package/src/theme-wet-boew/css/theme.css +11357 -0
  22. package/src/theme-wet-boew/css/theme.min.css +6 -0
  23. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.js → theme-wet-boew/css/wet-boew.css} +12 -10
  24. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.min.js → theme-wet-boew/css/wet-boew.min.css} +6 -7
  25. package/src/theme-wet-boew/payload.json +66 -0
  26. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/mediacontrols.html +32 -33
  27. package/src/wet-boew/assets/sprites_share.png +0 -0
  28. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/noscript.css +112 -112
  29. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/noscript.min.css +5 -5
  30. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datalist.css +32 -32
  31. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datepicker.css +47 -47
  32. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/details.css +28 -28
  33. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/mathml.css +16 -16
  34. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/meter.css +24 -24
  35. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/progress.css +8 -8
  36. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/slider.css +229 -229
  37. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.svg +287 -287
  38. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/additional-methods.js +1511 -1511
  39. package/src/wet-boew/js/deps/additional-methods.min.js +9 -0
  40. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/geomap-lib.js +3758 -3770
  41. package/src/wet-boew/js/deps/geomap-lib.min.js +1 -0
  42. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.dataTables.js +15345 -15733
  43. package/src/wet-boew/js/deps/jquery.dataTables.min.js +4 -0
  44. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.canvas.js +345 -345
  45. package/src/wet-boew/js/deps/jquery.flot.canvas.min.js +1 -0
  46. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.js +3168 -3168
  47. package/src/wet-boew/js/deps/jquery.flot.min.js +1 -0
  48. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.orderBars.js +282 -282
  49. package/src/wet-boew/js/deps/jquery.flot.orderBars.min.js +1 -0
  50. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.pie.js +820 -820
  51. package/src/wet-boew/js/deps/jquery.flot.pie.min.js +1 -0
  52. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.magnific-popup.js +2060 -2060
  53. package/src/wet-boew/js/deps/jquery.magnific-popup.min.js +4 -0
  54. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.validate.js +1660 -1660
  55. package/src/wet-boew/js/deps/jquery.validate.min.js +9 -0
  56. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/json-patch.js +314 -314
  57. package/src/wet-boew/js/deps/json-patch.min.js +1 -0
  58. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jsonpointer.js +349 -349
  59. package/src/wet-boew/js/deps/jsonpointer.min.js +1 -0
  60. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-apollo.js +53 -53
  61. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-basic.js +49 -49
  62. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-clj.js +64 -64
  63. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-css.js +160 -160
  64. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-dart.js +92 -92
  65. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-erlang.js +94 -94
  66. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-go.js +59 -59
  67. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-hs.js +102 -102
  68. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lasso.js +67 -67
  69. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lisp.js +95 -95
  70. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-llvm.js +63 -63
  71. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-logtalk.js +50 -50
  72. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lua.js +60 -60
  73. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-matlab.js +183 -183
  74. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-matlab.min.js +1 -1
  75. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-ml.js +57 -57
  76. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-mumps.js +140 -140
  77. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-n.js +67 -67
  78. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-pascal.js +49 -49
  79. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-proto.js +37 -37
  80. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-r.js +59 -59
  81. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rd.js +50 -50
  82. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rust.js +81 -81
  83. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-scala.js +56 -56
  84. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-sql.js +59 -59
  85. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-swift.js +60 -60
  86. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tcl.js +63 -63
  87. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tex.js +49 -49
  88. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vb.js +67 -67
  89. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vhdl.js +51 -51
  90. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-wiki.js +55 -55
  91. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-xq.js +71 -71
  92. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-yaml.js +45 -45
  93. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/ol.js +1008 -1008
  94. package/src/wet-boew/js/deps/ol.min.js +1 -0
  95. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/prettify.js +1742 -1742
  96. package/src/wet-boew/js/deps/prettify.min.js +1 -0
  97. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/proj4.js +2 -2
  98. package/src/wet-boew/js/deps/proj4.min.js +1 -0
  99. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/run_prettify.js +1998 -1998
  100. package/src/wet-boew/js/deps/run_prettify.min.js +1 -0
  101. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/tableparser.js +2216 -2216
  102. package/src/wet-boew/js/deps/tableparser.min.js +1 -0
  103. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/unorm.js +452 -452
  104. package/src/wet-boew/js/deps/unorm.min.js +1 -0
  105. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/af.js +246 -254
  106. package/src/wet-boew/js/i18n/af.min.js +7 -0
  107. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ar.js +284 -292
  108. package/src/wet-boew/js/i18n/ar.min.js +7 -0
  109. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/bg.js +284 -292
  110. package/src/wet-boew/js/i18n/bg.min.js +7 -0
  111. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/cs.js +285 -293
  112. package/src/wet-boew/js/i18n/cs.min.js +7 -0
  113. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/de.js +354 -362
  114. package/src/wet-boew/js/i18n/de.min.js +7 -0
  115. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/el.js +284 -292
  116. package/src/wet-boew/js/i18n/el.min.js +7 -0
  117. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/en.js +246 -254
  118. package/src/wet-boew/js/i18n/en.min.js +7 -0
  119. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/es.js +287 -295
  120. package/src/wet-boew/js/i18n/es.min.js +7 -0
  121. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/et.js +282 -290
  122. package/src/wet-boew/js/i18n/et.min.js +7 -0
  123. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/fr.js +313 -321
  124. package/src/wet-boew/js/i18n/fr.min.js +7 -0
  125. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hi.js +246 -254
  126. package/src/wet-boew/js/i18n/hi.min.js +7 -0
  127. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hu.js +284 -292
  128. package/src/wet-boew/js/i18n/hu.min.js +7 -0
  129. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hy.js +246 -254
  130. package/src/wet-boew/js/i18n/hy.min.js +7 -0
  131. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/id.js +283 -291
  132. package/src/wet-boew/js/i18n/id.min.js +7 -0
  133. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/is.js +282 -290
  134. package/src/wet-boew/js/i18n/is.min.js +7 -0
  135. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/it.js +311 -319
  136. package/src/wet-boew/js/i18n/it.min.js +7 -0
  137. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/iu.js +246 -254
  138. package/src/wet-boew/js/i18n/iu.min.js +7 -0
  139. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ja.js +285 -293
  140. package/src/wet-boew/js/i18n/ja.min.js +7 -0
  141. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ko.js +284 -292
  142. package/src/wet-boew/js/i18n/ko.min.js +7 -0
  143. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/lt.js +284 -292
  144. package/src/wet-boew/js/i18n/lt.min.js +7 -0
  145. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/lv.js +284 -292
  146. package/src/wet-boew/js/i18n/lv.min.js +7 -0
  147. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/nl.js +318 -326
  148. package/src/wet-boew/js/i18n/nl.min.js +7 -0
  149. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pl.js +287 -295
  150. package/src/wet-boew/js/i18n/pl.min.js +7 -0
  151. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pt-BR.js +246 -254
  152. package/src/wet-boew/js/i18n/pt-BR.min.js +7 -0
  153. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pt.js +270 -278
  154. package/src/wet-boew/js/i18n/pt.min.js +7 -0
  155. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ru.js +284 -292
  156. package/src/wet-boew/js/i18n/ru.min.js +7 -0
  157. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/sk.js +282 -290
  158. package/src/wet-boew/js/i18n/sk.min.js +7 -0
  159. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/sq.js +246 -254
  160. package/src/wet-boew/js/i18n/sq.min.js +7 -0
  161. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/th.js +284 -292
  162. package/src/wet-boew/js/i18n/th.min.js +7 -0
  163. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/tr.js +286 -294
  164. package/src/wet-boew/js/i18n/tr.min.js +7 -0
  165. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/uk.js +284 -292
  166. package/src/wet-boew/js/i18n/uk.min.js +7 -0
  167. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/vi.js +284 -292
  168. package/src/wet-boew/js/i18n/vi.min.js +7 -0
  169. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/zh-Hans.js +246 -254
  170. package/src/wet-boew/js/i18n/zh-Hans.min.js +7 -0
  171. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/zh.js +285 -293
  172. package/src/wet-boew/js/i18n/zh.min.js +7 -0
  173. package/src/wet-boew/js/ie8-wet-boew.js +3992 -0
  174. package/src/wet-boew/js/ie8-wet-boew.min.js +7 -0
  175. package/src/wet-boew/js/ie8-wet-boew2.js +15294 -0
  176. package/src/wet-boew/js/ie8-wet-boew2.min.js +7 -0
  177. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.js +9814 -9814
  178. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.min.js +4 -4
  179. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist.js +423 -419
  180. package/src/wet-boew/js/polyfills/datalist.min.js +8 -0
  181. package/src/wet-boew/js/polyfills/datalist.min.js.map +1 -0
  182. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist_dynamic.js +50 -50
  183. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist_dynamic.min.js +7 -7
  184. package/src/wet-boew/js/polyfills/datalist_dynamic.min.js.map +1 -0
  185. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datepicker.js +338 -338
  186. package/src/wet-boew/js/polyfills/datepicker.min.js +8 -0
  187. package/src/wet-boew/js/polyfills/datepicker.min.js.map +1 -0
  188. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/details.js +126 -126
  189. package/src/wet-boew/js/polyfills/details.min.js +8 -0
  190. package/src/wet-boew/js/polyfills/details.min.js.map +1 -0
  191. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/jawsariafixes.js +47 -47
  192. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/jawsariafixes.min.js +15 -15
  193. package/src/wet-boew/js/polyfills/jawsariafixes.min.js.map +1 -0
  194. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/meter.js +140 -140
  195. package/src/wet-boew/js/polyfills/meter.min.js +8 -0
  196. package/src/wet-boew/js/polyfills/meter.min.js.map +1 -0
  197. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/mobile.js +783 -784
  198. package/src/wet-boew/js/polyfills/mobile.min.js +8 -0
  199. package/src/wet-boew/js/polyfills/mobile.min.js.map +1 -0
  200. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/progress.js +107 -107
  201. package/src/wet-boew/js/polyfills/progress.min.js +8 -0
  202. package/src/wet-boew/js/polyfills/progress.min.js.map +1 -0
  203. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider.js +1343 -1343
  204. package/src/wet-boew/js/polyfills/slider.min.js +9 -0
  205. package/src/wet-boew/js/polyfills/slider.min.js.map +1 -0
  206. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider_wrapper.js +73 -73
  207. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider_wrapper.min.js +7 -7
  208. package/src/wet-boew/js/polyfills/slider_wrapper.min.js.map +1 -0
  209. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/svg.js +29 -29
  210. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/svg.min.js +7 -7
  211. package/src/wet-boew/js/polyfills/svg.min.js.map +1 -0
  212. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/test.js +603 -603
  213. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/test.min.js +7 -7
  214. package/src/wet-boew/js/polyfills/test.min.js.map +1 -0
  215. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/wet-boew.js +17714 -20264
  216. package/src/wet-boew/js/wet-boew.min.js +9 -0
  217. package/src/wet-boew/js/wet-boew.min.js.map +1 -0
  218. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/payload.json +1721 -1721
  219. package/src/wet-boew-cdn-4.0.81.1/Licence-fr.txt +0 -1
  220. package/src/wet-boew-cdn-4.0.81.1/License-en.txt +0 -1
  221. package/src/wet-boew-cdn-4.0.81.1/assets/sprites_share.png +0 -0
  222. package/src/wet-boew-cdn-4.0.81.1/js/deps/additional-methods.min.js +0 -9
  223. package/src/wet-boew-cdn-4.0.81.1/js/deps/geomap-lib.min.js +0 -1
  224. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.dataTables.min.js +0 -4
  225. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.canvas.min.js +0 -1
  226. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.min.js +0 -1
  227. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.orderBars.min.js +0 -1
  228. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.pie.min.js +0 -1
  229. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.magnific-popup.min.js +0 -4
  230. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.validate.min.js +0 -9
  231. package/src/wet-boew-cdn-4.0.81.1/js/deps/json-patch.min.js +0 -1
  232. package/src/wet-boew-cdn-4.0.81.1/js/deps/jsonpointer.min.js +0 -1
  233. package/src/wet-boew-cdn-4.0.81.1/js/deps/ol.min.js +0 -1
  234. package/src/wet-boew-cdn-4.0.81.1/js/deps/prettify.min.js +0 -1
  235. package/src/wet-boew-cdn-4.0.81.1/js/deps/proj4.min.js +0 -1
  236. package/src/wet-boew-cdn-4.0.81.1/js/deps/run_prettify.min.js +0 -1
  237. package/src/wet-boew-cdn-4.0.81.1/js/deps/tableparser.min.js +0 -1
  238. package/src/wet-boew-cdn-4.0.81.1/js/deps/unorm.min.js +0 -1
  239. package/src/wet-boew-cdn-4.0.81.1/js/i18n/af.min.js +0 -7
  240. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ar.min.js +0 -7
  241. package/src/wet-boew-cdn-4.0.81.1/js/i18n/bg.min.js +0 -7
  242. package/src/wet-boew-cdn-4.0.81.1/js/i18n/cs.min.js +0 -7
  243. package/src/wet-boew-cdn-4.0.81.1/js/i18n/de.min.js +0 -7
  244. package/src/wet-boew-cdn-4.0.81.1/js/i18n/el.min.js +0 -7
  245. package/src/wet-boew-cdn-4.0.81.1/js/i18n/en.min.js +0 -7
  246. package/src/wet-boew-cdn-4.0.81.1/js/i18n/es.min.js +0 -7
  247. package/src/wet-boew-cdn-4.0.81.1/js/i18n/et.min.js +0 -7
  248. package/src/wet-boew-cdn-4.0.81.1/js/i18n/fr.min.js +0 -7
  249. package/src/wet-boew-cdn-4.0.81.1/js/i18n/hi.min.js +0 -7
  250. package/src/wet-boew-cdn-4.0.81.1/js/i18n/hu.min.js +0 -7
  251. package/src/wet-boew-cdn-4.0.81.1/js/i18n/hy.min.js +0 -7
  252. package/src/wet-boew-cdn-4.0.81.1/js/i18n/id.min.js +0 -7
  253. package/src/wet-boew-cdn-4.0.81.1/js/i18n/is.min.js +0 -7
  254. package/src/wet-boew-cdn-4.0.81.1/js/i18n/it.min.js +0 -7
  255. package/src/wet-boew-cdn-4.0.81.1/js/i18n/iu.min.js +0 -7
  256. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ja.min.js +0 -7
  257. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ko.min.js +0 -7
  258. package/src/wet-boew-cdn-4.0.81.1/js/i18n/lt.min.js +0 -7
  259. package/src/wet-boew-cdn-4.0.81.1/js/i18n/lv.min.js +0 -7
  260. package/src/wet-boew-cdn-4.0.81.1/js/i18n/nl.min.js +0 -7
  261. package/src/wet-boew-cdn-4.0.81.1/js/i18n/pl.min.js +0 -7
  262. package/src/wet-boew-cdn-4.0.81.1/js/i18n/pt-BR.min.js +0 -7
  263. package/src/wet-boew-cdn-4.0.81.1/js/i18n/pt.min.js +0 -7
  264. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ru.min.js +0 -7
  265. package/src/wet-boew-cdn-4.0.81.1/js/i18n/sk.min.js +0 -7
  266. package/src/wet-boew-cdn-4.0.81.1/js/i18n/sq.min.js +0 -7
  267. package/src/wet-boew-cdn-4.0.81.1/js/i18n/th.min.js +0 -7
  268. package/src/wet-boew-cdn-4.0.81.1/js/i18n/tr.min.js +0 -7
  269. package/src/wet-boew-cdn-4.0.81.1/js/i18n/uk.min.js +0 -7
  270. package/src/wet-boew-cdn-4.0.81.1/js/i18n/vi.min.js +0 -7
  271. package/src/wet-boew-cdn-4.0.81.1/js/i18n/zh-Hans.min.js +0 -7
  272. package/src/wet-boew-cdn-4.0.81.1/js/i18n/zh.min.js +0 -7
  273. package/src/wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.min.js.map +0 -1
  274. package/src/wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.min.js.map +0 -1
  275. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist.min.js +0 -8
  276. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist.min.js.map +0 -1
  277. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist_dynamic.min.js.map +0 -1
  278. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datepicker.min.js +0 -8
  279. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datepicker.min.js.map +0 -1
  280. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/details.min.js +0 -8
  281. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/details.min.js.map +0 -1
  282. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/jawsariafixes.min.js.map +0 -1
  283. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/meter.min.js +0 -8
  284. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/meter.min.js.map +0 -1
  285. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/mobile.min.js +0 -8
  286. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/mobile.min.js.map +0 -1
  287. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/progress.min.js +0 -8
  288. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/progress.min.js.map +0 -1
  289. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider.min.js +0 -9
  290. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider.min.js.map +0 -1
  291. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider_wrapper.min.js.map +0 -1
  292. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/svg.min.js.map +0 -1
  293. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/test.min.js.map +0 -1
  294. package/src/wet-boew-cdn-4.0.81.1/js/wet-boew.min.js +0 -9
  295. package/src/wet-boew-cdn-4.0.81.1/js/wet-boew.min.js.map +0 -1
  296. package/src/wet-boew-cdn-4.0.81.1/package.json +0 -15
  297. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/cloud-popup-relative.png +0 -0
  298. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/fd-slider-sprite.png +0 -0
  299. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/loading.png +0 -0
  300. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-minus-mini.png +0 -0
  301. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-plus-mini.png +0 -0
  302. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-world-mini.png +0 -0
  303. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datalist.min.css +0 -0
  304. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datepicker.min.css +0 -0
  305. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/details.min.css +0 -0
  306. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/mathml.min.css +0 -0
  307. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/meter.min.css +0 -0
  308. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/progress.min.css +0 -0
  309. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/slider.min.css +0 -0
  310. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.eot +0 -0
  311. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.ttf +0 -0
  312. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.woff +0 -0
  313. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.woff2 +0 -0
  314. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/mml-chtml.js +0 -0
  315. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff +0 -0
  316. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff +0 -0
  317. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff +0 -0
  318. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff +0 -0
  319. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff +0 -0
  320. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff +0 -0
  321. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff +0 -0
  322. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff +0 -0
  323. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff +0 -0
  324. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff +0 -0
  325. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff +0 -0
  326. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff +0 -0
  327. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff +0 -0
  328. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff +0 -0
  329. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff +0 -0
  330. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff +0 -0
  331. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff +0 -0
  332. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff +0 -0
  333. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff +0 -0
  334. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff +0 -0
  335. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff +0 -0
  336. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff +0 -0
  337. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Zero.woff +0 -0
  338. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-apollo.min.js +0 -0
  339. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-basic.min.js +0 -0
  340. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-clj.min.js +0 -0
  341. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-css.min.js +0 -0
  342. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-dart.min.js +0 -0
  343. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-erlang.min.js +0 -0
  344. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-go.min.js +0 -0
  345. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-hs.min.js +0 -0
  346. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lasso.min.js +0 -0
  347. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lisp.min.js +0 -0
  348. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-llvm.min.js +0 -0
  349. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-logtalk.min.js +0 -0
  350. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lua.min.js +0 -0
  351. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-ml.min.js +0 -0
  352. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-mumps.min.js +0 -0
  353. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-n.min.js +0 -0
  354. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-pascal.min.js +0 -0
  355. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-proto.min.js +0 -0
  356. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-r.min.js +0 -0
  357. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rd.min.js +0 -0
  358. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rust.min.js +0 -0
  359. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-scala.min.js +0 -0
  360. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-sql.min.js +0 -0
  361. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-swift.min.js +0 -0
  362. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tcl.min.js +0 -0
  363. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tex.min.js +0 -0
  364. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vb.min.js +0 -0
  365. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vhdl.min.js +0 -0
  366. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-wiki.min.js +0 -0
  367. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-xq.min.js +0 -0
  368. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-yaml.min.js +0 -0
  369. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.min.map +0 -0
@@ -1,2061 +1,2061 @@
1
- /*! Magnific Popup - v1.0.0 - 2017-01-24
2
- * http://dimsemenov.com/plugins/magnific-popup/
3
- * Copyright (c) 2017 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
- var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
46
- MagnificPopup = function(){},
47
- _isJQ = !!(window.jQuery),
48
- _prevStatus,
49
- _window = $(window),
50
- _body,
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
- mfp = new MagnificPopup();
101
- mfp.init();
102
- $.magnificPopup.instance = mfp;
103
- }
104
- },
105
- // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
106
- supportsTransitions = function() {
107
- var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
108
- v = ['ms','O','Moz','Webkit']; // 'v' for vendor
109
-
110
- if( s['transition'] !== undefined ) {
111
- return true;
112
- }
113
-
114
- while( v.length ) {
115
- if( v.pop() + 'Transition' in s ) {
116
- return true;
117
- }
118
- }
119
-
120
- return false;
121
- };
122
-
123
-
124
-
125
- /**
126
- * Public functions
127
- */
128
- MagnificPopup.prototype = {
129
-
130
- constructor: MagnificPopup,
131
-
132
- /**
133
- * Initializes Magnific Popup plugin.
134
- * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
135
- */
136
- init: function() {
137
- var appVersion = navigator.appVersion;
138
- mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
139
- mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
140
- mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
141
- mfp.isAndroid = (/android/gi).test(appVersion);
142
- mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
143
- mfp.supportsTransition = supportsTransitions();
144
-
145
- // We disable fixed positioned lightbox on devices that don't handle it nicely.
146
- // If you know a better way of detecting this - let me know.
147
- mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
148
- _document = $(document);
149
-
150
- mfp.popupsCache = {};
151
- },
152
-
153
- /**
154
- * Opens popup
155
- * @param data [description]
156
- */
157
- open: function(data) {
158
-
159
- if(!_body) {
160
- _body = $(document.body);
161
- }
162
-
163
- var i;
164
-
165
- if(data.isObj === false) {
166
- // convert jQuery collection to array to avoid conflicts later
167
- mfp.items = data.items.toArray();
168
-
169
- mfp.index = 0;
170
- var items = data.items,
171
- item;
172
- for(i = 0; i < items.length; i++) {
173
- item = items[i];
174
- if(item.parsed) {
175
- item = item.el[0];
176
- }
177
- if(item === data.el[0]) {
178
- mfp.index = i;
179
- break;
180
- }
181
- }
182
- } else {
183
- mfp.items = $.isArray(data.items) ? data.items : [data.items];
184
- mfp.index = data.index || 0;
185
- }
186
-
187
- // if popup is already opened - we just update the content
188
- if(mfp.isOpen) {
189
- mfp.updateItemHTML();
190
- return;
191
- }
192
-
193
- mfp.types = [];
194
- _wrapClasses = '';
195
- if(data.mainEl && data.mainEl.length) {
196
- mfp.ev = data.mainEl.eq(0);
197
- } else {
198
- mfp.ev = _document;
199
- }
200
-
201
- if(data.key) {
202
- if(!mfp.popupsCache[data.key]) {
203
- mfp.popupsCache[data.key] = {};
204
- }
205
- mfp.currTemplate = mfp.popupsCache[data.key];
206
- } else {
207
- mfp.currTemplate = {};
208
- }
209
-
210
-
211
-
212
- mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
213
- mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
214
-
215
- if(mfp.st.modal) {
216
- mfp.st.closeOnContentClick = false;
217
- mfp.st.closeOnBgClick = false;
218
- mfp.st.showCloseBtn = false;
219
- mfp.st.enableEscapeKey = false;
220
- }
221
-
222
-
223
- // Building markup
224
- // main containers are created only once
225
- if(!mfp.bgOverlay) {
226
-
227
- // Dark overlay
228
- mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
229
- mfp.close();
230
- });
231
-
232
- mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
233
- if(mfp._checkIfClose(e.target)) {
234
- mfp.close();
235
- }
236
- });
237
-
238
- mfp.container = _getEl('container', mfp.wrap);
239
- }
240
-
241
- mfp.contentContainer = _getEl('content');
242
- if(mfp.st.preloader) {
243
- mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
244
- }
245
-
246
-
247
- // Initializing modules
248
- var modules = $.magnificPopup.modules;
249
- for(i = 0; i < modules.length; i++) {
250
- var n = modules[i];
251
- n = n.charAt(0).toUpperCase() + n.slice(1);
252
- mfp['init'+n].call(mfp);
253
- }
254
- _mfpTrigger('BeforeOpen');
255
-
256
-
257
- if(mfp.st.showCloseBtn) {
258
- // Close button
259
- if(!mfp.st.closeBtnInside) {
260
- mfp.wrap.append( _getCloseBtn() );
261
- } else {
262
- _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
263
- values.close_replaceWith = _getCloseBtn(item.type);
264
- });
265
- _wrapClasses += ' mfp-close-btn-in';
266
- }
267
- }
268
-
269
- if(mfp.st.alignTop) {
270
- _wrapClasses += ' mfp-align-top';
271
- }
272
-
273
-
274
-
275
- if(mfp.fixedContentPos) {
276
- mfp.wrap.css({
277
- overflow: mfp.st.overflowY,
278
- overflowX: 'hidden',
279
- overflowY: mfp.st.overflowY
280
- });
281
- } else {
282
- mfp.wrap.css({
283
- top: _window.scrollTop(),
284
- position: 'absolute'
285
- });
286
- }
287
- if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
288
- mfp.bgOverlay.css({
289
- height: _document.height(),
290
- position: 'absolute'
291
- });
292
- }
293
-
294
-
295
-
296
- if(mfp.st.enableEscapeKey) {
297
- // Close on ESC key
298
- _document.on('keyup' + EVENT_NS, function(e) {
299
- if(e.keyCode === 27) {
300
- mfp.close();
301
- }
302
- });
303
- }
304
-
305
- _window.on('resize' + EVENT_NS, function() {
306
- mfp.updateSize();
307
- });
308
-
309
-
310
- if(!mfp.st.closeOnContentClick) {
311
- _wrapClasses += ' mfp-auto-cursor';
312
- }
313
-
314
- if(_wrapClasses)
315
- mfp.wrap.addClass(_wrapClasses);
316
-
317
-
318
- // this triggers recalculation of layout, so we get it once to not to trigger twice
319
- var windowHeight = mfp.wH = _window.height();
320
-
321
-
322
- var windowStyles = {};
323
-
324
- if( mfp.fixedContentPos ) {
325
- if(mfp._hasScrollBar(windowHeight)){
326
- var s = mfp._getScrollbarSize();
327
- if(s) {
328
- windowStyles.marginRight = s;
329
- }
330
- }
331
- }
332
-
333
- if(mfp.fixedContentPos) {
334
- if(!mfp.isIE7) {
335
- windowStyles.overflow = 'hidden';
336
- } else {
337
- // ie7 double-scroll bug
338
- $('body, html').css('overflow', 'hidden');
339
- }
340
- }
341
-
342
-
343
-
344
- var classesToadd = mfp.st.mainClass;
345
- if(mfp.isIE7) {
346
- classesToadd += ' mfp-ie7';
347
- }
348
- if(classesToadd) {
349
- mfp._addClassToMFP( classesToadd );
350
- }
351
-
352
- // add content
353
- mfp.updateItemHTML();
354
-
355
- _mfpTrigger('BuildControls');
356
-
357
- // remove scrollbar, add margin e.t.c
358
- $('html').css(windowStyles);
359
-
360
- // add everything to DOM
361
- mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body );
362
-
363
- // Save last focused element
364
- mfp._lastFocusedEl = document.activeElement;
365
-
366
- // Wait for next cycle to allow CSS transition
367
- setTimeout(function() {
368
-
369
- if(mfp.content) {
370
- mfp._addClassToMFP(READY_CLASS);
371
- mfp._setFocus();
372
- } else {
373
- // if content is not defined (not loaded e.t.c) we add class only for BG
374
- mfp.bgOverlay.addClass(READY_CLASS);
375
- }
376
-
377
- // Trap the focus in popup
378
- _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
379
-
380
- }, 16);
381
-
382
- mfp.isOpen = true;
383
- mfp.updateSize(windowHeight);
384
- _mfpTrigger(OPEN_EVENT);
385
-
386
- return data;
387
- },
388
-
389
- /**
390
- * Closes the popup
391
- */
392
- close: function() {
393
- if(!mfp.isOpen) return;
394
- _mfpTrigger(BEFORE_CLOSE_EVENT);
395
-
396
- mfp.isOpen = false;
397
- // for CSS3 animation
398
- if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
399
- mfp._addClassToMFP(REMOVING_CLASS);
400
- setTimeout(function() {
401
- mfp._close();
402
- }, mfp.st.removalDelay);
403
- } else {
404
- mfp._close();
405
- }
406
- },
407
-
408
- /**
409
- * Helper for close() function
410
- */
411
- _close: function() {
412
- _mfpTrigger(CLOSE_EVENT);
413
-
414
- var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
415
-
416
- mfp.bgOverlay.detach();
417
- mfp.wrap.detach();
418
- mfp.container.empty();
419
-
420
- if(mfp.st.mainClass) {
421
- classesToRemove += mfp.st.mainClass + ' ';
422
- }
423
-
424
- mfp._removeClassFromMFP(classesToRemove);
425
-
426
- if(mfp.fixedContentPos) {
427
- var windowStyles = {marginRight: ''};
428
- if(mfp.isIE7) {
429
- $('body, html').css('overflow', '');
430
- } else {
431
- windowStyles.overflow = '';
432
- }
433
- $('html').css(windowStyles);
434
- }
435
-
436
- _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
437
- mfp.ev.off(EVENT_NS);
438
-
439
- // clean up DOM elements that aren't removed
440
- mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
441
- mfp.bgOverlay.attr('class', 'mfp-bg');
442
- mfp.container.attr('class', 'mfp-container');
443
-
444
- // remove close button from target element
445
- if(mfp.st.showCloseBtn &&
446
- (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
447
- if(mfp.currTemplate.closeBtn)
448
- mfp.currTemplate.closeBtn.detach();
449
- }
450
-
451
-
452
- if(mfp._lastFocusedEl) {
453
- $(mfp._lastFocusedEl).focus(); // put tab focus back
454
- }
455
- mfp.currItem = null;
456
- mfp.content = null;
457
- mfp.currTemplate = null;
458
- mfp.prevHeight = 0;
459
-
460
- _mfpTrigger(AFTER_CLOSE_EVENT);
461
- },
462
-
463
- updateSize: function(winHeight) {
464
-
465
- if(mfp.isIOS) {
466
- // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
467
- var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
468
- var height = window.innerHeight * zoomLevel;
469
- mfp.wrap.css('height', height);
470
- mfp.wH = height;
471
- } else {
472
- mfp.wH = winHeight || _window.height();
473
- }
474
- // Fixes #84: popup incorrectly positioned with position:relative on body
475
- if(!mfp.fixedContentPos) {
476
- mfp.wrap.css('height', mfp.wH);
477
- }
478
-
479
- _mfpTrigger('Resize');
480
-
481
- },
482
-
483
- /**
484
- * Set content of popup based on current index
485
- */
486
- updateItemHTML: function() {
487
- var item = mfp.items[mfp.index];
488
-
489
- // Detach and perform modifications
490
- mfp.contentContainer.detach();
491
-
492
- if(mfp.content)
493
- mfp.content.detach();
494
-
495
- if(!item.parsed) {
496
- item = mfp.parseEl( mfp.index );
497
- }
498
-
499
- var type = item.type;
500
-
501
- _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
502
- // BeforeChange event works like so:
503
- // _mfpOn('BeforeChange', function(e, prevType, newType) { });
504
-
505
- mfp.currItem = item;
506
-
507
-
508
-
509
-
510
-
511
- if(!mfp.currTemplate[type]) {
512
- var markup = mfp.st[type] ? mfp.st[type].markup : false;
513
-
514
- // allows to modify markup
515
- _mfpTrigger('FirstMarkupParse', markup);
516
-
517
- if(markup) {
518
- mfp.currTemplate[type] = $(markup);
519
- } else {
520
- // if there is no markup found we just define that template is parsed
521
- mfp.currTemplate[type] = true;
522
- }
523
- }
524
-
525
- if(_prevContentType && _prevContentType !== item.type) {
526
- mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
527
- }
528
-
529
- var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
530
- mfp.appendContent(newContent, type);
531
-
532
- item.preloaded = true;
533
-
534
- _mfpTrigger(CHANGE_EVENT, item);
535
- _prevContentType = item.type;
536
-
537
- // Append container back after its content changed
538
- mfp.container.prepend(mfp.contentContainer);
539
-
540
- _mfpTrigger('AfterChange');
541
- },
542
-
543
-
544
- /**
545
- * Set HTML content of popup
546
- */
547
- appendContent: function(newContent, type) {
548
- mfp.content = newContent;
549
-
550
- if(newContent) {
551
- if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
552
- mfp.currTemplate[type] === true) {
553
- // if there is no markup, we just append close button element inside
554
- if(!mfp.content.find('.mfp-close').length) {
555
- mfp.content.append(_getCloseBtn());
556
- }
557
- } else {
558
- mfp.content = newContent;
559
- }
560
- } else {
561
- mfp.content = '';
562
- }
563
-
564
- _mfpTrigger(BEFORE_APPEND_EVENT);
565
- mfp.container.addClass('mfp-'+type+'-holder');
566
-
567
- mfp.contentContainer.append(mfp.content);
568
- },
569
-
570
-
571
-
572
-
573
- /**
574
- * Creates Magnific Popup data object based on given data
575
- * @param {int} index Index of item to parse
576
- */
577
- parseEl: function(index) {
578
- var item = mfp.items[index],
579
- type;
580
-
581
- if(item.tagName) {
582
- item = { el: $(item) };
583
- } else {
584
- type = item.type;
585
- item = { data: item, src: item.src };
586
- }
587
-
588
- if(item.el) {
589
- var types = mfp.types;
590
-
591
- // check for 'mfp-TYPE' class
592
- for(var i = 0; i < types.length; i++) {
593
- if( item.el.hasClass('mfp-'+types[i]) ) {
594
- type = types[i];
595
- break;
596
- }
597
- }
598
-
599
- item.src = item.el.attr('data-mfp-src');
600
- if(!item.src) {
601
- item.src = item.el.attr('href');
602
- }
603
- }
604
-
605
- item.type = type || mfp.st.type || 'inline';
606
- item.index = index;
607
- item.parsed = true;
608
- mfp.items[index] = item;
609
- _mfpTrigger('ElementParse', item);
610
-
611
- return mfp.items[index];
612
- },
613
-
614
-
615
- /**
616
- * Initializes single popup or a group of popups
617
- */
618
- addGroup: function(el, options) {
619
- var eHandler = function(e) {
620
- e.mfpEl = this;
621
- mfp._openClick(e, el, options);
622
- };
623
-
624
- if(!options) {
625
- options = {};
626
- }
627
-
628
- var eName = 'click.magnificPopup';
629
- options.mainEl = el;
630
-
631
- if(options.items) {
632
- options.isObj = true;
633
- el.off(eName).on(eName, eHandler);
634
- } else {
635
- options.isObj = false;
636
- if(options.delegate) {
637
- el.off(eName).on(eName, options.delegate , eHandler);
638
- } else {
639
- options.items = el;
640
- el.off(eName).on(eName, eHandler);
641
- }
642
- }
643
- },
644
- _openClick: function(e, el, options) {
645
- var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
646
-
647
-
648
- if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
649
- return;
650
- }
651
-
652
- var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
653
-
654
- if(disableOn) {
655
- if($.isFunction(disableOn)) {
656
- if( !disableOn.call(mfp) ) {
657
- return true;
658
- }
659
- } else { // else it's number
660
- if( _window.width() < disableOn ) {
661
- return true;
662
- }
663
- }
664
- }
665
-
666
- if(e.type) {
667
- e.preventDefault();
668
-
669
- // This will prevent popup from closing if element is inside and popup is already opened
670
- if(mfp.isOpen) {
671
- e.stopPropagation();
672
- }
673
- }
674
-
675
-
676
- options.el = $(e.mfpEl);
677
- if(options.delegate) {
678
- options.items = el.find(options.delegate);
679
- }
680
- mfp.open(options);
681
- },
682
-
683
-
684
- /**
685
- * Updates text on preloader
686
- */
687
- updateStatus: function(status, text) {
688
-
689
- if(mfp.preloader) {
690
- if(_prevStatus !== status) {
691
- mfp.container.removeClass('mfp-s-'+_prevStatus);
692
- }
693
-
694
- if(!text && status === 'loading') {
695
- text = mfp.st.tLoading;
696
- }
697
-
698
- var data = {
699
- status: status,
700
- text: text
701
- };
702
- // allows to modify status
703
- _mfpTrigger('UpdateStatus', data);
704
-
705
- status = data.status;
706
- text = data.text;
707
-
708
- mfp.preloader.html(text);
709
-
710
- mfp.preloader.find('a').on('click', function(e) {
711
- e.stopImmediatePropagation();
712
- });
713
-
714
- mfp.container.addClass('mfp-s-'+status);
715
- _prevStatus = status;
716
- }
717
- },
718
-
719
-
720
- /*
721
- "Private" helpers that aren't private at all
722
- */
723
- // Check to close popup or not
724
- // "target" is an element that was clicked
725
- _checkIfClose: function(target) {
726
-
727
- if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
728
- return;
729
- }
730
-
731
- var closeOnContent = mfp.st.closeOnContentClick;
732
- var closeOnBg = mfp.st.closeOnBgClick;
733
-
734
- if(closeOnContent && closeOnBg) {
735
- return true;
736
- } else {
737
-
738
- // We close the popup if click is on close button or on preloader. Or if there is no content.
739
- if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
740
- return true;
741
- }
742
-
743
- // if click is outside the content
744
- if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
745
- if(closeOnBg) {
746
- // last check, if the clicked element is in DOM, (in case it's removed onclick)
747
- if( $.contains(document, target) ) {
748
- return true;
749
- }
750
- }
751
- } else if(closeOnContent) {
752
- return true;
753
- }
754
-
755
- }
756
- return false;
757
- },
758
- _addClassToMFP: function(cName) {
759
- mfp.bgOverlay.addClass(cName);
760
- mfp.wrap.addClass(cName);
761
- },
762
- _removeClassFromMFP: function(cName) {
763
- this.bgOverlay.removeClass(cName);
764
- mfp.wrap.removeClass(cName);
765
- },
766
- _hasScrollBar: function(winHeight) {
767
- return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
768
- },
769
- _setFocus: function() {
770
- (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
771
- },
772
- _onFocusIn: function(e) {
773
- if( (e.target !== mfp.wrap[0] && e.target !== document) && !$.contains(mfp.wrap[0], e.target) ) {
774
- mfp._setFocus();
775
- return false;
776
- }
777
- },
778
- _parseMarkup: function(template, values, item) {
779
- var arr;
780
- if(item.data) {
781
- values = $.extend(item.data, values);
782
- }
783
- _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
784
-
785
- $.each(values, function(key, value) {
786
- if(value === undefined || value === false) {
787
- return true;
788
- }
789
- arr = key.split('_');
790
- if(arr.length > 1) {
791
- var el = template.find(EVENT_NS + '-'+arr[0]);
792
-
793
- if(el.length > 0) {
794
- var attr = arr[1];
795
- if(attr === 'replaceWith') {
796
- if(el[0] !== value[0]) {
797
- el.replaceWith(value);
798
- }
799
- } else if(attr === 'img') {
800
- if(el.is('img')) {
801
- el.attr('src', value);
802
- } else {
803
- el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
804
- }
805
- } else {
806
- el.attr(arr[1], value);
807
- }
808
- }
809
-
810
- } else {
811
- template.find(EVENT_NS + '-'+key).html(value);
812
- }
813
- });
814
- },
815
-
816
- _getScrollbarSize: function() {
817
- // thx David
818
- if(mfp.scrollbarSize === undefined) {
819
- var scrollDiv = document.createElement("div");
820
- scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
821
- document.body.appendChild(scrollDiv);
822
- mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
823
- document.body.removeChild(scrollDiv);
824
- }
825
- return mfp.scrollbarSize;
826
- }
827
-
828
- }; /* MagnificPopup core prototype end */
829
-
830
-
831
-
832
-
833
- /**
834
- * Public static functions
835
- */
836
- $.magnificPopup = {
837
- instance: null,
838
- proto: MagnificPopup.prototype,
839
- modules: [],
840
-
841
- open: function(options, index) {
842
- _checkInstance();
843
-
844
- if(!options) {
845
- options = {};
846
- } else {
847
- options = $.extend(true, {}, options);
848
- }
849
-
850
-
851
- options.isObj = true;
852
- options.index = index || 0;
853
- return this.instance.open(options);
854
- },
855
-
856
- close: function() {
857
- return $.magnificPopup.instance && $.magnificPopup.instance.close();
858
- },
859
-
860
- registerModule: function(name, module) {
861
- if(module.options) {
862
- $.magnificPopup.defaults[name] = module.options;
863
- }
864
- $.extend(this.proto, module.proto);
865
- this.modules.push(name);
866
- },
867
-
868
- defaults: {
869
-
870
- // Info about options is in docs:
871
- // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
872
-
873
- disableOn: 0,
874
-
875
- key: null,
876
-
877
- midClick: false,
878
-
879
- mainClass: '',
880
-
881
- preloader: true,
882
-
883
- focus: '', // CSS selector of input to focus after popup is opened
884
-
885
- closeOnContentClick: false,
886
-
887
- closeOnBgClick: true,
888
-
889
- closeBtnInside: true,
890
-
891
- showCloseBtn: true,
892
-
893
- enableEscapeKey: true,
894
-
895
- modal: false,
896
-
897
- alignTop: false,
898
-
899
- removalDelay: 0,
900
-
901
- prependTo: null,
902
-
903
- fixedContentPos: 'auto',
904
-
905
- fixedBgPos: 'auto',
906
-
907
- overflowY: 'auto',
908
-
909
- closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
910
-
911
- tClose: 'Close (Esc)',
912
-
913
- tLoading: 'Loading...'
914
-
915
- }
916
- };
917
-
918
-
919
-
920
- $.fn.magnificPopup = function(options) {
921
- _checkInstance();
922
-
923
- var jqEl = $(this);
924
-
925
- // We call some API method of first param is a string
926
- if (typeof options === "string" ) {
927
-
928
- if(options === 'open') {
929
- var items,
930
- itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
931
- index = parseInt(arguments[1], 10) || 0;
932
-
933
- if(itemOpts.items) {
934
- items = itemOpts.items[index];
935
- } else {
936
- items = jqEl;
937
- if(itemOpts.delegate) {
938
- items = items.find(itemOpts.delegate);
939
- }
940
- items = items.eq( index );
941
- }
942
- mfp._openClick({mfpEl:items}, jqEl, itemOpts);
943
- } else {
944
- if(mfp.isOpen)
945
- mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
946
- }
947
-
948
- } else {
949
- // clone options obj
950
- options = $.extend(true, {}, options);
951
-
952
- /*
953
- * As Zepto doesn't support .data() method for objects
954
- * and it works only in normal browsers
955
- * we assign "options" object directly to the DOM element. FTW!
956
- */
957
- if(_isJQ) {
958
- jqEl.data('magnificPopup', options);
959
- } else {
960
- jqEl[0].magnificPopup = options;
961
- }
962
-
963
- mfp.addGroup(jqEl, options);
964
-
965
- }
966
- return jqEl;
967
- };
968
-
969
- //Quick benchmark
970
- /*
971
- var start = performance.now(),
972
- i,
973
- rounds = 1000;
974
-
975
- for(i = 0; i < rounds; i++) {
976
-
977
- }
978
- console.log('Test #1:', performance.now() - start);
979
-
980
- start = performance.now();
981
- for(i = 0; i < rounds; i++) {
982
-
983
- }
984
- console.log('Test #2:', performance.now() - start);
985
- */
986
-
987
-
988
- /*>>core*/
989
-
990
- /*>>inline*/
991
-
992
- var INLINE_NS = 'inline',
993
- _hiddenClass,
994
- _inlinePlaceholder,
995
- _lastInlineElement,
996
- _putInlineElementsBack = function() {
997
- if(_lastInlineElement) {
998
- _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
999
- _lastInlineElement = null;
1000
- }
1001
- };
1002
-
1003
- $.magnificPopup.registerModule(INLINE_NS, {
1004
- options: {
1005
- hiddenClass: 'hide', // will be appended with `mfp-` prefix
1006
- markup: '',
1007
- tNotFound: 'Content not found'
1008
- },
1009
- proto: {
1010
-
1011
- initInline: function() {
1012
- mfp.types.push(INLINE_NS);
1013
-
1014
- _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
1015
- _putInlineElementsBack();
1016
- });
1017
- },
1018
-
1019
- getInline: function(item, template) {
1020
-
1021
- _putInlineElementsBack();
1022
-
1023
- if(item.src) {
1024
- var inlineSt = mfp.st.inline,
1025
- el = $(item.src);
1026
-
1027
- if(el.length) {
1028
-
1029
- // If target element has parent - we replace it with placeholder and put it back after popup is closed
1030
- var parent = el[0].parentNode;
1031
- if(parent && parent.tagName) {
1032
- if(!_inlinePlaceholder) {
1033
- _hiddenClass = inlineSt.hiddenClass;
1034
- _inlinePlaceholder = _getEl(_hiddenClass);
1035
- _hiddenClass = 'mfp-'+_hiddenClass;
1036
- }
1037
- // replace target inline element with placeholder
1038
- _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1039
- }
1040
-
1041
- mfp.updateStatus('ready');
1042
- } else {
1043
- mfp.updateStatus('error', inlineSt.tNotFound);
1044
- el = $('<div>');
1045
- }
1046
-
1047
- item.inlineElement = el;
1048
- return el;
1049
- }
1050
-
1051
- mfp.updateStatus('ready');
1052
- mfp._parseMarkup(template, {}, item);
1053
- return template;
1054
- }
1055
- }
1056
- });
1057
-
1058
- /*>>inline*/
1059
-
1060
- /*>>ajax*/
1061
- var AJAX_NS = 'ajax',
1062
- _ajaxCur,
1063
- _removeAjaxCursor = function() {
1064
- if(_ajaxCur) {
1065
- _body.removeClass(_ajaxCur);
1066
- }
1067
- },
1068
- _destroyAjaxRequest = function() {
1069
- _removeAjaxCursor();
1070
- if(mfp.req) {
1071
- mfp.req.abort();
1072
- }
1073
- };
1074
-
1075
- $.magnificPopup.registerModule(AJAX_NS, {
1076
-
1077
- options: {
1078
- settings: null,
1079
- cursor: 'mfp-ajax-cur',
1080
- tError: '<a href="%url%">The content</a> could not be loaded.'
1081
- },
1082
-
1083
- proto: {
1084
- initAjax: function() {
1085
- mfp.types.push(AJAX_NS);
1086
- _ajaxCur = mfp.st.ajax.cursor;
1087
-
1088
- _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1089
- _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1090
- },
1091
- getAjax: function(item) {
1092
-
1093
- if(_ajaxCur)
1094
- _body.addClass(_ajaxCur);
1095
-
1096
- mfp.updateStatus('loading');
1097
-
1098
- var opts = $.extend({
1099
- url: item.src,
1100
- success: function(data, textStatus, jqXHR) {
1101
- var temp = {
1102
- data:data,
1103
- xhr:jqXHR
1104
- };
1105
-
1106
- _mfpTrigger('ParseAjax', temp);
1107
-
1108
- mfp.appendContent( $(temp.data), AJAX_NS );
1109
-
1110
- item.finished = true;
1111
-
1112
- _removeAjaxCursor();
1113
-
1114
- mfp._setFocus();
1115
-
1116
- setTimeout(function() {
1117
- mfp.wrap.addClass(READY_CLASS);
1118
- }, 16);
1119
-
1120
- mfp.updateStatus('ready');
1121
-
1122
- _mfpTrigger('AjaxContentAdded');
1123
- },
1124
- error: function() {
1125
- _removeAjaxCursor();
1126
- item.finished = item.loadError = true;
1127
- mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1128
- }
1129
- }, mfp.st.ajax.settings);
1130
-
1131
- mfp.req = $.ajax(opts);
1132
-
1133
- return '';
1134
- }
1135
- }
1136
- });
1137
-
1138
-
1139
-
1140
-
1141
-
1142
-
1143
-
1144
- /*>>ajax*/
1145
-
1146
- /*>>image*/
1147
- var _imgInterval,
1148
- _getTitle = function(item) {
1149
- if(item.data && item.data.title !== undefined)
1150
- return item.data.title;
1151
-
1152
- var src = mfp.st.image.titleSrc;
1153
-
1154
- if(src) {
1155
- if($.isFunction(src)) {
1156
- return src.call(mfp, item);
1157
- } else if(item.el) {
1158
- return item.el.attr(src) || '';
1159
- }
1160
- }
1161
- return '';
1162
- };
1163
-
1164
- $.magnificPopup.registerModule('image', {
1165
-
1166
- options: {
1167
- markup: '<div class="mfp-figure">'+
1168
- '<div class="mfp-close"></div>'+
1169
- '<figure>'+
1170
- '<div class="mfp-img"></div>'+
1171
- '<figcaption>'+
1172
- '<div class="mfp-bottom-bar">'+
1173
- '<div class="mfp-title"></div>'+
1174
- '<div class="mfp-counter"></div>'+
1175
- '</div>'+
1176
- '</figcaption>'+
1177
- '</figure>'+
1178
- '</div>',
1179
- cursor: 'mfp-zoom-out-cur',
1180
- titleSrc: 'title',
1181
- verticalFit: true,
1182
- tError: '<a href="%url%">The image</a> could not be loaded.'
1183
- },
1184
-
1185
- proto: {
1186
- initImage: function() {
1187
- var imgSt = mfp.st.image,
1188
- ns = '.image';
1189
-
1190
- mfp.types.push('image');
1191
-
1192
- _mfpOn(OPEN_EVENT+ns, function() {
1193
- if(mfp.currItem.type === 'image' && imgSt.cursor) {
1194
- _body.addClass(imgSt.cursor);
1195
- }
1196
- });
1197
-
1198
- _mfpOn(CLOSE_EVENT+ns, function() {
1199
- if(imgSt.cursor) {
1200
- _body.removeClass(imgSt.cursor);
1201
- }
1202
- _window.off('resize' + EVENT_NS);
1203
- });
1204
-
1205
- _mfpOn('Resize'+ns, mfp.resizeImage);
1206
- if(mfp.isLowIE) {
1207
- _mfpOn('AfterChange', mfp.resizeImage);
1208
- }
1209
- },
1210
- resizeImage: function() {
1211
- var item = mfp.currItem;
1212
- if(!item || !item.img) return;
1213
-
1214
- if(mfp.st.image.verticalFit) {
1215
- var decr = 0;
1216
- // fix box-sizing in ie7/8
1217
- if(mfp.isLowIE) {
1218
- decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1219
- }
1220
- item.img.css('max-height', mfp.wH-decr);
1221
- }
1222
- },
1223
- _onImageHasSize: function(item) {
1224
- if(item.img) {
1225
-
1226
- item.hasSize = true;
1227
-
1228
- if(_imgInterval) {
1229
- clearInterval(_imgInterval);
1230
- }
1231
-
1232
- item.isCheckingImgSize = false;
1233
-
1234
- _mfpTrigger('ImageHasSize', item);
1235
-
1236
- if(item.imgHidden) {
1237
- if(mfp.content)
1238
- mfp.content.removeClass('mfp-loading');
1239
-
1240
- item.imgHidden = false;
1241
- }
1242
-
1243
- }
1244
- },
1245
-
1246
- /**
1247
- * Function that loops until the image has size to display elements that rely on it asap
1248
- */
1249
- findImageSize: function(item) {
1250
-
1251
- var counter = 0,
1252
- img = item.img[0],
1253
- mfpSetInterval = function(delay) {
1254
-
1255
- if(_imgInterval) {
1256
- clearInterval(_imgInterval);
1257
- }
1258
- // decelerating interval that checks for size of an image
1259
- _imgInterval = setInterval(function() {
1260
- if(img.naturalWidth > 0) {
1261
- mfp._onImageHasSize(item);
1262
- return;
1263
- }
1264
-
1265
- if(counter > 200) {
1266
- clearInterval(_imgInterval);
1267
- }
1268
-
1269
- counter++;
1270
- if(counter === 3) {
1271
- mfpSetInterval(10);
1272
- } else if(counter === 40) {
1273
- mfpSetInterval(50);
1274
- } else if(counter === 100) {
1275
- mfpSetInterval(500);
1276
- }
1277
- }, delay);
1278
- };
1279
-
1280
- mfpSetInterval(1);
1281
- },
1282
-
1283
- getImage: function(item, template) {
1284
-
1285
- var guard = 0,
1286
-
1287
- // image load complete handler
1288
- onLoadComplete = function() {
1289
- if(item) {
1290
- if (item.img[0].complete) {
1291
- item.img.off('.mfploader');
1292
-
1293
- if(item === mfp.currItem){
1294
- mfp._onImageHasSize(item);
1295
-
1296
- mfp.updateStatus('ready');
1297
- }
1298
-
1299
- item.hasSize = true;
1300
- item.loaded = true;
1301
-
1302
- _mfpTrigger('ImageLoadComplete');
1303
-
1304
- }
1305
- else {
1306
- // if image complete check fails 200 times (20 sec), we assume that there was an error.
1307
- guard++;
1308
- if(guard < 200) {
1309
- setTimeout(onLoadComplete,100);
1310
- } else {
1311
- onLoadError();
1312
- }
1313
- }
1314
- }
1315
- },
1316
-
1317
- // image error handler
1318
- onLoadError = function() {
1319
- if(item) {
1320
- item.img.off('.mfploader');
1321
- if(item === mfp.currItem){
1322
- mfp._onImageHasSize(item);
1323
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1324
- }
1325
-
1326
- item.hasSize = true;
1327
- item.loaded = true;
1328
- item.loadError = true;
1329
- }
1330
- },
1331
- imgSt = mfp.st.image;
1332
-
1333
-
1334
- var el = template.find('.mfp-img');
1335
- if(el.length) {
1336
- var img = document.createElement('img');
1337
- img.className = 'mfp-img';
1338
- if(item.el && item.el.find('img').length) {
1339
- img.alt = item.el.find('img').attr('alt');
1340
- }
1341
- item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1342
- img.src = item.src;
1343
-
1344
- // without clone() "error" event is not firing when IMG is replaced by new IMG
1345
- // TODO: find a way to avoid such cloning
1346
- if(el.is('img')) {
1347
- item.img = item.img.clone();
1348
- }
1349
-
1350
- img = item.img[0];
1351
- if(img.naturalWidth > 0) {
1352
- item.hasSize = true;
1353
- } else if(!img.width) {
1354
- item.hasSize = false;
1355
- }
1356
- }
1357
-
1358
- mfp._parseMarkup(template, {
1359
- title: _getTitle(item),
1360
- img_replaceWith: item.img
1361
- }, item);
1362
-
1363
- mfp.resizeImage();
1364
-
1365
- if(item.hasSize) {
1366
- if(_imgInterval) clearInterval(_imgInterval);
1367
-
1368
- if(item.loadError) {
1369
- template.addClass('mfp-loading');
1370
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1371
- } else {
1372
- template.removeClass('mfp-loading');
1373
- mfp.updateStatus('ready');
1374
- }
1375
- return template;
1376
- }
1377
-
1378
- mfp.updateStatus('loading');
1379
- item.loading = true;
1380
-
1381
- if(!item.hasSize) {
1382
- item.imgHidden = true;
1383
- template.addClass('mfp-loading');
1384
- mfp.findImageSize(item);
1385
- }
1386
-
1387
- return template;
1388
- }
1389
- }
1390
- });
1391
-
1392
-
1393
-
1394
- /*>>image*/
1395
-
1396
- /*>>zoom*/
1397
- var hasMozTransform,
1398
- getHasMozTransform = function() {
1399
- if(hasMozTransform === undefined) {
1400
- hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1401
- }
1402
- return hasMozTransform;
1403
- };
1404
-
1405
- $.magnificPopup.registerModule('zoom', {
1406
-
1407
- options: {
1408
- enabled: false,
1409
- easing: 'ease-in-out',
1410
- duration: 300,
1411
- opener: function(element) {
1412
- return element.is('img') ? element : element.find('img');
1413
- }
1414
- },
1415
-
1416
- proto: {
1417
-
1418
- initZoom: function() {
1419
- var zoomSt = mfp.st.zoom,
1420
- ns = '.zoom',
1421
- image;
1422
-
1423
- if(!zoomSt.enabled || !mfp.supportsTransition) {
1424
- return;
1425
- }
1426
-
1427
- var duration = zoomSt.duration,
1428
- getElToAnimate = function(image) {
1429
- var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1430
- transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1431
- cssObj = {
1432
- position: 'fixed',
1433
- zIndex: 9999,
1434
- left: 0,
1435
- top: 0,
1436
- '-webkit-backface-visibility': 'hidden'
1437
- },
1438
- t = 'transition';
1439
-
1440
- cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1441
-
1442
- newImg.css(cssObj);
1443
- return newImg;
1444
- },
1445
- showMainContent = function() {
1446
- mfp.content.css('visibility', 'visible');
1447
- },
1448
- openTimeout,
1449
- animatedImg;
1450
-
1451
- _mfpOn('BuildControls'+ns, function() {
1452
- if(mfp._allowZoom()) {
1453
-
1454
- clearTimeout(openTimeout);
1455
- mfp.content.css('visibility', 'hidden');
1456
-
1457
- // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1458
-
1459
- image = mfp._getItemToZoom();
1460
-
1461
- if(!image) {
1462
- showMainContent();
1463
- return;
1464
- }
1465
-
1466
- animatedImg = getElToAnimate(image);
1467
-
1468
- animatedImg.css( mfp._getOffset() );
1469
-
1470
- mfp.wrap.append(animatedImg);
1471
-
1472
- openTimeout = setTimeout(function() {
1473
- animatedImg.css( mfp._getOffset( true ) );
1474
- openTimeout = setTimeout(function() {
1475
-
1476
- showMainContent();
1477
-
1478
- setTimeout(function() {
1479
- animatedImg.remove();
1480
- image = animatedImg = null;
1481
- _mfpTrigger('ZoomAnimationEnded');
1482
- }, 16); // avoid blink when switching images
1483
-
1484
- }, duration); // this timeout equals animation duration
1485
-
1486
- }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1487
-
1488
-
1489
- // Lots of timeouts...
1490
- }
1491
- });
1492
- _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1493
- if(mfp._allowZoom()) {
1494
-
1495
- clearTimeout(openTimeout);
1496
-
1497
- mfp.st.removalDelay = duration;
1498
-
1499
- if(!image) {
1500
- image = mfp._getItemToZoom();
1501
- if(!image) {
1502
- return;
1503
- }
1504
- animatedImg = getElToAnimate(image);
1505
- }
1506
-
1507
-
1508
- animatedImg.css( mfp._getOffset(true) );
1509
- mfp.wrap.append(animatedImg);
1510
- mfp.content.css('visibility', 'hidden');
1511
-
1512
- setTimeout(function() {
1513
- animatedImg.css( mfp._getOffset() );
1514
- }, 16);
1515
- }
1516
-
1517
- });
1518
-
1519
- _mfpOn(CLOSE_EVENT+ns, function() {
1520
- if(mfp._allowZoom()) {
1521
- showMainContent();
1522
- if(animatedImg) {
1523
- animatedImg.remove();
1524
- }
1525
- image = null;
1526
- }
1527
- });
1528
- },
1529
-
1530
- _allowZoom: function() {
1531
- return mfp.currItem.type === 'image';
1532
- },
1533
-
1534
- _getItemToZoom: function() {
1535
- if(mfp.currItem.hasSize) {
1536
- return mfp.currItem.img;
1537
- } else {
1538
- return false;
1539
- }
1540
- },
1541
-
1542
- // Get element postion relative to viewport
1543
- _getOffset: function(isLarge) {
1544
- var el;
1545
- if(isLarge) {
1546
- el = mfp.currItem.img;
1547
- } else {
1548
- el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
1549
- }
1550
-
1551
- var offset = el.offset();
1552
- var paddingTop = parseInt(el.css('padding-top'),10);
1553
- var paddingBottom = parseInt(el.css('padding-bottom'),10);
1554
- offset.top -= ( $(window).scrollTop() - paddingTop );
1555
-
1556
-
1557
- /*
1558
-
1559
- Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
1560
-
1561
- */
1562
- var obj = {
1563
- width: el.width(),
1564
- // fix Zepto height+padding issue
1565
- height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
1566
- };
1567
-
1568
- // I hate to do this, but there is no another option
1569
- if( getHasMozTransform() ) {
1570
- obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
1571
- } else {
1572
- obj.left = offset.left;
1573
- obj.top = offset.top;
1574
- }
1575
- return obj;
1576
- }
1577
-
1578
- }
1579
- });
1580
-
1581
-
1582
-
1583
- /*>>zoom*/
1584
-
1585
- /*>>iframe*/
1586
-
1587
- var IFRAME_NS = 'iframe',
1588
- _emptyPage = '//about:blank',
1589
-
1590
- _fixIframeBugs = function(isShowing) {
1591
- if(mfp.currTemplate[IFRAME_NS]) {
1592
- var el = mfp.currTemplate[IFRAME_NS].find('iframe');
1593
- if(el.length) {
1594
- // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
1595
- if(!isShowing) {
1596
- el[0].src = _emptyPage;
1597
- }
1598
-
1599
- // IE8 black screen bug fix
1600
- if(mfp.isIE8) {
1601
- el.css('display', isShowing ? 'block' : 'none');
1602
- }
1603
- }
1604
- }
1605
- };
1606
-
1607
- $.magnificPopup.registerModule(IFRAME_NS, {
1608
-
1609
- options: {
1610
- markup: '<div class="mfp-iframe-scaler">'+
1611
- '<div class="mfp-close"></div>'+
1612
- '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
1613
- '</div>',
1614
-
1615
- srcAction: 'iframe_src',
1616
-
1617
- // we don't care and support only one default type of URL by default
1618
- patterns: {
1619
- youtube: {
1620
- index: 'youtube.com',
1621
- id: 'v=',
1622
- src: '//www.youtube.com/embed/%id%?autoplay=1'
1623
- },
1624
- vimeo: {
1625
- index: 'vimeo.com/',
1626
- id: '/',
1627
- src: '//player.vimeo.com/video/%id%?autoplay=1'
1628
- },
1629
- gmaps: {
1630
- index: '//maps.google.',
1631
- src: '%id%&output=embed'
1632
- }
1633
- }
1634
- },
1635
-
1636
- proto: {
1637
- initIframe: function() {
1638
- mfp.types.push(IFRAME_NS);
1639
-
1640
- _mfpOn('BeforeChange', function(e, prevType, newType) {
1641
- if(prevType !== newType) {
1642
- if(prevType === IFRAME_NS) {
1643
- _fixIframeBugs(); // iframe if removed
1644
- } else if(newType === IFRAME_NS) {
1645
- _fixIframeBugs(true); // iframe is showing
1646
- }
1647
- }// else {
1648
- // iframe source is switched, don't do anything
1649
- //}
1650
- });
1651
-
1652
- _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
1653
- _fixIframeBugs();
1654
- });
1655
- },
1656
-
1657
- getIframe: function(item, template) {
1658
- var embedSrc = item.src;
1659
- var iframeSt = mfp.st.iframe;
1660
-
1661
- $.each(iframeSt.patterns, function() {
1662
- if(embedSrc.indexOf( this.index ) > -1) {
1663
- if(this.id) {
1664
- if(typeof this.id === 'string') {
1665
- embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
1666
- } else {
1667
- embedSrc = this.id.call( this, embedSrc );
1668
- }
1669
- }
1670
- embedSrc = this.src.replace('%id%', embedSrc );
1671
- return false; // break;
1672
- }
1673
- });
1674
-
1675
- var dataObj = {};
1676
- if(iframeSt.srcAction) {
1677
- dataObj[iframeSt.srcAction] = embedSrc;
1678
- }
1679
- mfp._parseMarkup(template, dataObj, item);
1680
-
1681
- mfp.updateStatus('ready');
1682
-
1683
- return template;
1684
- }
1685
- }
1686
- });
1687
-
1688
-
1689
-
1690
- /*>>iframe*/
1691
-
1692
- /*>>gallery*/
1693
- /**
1694
- * Get looped index depending on number of slides
1695
- */
1696
- var _getLoopedId = function(index) {
1697
- var numSlides = mfp.items.length;
1698
- if(index > numSlides - 1) {
1699
- return index - numSlides;
1700
- } else if(index < 0) {
1701
- return numSlides + index;
1702
- }
1703
- return index;
1704
- },
1705
- _replaceCurrTotal = function(text, curr, total) {
1706
- return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
1707
- };
1708
-
1709
- $.magnificPopup.registerModule('gallery', {
1710
-
1711
- options: {
1712
- enabled: false,
1713
- arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
1714
- preload: [0,2],
1715
- navigateByImgClick: true,
1716
- arrows: true,
1717
-
1718
- tPrev: 'Previous (Left arrow key)',
1719
- tNext: 'Next (Right arrow key)',
1720
- tCounter: '%curr% of %total%'
1721
- },
1722
-
1723
- proto: {
1724
- initGallery: function() {
1725
-
1726
- var gSt = mfp.st.gallery,
1727
- ns = '.mfp-gallery',
1728
- supportsFastClick = Boolean($.fn.mfpFastClick);
1729
-
1730
- mfp.direction = true; // true - next, false - prev
1731
-
1732
- if(!gSt || !gSt.enabled ) return false;
1733
-
1734
- _wrapClasses += ' mfp-gallery';
1735
-
1736
- _mfpOn(OPEN_EVENT+ns, function() {
1737
-
1738
- if(gSt.navigateByImgClick) {
1739
- mfp.wrap.on('click'+ns, '.mfp-img', function() {
1740
- if(mfp.items.length > 1) {
1741
- mfp.next();
1742
- return false;
1743
- }
1744
- });
1745
- }
1746
-
1747
- _document.on('keydown'+ns, function(e) {
1748
- if (e.keyCode === 37) {
1749
- mfp.prev();
1750
- } else if (e.keyCode === 39) {
1751
- mfp.next();
1752
- }
1753
- });
1754
- });
1755
-
1756
- _mfpOn('UpdateStatus'+ns, function(e, data) {
1757
- if(data.text) {
1758
- data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
1759
- }
1760
- });
1761
-
1762
- _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
1763
- var l = mfp.items.length;
1764
- values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
1765
- });
1766
-
1767
- _mfpOn('BuildControls' + ns, function() {
1768
- if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
1769
- var markup = gSt.arrowMarkup,
1770
- arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1771
- arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
1772
-
1773
- var eName = supportsFastClick ? 'mfpFastClick' : 'click';
1774
- arrowLeft[eName](function() {
1775
- mfp.prev();
1776
- });
1777
- arrowRight[eName](function() {
1778
- mfp.next();
1779
- });
1780
-
1781
- // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
1782
- if(mfp.isIE7) {
1783
- _getEl('b', arrowLeft[0], false, true);
1784
- _getEl('a', arrowLeft[0], false, true);
1785
- _getEl('b', arrowRight[0], false, true);
1786
- _getEl('a', arrowRight[0], false, true);
1787
- }
1788
-
1789
- mfp.container.append(arrowLeft.add(arrowRight));
1790
- }
1791
- });
1792
-
1793
- _mfpOn(CHANGE_EVENT+ns, function() {
1794
- if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
1795
-
1796
- mfp._preloadTimeout = setTimeout(function() {
1797
- mfp.preloadNearbyImages();
1798
- mfp._preloadTimeout = null;
1799
- }, 16);
1800
- });
1801
-
1802
-
1803
- _mfpOn(CLOSE_EVENT+ns, function() {
1804
- _document.off(ns);
1805
- mfp.wrap.off('click'+ns);
1806
-
1807
- if(mfp.arrowLeft && supportsFastClick) {
1808
- mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
1809
- }
1810
- mfp.arrowRight = mfp.arrowLeft = null;
1811
- });
1812
-
1813
- },
1814
- next: function() {
1815
- mfp.direction = true;
1816
- mfp.index = _getLoopedId(mfp.index + 1);
1817
- mfp.updateItemHTML();
1818
- },
1819
- prev: function() {
1820
- mfp.direction = false;
1821
- mfp.index = _getLoopedId(mfp.index - 1);
1822
- mfp.updateItemHTML();
1823
- },
1824
- goTo: function(newIndex) {
1825
- mfp.direction = (newIndex >= mfp.index);
1826
- mfp.index = newIndex;
1827
- mfp.updateItemHTML();
1828
- },
1829
- preloadNearbyImages: function() {
1830
- var p = mfp.st.gallery.preload,
1831
- preloadBefore = Math.min(p[0], mfp.items.length),
1832
- preloadAfter = Math.min(p[1], mfp.items.length),
1833
- i;
1834
-
1835
- for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
1836
- mfp._preloadItem(mfp.index+i);
1837
- }
1838
- for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
1839
- mfp._preloadItem(mfp.index-i);
1840
- }
1841
- },
1842
- _preloadItem: function(index) {
1843
- index = _getLoopedId(index);
1844
-
1845
- if(mfp.items[index].preloaded) {
1846
- return;
1847
- }
1848
-
1849
- var item = mfp.items[index];
1850
- if(!item.parsed) {
1851
- item = mfp.parseEl( index );
1852
- }
1853
-
1854
- _mfpTrigger('LazyLoad', item);
1855
-
1856
- if(item.type === 'image') {
1857
- item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
1858
- item.hasSize = true;
1859
- }).on('error.mfploader', function() {
1860
- item.hasSize = true;
1861
- item.loadError = true;
1862
- _mfpTrigger('LazyLoadError', item);
1863
- }).attr('src', item.src);
1864
- }
1865
-
1866
-
1867
- item.preloaded = true;
1868
- }
1869
- }
1870
- });
1871
-
1872
- /*
1873
- Touch Support that might be implemented some day
1874
-
1875
- addSwipeGesture: function() {
1876
- var startX,
1877
- moved,
1878
- multipleTouches;
1879
-
1880
- return;
1881
-
1882
- var namespace = '.mfp',
1883
- addEventNames = function(pref, down, move, up, cancel) {
1884
- mfp._tStart = pref + down + namespace;
1885
- mfp._tMove = pref + move + namespace;
1886
- mfp._tEnd = pref + up + namespace;
1887
- mfp._tCancel = pref + cancel + namespace;
1888
- };
1889
-
1890
- if(window.navigator.msPointerEnabled) {
1891
- addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
1892
- } else if('ontouchstart' in window) {
1893
- addEventNames('touch', 'start', 'move', 'end', 'cancel');
1894
- } else {
1895
- return;
1896
- }
1897
- _window.on(mfp._tStart, function(e) {
1898
- var oE = e.originalEvent;
1899
- multipleTouches = moved = false;
1900
- startX = oE.pageX || oE.changedTouches[0].pageX;
1901
- }).on(mfp._tMove, function(e) {
1902
- if(e.originalEvent.touches.length > 1) {
1903
- multipleTouches = e.originalEvent.touches.length;
1904
- } else {
1905
- //e.preventDefault();
1906
- moved = true;
1907
- }
1908
- }).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
1909
- if(moved && !multipleTouches) {
1910
- var oE = e.originalEvent,
1911
- diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
1912
-
1913
- if(diff > 20) {
1914
- mfp.next();
1915
- } else if(diff < -20) {
1916
- mfp.prev();
1917
- }
1918
- }
1919
- });
1920
- },
1921
- */
1922
-
1923
-
1924
- /*>>gallery*/
1925
-
1926
- /*>>retina*/
1927
-
1928
- var RETINA_NS = 'retina';
1929
-
1930
- $.magnificPopup.registerModule(RETINA_NS, {
1931
- options: {
1932
- replaceSrc: function(item) {
1933
- return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
1934
- },
1935
- ratio: 1 // Function or number. Set to 1 to disable.
1936
- },
1937
- proto: {
1938
- initRetina: function() {
1939
- if(window.devicePixelRatio > 1) {
1940
-
1941
- var st = mfp.st.retina,
1942
- ratio = st.ratio;
1943
-
1944
- ratio = !isNaN(ratio) ? ratio : ratio();
1945
-
1946
- if(ratio > 1) {
1947
- _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
1948
- item.img.css({
1949
- 'max-width': item.img[0].naturalWidth / ratio,
1950
- 'width': '100%'
1951
- });
1952
- });
1953
- _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
1954
- item.src = st.replaceSrc(item, ratio);
1955
- });
1956
- }
1957
- }
1958
-
1959
- }
1960
- }
1961
- });
1962
-
1963
- /*>>retina*/
1964
-
1965
- /*>>fastclick*/
1966
- /**
1967
- * FastClick event implementation. (removes 300ms delay on touch devices)
1968
- * Based on https://developers.google.com/mobile/articles/fast_buttons
1969
- *
1970
- * You may use it outside the Magnific Popup by calling just:
1971
- *
1972
- * $('.your-el').mfpFastClick(function() {
1973
- * console.log('Clicked!');
1974
- * });
1975
- *
1976
- * To unbind:
1977
- * $('.your-el').destroyMfpFastClick();
1978
- *
1979
- *
1980
- * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
1981
- * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
1982
- *
1983
- */
1984
-
1985
- (function() {
1986
- var ghostClickDelay = 1000,
1987
- supportsTouch = 'ontouchstart' in window,
1988
- unbindTouchMove = function() {
1989
- _window.off('touchmove'+ns+' touchend'+ns);
1990
- },
1991
- eName = 'mfpFastClick',
1992
- ns = '.'+eName;
1993
-
1994
-
1995
- // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
1996
- $.fn.mfpFastClick = function(callback) {
1997
-
1998
- return $(this).each(function() {
1999
-
2000
- var elem = $(this),
2001
- lock;
2002
-
2003
- if( supportsTouch ) {
2004
-
2005
- var timeout,
2006
- startX,
2007
- startY,
2008
- pointerMoved,
2009
- point,
2010
- numPointers;
2011
-
2012
- elem.on('touchstart' + ns, function(e) {
2013
- pointerMoved = false;
2014
- numPointers = 1;
2015
-
2016
- point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
2017
- startX = point.clientX;
2018
- startY = point.clientY;
2019
-
2020
- _window.on('touchmove'+ns, function(e) {
2021
- point = e.originalEvent ? e.originalEvent.touches : e.touches;
2022
- numPointers = point.length;
2023
- point = point[0];
2024
- if (Math.abs(point.clientX - startX) > 10 ||
2025
- Math.abs(point.clientY - startY) > 10) {
2026
- pointerMoved = true;
2027
- unbindTouchMove();
2028
- }
2029
- }).on('touchend'+ns, function(e) {
2030
- unbindTouchMove();
2031
- if(pointerMoved || numPointers > 1) {
2032
- return;
2033
- }
2034
- lock = true;
2035
- e.preventDefault();
2036
- clearTimeout(timeout);
2037
- timeout = setTimeout(function() {
2038
- lock = false;
2039
- }, ghostClickDelay);
2040
- callback();
2041
- });
2042
- });
2043
-
2044
- }
2045
-
2046
- elem.on('click' + ns, function() {
2047
- if(!lock) {
2048
- callback();
2049
- }
2050
- });
2051
- });
2052
- };
2053
-
2054
- $.fn.destroyMfpFastClick = function() {
2055
- $(this).off('touchstart' + ns + ' click' + ns);
2056
- if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
2057
- };
2058
- })();
2059
-
2060
- /*>>fastclick*/
1
+ /*! Magnific Popup - v1.0.0 - 2017-01-24
2
+ * http://dimsemenov.com/plugins/magnific-popup/
3
+ * Copyright (c) 2017 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
+ var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
46
+ MagnificPopup = function(){},
47
+ _isJQ = !!(window.jQuery),
48
+ _prevStatus,
49
+ _window = $(window),
50
+ _body,
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
+ mfp = new MagnificPopup();
101
+ mfp.init();
102
+ $.magnificPopup.instance = mfp;
103
+ }
104
+ },
105
+ // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
106
+ supportsTransitions = function() {
107
+ var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
108
+ v = ['ms','O','Moz','Webkit']; // 'v' for vendor
109
+
110
+ if( s['transition'] !== undefined ) {
111
+ return true;
112
+ }
113
+
114
+ while( v.length ) {
115
+ if( v.pop() + 'Transition' in s ) {
116
+ return true;
117
+ }
118
+ }
119
+
120
+ return false;
121
+ };
122
+
123
+
124
+
125
+ /**
126
+ * Public functions
127
+ */
128
+ MagnificPopup.prototype = {
129
+
130
+ constructor: MagnificPopup,
131
+
132
+ /**
133
+ * Initializes Magnific Popup plugin.
134
+ * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
135
+ */
136
+ init: function() {
137
+ var appVersion = navigator.appVersion;
138
+ mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
139
+ mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
140
+ mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
141
+ mfp.isAndroid = (/android/gi).test(appVersion);
142
+ mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
143
+ mfp.supportsTransition = supportsTransitions();
144
+
145
+ // We disable fixed positioned lightbox on devices that don't handle it nicely.
146
+ // If you know a better way of detecting this - let me know.
147
+ mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
148
+ _document = $(document);
149
+
150
+ mfp.popupsCache = {};
151
+ },
152
+
153
+ /**
154
+ * Opens popup
155
+ * @param data [description]
156
+ */
157
+ open: function(data) {
158
+
159
+ if(!_body) {
160
+ _body = $(document.body);
161
+ }
162
+
163
+ var i;
164
+
165
+ if(data.isObj === false) {
166
+ // convert jQuery collection to array to avoid conflicts later
167
+ mfp.items = data.items.toArray();
168
+
169
+ mfp.index = 0;
170
+ var items = data.items,
171
+ item;
172
+ for(i = 0; i < items.length; i++) {
173
+ item = items[i];
174
+ if(item.parsed) {
175
+ item = item.el[0];
176
+ }
177
+ if(item === data.el[0]) {
178
+ mfp.index = i;
179
+ break;
180
+ }
181
+ }
182
+ } else {
183
+ mfp.items = $.isArray(data.items) ? data.items : [data.items];
184
+ mfp.index = data.index || 0;
185
+ }
186
+
187
+ // if popup is already opened - we just update the content
188
+ if(mfp.isOpen) {
189
+ mfp.updateItemHTML();
190
+ return;
191
+ }
192
+
193
+ mfp.types = [];
194
+ _wrapClasses = '';
195
+ if(data.mainEl && data.mainEl.length) {
196
+ mfp.ev = data.mainEl.eq(0);
197
+ } else {
198
+ mfp.ev = _document;
199
+ }
200
+
201
+ if(data.key) {
202
+ if(!mfp.popupsCache[data.key]) {
203
+ mfp.popupsCache[data.key] = {};
204
+ }
205
+ mfp.currTemplate = mfp.popupsCache[data.key];
206
+ } else {
207
+ mfp.currTemplate = {};
208
+ }
209
+
210
+
211
+
212
+ mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
213
+ mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
214
+
215
+ if(mfp.st.modal) {
216
+ mfp.st.closeOnContentClick = false;
217
+ mfp.st.closeOnBgClick = false;
218
+ mfp.st.showCloseBtn = false;
219
+ mfp.st.enableEscapeKey = false;
220
+ }
221
+
222
+
223
+ // Building markup
224
+ // main containers are created only once
225
+ if(!mfp.bgOverlay) {
226
+
227
+ // Dark overlay
228
+ mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
229
+ mfp.close();
230
+ });
231
+
232
+ mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
233
+ if(mfp._checkIfClose(e.target)) {
234
+ mfp.close();
235
+ }
236
+ });
237
+
238
+ mfp.container = _getEl('container', mfp.wrap);
239
+ }
240
+
241
+ mfp.contentContainer = _getEl('content');
242
+ if(mfp.st.preloader) {
243
+ mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
244
+ }
245
+
246
+
247
+ // Initializing modules
248
+ var modules = $.magnificPopup.modules;
249
+ for(i = 0; i < modules.length; i++) {
250
+ var n = modules[i];
251
+ n = n.charAt(0).toUpperCase() + n.slice(1);
252
+ mfp['init'+n].call(mfp);
253
+ }
254
+ _mfpTrigger('BeforeOpen');
255
+
256
+
257
+ if(mfp.st.showCloseBtn) {
258
+ // Close button
259
+ if(!mfp.st.closeBtnInside) {
260
+ mfp.wrap.append( _getCloseBtn() );
261
+ } else {
262
+ _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
263
+ values.close_replaceWith = _getCloseBtn(item.type);
264
+ });
265
+ _wrapClasses += ' mfp-close-btn-in';
266
+ }
267
+ }
268
+
269
+ if(mfp.st.alignTop) {
270
+ _wrapClasses += ' mfp-align-top';
271
+ }
272
+
273
+
274
+
275
+ if(mfp.fixedContentPos) {
276
+ mfp.wrap.css({
277
+ overflow: mfp.st.overflowY,
278
+ overflowX: 'hidden',
279
+ overflowY: mfp.st.overflowY
280
+ });
281
+ } else {
282
+ mfp.wrap.css({
283
+ top: _window.scrollTop(),
284
+ position: 'absolute'
285
+ });
286
+ }
287
+ if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
288
+ mfp.bgOverlay.css({
289
+ height: _document.height(),
290
+ position: 'absolute'
291
+ });
292
+ }
293
+
294
+
295
+
296
+ if(mfp.st.enableEscapeKey) {
297
+ // Close on ESC key
298
+ _document.on('keyup' + EVENT_NS, function(e) {
299
+ if(e.keyCode === 27) {
300
+ mfp.close();
301
+ }
302
+ });
303
+ }
304
+
305
+ _window.on('resize' + EVENT_NS, function() {
306
+ mfp.updateSize();
307
+ });
308
+
309
+
310
+ if(!mfp.st.closeOnContentClick) {
311
+ _wrapClasses += ' mfp-auto-cursor';
312
+ }
313
+
314
+ if(_wrapClasses)
315
+ mfp.wrap.addClass(_wrapClasses);
316
+
317
+
318
+ // this triggers recalculation of layout, so we get it once to not to trigger twice
319
+ var windowHeight = mfp.wH = _window.height();
320
+
321
+
322
+ var windowStyles = {};
323
+
324
+ if( mfp.fixedContentPos ) {
325
+ if(mfp._hasScrollBar(windowHeight)){
326
+ var s = mfp._getScrollbarSize();
327
+ if(s) {
328
+ windowStyles.marginRight = s;
329
+ }
330
+ }
331
+ }
332
+
333
+ if(mfp.fixedContentPos) {
334
+ if(!mfp.isIE7) {
335
+ windowStyles.overflow = 'hidden';
336
+ } else {
337
+ // ie7 double-scroll bug
338
+ $('body, html').css('overflow', 'hidden');
339
+ }
340
+ }
341
+
342
+
343
+
344
+ var classesToadd = mfp.st.mainClass;
345
+ if(mfp.isIE7) {
346
+ classesToadd += ' mfp-ie7';
347
+ }
348
+ if(classesToadd) {
349
+ mfp._addClassToMFP( classesToadd );
350
+ }
351
+
352
+ // add content
353
+ mfp.updateItemHTML();
354
+
355
+ _mfpTrigger('BuildControls');
356
+
357
+ // remove scrollbar, add margin e.t.c
358
+ $('html').css(windowStyles);
359
+
360
+ // add everything to DOM
361
+ mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body );
362
+
363
+ // Save last focused element
364
+ mfp._lastFocusedEl = document.activeElement;
365
+
366
+ // Wait for next cycle to allow CSS transition
367
+ setTimeout(function() {
368
+
369
+ if(mfp.content) {
370
+ mfp._addClassToMFP(READY_CLASS);
371
+ mfp._setFocus();
372
+ } else {
373
+ // if content is not defined (not loaded e.t.c) we add class only for BG
374
+ mfp.bgOverlay.addClass(READY_CLASS);
375
+ }
376
+
377
+ // Trap the focus in popup
378
+ _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
379
+
380
+ }, 16);
381
+
382
+ mfp.isOpen = true;
383
+ mfp.updateSize(windowHeight);
384
+ _mfpTrigger(OPEN_EVENT);
385
+
386
+ return data;
387
+ },
388
+
389
+ /**
390
+ * Closes the popup
391
+ */
392
+ close: function() {
393
+ if(!mfp.isOpen) return;
394
+ _mfpTrigger(BEFORE_CLOSE_EVENT);
395
+
396
+ mfp.isOpen = false;
397
+ // for CSS3 animation
398
+ if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
399
+ mfp._addClassToMFP(REMOVING_CLASS);
400
+ setTimeout(function() {
401
+ mfp._close();
402
+ }, mfp.st.removalDelay);
403
+ } else {
404
+ mfp._close();
405
+ }
406
+ },
407
+
408
+ /**
409
+ * Helper for close() function
410
+ */
411
+ _close: function() {
412
+ _mfpTrigger(CLOSE_EVENT);
413
+
414
+ var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
415
+
416
+ mfp.bgOverlay.detach();
417
+ mfp.wrap.detach();
418
+ mfp.container.empty();
419
+
420
+ if(mfp.st.mainClass) {
421
+ classesToRemove += mfp.st.mainClass + ' ';
422
+ }
423
+
424
+ mfp._removeClassFromMFP(classesToRemove);
425
+
426
+ if(mfp.fixedContentPos) {
427
+ var windowStyles = {marginRight: ''};
428
+ if(mfp.isIE7) {
429
+ $('body, html').css('overflow', '');
430
+ } else {
431
+ windowStyles.overflow = '';
432
+ }
433
+ $('html').css(windowStyles);
434
+ }
435
+
436
+ _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
437
+ mfp.ev.off(EVENT_NS);
438
+
439
+ // clean up DOM elements that aren't removed
440
+ mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
441
+ mfp.bgOverlay.attr('class', 'mfp-bg');
442
+ mfp.container.attr('class', 'mfp-container');
443
+
444
+ // remove close button from target element
445
+ if(mfp.st.showCloseBtn &&
446
+ (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
447
+ if(mfp.currTemplate.closeBtn)
448
+ mfp.currTemplate.closeBtn.detach();
449
+ }
450
+
451
+
452
+ if(mfp._lastFocusedEl) {
453
+ $(mfp._lastFocusedEl).focus(); // put tab focus back
454
+ }
455
+ mfp.currItem = null;
456
+ mfp.content = null;
457
+ mfp.currTemplate = null;
458
+ mfp.prevHeight = 0;
459
+
460
+ _mfpTrigger(AFTER_CLOSE_EVENT);
461
+ },
462
+
463
+ updateSize: function(winHeight) {
464
+
465
+ if(mfp.isIOS) {
466
+ // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
467
+ var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
468
+ var height = window.innerHeight * zoomLevel;
469
+ mfp.wrap.css('height', height);
470
+ mfp.wH = height;
471
+ } else {
472
+ mfp.wH = winHeight || _window.height();
473
+ }
474
+ // Fixes #84: popup incorrectly positioned with position:relative on body
475
+ if(!mfp.fixedContentPos) {
476
+ mfp.wrap.css('height', mfp.wH);
477
+ }
478
+
479
+ _mfpTrigger('Resize');
480
+
481
+ },
482
+
483
+ /**
484
+ * Set content of popup based on current index
485
+ */
486
+ updateItemHTML: function() {
487
+ var item = mfp.items[mfp.index];
488
+
489
+ // Detach and perform modifications
490
+ mfp.contentContainer.detach();
491
+
492
+ if(mfp.content)
493
+ mfp.content.detach();
494
+
495
+ if(!item.parsed) {
496
+ item = mfp.parseEl( mfp.index );
497
+ }
498
+
499
+ var type = item.type;
500
+
501
+ _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
502
+ // BeforeChange event works like so:
503
+ // _mfpOn('BeforeChange', function(e, prevType, newType) { });
504
+
505
+ mfp.currItem = item;
506
+
507
+
508
+
509
+
510
+
511
+ if(!mfp.currTemplate[type]) {
512
+ var markup = mfp.st[type] ? mfp.st[type].markup : false;
513
+
514
+ // allows to modify markup
515
+ _mfpTrigger('FirstMarkupParse', markup);
516
+
517
+ if(markup) {
518
+ mfp.currTemplate[type] = $(markup);
519
+ } else {
520
+ // if there is no markup found we just define that template is parsed
521
+ mfp.currTemplate[type] = true;
522
+ }
523
+ }
524
+
525
+ if(_prevContentType && _prevContentType !== item.type) {
526
+ mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
527
+ }
528
+
529
+ var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
530
+ mfp.appendContent(newContent, type);
531
+
532
+ item.preloaded = true;
533
+
534
+ _mfpTrigger(CHANGE_EVENT, item);
535
+ _prevContentType = item.type;
536
+
537
+ // Append container back after its content changed
538
+ mfp.container.prepend(mfp.contentContainer);
539
+
540
+ _mfpTrigger('AfterChange');
541
+ },
542
+
543
+
544
+ /**
545
+ * Set HTML content of popup
546
+ */
547
+ appendContent: function(newContent, type) {
548
+ mfp.content = newContent;
549
+
550
+ if(newContent) {
551
+ if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
552
+ mfp.currTemplate[type] === true) {
553
+ // if there is no markup, we just append close button element inside
554
+ if(!mfp.content.find('.mfp-close').length) {
555
+ mfp.content.append(_getCloseBtn());
556
+ }
557
+ } else {
558
+ mfp.content = newContent;
559
+ }
560
+ } else {
561
+ mfp.content = '';
562
+ }
563
+
564
+ _mfpTrigger(BEFORE_APPEND_EVENT);
565
+ mfp.container.addClass('mfp-'+type+'-holder');
566
+
567
+ mfp.contentContainer.append(mfp.content);
568
+ },
569
+
570
+
571
+
572
+
573
+ /**
574
+ * Creates Magnific Popup data object based on given data
575
+ * @param {int} index Index of item to parse
576
+ */
577
+ parseEl: function(index) {
578
+ var item = mfp.items[index],
579
+ type;
580
+
581
+ if(item.tagName) {
582
+ item = { el: $(item) };
583
+ } else {
584
+ type = item.type;
585
+ item = { data: item, src: item.src };
586
+ }
587
+
588
+ if(item.el) {
589
+ var types = mfp.types;
590
+
591
+ // check for 'mfp-TYPE' class
592
+ for(var i = 0; i < types.length; i++) {
593
+ if( item.el.hasClass('mfp-'+types[i]) ) {
594
+ type = types[i];
595
+ break;
596
+ }
597
+ }
598
+
599
+ item.src = item.el.attr('data-mfp-src');
600
+ if(!item.src) {
601
+ item.src = item.el.attr('href');
602
+ }
603
+ }
604
+
605
+ item.type = type || mfp.st.type || 'inline';
606
+ item.index = index;
607
+ item.parsed = true;
608
+ mfp.items[index] = item;
609
+ _mfpTrigger('ElementParse', item);
610
+
611
+ return mfp.items[index];
612
+ },
613
+
614
+
615
+ /**
616
+ * Initializes single popup or a group of popups
617
+ */
618
+ addGroup: function(el, options) {
619
+ var eHandler = function(e) {
620
+ e.mfpEl = this;
621
+ mfp._openClick(e, el, options);
622
+ };
623
+
624
+ if(!options) {
625
+ options = {};
626
+ }
627
+
628
+ var eName = 'click.magnificPopup';
629
+ options.mainEl = el;
630
+
631
+ if(options.items) {
632
+ options.isObj = true;
633
+ el.off(eName).on(eName, eHandler);
634
+ } else {
635
+ options.isObj = false;
636
+ if(options.delegate) {
637
+ el.off(eName).on(eName, options.delegate , eHandler);
638
+ } else {
639
+ options.items = el;
640
+ el.off(eName).on(eName, eHandler);
641
+ }
642
+ }
643
+ },
644
+ _openClick: function(e, el, options) {
645
+ var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
646
+
647
+
648
+ if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
649
+ return;
650
+ }
651
+
652
+ var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
653
+
654
+ if(disableOn) {
655
+ if($.isFunction(disableOn)) {
656
+ if( !disableOn.call(mfp) ) {
657
+ return true;
658
+ }
659
+ } else { // else it's number
660
+ if( _window.width() < disableOn ) {
661
+ return true;
662
+ }
663
+ }
664
+ }
665
+
666
+ if(e.type) {
667
+ e.preventDefault();
668
+
669
+ // This will prevent popup from closing if element is inside and popup is already opened
670
+ if(mfp.isOpen) {
671
+ e.stopPropagation();
672
+ }
673
+ }
674
+
675
+
676
+ options.el = $(e.mfpEl);
677
+ if(options.delegate) {
678
+ options.items = el.find(options.delegate);
679
+ }
680
+ mfp.open(options);
681
+ },
682
+
683
+
684
+ /**
685
+ * Updates text on preloader
686
+ */
687
+ updateStatus: function(status, text) {
688
+
689
+ if(mfp.preloader) {
690
+ if(_prevStatus !== status) {
691
+ mfp.container.removeClass('mfp-s-'+_prevStatus);
692
+ }
693
+
694
+ if(!text && status === 'loading') {
695
+ text = mfp.st.tLoading;
696
+ }
697
+
698
+ var data = {
699
+ status: status,
700
+ text: text
701
+ };
702
+ // allows to modify status
703
+ _mfpTrigger('UpdateStatus', data);
704
+
705
+ status = data.status;
706
+ text = data.text;
707
+
708
+ mfp.preloader.html(text);
709
+
710
+ mfp.preloader.find('a').on('click', function(e) {
711
+ e.stopImmediatePropagation();
712
+ });
713
+
714
+ mfp.container.addClass('mfp-s-'+status);
715
+ _prevStatus = status;
716
+ }
717
+ },
718
+
719
+
720
+ /*
721
+ "Private" helpers that aren't private at all
722
+ */
723
+ // Check to close popup or not
724
+ // "target" is an element that was clicked
725
+ _checkIfClose: function(target) {
726
+
727
+ if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
728
+ return;
729
+ }
730
+
731
+ var closeOnContent = mfp.st.closeOnContentClick;
732
+ var closeOnBg = mfp.st.closeOnBgClick;
733
+
734
+ if(closeOnContent && closeOnBg) {
735
+ return true;
736
+ } else {
737
+
738
+ // We close the popup if click is on close button or on preloader. Or if there is no content.
739
+ if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
740
+ return true;
741
+ }
742
+
743
+ // if click is outside the content
744
+ if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
745
+ if(closeOnBg) {
746
+ // last check, if the clicked element is in DOM, (in case it's removed onclick)
747
+ if( $.contains(document, target) ) {
748
+ return true;
749
+ }
750
+ }
751
+ } else if(closeOnContent) {
752
+ return true;
753
+ }
754
+
755
+ }
756
+ return false;
757
+ },
758
+ _addClassToMFP: function(cName) {
759
+ mfp.bgOverlay.addClass(cName);
760
+ mfp.wrap.addClass(cName);
761
+ },
762
+ _removeClassFromMFP: function(cName) {
763
+ this.bgOverlay.removeClass(cName);
764
+ mfp.wrap.removeClass(cName);
765
+ },
766
+ _hasScrollBar: function(winHeight) {
767
+ return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
768
+ },
769
+ _setFocus: function() {
770
+ (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
771
+ },
772
+ _onFocusIn: function(e) {
773
+ if( (e.target !== mfp.wrap[0] && e.target !== document) && !$.contains(mfp.wrap[0], e.target) ) {
774
+ mfp._setFocus();
775
+ return false;
776
+ }
777
+ },
778
+ _parseMarkup: function(template, values, item) {
779
+ var arr;
780
+ if(item.data) {
781
+ values = $.extend(item.data, values);
782
+ }
783
+ _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
784
+
785
+ $.each(values, function(key, value) {
786
+ if(value === undefined || value === false) {
787
+ return true;
788
+ }
789
+ arr = key.split('_');
790
+ if(arr.length > 1) {
791
+ var el = template.find(EVENT_NS + '-'+arr[0]);
792
+
793
+ if(el.length > 0) {
794
+ var attr = arr[1];
795
+ if(attr === 'replaceWith') {
796
+ if(el[0] !== value[0]) {
797
+ el.replaceWith(value);
798
+ }
799
+ } else if(attr === 'img') {
800
+ if(el.is('img')) {
801
+ el.attr('src', value);
802
+ } else {
803
+ el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
804
+ }
805
+ } else {
806
+ el.attr(arr[1], value);
807
+ }
808
+ }
809
+
810
+ } else {
811
+ template.find(EVENT_NS + '-'+key).html(value);
812
+ }
813
+ });
814
+ },
815
+
816
+ _getScrollbarSize: function() {
817
+ // thx David
818
+ if(mfp.scrollbarSize === undefined) {
819
+ var scrollDiv = document.createElement("div");
820
+ scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
821
+ document.body.appendChild(scrollDiv);
822
+ mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
823
+ document.body.removeChild(scrollDiv);
824
+ }
825
+ return mfp.scrollbarSize;
826
+ }
827
+
828
+ }; /* MagnificPopup core prototype end */
829
+
830
+
831
+
832
+
833
+ /**
834
+ * Public static functions
835
+ */
836
+ $.magnificPopup = {
837
+ instance: null,
838
+ proto: MagnificPopup.prototype,
839
+ modules: [],
840
+
841
+ open: function(options, index) {
842
+ _checkInstance();
843
+
844
+ if(!options) {
845
+ options = {};
846
+ } else {
847
+ options = $.extend(true, {}, options);
848
+ }
849
+
850
+
851
+ options.isObj = true;
852
+ options.index = index || 0;
853
+ return this.instance.open(options);
854
+ },
855
+
856
+ close: function() {
857
+ return $.magnificPopup.instance && $.magnificPopup.instance.close();
858
+ },
859
+
860
+ registerModule: function(name, module) {
861
+ if(module.options) {
862
+ $.magnificPopup.defaults[name] = module.options;
863
+ }
864
+ $.extend(this.proto, module.proto);
865
+ this.modules.push(name);
866
+ },
867
+
868
+ defaults: {
869
+
870
+ // Info about options is in docs:
871
+ // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
872
+
873
+ disableOn: 0,
874
+
875
+ key: null,
876
+
877
+ midClick: false,
878
+
879
+ mainClass: '',
880
+
881
+ preloader: true,
882
+
883
+ focus: '', // CSS selector of input to focus after popup is opened
884
+
885
+ closeOnContentClick: false,
886
+
887
+ closeOnBgClick: true,
888
+
889
+ closeBtnInside: true,
890
+
891
+ showCloseBtn: true,
892
+
893
+ enableEscapeKey: true,
894
+
895
+ modal: false,
896
+
897
+ alignTop: false,
898
+
899
+ removalDelay: 0,
900
+
901
+ prependTo: null,
902
+
903
+ fixedContentPos: 'auto',
904
+
905
+ fixedBgPos: 'auto',
906
+
907
+ overflowY: 'auto',
908
+
909
+ closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
910
+
911
+ tClose: 'Close (Esc)',
912
+
913
+ tLoading: 'Loading...'
914
+
915
+ }
916
+ };
917
+
918
+
919
+
920
+ $.fn.magnificPopup = function(options) {
921
+ _checkInstance();
922
+
923
+ var jqEl = $(this);
924
+
925
+ // We call some API method of first param is a string
926
+ if (typeof options === "string" ) {
927
+
928
+ if(options === 'open') {
929
+ var items,
930
+ itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
931
+ index = parseInt(arguments[1], 10) || 0;
932
+
933
+ if(itemOpts.items) {
934
+ items = itemOpts.items[index];
935
+ } else {
936
+ items = jqEl;
937
+ if(itemOpts.delegate) {
938
+ items = items.find(itemOpts.delegate);
939
+ }
940
+ items = items.eq( index );
941
+ }
942
+ mfp._openClick({mfpEl:items}, jqEl, itemOpts);
943
+ } else {
944
+ if(mfp.isOpen)
945
+ mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
946
+ }
947
+
948
+ } else {
949
+ // clone options obj
950
+ options = $.extend(true, {}, options);
951
+
952
+ /*
953
+ * As Zepto doesn't support .data() method for objects
954
+ * and it works only in normal browsers
955
+ * we assign "options" object directly to the DOM element. FTW!
956
+ */
957
+ if(_isJQ) {
958
+ jqEl.data('magnificPopup', options);
959
+ } else {
960
+ jqEl[0].magnificPopup = options;
961
+ }
962
+
963
+ mfp.addGroup(jqEl, options);
964
+
965
+ }
966
+ return jqEl;
967
+ };
968
+
969
+ //Quick benchmark
970
+ /*
971
+ var start = performance.now(),
972
+ i,
973
+ rounds = 1000;
974
+
975
+ for(i = 0; i < rounds; i++) {
976
+
977
+ }
978
+ console.log('Test #1:', performance.now() - start);
979
+
980
+ start = performance.now();
981
+ for(i = 0; i < rounds; i++) {
982
+
983
+ }
984
+ console.log('Test #2:', performance.now() - start);
985
+ */
986
+
987
+
988
+ /*>>core*/
989
+
990
+ /*>>inline*/
991
+
992
+ var INLINE_NS = 'inline',
993
+ _hiddenClass,
994
+ _inlinePlaceholder,
995
+ _lastInlineElement,
996
+ _putInlineElementsBack = function() {
997
+ if(_lastInlineElement) {
998
+ _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
999
+ _lastInlineElement = null;
1000
+ }
1001
+ };
1002
+
1003
+ $.magnificPopup.registerModule(INLINE_NS, {
1004
+ options: {
1005
+ hiddenClass: 'hide', // will be appended with `mfp-` prefix
1006
+ markup: '',
1007
+ tNotFound: 'Content not found'
1008
+ },
1009
+ proto: {
1010
+
1011
+ initInline: function() {
1012
+ mfp.types.push(INLINE_NS);
1013
+
1014
+ _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
1015
+ _putInlineElementsBack();
1016
+ });
1017
+ },
1018
+
1019
+ getInline: function(item, template) {
1020
+
1021
+ _putInlineElementsBack();
1022
+
1023
+ if(item.src) {
1024
+ var inlineSt = mfp.st.inline,
1025
+ el = $(item.src);
1026
+
1027
+ if(el.length) {
1028
+
1029
+ // If target element has parent - we replace it with placeholder and put it back after popup is closed
1030
+ var parent = el[0].parentNode;
1031
+ if(parent && parent.tagName) {
1032
+ if(!_inlinePlaceholder) {
1033
+ _hiddenClass = inlineSt.hiddenClass;
1034
+ _inlinePlaceholder = _getEl(_hiddenClass);
1035
+ _hiddenClass = 'mfp-'+_hiddenClass;
1036
+ }
1037
+ // replace target inline element with placeholder
1038
+ _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1039
+ }
1040
+
1041
+ mfp.updateStatus('ready');
1042
+ } else {
1043
+ mfp.updateStatus('error', inlineSt.tNotFound);
1044
+ el = $('<div>');
1045
+ }
1046
+
1047
+ item.inlineElement = el;
1048
+ return el;
1049
+ }
1050
+
1051
+ mfp.updateStatus('ready');
1052
+ mfp._parseMarkup(template, {}, item);
1053
+ return template;
1054
+ }
1055
+ }
1056
+ });
1057
+
1058
+ /*>>inline*/
1059
+
1060
+ /*>>ajax*/
1061
+ var AJAX_NS = 'ajax',
1062
+ _ajaxCur,
1063
+ _removeAjaxCursor = function() {
1064
+ if(_ajaxCur) {
1065
+ _body.removeClass(_ajaxCur);
1066
+ }
1067
+ },
1068
+ _destroyAjaxRequest = function() {
1069
+ _removeAjaxCursor();
1070
+ if(mfp.req) {
1071
+ mfp.req.abort();
1072
+ }
1073
+ };
1074
+
1075
+ $.magnificPopup.registerModule(AJAX_NS, {
1076
+
1077
+ options: {
1078
+ settings: null,
1079
+ cursor: 'mfp-ajax-cur',
1080
+ tError: '<a href="%url%">The content</a> could not be loaded.'
1081
+ },
1082
+
1083
+ proto: {
1084
+ initAjax: function() {
1085
+ mfp.types.push(AJAX_NS);
1086
+ _ajaxCur = mfp.st.ajax.cursor;
1087
+
1088
+ _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1089
+ _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1090
+ },
1091
+ getAjax: function(item) {
1092
+
1093
+ if(_ajaxCur)
1094
+ _body.addClass(_ajaxCur);
1095
+
1096
+ mfp.updateStatus('loading');
1097
+
1098
+ var opts = $.extend({
1099
+ url: item.src,
1100
+ success: function(data, textStatus, jqXHR) {
1101
+ var temp = {
1102
+ data:data,
1103
+ xhr:jqXHR
1104
+ };
1105
+
1106
+ _mfpTrigger('ParseAjax', temp);
1107
+
1108
+ mfp.appendContent( $(temp.data), AJAX_NS );
1109
+
1110
+ item.finished = true;
1111
+
1112
+ _removeAjaxCursor();
1113
+
1114
+ mfp._setFocus();
1115
+
1116
+ setTimeout(function() {
1117
+ mfp.wrap.addClass(READY_CLASS);
1118
+ }, 16);
1119
+
1120
+ mfp.updateStatus('ready');
1121
+
1122
+ _mfpTrigger('AjaxContentAdded');
1123
+ },
1124
+ error: function() {
1125
+ _removeAjaxCursor();
1126
+ item.finished = item.loadError = true;
1127
+ mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1128
+ }
1129
+ }, mfp.st.ajax.settings);
1130
+
1131
+ mfp.req = $.ajax(opts);
1132
+
1133
+ return '';
1134
+ }
1135
+ }
1136
+ });
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+
1144
+ /*>>ajax*/
1145
+
1146
+ /*>>image*/
1147
+ var _imgInterval,
1148
+ _getTitle = function(item) {
1149
+ if(item.data && item.data.title !== undefined)
1150
+ return item.data.title;
1151
+
1152
+ var src = mfp.st.image.titleSrc;
1153
+
1154
+ if(src) {
1155
+ if($.isFunction(src)) {
1156
+ return src.call(mfp, item);
1157
+ } else if(item.el) {
1158
+ return item.el.attr(src) || '';
1159
+ }
1160
+ }
1161
+ return '';
1162
+ };
1163
+
1164
+ $.magnificPopup.registerModule('image', {
1165
+
1166
+ options: {
1167
+ markup: '<div class="mfp-figure">'+
1168
+ '<div class="mfp-close"></div>'+
1169
+ '<figure>'+
1170
+ '<div class="mfp-img"></div>'+
1171
+ '<figcaption>'+
1172
+ '<div class="mfp-bottom-bar">'+
1173
+ '<div class="mfp-title"></div>'+
1174
+ '<div class="mfp-counter"></div>'+
1175
+ '</div>'+
1176
+ '</figcaption>'+
1177
+ '</figure>'+
1178
+ '</div>',
1179
+ cursor: 'mfp-zoom-out-cur',
1180
+ titleSrc: 'title',
1181
+ verticalFit: true,
1182
+ tError: '<a href="%url%">The image</a> could not be loaded.'
1183
+ },
1184
+
1185
+ proto: {
1186
+ initImage: function() {
1187
+ var imgSt = mfp.st.image,
1188
+ ns = '.image';
1189
+
1190
+ mfp.types.push('image');
1191
+
1192
+ _mfpOn(OPEN_EVENT+ns, function() {
1193
+ if(mfp.currItem.type === 'image' && imgSt.cursor) {
1194
+ _body.addClass(imgSt.cursor);
1195
+ }
1196
+ });
1197
+
1198
+ _mfpOn(CLOSE_EVENT+ns, function() {
1199
+ if(imgSt.cursor) {
1200
+ _body.removeClass(imgSt.cursor);
1201
+ }
1202
+ _window.off('resize' + EVENT_NS);
1203
+ });
1204
+
1205
+ _mfpOn('Resize'+ns, mfp.resizeImage);
1206
+ if(mfp.isLowIE) {
1207
+ _mfpOn('AfterChange', mfp.resizeImage);
1208
+ }
1209
+ },
1210
+ resizeImage: function() {
1211
+ var item = mfp.currItem;
1212
+ if(!item || !item.img) return;
1213
+
1214
+ if(mfp.st.image.verticalFit) {
1215
+ var decr = 0;
1216
+ // fix box-sizing in ie7/8
1217
+ if(mfp.isLowIE) {
1218
+ decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1219
+ }
1220
+ item.img.css('max-height', mfp.wH-decr);
1221
+ }
1222
+ },
1223
+ _onImageHasSize: function(item) {
1224
+ if(item.img) {
1225
+
1226
+ item.hasSize = true;
1227
+
1228
+ if(_imgInterval) {
1229
+ clearInterval(_imgInterval);
1230
+ }
1231
+
1232
+ item.isCheckingImgSize = false;
1233
+
1234
+ _mfpTrigger('ImageHasSize', item);
1235
+
1236
+ if(item.imgHidden) {
1237
+ if(mfp.content)
1238
+ mfp.content.removeClass('mfp-loading');
1239
+
1240
+ item.imgHidden = false;
1241
+ }
1242
+
1243
+ }
1244
+ },
1245
+
1246
+ /**
1247
+ * Function that loops until the image has size to display elements that rely on it asap
1248
+ */
1249
+ findImageSize: function(item) {
1250
+
1251
+ var counter = 0,
1252
+ img = item.img[0],
1253
+ mfpSetInterval = function(delay) {
1254
+
1255
+ if(_imgInterval) {
1256
+ clearInterval(_imgInterval);
1257
+ }
1258
+ // decelerating interval that checks for size of an image
1259
+ _imgInterval = setInterval(function() {
1260
+ if(img.naturalWidth > 0) {
1261
+ mfp._onImageHasSize(item);
1262
+ return;
1263
+ }
1264
+
1265
+ if(counter > 200) {
1266
+ clearInterval(_imgInterval);
1267
+ }
1268
+
1269
+ counter++;
1270
+ if(counter === 3) {
1271
+ mfpSetInterval(10);
1272
+ } else if(counter === 40) {
1273
+ mfpSetInterval(50);
1274
+ } else if(counter === 100) {
1275
+ mfpSetInterval(500);
1276
+ }
1277
+ }, delay);
1278
+ };
1279
+
1280
+ mfpSetInterval(1);
1281
+ },
1282
+
1283
+ getImage: function(item, template) {
1284
+
1285
+ var guard = 0,
1286
+
1287
+ // image load complete handler
1288
+ onLoadComplete = function() {
1289
+ if(item) {
1290
+ if (item.img[0].complete) {
1291
+ item.img.off('.mfploader');
1292
+
1293
+ if(item === mfp.currItem){
1294
+ mfp._onImageHasSize(item);
1295
+
1296
+ mfp.updateStatus('ready');
1297
+ }
1298
+
1299
+ item.hasSize = true;
1300
+ item.loaded = true;
1301
+
1302
+ _mfpTrigger('ImageLoadComplete');
1303
+
1304
+ }
1305
+ else {
1306
+ // if image complete check fails 200 times (20 sec), we assume that there was an error.
1307
+ guard++;
1308
+ if(guard < 200) {
1309
+ setTimeout(onLoadComplete,100);
1310
+ } else {
1311
+ onLoadError();
1312
+ }
1313
+ }
1314
+ }
1315
+ },
1316
+
1317
+ // image error handler
1318
+ onLoadError = function() {
1319
+ if(item) {
1320
+ item.img.off('.mfploader');
1321
+ if(item === mfp.currItem){
1322
+ mfp._onImageHasSize(item);
1323
+ mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1324
+ }
1325
+
1326
+ item.hasSize = true;
1327
+ item.loaded = true;
1328
+ item.loadError = true;
1329
+ }
1330
+ },
1331
+ imgSt = mfp.st.image;
1332
+
1333
+
1334
+ var el = template.find('.mfp-img');
1335
+ if(el.length) {
1336
+ var img = document.createElement('img');
1337
+ img.className = 'mfp-img';
1338
+ if(item.el && item.el.find('img').length) {
1339
+ img.alt = item.el.find('img').attr('alt');
1340
+ }
1341
+ item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1342
+ img.src = item.src;
1343
+
1344
+ // without clone() "error" event is not firing when IMG is replaced by new IMG
1345
+ // TODO: find a way to avoid such cloning
1346
+ if(el.is('img')) {
1347
+ item.img = item.img.clone();
1348
+ }
1349
+
1350
+ img = item.img[0];
1351
+ if(img.naturalWidth > 0) {
1352
+ item.hasSize = true;
1353
+ } else if(!img.width) {
1354
+ item.hasSize = false;
1355
+ }
1356
+ }
1357
+
1358
+ mfp._parseMarkup(template, {
1359
+ title: _getTitle(item),
1360
+ img_replaceWith: item.img
1361
+ }, item);
1362
+
1363
+ mfp.resizeImage();
1364
+
1365
+ if(item.hasSize) {
1366
+ if(_imgInterval) clearInterval(_imgInterval);
1367
+
1368
+ if(item.loadError) {
1369
+ template.addClass('mfp-loading');
1370
+ mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1371
+ } else {
1372
+ template.removeClass('mfp-loading');
1373
+ mfp.updateStatus('ready');
1374
+ }
1375
+ return template;
1376
+ }
1377
+
1378
+ mfp.updateStatus('loading');
1379
+ item.loading = true;
1380
+
1381
+ if(!item.hasSize) {
1382
+ item.imgHidden = true;
1383
+ template.addClass('mfp-loading');
1384
+ mfp.findImageSize(item);
1385
+ }
1386
+
1387
+ return template;
1388
+ }
1389
+ }
1390
+ });
1391
+
1392
+
1393
+
1394
+ /*>>image*/
1395
+
1396
+ /*>>zoom*/
1397
+ var hasMozTransform,
1398
+ getHasMozTransform = function() {
1399
+ if(hasMozTransform === undefined) {
1400
+ hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1401
+ }
1402
+ return hasMozTransform;
1403
+ };
1404
+
1405
+ $.magnificPopup.registerModule('zoom', {
1406
+
1407
+ options: {
1408
+ enabled: false,
1409
+ easing: 'ease-in-out',
1410
+ duration: 300,
1411
+ opener: function(element) {
1412
+ return element.is('img') ? element : element.find('img');
1413
+ }
1414
+ },
1415
+
1416
+ proto: {
1417
+
1418
+ initZoom: function() {
1419
+ var zoomSt = mfp.st.zoom,
1420
+ ns = '.zoom',
1421
+ image;
1422
+
1423
+ if(!zoomSt.enabled || !mfp.supportsTransition) {
1424
+ return;
1425
+ }
1426
+
1427
+ var duration = zoomSt.duration,
1428
+ getElToAnimate = function(image) {
1429
+ var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1430
+ transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1431
+ cssObj = {
1432
+ position: 'fixed',
1433
+ zIndex: 9999,
1434
+ left: 0,
1435
+ top: 0,
1436
+ '-webkit-backface-visibility': 'hidden'
1437
+ },
1438
+ t = 'transition';
1439
+
1440
+ cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1441
+
1442
+ newImg.css(cssObj);
1443
+ return newImg;
1444
+ },
1445
+ showMainContent = function() {
1446
+ mfp.content.css('visibility', 'visible');
1447
+ },
1448
+ openTimeout,
1449
+ animatedImg;
1450
+
1451
+ _mfpOn('BuildControls'+ns, function() {
1452
+ if(mfp._allowZoom()) {
1453
+
1454
+ clearTimeout(openTimeout);
1455
+ mfp.content.css('visibility', 'hidden');
1456
+
1457
+ // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1458
+
1459
+ image = mfp._getItemToZoom();
1460
+
1461
+ if(!image) {
1462
+ showMainContent();
1463
+ return;
1464
+ }
1465
+
1466
+ animatedImg = getElToAnimate(image);
1467
+
1468
+ animatedImg.css( mfp._getOffset() );
1469
+
1470
+ mfp.wrap.append(animatedImg);
1471
+
1472
+ openTimeout = setTimeout(function() {
1473
+ animatedImg.css( mfp._getOffset( true ) );
1474
+ openTimeout = setTimeout(function() {
1475
+
1476
+ showMainContent();
1477
+
1478
+ setTimeout(function() {
1479
+ animatedImg.remove();
1480
+ image = animatedImg = null;
1481
+ _mfpTrigger('ZoomAnimationEnded');
1482
+ }, 16); // avoid blink when switching images
1483
+
1484
+ }, duration); // this timeout equals animation duration
1485
+
1486
+ }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1487
+
1488
+
1489
+ // Lots of timeouts...
1490
+ }
1491
+ });
1492
+ _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1493
+ if(mfp._allowZoom()) {
1494
+
1495
+ clearTimeout(openTimeout);
1496
+
1497
+ mfp.st.removalDelay = duration;
1498
+
1499
+ if(!image) {
1500
+ image = mfp._getItemToZoom();
1501
+ if(!image) {
1502
+ return;
1503
+ }
1504
+ animatedImg = getElToAnimate(image);
1505
+ }
1506
+
1507
+
1508
+ animatedImg.css( mfp._getOffset(true) );
1509
+ mfp.wrap.append(animatedImg);
1510
+ mfp.content.css('visibility', 'hidden');
1511
+
1512
+ setTimeout(function() {
1513
+ animatedImg.css( mfp._getOffset() );
1514
+ }, 16);
1515
+ }
1516
+
1517
+ });
1518
+
1519
+ _mfpOn(CLOSE_EVENT+ns, function() {
1520
+ if(mfp._allowZoom()) {
1521
+ showMainContent();
1522
+ if(animatedImg) {
1523
+ animatedImg.remove();
1524
+ }
1525
+ image = null;
1526
+ }
1527
+ });
1528
+ },
1529
+
1530
+ _allowZoom: function() {
1531
+ return mfp.currItem.type === 'image';
1532
+ },
1533
+
1534
+ _getItemToZoom: function() {
1535
+ if(mfp.currItem.hasSize) {
1536
+ return mfp.currItem.img;
1537
+ } else {
1538
+ return false;
1539
+ }
1540
+ },
1541
+
1542
+ // Get element postion relative to viewport
1543
+ _getOffset: function(isLarge) {
1544
+ var el;
1545
+ if(isLarge) {
1546
+ el = mfp.currItem.img;
1547
+ } else {
1548
+ el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
1549
+ }
1550
+
1551
+ var offset = el.offset();
1552
+ var paddingTop = parseInt(el.css('padding-top'),10);
1553
+ var paddingBottom = parseInt(el.css('padding-bottom'),10);
1554
+ offset.top -= ( $(window).scrollTop() - paddingTop );
1555
+
1556
+
1557
+ /*
1558
+
1559
+ Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
1560
+
1561
+ */
1562
+ var obj = {
1563
+ width: el.width(),
1564
+ // fix Zepto height+padding issue
1565
+ height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
1566
+ };
1567
+
1568
+ // I hate to do this, but there is no another option
1569
+ if( getHasMozTransform() ) {
1570
+ obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
1571
+ } else {
1572
+ obj.left = offset.left;
1573
+ obj.top = offset.top;
1574
+ }
1575
+ return obj;
1576
+ }
1577
+
1578
+ }
1579
+ });
1580
+
1581
+
1582
+
1583
+ /*>>zoom*/
1584
+
1585
+ /*>>iframe*/
1586
+
1587
+ var IFRAME_NS = 'iframe',
1588
+ _emptyPage = '//about:blank',
1589
+
1590
+ _fixIframeBugs = function(isShowing) {
1591
+ if(mfp.currTemplate[IFRAME_NS]) {
1592
+ var el = mfp.currTemplate[IFRAME_NS].find('iframe');
1593
+ if(el.length) {
1594
+ // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
1595
+ if(!isShowing) {
1596
+ el[0].src = _emptyPage;
1597
+ }
1598
+
1599
+ // IE8 black screen bug fix
1600
+ if(mfp.isIE8) {
1601
+ el.css('display', isShowing ? 'block' : 'none');
1602
+ }
1603
+ }
1604
+ }
1605
+ };
1606
+
1607
+ $.magnificPopup.registerModule(IFRAME_NS, {
1608
+
1609
+ options: {
1610
+ markup: '<div class="mfp-iframe-scaler">'+
1611
+ '<div class="mfp-close"></div>'+
1612
+ '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
1613
+ '</div>',
1614
+
1615
+ srcAction: 'iframe_src',
1616
+
1617
+ // we don't care and support only one default type of URL by default
1618
+ patterns: {
1619
+ youtube: {
1620
+ index: 'youtube.com',
1621
+ id: 'v=',
1622
+ src: '//www.youtube.com/embed/%id%?autoplay=1'
1623
+ },
1624
+ vimeo: {
1625
+ index: 'vimeo.com/',
1626
+ id: '/',
1627
+ src: '//player.vimeo.com/video/%id%?autoplay=1'
1628
+ },
1629
+ gmaps: {
1630
+ index: '//maps.google.',
1631
+ src: '%id%&output=embed'
1632
+ }
1633
+ }
1634
+ },
1635
+
1636
+ proto: {
1637
+ initIframe: function() {
1638
+ mfp.types.push(IFRAME_NS);
1639
+
1640
+ _mfpOn('BeforeChange', function(e, prevType, newType) {
1641
+ if(prevType !== newType) {
1642
+ if(prevType === IFRAME_NS) {
1643
+ _fixIframeBugs(); // iframe if removed
1644
+ } else if(newType === IFRAME_NS) {
1645
+ _fixIframeBugs(true); // iframe is showing
1646
+ }
1647
+ }// else {
1648
+ // iframe source is switched, don't do anything
1649
+ //}
1650
+ });
1651
+
1652
+ _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
1653
+ _fixIframeBugs();
1654
+ });
1655
+ },
1656
+
1657
+ getIframe: function(item, template) {
1658
+ var embedSrc = item.src;
1659
+ var iframeSt = mfp.st.iframe;
1660
+
1661
+ $.each(iframeSt.patterns, function() {
1662
+ if(embedSrc.indexOf( this.index ) > -1) {
1663
+ if(this.id) {
1664
+ if(typeof this.id === 'string') {
1665
+ embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
1666
+ } else {
1667
+ embedSrc = this.id.call( this, embedSrc );
1668
+ }
1669
+ }
1670
+ embedSrc = this.src.replace('%id%', embedSrc );
1671
+ return false; // break;
1672
+ }
1673
+ });
1674
+
1675
+ var dataObj = {};
1676
+ if(iframeSt.srcAction) {
1677
+ dataObj[iframeSt.srcAction] = embedSrc;
1678
+ }
1679
+ mfp._parseMarkup(template, dataObj, item);
1680
+
1681
+ mfp.updateStatus('ready');
1682
+
1683
+ return template;
1684
+ }
1685
+ }
1686
+ });
1687
+
1688
+
1689
+
1690
+ /*>>iframe*/
1691
+
1692
+ /*>>gallery*/
1693
+ /**
1694
+ * Get looped index depending on number of slides
1695
+ */
1696
+ var _getLoopedId = function(index) {
1697
+ var numSlides = mfp.items.length;
1698
+ if(index > numSlides - 1) {
1699
+ return index - numSlides;
1700
+ } else if(index < 0) {
1701
+ return numSlides + index;
1702
+ }
1703
+ return index;
1704
+ },
1705
+ _replaceCurrTotal = function(text, curr, total) {
1706
+ return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
1707
+ };
1708
+
1709
+ $.magnificPopup.registerModule('gallery', {
1710
+
1711
+ options: {
1712
+ enabled: false,
1713
+ arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
1714
+ preload: [0,2],
1715
+ navigateByImgClick: true,
1716
+ arrows: true,
1717
+
1718
+ tPrev: 'Previous (Left arrow key)',
1719
+ tNext: 'Next (Right arrow key)',
1720
+ tCounter: '%curr% of %total%'
1721
+ },
1722
+
1723
+ proto: {
1724
+ initGallery: function() {
1725
+
1726
+ var gSt = mfp.st.gallery,
1727
+ ns = '.mfp-gallery',
1728
+ supportsFastClick = Boolean($.fn.mfpFastClick);
1729
+
1730
+ mfp.direction = true; // true - next, false - prev
1731
+
1732
+ if(!gSt || !gSt.enabled ) return false;
1733
+
1734
+ _wrapClasses += ' mfp-gallery';
1735
+
1736
+ _mfpOn(OPEN_EVENT+ns, function() {
1737
+
1738
+ if(gSt.navigateByImgClick) {
1739
+ mfp.wrap.on('click'+ns, '.mfp-img', function() {
1740
+ if(mfp.items.length > 1) {
1741
+ mfp.next();
1742
+ return false;
1743
+ }
1744
+ });
1745
+ }
1746
+
1747
+ _document.on('keydown'+ns, function(e) {
1748
+ if (e.keyCode === 37) {
1749
+ mfp.prev();
1750
+ } else if (e.keyCode === 39) {
1751
+ mfp.next();
1752
+ }
1753
+ });
1754
+ });
1755
+
1756
+ _mfpOn('UpdateStatus'+ns, function(e, data) {
1757
+ if(data.text) {
1758
+ data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
1759
+ }
1760
+ });
1761
+
1762
+ _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
1763
+ var l = mfp.items.length;
1764
+ values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
1765
+ });
1766
+
1767
+ _mfpOn('BuildControls' + ns, function() {
1768
+ if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
1769
+ var markup = gSt.arrowMarkup,
1770
+ arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1771
+ arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
1772
+
1773
+ var eName = supportsFastClick ? 'mfpFastClick' : 'click';
1774
+ arrowLeft[eName](function() {
1775
+ mfp.prev();
1776
+ });
1777
+ arrowRight[eName](function() {
1778
+ mfp.next();
1779
+ });
1780
+
1781
+ // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
1782
+ if(mfp.isIE7) {
1783
+ _getEl('b', arrowLeft[0], false, true);
1784
+ _getEl('a', arrowLeft[0], false, true);
1785
+ _getEl('b', arrowRight[0], false, true);
1786
+ _getEl('a', arrowRight[0], false, true);
1787
+ }
1788
+
1789
+ mfp.container.append(arrowLeft.add(arrowRight));
1790
+ }
1791
+ });
1792
+
1793
+ _mfpOn(CHANGE_EVENT+ns, function() {
1794
+ if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
1795
+
1796
+ mfp._preloadTimeout = setTimeout(function() {
1797
+ mfp.preloadNearbyImages();
1798
+ mfp._preloadTimeout = null;
1799
+ }, 16);
1800
+ });
1801
+
1802
+
1803
+ _mfpOn(CLOSE_EVENT+ns, function() {
1804
+ _document.off(ns);
1805
+ mfp.wrap.off('click'+ns);
1806
+
1807
+ if(mfp.arrowLeft && supportsFastClick) {
1808
+ mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
1809
+ }
1810
+ mfp.arrowRight = mfp.arrowLeft = null;
1811
+ });
1812
+
1813
+ },
1814
+ next: function() {
1815
+ mfp.direction = true;
1816
+ mfp.index = _getLoopedId(mfp.index + 1);
1817
+ mfp.updateItemHTML();
1818
+ },
1819
+ prev: function() {
1820
+ mfp.direction = false;
1821
+ mfp.index = _getLoopedId(mfp.index - 1);
1822
+ mfp.updateItemHTML();
1823
+ },
1824
+ goTo: function(newIndex) {
1825
+ mfp.direction = (newIndex >= mfp.index);
1826
+ mfp.index = newIndex;
1827
+ mfp.updateItemHTML();
1828
+ },
1829
+ preloadNearbyImages: function() {
1830
+ var p = mfp.st.gallery.preload,
1831
+ preloadBefore = Math.min(p[0], mfp.items.length),
1832
+ preloadAfter = Math.min(p[1], mfp.items.length),
1833
+ i;
1834
+
1835
+ for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
1836
+ mfp._preloadItem(mfp.index+i);
1837
+ }
1838
+ for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
1839
+ mfp._preloadItem(mfp.index-i);
1840
+ }
1841
+ },
1842
+ _preloadItem: function(index) {
1843
+ index = _getLoopedId(index);
1844
+
1845
+ if(mfp.items[index].preloaded) {
1846
+ return;
1847
+ }
1848
+
1849
+ var item = mfp.items[index];
1850
+ if(!item.parsed) {
1851
+ item = mfp.parseEl( index );
1852
+ }
1853
+
1854
+ _mfpTrigger('LazyLoad', item);
1855
+
1856
+ if(item.type === 'image') {
1857
+ item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
1858
+ item.hasSize = true;
1859
+ }).on('error.mfploader', function() {
1860
+ item.hasSize = true;
1861
+ item.loadError = true;
1862
+ _mfpTrigger('LazyLoadError', item);
1863
+ }).attr('src', item.src);
1864
+ }
1865
+
1866
+
1867
+ item.preloaded = true;
1868
+ }
1869
+ }
1870
+ });
1871
+
1872
+ /*
1873
+ Touch Support that might be implemented some day
1874
+
1875
+ addSwipeGesture: function() {
1876
+ var startX,
1877
+ moved,
1878
+ multipleTouches;
1879
+
1880
+ return;
1881
+
1882
+ var namespace = '.mfp',
1883
+ addEventNames = function(pref, down, move, up, cancel) {
1884
+ mfp._tStart = pref + down + namespace;
1885
+ mfp._tMove = pref + move + namespace;
1886
+ mfp._tEnd = pref + up + namespace;
1887
+ mfp._tCancel = pref + cancel + namespace;
1888
+ };
1889
+
1890
+ if(window.navigator.msPointerEnabled) {
1891
+ addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
1892
+ } else if('ontouchstart' in window) {
1893
+ addEventNames('touch', 'start', 'move', 'end', 'cancel');
1894
+ } else {
1895
+ return;
1896
+ }
1897
+ _window.on(mfp._tStart, function(e) {
1898
+ var oE = e.originalEvent;
1899
+ multipleTouches = moved = false;
1900
+ startX = oE.pageX || oE.changedTouches[0].pageX;
1901
+ }).on(mfp._tMove, function(e) {
1902
+ if(e.originalEvent.touches.length > 1) {
1903
+ multipleTouches = e.originalEvent.touches.length;
1904
+ } else {
1905
+ //e.preventDefault();
1906
+ moved = true;
1907
+ }
1908
+ }).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
1909
+ if(moved && !multipleTouches) {
1910
+ var oE = e.originalEvent,
1911
+ diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
1912
+
1913
+ if(diff > 20) {
1914
+ mfp.next();
1915
+ } else if(diff < -20) {
1916
+ mfp.prev();
1917
+ }
1918
+ }
1919
+ });
1920
+ },
1921
+ */
1922
+
1923
+
1924
+ /*>>gallery*/
1925
+
1926
+ /*>>retina*/
1927
+
1928
+ var RETINA_NS = 'retina';
1929
+
1930
+ $.magnificPopup.registerModule(RETINA_NS, {
1931
+ options: {
1932
+ replaceSrc: function(item) {
1933
+ return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
1934
+ },
1935
+ ratio: 1 // Function or number. Set to 1 to disable.
1936
+ },
1937
+ proto: {
1938
+ initRetina: function() {
1939
+ if(window.devicePixelRatio > 1) {
1940
+
1941
+ var st = mfp.st.retina,
1942
+ ratio = st.ratio;
1943
+
1944
+ ratio = !isNaN(ratio) ? ratio : ratio();
1945
+
1946
+ if(ratio > 1) {
1947
+ _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
1948
+ item.img.css({
1949
+ 'max-width': item.img[0].naturalWidth / ratio,
1950
+ 'width': '100%'
1951
+ });
1952
+ });
1953
+ _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
1954
+ item.src = st.replaceSrc(item, ratio);
1955
+ });
1956
+ }
1957
+ }
1958
+
1959
+ }
1960
+ }
1961
+ });
1962
+
1963
+ /*>>retina*/
1964
+
1965
+ /*>>fastclick*/
1966
+ /**
1967
+ * FastClick event implementation. (removes 300ms delay on touch devices)
1968
+ * Based on https://developers.google.com/mobile/articles/fast_buttons
1969
+ *
1970
+ * You may use it outside the Magnific Popup by calling just:
1971
+ *
1972
+ * $('.your-el').mfpFastClick(function() {
1973
+ * console.log('Clicked!');
1974
+ * });
1975
+ *
1976
+ * To unbind:
1977
+ * $('.your-el').destroyMfpFastClick();
1978
+ *
1979
+ *
1980
+ * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
1981
+ * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
1982
+ *
1983
+ */
1984
+
1985
+ (function() {
1986
+ var ghostClickDelay = 1000,
1987
+ supportsTouch = 'ontouchstart' in window,
1988
+ unbindTouchMove = function() {
1989
+ _window.off('touchmove'+ns+' touchend'+ns);
1990
+ },
1991
+ eName = 'mfpFastClick',
1992
+ ns = '.'+eName;
1993
+
1994
+
1995
+ // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
1996
+ $.fn.mfpFastClick = function(callback) {
1997
+
1998
+ return $(this).each(function() {
1999
+
2000
+ var elem = $(this),
2001
+ lock;
2002
+
2003
+ if( supportsTouch ) {
2004
+
2005
+ var timeout,
2006
+ startX,
2007
+ startY,
2008
+ pointerMoved,
2009
+ point,
2010
+ numPointers;
2011
+
2012
+ elem.on('touchstart' + ns, function(e) {
2013
+ pointerMoved = false;
2014
+ numPointers = 1;
2015
+
2016
+ point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
2017
+ startX = point.clientX;
2018
+ startY = point.clientY;
2019
+
2020
+ _window.on('touchmove'+ns, function(e) {
2021
+ point = e.originalEvent ? e.originalEvent.touches : e.touches;
2022
+ numPointers = point.length;
2023
+ point = point[0];
2024
+ if (Math.abs(point.clientX - startX) > 10 ||
2025
+ Math.abs(point.clientY - startY) > 10) {
2026
+ pointerMoved = true;
2027
+ unbindTouchMove();
2028
+ }
2029
+ }).on('touchend'+ns, function(e) {
2030
+ unbindTouchMove();
2031
+ if(pointerMoved || numPointers > 1) {
2032
+ return;
2033
+ }
2034
+ lock = true;
2035
+ e.preventDefault();
2036
+ clearTimeout(timeout);
2037
+ timeout = setTimeout(function() {
2038
+ lock = false;
2039
+ }, ghostClickDelay);
2040
+ callback();
2041
+ });
2042
+ });
2043
+
2044
+ }
2045
+
2046
+ elem.on('click' + ns, function() {
2047
+ if(!lock) {
2048
+ callback();
2049
+ }
2050
+ });
2051
+ });
2052
+ };
2053
+
2054
+ $.fn.destroyMfpFastClick = function() {
2055
+ $(this).off('touchstart' + ns + ' click' + ns);
2056
+ if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
2057
+ };
2058
+ })();
2059
+
2060
+ /*>>fastclick*/
2061
2061
  _checkInstance(); }));