gent_styleguide 2.9.2 → 2.12.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 (284) hide show
  1. package/.codeclimate.yml +51 -14
  2. package/CHANGELOG.md +15 -1
  3. package/CONTRIBUTING.md +8 -1
  4. package/README.md +23 -6
  5. package/build/styleguide/js/base-min.js +68 -1
  6. package/build/styleguide/js/breadcrumbs.binding-min.js +13 -1
  7. package/build/styleguide/js/breadcrumbs.functions-min.js +131 -1
  8. package/build/styleguide/js/button-drop-min.js +38 -1
  9. package/build/styleguide/js/button-drop.binding-min.js +13 -1
  10. package/build/styleguide/js/button-drop.functions-min.js +48 -1
  11. package/build/styleguide/js/gallery.binding-min.js +12 -1
  12. package/build/styleguide/js/gallery.functions-min.js +29 -1
  13. package/build/styleguide/js/hamburger-menu.binding-min.js +17 -1
  14. package/build/styleguide/js/hamburger-menu.functions-min.js +166 -1
  15. package/build/styleguide/js/header.binding-min.js +18 -1
  16. package/build/styleguide/js/header.functions-min.js +73 -1
  17. package/build/styleguide/js/input-date.binding-min.js +8 -1
  18. package/build/styleguide/js/input-date.functions-min.js +27 -1
  19. package/build/styleguide/js/input-multiselect-chosen.binding-min.js +31 -1
  20. package/build/styleguide/js/input-multiselect-chosen.functions-min.js +24 -1
  21. package/build/styleguide/js/teaser-collection.binding-min.js +14 -1
  22. package/build/styleguide/sass/00-settings/_vars.scss +2 -3
  23. package/build/styleguide/sass/01-mixins/grid/_default_classes.scss +8 -6
  24. package/build/styleguide/sass/01-mixins/grid/_mixins.scss +22 -20
  25. package/build/styleguide/sass/11-base/forms/_forms.scss +3 -0
  26. package/build/styleguide/sass/11-base/grid/_grid.scss +2 -2
  27. package/build/styleguide/sass/21-atoms/fieldset/_fieldset.scss +1 -1
  28. package/build/styleguide/sass/21-atoms/inputs/input-multiselect-chosen/_input-multiselect-chosen.scss +1 -1
  29. package/build/styleguide/sass/21-atoms/tag/_tag.scss +0 -5
  30. package/build/styleguide/sass/31-molecules/building-blocks/breadcrumbs/_breadcrumbs.scss +33 -37
  31. package/build/styleguide/sass/31-molecules/building-blocks/hamburger-menu/_hamburger-menu.scss +1 -1
  32. package/build/styleguide/sass/31-molecules/status-message/_status-message.scss +1 -0
  33. package/build/styleguide/sass/41-organisms/header/_header.scss +2 -2
  34. package/build/styleguide/sass/main_cli.scss +12 -11
  35. package/nbproject/private/private.properties +1 -0
  36. package/nbproject/private/private.xml +8 -0
  37. package/nbproject/project.properties +5 -0
  38. package/nbproject/project.xml +9 -0
  39. package/package.json +7 -9
  40. package/.github/ISSUE_TEMPLATE.md +0 -32
  41. package/.github/PULL_REQUEST_TEMPLATE.md +0 -30
  42. package/.mdl.style.rb +0 -9
  43. package/.mdlrc +0 -1
  44. package/.travis.yml +0 -27
  45. package/build/styleguide/vendor/chosen-js/README.md +0 -47
  46. package/build/styleguide/vendor/chosen-js/chosen-sprite.png +0 -0
  47. package/build/styleguide/vendor/chosen-js/chosen-sprite@2x.png +0 -0
  48. package/build/styleguide/vendor/chosen-js/chosen.css +0 -490
  49. package/build/styleguide/vendor/chosen-js/chosen.jquery.js +0 -1349
  50. package/build/styleguide/vendor/chosen-js/chosen.jquery.min.js +0 -3
  51. package/build/styleguide/vendor/chosen-js/chosen.min.css +0 -11
  52. package/build/styleguide/vendor/chosen-js/chosen.proto.js +0 -1389
  53. package/build/styleguide/vendor/chosen-js/chosen.proto.min.js +0 -3
  54. package/build/styleguide/vendor/jquery/AUTHORS.txt +0 -301
  55. package/build/styleguide/vendor/jquery/LICENSE.txt +0 -36
  56. package/build/styleguide/vendor/jquery/README.md +0 -67
  57. package/build/styleguide/vendor/jquery/dist/core.js +0 -476
  58. package/build/styleguide/vendor/jquery/dist/jquery.js +0 -10253
  59. package/build/styleguide/vendor/jquery/dist/jquery.min.js +0 -4
  60. package/build/styleguide/vendor/jquery/dist/jquery.min.map +0 -1
  61. package/build/styleguide/vendor/jquery/dist/jquery.slim.js +0 -8160
  62. package/build/styleguide/vendor/jquery/dist/jquery.slim.min.js +0 -4
  63. package/build/styleguide/vendor/jquery/dist/jquery.slim.min.map +0 -1
  64. package/build/styleguide/vendor/jquery/external/sizzle/LICENSE.txt +0 -36
  65. package/build/styleguide/vendor/jquery/external/sizzle/dist/sizzle.js +0 -2272
  66. package/build/styleguide/vendor/jquery/external/sizzle/dist/sizzle.min.js +0 -3
  67. package/build/styleguide/vendor/jquery/external/sizzle/dist/sizzle.min.map +0 -1
  68. package/build/styleguide/vendor/jquery/package.json +0 -97
  69. package/build/styleguide/vendor/jquery/src/.eslintrc.json +0 -5
  70. package/build/styleguide/vendor/jquery/src/ajax/jsonp.js +0 -102
  71. package/build/styleguide/vendor/jquery/src/ajax/load.js +0 -76
  72. package/build/styleguide/vendor/jquery/src/ajax/parseXML.js +0 -30
  73. package/build/styleguide/vendor/jquery/src/ajax/script.js +0 -77
  74. package/build/styleguide/vendor/jquery/src/ajax/var/location.js +0 -5
  75. package/build/styleguide/vendor/jquery/src/ajax/var/nonce.js +0 -7
  76. package/build/styleguide/vendor/jquery/src/ajax/var/rquery.js +0 -5
  77. package/build/styleguide/vendor/jquery/src/ajax/xhr.js +0 -169
  78. package/build/styleguide/vendor/jquery/src/ajax.js +0 -855
  79. package/build/styleguide/vendor/jquery/src/attributes/attr.js +0 -141
  80. package/build/styleguide/vendor/jquery/src/attributes/classes.js +0 -174
  81. package/build/styleguide/vendor/jquery/src/attributes/prop.js +0 -143
  82. package/build/styleguide/vendor/jquery/src/attributes/support.js +0 -33
  83. package/build/styleguide/vendor/jquery/src/attributes/val.js +0 -190
  84. package/build/styleguide/vendor/jquery/src/attributes.js +0 -13
  85. package/build/styleguide/vendor/jquery/src/callbacks.js +0 -234
  86. package/build/styleguide/vendor/jquery/src/core/DOMEval.js +0 -16
  87. package/build/styleguide/vendor/jquery/src/core/access.js +0 -70
  88. package/build/styleguide/vendor/jquery/src/core/init.js +0 -128
  89. package/build/styleguide/vendor/jquery/src/core/nodeName.js +0 -13
  90. package/build/styleguide/vendor/jquery/src/core/parseHTML.js +0 -65
  91. package/build/styleguide/vendor/jquery/src/core/ready-no-deferred.js +0 -96
  92. package/build/styleguide/vendor/jquery/src/core/ready.js +0 -86
  93. package/build/styleguide/vendor/jquery/src/core/readyException.js +0 -13
  94. package/build/styleguide/vendor/jquery/src/core/stripAndCollapse.js +0 -14
  95. package/build/styleguide/vendor/jquery/src/core/support.js +0 -20
  96. package/build/styleguide/vendor/jquery/src/core/var/rsingleTag.js +0 -6
  97. package/build/styleguide/vendor/jquery/src/core.js +0 -476
  98. package/build/styleguide/vendor/jquery/src/css/addGetHookIf.js +0 -26
  99. package/build/styleguide/vendor/jquery/src/css/adjustCSS.js +0 -71
  100. package/build/styleguide/vendor/jquery/src/css/curCSS.js +0 -65
  101. package/build/styleguide/vendor/jquery/src/css/hiddenVisibleSelectors.js +0 -15
  102. package/build/styleguide/vendor/jquery/src/css/showHide.js +0 -105
  103. package/build/styleguide/vendor/jquery/src/css/support.js +0 -89
  104. package/build/styleguide/vendor/jquery/src/css/var/cssExpand.js +0 -5
  105. package/build/styleguide/vendor/jquery/src/css/var/getStyles.js +0 -17
  106. package/build/styleguide/vendor/jquery/src/css/var/isHiddenWithinTree.js +0 -34
  107. package/build/styleguide/vendor/jquery/src/css/var/rmargin.js +0 -5
  108. package/build/styleguide/vendor/jquery/src/css/var/rnumnonpx.js +0 -7
  109. package/build/styleguide/vendor/jquery/src/css/var/swap.js +0 -26
  110. package/build/styleguide/vendor/jquery/src/css.js +0 -438
  111. package/build/styleguide/vendor/jquery/src/data/Data.js +0 -161
  112. package/build/styleguide/vendor/jquery/src/data/var/acceptData.js +0 -19
  113. package/build/styleguide/vendor/jquery/src/data/var/dataPriv.js +0 -7
  114. package/build/styleguide/vendor/jquery/src/data/var/dataUser.js +0 -7
  115. package/build/styleguide/vendor/jquery/src/data.js +0 -179
  116. package/build/styleguide/vendor/jquery/src/deferred/exceptionHook.js +0 -21
  117. package/build/styleguide/vendor/jquery/src/deferred.js +0 -391
  118. package/build/styleguide/vendor/jquery/src/deprecated.js +0 -40
  119. package/build/styleguide/vendor/jquery/src/dimensions.js +0 -56
  120. package/build/styleguide/vendor/jquery/src/effects/Tween.js +0 -123
  121. package/build/styleguide/vendor/jquery/src/effects/animatedSelector.js +0 -15
  122. package/build/styleguide/vendor/jquery/src/effects.js +0 -699
  123. package/build/styleguide/vendor/jquery/src/event/ajax.js +0 -22
  124. package/build/styleguide/vendor/jquery/src/event/alias.js +0 -29
  125. package/build/styleguide/vendor/jquery/src/event/focusin.js +0 -55
  126. package/build/styleguide/vendor/jquery/src/event/support.js +0 -11
  127. package/build/styleguide/vendor/jquery/src/event/trigger.js +0 -185
  128. package/build/styleguide/vendor/jquery/src/event.js +0 -746
  129. package/build/styleguide/vendor/jquery/src/exports/amd.js +0 -26
  130. package/build/styleguide/vendor/jquery/src/exports/global.js +0 -34
  131. package/build/styleguide/vendor/jquery/src/jquery.js +0 -41
  132. package/build/styleguide/vendor/jquery/src/manipulation/_evalUrl.js +0 -23
  133. package/build/styleguide/vendor/jquery/src/manipulation/buildFragment.js +0 -104
  134. package/build/styleguide/vendor/jquery/src/manipulation/getAll.js +0 -32
  135. package/build/styleguide/vendor/jquery/src/manipulation/setGlobalEval.js +0 -22
  136. package/build/styleguide/vendor/jquery/src/manipulation/support.js +0 -35
  137. package/build/styleguide/vendor/jquery/src/manipulation/var/rcheckableType.js +0 -5
  138. package/build/styleguide/vendor/jquery/src/manipulation/var/rscriptType.js +0 -5
  139. package/build/styleguide/vendor/jquery/src/manipulation/var/rtagName.js +0 -5
  140. package/build/styleguide/vendor/jquery/src/manipulation/wrapMap.js +0 -29
  141. package/build/styleguide/vendor/jquery/src/manipulation.js +0 -488
  142. package/build/styleguide/vendor/jquery/src/offset.js +0 -229
  143. package/build/styleguide/vendor/jquery/src/queue/delay.js +0 -24
  144. package/build/styleguide/vendor/jquery/src/queue.js +0 -145
  145. package/build/styleguide/vendor/jquery/src/selector-native.js +0 -237
  146. package/build/styleguide/vendor/jquery/src/selector-sizzle.js +0 -19
  147. package/build/styleguide/vendor/jquery/src/selector.js +0 -3
  148. package/build/styleguide/vendor/jquery/src/serialize.js +0 -130
  149. package/build/styleguide/vendor/jquery/src/traversing/findFilter.js +0 -106
  150. package/build/styleguide/vendor/jquery/src/traversing/var/dir.js +0 -22
  151. package/build/styleguide/vendor/jquery/src/traversing/var/rneedsContext.js +0 -8
  152. package/build/styleguide/vendor/jquery/src/traversing/var/siblings.js +0 -17
  153. package/build/styleguide/vendor/jquery/src/traversing.js +0 -191
  154. package/build/styleguide/vendor/jquery/src/var/ObjectFunctionString.js +0 -7
  155. package/build/styleguide/vendor/jquery/src/var/arr.js +0 -5
  156. package/build/styleguide/vendor/jquery/src/var/class2type.js +0 -6
  157. package/build/styleguide/vendor/jquery/src/var/concat.js +0 -7
  158. package/build/styleguide/vendor/jquery/src/var/document.js +0 -5
  159. package/build/styleguide/vendor/jquery/src/var/documentElement.js +0 -7
  160. package/build/styleguide/vendor/jquery/src/var/fnToString.js +0 -7
  161. package/build/styleguide/vendor/jquery/src/var/getProto.js +0 -5
  162. package/build/styleguide/vendor/jquery/src/var/hasOwn.js +0 -7
  163. package/build/styleguide/vendor/jquery/src/var/indexOf.js +0 -7
  164. package/build/styleguide/vendor/jquery/src/var/pnum.js +0 -5
  165. package/build/styleguide/vendor/jquery/src/var/push.js +0 -7
  166. package/build/styleguide/vendor/jquery/src/var/rcssNum.js +0 -9
  167. package/build/styleguide/vendor/jquery/src/var/rnothtmlwhite.js +0 -8
  168. package/build/styleguide/vendor/jquery/src/var/slice.js +0 -7
  169. package/build/styleguide/vendor/jquery/src/var/support.js +0 -6
  170. package/build/styleguide/vendor/jquery/src/var/toString.js +0 -7
  171. package/build/styleguide/vendor/jquery/src/wrap.js +0 -77
  172. package/build/styleguide/vendor/lightgallery/.editorconfig +0 -16
  173. package/build/styleguide/vendor/lightgallery/.gitattributes +0 -1
  174. package/build/styleguide/vendor/lightgallery/.jscsrc +0 -7
  175. package/build/styleguide/vendor/lightgallery/.jshintrc +0 -18
  176. package/build/styleguide/vendor/lightgallery/.travis.yml +0 -9
  177. package/build/styleguide/vendor/lightgallery/Gruntfile.js +0 -208
  178. package/build/styleguide/vendor/lightgallery/LICENSE.md +0 -686
  179. package/build/styleguide/vendor/lightgallery/README.md +0 -191
  180. package/build/styleguide/vendor/lightgallery/contributing.md +0 -34
  181. package/build/styleguide/vendor/lightgallery/demo/img/1-1600.jpg +0 -0
  182. package/build/styleguide/vendor/lightgallery/demo/img/1-375.jpg +0 -0
  183. package/build/styleguide/vendor/lightgallery/demo/img/1-480.jpg +0 -0
  184. package/build/styleguide/vendor/lightgallery/demo/img/1.jpg +0 -0
  185. package/build/styleguide/vendor/lightgallery/demo/img/13-1600.jpg +0 -0
  186. package/build/styleguide/vendor/lightgallery/demo/img/13-375.jpg +0 -0
  187. package/build/styleguide/vendor/lightgallery/demo/img/13-480.jpg +0 -0
  188. package/build/styleguide/vendor/lightgallery/demo/img/13.jpg +0 -0
  189. package/build/styleguide/vendor/lightgallery/demo/img/2-1600.jpg +0 -0
  190. package/build/styleguide/vendor/lightgallery/demo/img/2-375.jpg +0 -0
  191. package/build/styleguide/vendor/lightgallery/demo/img/2-480.jpg +0 -0
  192. package/build/styleguide/vendor/lightgallery/demo/img/2.jpg +0 -0
  193. package/build/styleguide/vendor/lightgallery/demo/img/4-1600.jpg +0 -0
  194. package/build/styleguide/vendor/lightgallery/demo/img/4-375.jpg +0 -0
  195. package/build/styleguide/vendor/lightgallery/demo/img/4-480.jpg +0 -0
  196. package/build/styleguide/vendor/lightgallery/demo/img/4.jpg +0 -0
  197. package/build/styleguide/vendor/lightgallery/demo/img/thumb-1.jpg +0 -0
  198. package/build/styleguide/vendor/lightgallery/demo/img/thumb-13.jpg +0 -0
  199. package/build/styleguide/vendor/lightgallery/demo/img/thumb-2.jpg +0 -0
  200. package/build/styleguide/vendor/lightgallery/demo/img/thumb-4.jpg +0 -0
  201. package/build/styleguide/vendor/lightgallery/demo/index.html +0 -162
  202. package/build/styleguide/vendor/lightgallery/dist/css/lg-fb-comment-box.css +0 -57
  203. package/build/styleguide/vendor/lightgallery/dist/css/lg-fb-comment-box.min.css +0 -1
  204. package/build/styleguide/vendor/lightgallery/dist/css/lg-transitions.css +0 -779
  205. package/build/styleguide/vendor/lightgallery/dist/css/lg-transitions.min.css +0 -1
  206. package/build/styleguide/vendor/lightgallery/dist/css/lightgallery.css +0 -982
  207. package/build/styleguide/vendor/lightgallery/dist/css/lightgallery.min.css +0 -1
  208. package/build/styleguide/vendor/lightgallery/dist/fonts/lg.eot +0 -0
  209. package/build/styleguide/vendor/lightgallery/dist/fonts/lg.svg +0 -47
  210. package/build/styleguide/vendor/lightgallery/dist/fonts/lg.ttf +0 -0
  211. package/build/styleguide/vendor/lightgallery/dist/fonts/lg.woff +0 -0
  212. package/build/styleguide/vendor/lightgallery/dist/img/loading.gif +0 -0
  213. package/build/styleguide/vendor/lightgallery/dist/img/video-play.png +0 -0
  214. package/build/styleguide/vendor/lightgallery/dist/img/vimeo-play.png +0 -0
  215. package/build/styleguide/vendor/lightgallery/dist/img/youtube-play.png +0 -0
  216. package/build/styleguide/vendor/lightgallery/dist/js/lightgallery-all.js +0 -3331
  217. package/build/styleguide/vendor/lightgallery/dist/js/lightgallery-all.min.js +0 -5
  218. package/build/styleguide/vendor/lightgallery/dist/js/lightgallery.js +0 -1364
  219. package/build/styleguide/vendor/lightgallery/dist/js/lightgallery.min.js +0 -4
  220. package/build/styleguide/vendor/lightgallery/lib/jquery.mousewheel.min.js +0 -8
  221. package/build/styleguide/vendor/lightgallery/lib/lg.png +0 -0
  222. package/build/styleguide/vendor/lightgallery/lib/picturefill.min.js +0 -4
  223. package/build/styleguide/vendor/lightgallery/lightGallery.jquery.json +0 -27
  224. package/build/styleguide/vendor/lightgallery/modules/lg-autoplay.js +0 -206
  225. package/build/styleguide/vendor/lightgallery/modules/lg-autoplay.min.js +0 -4
  226. package/build/styleguide/vendor/lightgallery/modules/lg-fullscreen.js +0 -116
  227. package/build/styleguide/vendor/lightgallery/modules/lg-fullscreen.min.js +0 -4
  228. package/build/styleguide/vendor/lightgallery/modules/lg-hash.js +0 -101
  229. package/build/styleguide/vendor/lightgallery/modules/lg-hash.min.js +0 -4
  230. package/build/styleguide/vendor/lightgallery/modules/lg-pager.js +0 -105
  231. package/build/styleguide/vendor/lightgallery/modules/lg-pager.min.js +0 -4
  232. package/build/styleguide/vendor/lightgallery/modules/lg-share.js +0 -107
  233. package/build/styleguide/vendor/lightgallery/modules/lg-share.min.js +0 -4
  234. package/build/styleguide/vendor/lightgallery/modules/lg-thumbnail.js +0 -478
  235. package/build/styleguide/vendor/lightgallery/modules/lg-thumbnail.min.js +0 -4
  236. package/build/styleguide/vendor/lightgallery/modules/lg-video.js +0 -317
  237. package/build/styleguide/vendor/lightgallery/modules/lg-video.min.js +0 -4
  238. package/build/styleguide/vendor/lightgallery/modules/lg-zoom.js +0 -527
  239. package/build/styleguide/vendor/lightgallery/modules/lg-zoom.min.js +0 -4
  240. package/build/styleguide/vendor/lightgallery/package.json +0 -60
  241. package/build/styleguide/vendor/lightgallery/selection.json +0 -407
  242. package/build/styleguide/vendor/lightgallery/src/css/lg-fb-comment-box.css +0 -54
  243. package/build/styleguide/vendor/lightgallery/src/css/lg-fb-comment-box.css.map +0 -7
  244. package/build/styleguide/vendor/lightgallery/src/css/lg-transitions.css +0 -776
  245. package/build/styleguide/vendor/lightgallery/src/css/lg-transitions.css.map +0 -7
  246. package/build/styleguide/vendor/lightgallery/src/css/lightgallery.css +0 -979
  247. package/build/styleguide/vendor/lightgallery/src/css/lightgallery.css.map +0 -7
  248. package/build/styleguide/vendor/lightgallery/src/fonts/lg.eot +0 -0
  249. package/build/styleguide/vendor/lightgallery/src/fonts/lg.svg +0 -47
  250. package/build/styleguide/vendor/lightgallery/src/fonts/lg.ttf +0 -0
  251. package/build/styleguide/vendor/lightgallery/src/fonts/lg.woff +0 -0
  252. package/build/styleguide/vendor/lightgallery/src/img/loading.gif +0 -0
  253. package/build/styleguide/vendor/lightgallery/src/img/video-play.png +0 -0
  254. package/build/styleguide/vendor/lightgallery/src/img/vimeo-play.png +0 -0
  255. package/build/styleguide/vendor/lightgallery/src/img/youtube-play.png +0 -0
  256. package/build/styleguide/vendor/lightgallery/src/js/.jshintrc +0 -22
  257. package/build/styleguide/vendor/lightgallery/src/js/lightgallery.js +0 -1342
  258. package/build/styleguide/vendor/lightgallery/src/sass/lg-animations.scss +0 -714
  259. package/build/styleguide/vendor/lightgallery/src/sass/lg-autoplay.scss +0 -36
  260. package/build/styleguide/vendor/lightgallery/src/sass/lg-core.scss +0 -272
  261. package/build/styleguide/vendor/lightgallery/src/sass/lg-fb-comment-box.scss +0 -52
  262. package/build/styleguide/vendor/lightgallery/src/sass/lg-fonts.scss +0 -22
  263. package/build/styleguide/vendor/lightgallery/src/sass/lg-fullscreen.scss +0 -9
  264. package/build/styleguide/vendor/lightgallery/src/sass/lg-mixins.scss +0 -330
  265. package/build/styleguide/vendor/lightgallery/src/sass/lg-pager.scss +0 -89
  266. package/build/styleguide/vendor/lightgallery/src/sass/lg-share.scss +0 -135
  267. package/build/styleguide/vendor/lightgallery/src/sass/lg-theme-default.scss +0 -208
  268. package/build/styleguide/vendor/lightgallery/src/sass/lg-thumbnail.scss +0 -111
  269. package/build/styleguide/vendor/lightgallery/src/sass/lg-transitions.scss +0 -766
  270. package/build/styleguide/vendor/lightgallery/src/sass/lg-variables.scss +0 -57
  271. package/build/styleguide/vendor/lightgallery/src/sass/lg-video.scss +0 -110
  272. package/build/styleguide/vendor/lightgallery/src/sass/lg-zoom.scss +0 -69
  273. package/build/styleguide/vendor/lightgallery/src/sass/lightgallery.scss +0 -15
  274. package/build/styleguide/vendor/lightgallery/src/sass/prepros.cfg +0 -530
  275. package/build/styleguide/vendor/lightgallery/test/.jshintrc +0 -33
  276. package/build/styleguide/vendor/lightgallery/test/lightgallery.html +0 -27
  277. package/build/styleguide/vendor/lightgallery/test/lightgallery_test.js +0 -16
  278. package/build/styleguide/vendor/masonry-layout/README.md +0 -80
  279. package/build/styleguide/vendor/masonry-layout/dist/masonry.pkgd.js +0 -2499
  280. package/build/styleguide/vendor/masonry-layout/dist/masonry.pkgd.min.js +0 -9
  281. package/build/styleguide/vendor/masonry-layout/masonry.js +0 -239
  282. package/postinstall.sh +0 -76
  283. package/version_tag.sh +0 -99
  284. package/yarn.lock +0 -7827
@@ -1,1342 +0,0 @@
1
- (function() {
2
- 'use strict';
3
-
4
- var defaults = {
5
-
6
- mode: 'lg-slide',
7
-
8
- // Ex : 'ease'
9
- cssEasing: 'ease',
10
-
11
- //'for jquery animation'
12
- easing: 'linear',
13
- speed: 600,
14
- height: '100%',
15
- width: '100%',
16
- addClass: '',
17
- startClass: 'lg-start-zoom',
18
- backdropDuration: 150,
19
- hideBarsDelay: 6000,
20
-
21
- useLeft: false,
22
-
23
- closable: true,
24
- loop: true,
25
- escKey: true,
26
- keyPress: true,
27
- controls: true,
28
- slideEndAnimatoin: true,
29
- hideControlOnEnd: false,
30
- mousewheel: true,
31
-
32
- getCaptionFromTitleOrAlt: true,
33
-
34
- // .lg-item || '.lg-sub-html'
35
- appendSubHtmlTo: '.lg-sub-html',
36
-
37
- subHtmlSelectorRelative: false,
38
-
39
- /**
40
- * @desc number of preload slides
41
- * will exicute only after the current slide is fully loaded.
42
- *
43
- * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th
44
- * slide will be loaded in the background after the 4th slide is fully loaded..
45
- * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ...
46
- *
47
- */
48
- preload: 1,
49
- showAfterLoad: true,
50
- selector: '',
51
- selectWithin: '',
52
- nextHtml: '',
53
- prevHtml: '',
54
-
55
- // 0, 1
56
- index: false,
57
-
58
- iframeMaxWidth: '100%',
59
-
60
- download: true,
61
- counter: true,
62
- appendCounterTo: '.lg-toolbar',
63
-
64
- swipeThreshold: 50,
65
- enableSwipe: true,
66
- enableDrag: true,
67
-
68
- dynamic: false,
69
- dynamicEl: [],
70
- galleryId: 1
71
- };
72
-
73
- function Plugin(element, options) {
74
-
75
- // Current lightGallery element
76
- this.el = element;
77
-
78
- // Current jquery element
79
- this.$el = $(element);
80
-
81
- // lightGallery settings
82
- this.s = $.extend({}, defaults, options);
83
-
84
- // When using dynamic mode, ensure dynamicEl is an array
85
- if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) {
86
- throw ('When using dynamic mode, you must also define dynamicEl as an Array.');
87
- }
88
-
89
- // lightGallery modules
90
- this.modules = {};
91
-
92
- // false when lightgallery complete first slide;
93
- this.lGalleryOn = false;
94
-
95
- this.lgBusy = false;
96
-
97
- // Timeout function for hiding controls;
98
- this.hideBartimeout = false;
99
-
100
- // To determine browser supports for touch events;
101
- this.isTouch = ('ontouchstart' in document.documentElement);
102
-
103
- // Disable hideControlOnEnd if sildeEndAnimation is true
104
- if (this.s.slideEndAnimatoin) {
105
- this.s.hideControlOnEnd = false;
106
- }
107
-
108
- // Gallery items
109
- if (this.s.dynamic) {
110
- this.$items = this.s.dynamicEl;
111
- } else {
112
- if (this.s.selector === 'this') {
113
- this.$items = this.$el;
114
- } else if (this.s.selector !== '') {
115
- if (this.s.selectWithin) {
116
- this.$items = $(this.s.selectWithin).find(this.s.selector);
117
- } else {
118
- this.$items = this.$el.find($(this.s.selector));
119
- }
120
- } else {
121
- this.$items = this.$el.children();
122
- }
123
- }
124
-
125
- // .lg-item
126
- this.$slide = '';
127
-
128
- // .lg-outer
129
- this.$outer = '';
130
-
131
- this.init();
132
-
133
- return this;
134
- }
135
-
136
- Plugin.prototype.init = function() {
137
-
138
- var _this = this;
139
-
140
- // s.preload should not be more than $item.length
141
- if (_this.s.preload > _this.$items.length) {
142
- _this.s.preload = _this.$items.length;
143
- }
144
-
145
- // if dynamic option is enabled execute immediately
146
- var _hash = window.location.hash;
147
- if (_hash.indexOf('lg=' + this.s.galleryId) > 0) {
148
-
149
- _this.index = parseInt(_hash.split('&slide=')[1], 10);
150
-
151
- $('body').addClass('lg-from-hash');
152
- if (!$('body').hasClass('lg-on')) {
153
- setTimeout(function() {
154
- _this.build(_this.index);
155
- });
156
-
157
- $('body').addClass('lg-on');
158
- }
159
- }
160
-
161
- if (_this.s.dynamic) {
162
-
163
- _this.$el.trigger('onBeforeOpen.lg');
164
-
165
- _this.index = _this.s.index || 0;
166
-
167
- // prevent accidental double execution
168
- if (!$('body').hasClass('lg-on')) {
169
- setTimeout(function() {
170
- _this.build(_this.index);
171
- $('body').addClass('lg-on');
172
- });
173
- }
174
- } else {
175
-
176
- // Using different namespace for click because click event should not unbind if selector is same object('this')
177
- _this.$items.on('click.lgcustom', function(event) {
178
-
179
- // For IE8
180
- try {
181
- event.preventDefault();
182
- event.preventDefault();
183
- } catch (er) {
184
- event.returnValue = false;
185
- }
186
-
187
- _this.$el.trigger('onBeforeOpen.lg');
188
-
189
- _this.index = _this.s.index || _this.$items.index(this);
190
-
191
- // prevent accidental double execution
192
- if (!$('body').hasClass('lg-on')) {
193
- _this.build(_this.index);
194
- $('body').addClass('lg-on');
195
- }
196
- });
197
- }
198
-
199
- };
200
-
201
- Plugin.prototype.build = function(index) {
202
-
203
- var _this = this;
204
-
205
- _this.structure();
206
-
207
- // module constructor
208
- $.each($.fn.lightGallery.modules, function(key) {
209
- _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el);
210
- });
211
-
212
- // initiate slide function
213
- _this.slide(index, false, false, false);
214
-
215
- if (_this.s.keyPress) {
216
- _this.keyPress();
217
- }
218
-
219
- if (_this.$items.length > 1) {
220
-
221
- _this.arrow();
222
-
223
- setTimeout(function() {
224
- _this.enableDrag();
225
- _this.enableSwipe();
226
- }, 50);
227
-
228
- if (_this.s.mousewheel) {
229
- _this.mousewheel();
230
- }
231
- } else {
232
- _this.$slide.on('click.lg', function() {
233
- _this.$el.trigger('onSlideClick.lg');
234
- });
235
- }
236
-
237
- _this.counter();
238
-
239
- _this.closeGallery();
240
-
241
- _this.$el.trigger('onAfterOpen.lg');
242
-
243
- // Hide controllers if mouse doesn't move for some period
244
- _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() {
245
-
246
- _this.$outer.removeClass('lg-hide-items');
247
-
248
- clearTimeout(_this.hideBartimeout);
249
-
250
- // Timeout will be cleared on each slide movement also
251
- _this.hideBartimeout = setTimeout(function() {
252
- _this.$outer.addClass('lg-hide-items');
253
- }, _this.s.hideBarsDelay);
254
-
255
- });
256
-
257
- _this.$outer.trigger('mousemove.lg');
258
-
259
- };
260
-
261
- Plugin.prototype.structure = function() {
262
- var list = '';
263
- var controls = '';
264
- var i = 0;
265
- var subHtmlCont = '';
266
- var template;
267
- var _this = this;
268
-
269
- $('body').append('<div class="lg-backdrop"></div>');
270
- $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms');
271
-
272
- // Create gallery items
273
- for (i = 0; i < this.$items.length; i++) {
274
- list += '<div class="lg-item"></div>';
275
- }
276
-
277
- // Create controlls
278
- if (this.s.controls && this.$items.length > 1) {
279
- controls = '<div class="lg-actions">' +
280
- '<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' +
281
- '<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' +
282
- '</div>';
283
- }
284
-
285
- if (this.s.appendSubHtmlTo === '.lg-sub-html') {
286
- subHtmlCont = '<div class="lg-sub-html"></div>';
287
- }
288
-
289
- template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' +
290
- '<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' +
291
- '<div class="lg-inner">' + list + '</div>' +
292
- '<div class="lg-toolbar lg-group">' +
293
- '<span class="lg-close lg-icon"></span>' +
294
- '</div>' +
295
- controls +
296
- subHtmlCont +
297
- '</div>' +
298
- '</div>';
299
-
300
- $('body').append(template);
301
- this.$outer = $('.lg-outer');
302
- this.$slide = this.$outer.find('.lg-item');
303
-
304
- if (this.s.useLeft) {
305
- this.$outer.addClass('lg-use-left');
306
-
307
- // Set mode lg-slide if use left is true;
308
- this.s.mode = 'lg-slide';
309
- } else {
310
- this.$outer.addClass('lg-use-css3');
311
- }
312
-
313
- // For fixed height gallery
314
- _this.setTop();
315
- $(window).on('resize.lg orientationchange.lg', function() {
316
- setTimeout(function() {
317
- _this.setTop();
318
- }, 100);
319
- });
320
-
321
- // add class lg-current to remove initial transition
322
- this.$slide.eq(this.index).addClass('lg-current');
323
-
324
- // add Class for css support and transition mode
325
- if (this.doCss()) {
326
- this.$outer.addClass('lg-css3');
327
- } else {
328
- this.$outer.addClass('lg-css');
329
-
330
- // Set speed 0 because no animation will happen if browser doesn't support css3
331
- this.s.speed = 0;
332
- }
333
-
334
- this.$outer.addClass(this.s.mode);
335
-
336
- if (this.s.enableDrag && this.$items.length > 1) {
337
- this.$outer.addClass('lg-grab');
338
- }
339
-
340
- if (this.s.showAfterLoad) {
341
- this.$outer.addClass('lg-show-after-load');
342
- }
343
-
344
- if (this.doCss()) {
345
- var $inner = this.$outer.find('.lg-inner');
346
- $inner.css('transition-timing-function', this.s.cssEasing);
347
- $inner.css('transition-duration', this.s.speed + 'ms');
348
- }
349
-
350
- setTimeout(function() {
351
- $('.lg-backdrop').addClass('in');
352
- });
353
-
354
- setTimeout(function() {
355
- _this.$outer.addClass('lg-visible');
356
- }, this.s.backdropDuration);
357
-
358
- if (this.s.download) {
359
- this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>');
360
- }
361
-
362
- // Store the current scroll top value to scroll back after closing the gallery..
363
- this.prevScrollTop = $(window).scrollTop();
364
-
365
- };
366
-
367
- // For fixed height gallery
368
- Plugin.prototype.setTop = function() {
369
- if (this.s.height !== '100%') {
370
- var wH = $(window).height();
371
- var top = (wH - parseInt(this.s.height, 10)) / 2;
372
- var $lGallery = this.$outer.find('.lg');
373
- if (wH >= parseInt(this.s.height, 10)) {
374
- $lGallery.css('top', top + 'px');
375
- } else {
376
- $lGallery.css('top', '0px');
377
- }
378
- }
379
- };
380
-
381
- // Find css3 support
382
- Plugin.prototype.doCss = function() {
383
- // check for css animation support
384
- var support = function() {
385
- var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
386
- var root = document.documentElement;
387
- var i = 0;
388
- for (i = 0; i < transition.length; i++) {
389
- if (transition[i] in root.style) {
390
- return true;
391
- }
392
- }
393
- };
394
-
395
- if (support()) {
396
- return true;
397
- }
398
-
399
- return false;
400
- };
401
-
402
- /**
403
- * @desc Check the given src is video
404
- * @param {String} src
405
- * @return {Object} video type
406
- * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] }
407
- */
408
- Plugin.prototype.isVideo = function(src, index) {
409
-
410
- var html;
411
- if (this.s.dynamic) {
412
- html = this.s.dynamicEl[index].html;
413
- } else {
414
- html = this.$items.eq(index).attr('data-html');
415
- }
416
-
417
- if (!src) {
418
- if(html) {
419
- return {
420
- html5: true
421
- };
422
- } else {
423
- console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html');
424
- return false;
425
- }
426
- }
427
-
428
- var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
429
- var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
430
- var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i);
431
- var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);
432
-
433
- if (youtube) {
434
- return {
435
- youtube: youtube
436
- };
437
- } else if (vimeo) {
438
- return {
439
- vimeo: vimeo
440
- };
441
- } else if (dailymotion) {
442
- return {
443
- dailymotion: dailymotion
444
- };
445
- } else if (vk) {
446
- return {
447
- vk: vk
448
- };
449
- }
450
- };
451
-
452
- /**
453
- * @desc Create image counter
454
- * Ex: 1/10
455
- */
456
- Plugin.prototype.counter = function() {
457
- if (this.s.counter) {
458
- $(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>');
459
- }
460
- };
461
-
462
- /**
463
- * @desc add sub-html into the slide
464
- * @param {Number} index - index of the slide
465
- */
466
- Plugin.prototype.addHtml = function(index) {
467
- var subHtml = null;
468
- var subHtmlUrl;
469
- var $currentEle;
470
- if (this.s.dynamic) {
471
- if (this.s.dynamicEl[index].subHtmlUrl) {
472
- subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl;
473
- } else {
474
- subHtml = this.s.dynamicEl[index].subHtml;
475
- }
476
- } else {
477
- $currentEle = this.$items.eq(index);
478
- if ($currentEle.attr('data-sub-html-url')) {
479
- subHtmlUrl = $currentEle.attr('data-sub-html-url');
480
- } else {
481
- subHtml = $currentEle.attr('data-sub-html');
482
- if (this.s.getCaptionFromTitleOrAlt && !subHtml) {
483
- subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt');
484
- }
485
- }
486
- }
487
-
488
- if (!subHtmlUrl) {
489
- if (typeof subHtml !== 'undefined' && subHtml !== null) {
490
-
491
- // get first letter of subhtml
492
- // if first letter starts with . or # get the html form the jQuery object
493
- var fL = subHtml.substring(0, 1);
494
- if (fL === '.' || fL === '#') {
495
- if (this.s.subHtmlSelectorRelative && !this.s.dynamic) {
496
- subHtml = $currentEle.find(subHtml).html();
497
- } else {
498
- subHtml = $(subHtml).html();
499
- }
500
- }
501
- } else {
502
- subHtml = '';
503
- }
504
- }
505
-
506
- if (this.s.appendSubHtmlTo === '.lg-sub-html') {
507
-
508
- if (subHtmlUrl) {
509
- this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl);
510
- } else {
511
- this.$outer.find(this.s.appendSubHtmlTo).html(subHtml);
512
- }
513
-
514
- } else {
515
-
516
- if (subHtmlUrl) {
517
- this.$slide.eq(index).load(subHtmlUrl);
518
- } else {
519
- this.$slide.eq(index).append(subHtml);
520
- }
521
- }
522
-
523
- // Add lg-empty-html class if title doesn't exist
524
- if (typeof subHtml !== 'undefined' && subHtml !== null) {
525
- if (subHtml === '') {
526
- this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html');
527
- } else {
528
- this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html');
529
- }
530
- }
531
-
532
- this.$el.trigger('onAfterAppendSubHtml.lg', [index]);
533
- };
534
-
535
- /**
536
- * @desc Preload slides
537
- * @param {Number} index - index of the slide
538
- */
539
- Plugin.prototype.preload = function(index) {
540
- var i = 1;
541
- var j = 1;
542
- for (i = 1; i <= this.s.preload; i++) {
543
- if (i >= this.$items.length - index) {
544
- break;
545
- }
546
-
547
- this.loadContent(index + i, false, 0);
548
- }
549
-
550
- for (j = 1; j <= this.s.preload; j++) {
551
- if (index - j < 0) {
552
- break;
553
- }
554
-
555
- this.loadContent(index - j, false, 0);
556
- }
557
- };
558
-
559
- /**
560
- * @desc Load slide content into slide.
561
- * @param {Number} index - index of the slide.
562
- * @param {Boolean} rec - if true call loadcontent() function again.
563
- * @param {Boolean} delay - delay for adding complete class. it is 0 except first time.
564
- */
565
- Plugin.prototype.loadContent = function(index, rec, delay) {
566
-
567
- var _this = this;
568
- var _hasPoster = false;
569
- var _$img;
570
- var _src;
571
- var _poster;
572
- var _srcset;
573
- var _sizes;
574
- var _html;
575
- var getResponsiveSrc = function(srcItms) {
576
- var rsWidth = [];
577
- var rsSrc = [];
578
- for (var i = 0; i < srcItms.length; i++) {
579
- var __src = srcItms[i].split(' ');
580
-
581
- // Manage empty space
582
- if (__src[0] === '') {
583
- __src.splice(0, 1);
584
- }
585
-
586
- rsSrc.push(__src[0]);
587
- rsWidth.push(__src[1]);
588
- }
589
-
590
- var wWidth = $(window).width();
591
- for (var j = 0; j < rsWidth.length; j++) {
592
- if (parseInt(rsWidth[j], 10) > wWidth) {
593
- _src = rsSrc[j];
594
- break;
595
- }
596
- }
597
- };
598
-
599
- if (_this.s.dynamic) {
600
-
601
- if (_this.s.dynamicEl[index].poster) {
602
- _hasPoster = true;
603
- _poster = _this.s.dynamicEl[index].poster;
604
- }
605
-
606
- _html = _this.s.dynamicEl[index].html;
607
- _src = _this.s.dynamicEl[index].src;
608
-
609
- if (_this.s.dynamicEl[index].responsive) {
610
- var srcDyItms = _this.s.dynamicEl[index].responsive.split(',');
611
- getResponsiveSrc(srcDyItms);
612
- }
613
-
614
- _srcset = _this.s.dynamicEl[index].srcset;
615
- _sizes = _this.s.dynamicEl[index].sizes;
616
-
617
- } else {
618
-
619
- if (_this.$items.eq(index).attr('data-poster')) {
620
- _hasPoster = true;
621
- _poster = _this.$items.eq(index).attr('data-poster');
622
- }
623
-
624
- _html = _this.$items.eq(index).attr('data-html');
625
- _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src');
626
-
627
- if (_this.$items.eq(index).attr('data-responsive')) {
628
- var srcItms = _this.$items.eq(index).attr('data-responsive').split(',');
629
- getResponsiveSrc(srcItms);
630
- }
631
-
632
- _srcset = _this.$items.eq(index).attr('data-srcset');
633
- _sizes = _this.$items.eq(index).attr('data-sizes');
634
-
635
- }
636
-
637
- //if (_src || _srcset || _sizes || _poster) {
638
-
639
- var iframe = false;
640
- if (_this.s.dynamic) {
641
- if (_this.s.dynamicEl[index].iframe) {
642
- iframe = true;
643
- }
644
- } else {
645
- if (_this.$items.eq(index).attr('data-iframe') === 'true') {
646
- iframe = true;
647
- }
648
- }
649
-
650
- var _isVideo = _this.isVideo(_src, index);
651
- if (!_this.$slide.eq(index).hasClass('lg-loaded')) {
652
- if (iframe) {
653
- _this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>');
654
- } else if (_hasPoster) {
655
- var videoClass = '';
656
- if (_isVideo && _isVideo.youtube) {
657
- videoClass = 'lg-has-youtube';
658
- } else if (_isVideo && _isVideo.vimeo) {
659
- videoClass = 'lg-has-vimeo';
660
- } else {
661
- videoClass = 'lg-has-html5';
662
- }
663
-
664
- _this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>');
665
-
666
- } else if (_isVideo) {
667
- _this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>');
668
- _this.$el.trigger('hasVideo.lg', [index, _src, _html]);
669
- } else {
670
- _this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>');
671
- }
672
-
673
- _this.$el.trigger('onAferAppendSlide.lg', [index]);
674
-
675
- _$img = _this.$slide.eq(index).find('.lg-object');
676
- if (_sizes) {
677
- _$img.attr('sizes', _sizes);
678
- }
679
-
680
- if (_srcset) {
681
- _$img.attr('srcset', _srcset);
682
- try {
683
- picturefill({
684
- elements: [_$img[0]]
685
- });
686
- } catch (e) {
687
- console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.');
688
- }
689
- }
690
-
691
- if (this.s.appendSubHtmlTo !== '.lg-sub-html') {
692
- _this.addHtml(index);
693
- }
694
-
695
- _this.$slide.eq(index).addClass('lg-loaded');
696
- }
697
-
698
- _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
699
-
700
- // For first time add some delay for displaying the start animation.
701
- var _speed = 0;
702
-
703
- // Do not change the delay value because it is required for zoom plugin.
704
- // If gallery opened from direct url (hash) speed value should be 0
705
- if (delay && !$('body').hasClass('lg-from-hash')) {
706
- _speed = delay;
707
- }
708
-
709
- setTimeout(function() {
710
- _this.$slide.eq(index).addClass('lg-complete');
711
- _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]);
712
- }, _speed);
713
-
714
- });
715
-
716
- // @todo check load state for html5 videos
717
- if (_isVideo && _isVideo.html5 && !_hasPoster) {
718
- _this.$slide.eq(index).addClass('lg-complete');
719
- }
720
-
721
- if (rec === true) {
722
- if (!_this.$slide.eq(index).hasClass('lg-complete')) {
723
- _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
724
- _this.preload(index);
725
- });
726
- } else {
727
- _this.preload(index);
728
- }
729
- }
730
-
731
- //}
732
- };
733
-
734
- /**
735
- * @desc slide function for lightgallery
736
- ** Slide() gets call on start
737
- ** ** Set lg.on true once slide() function gets called.
738
- ** Call loadContent() on slide() function inside setTimeout
739
- ** ** On first slide we do not want any animation like slide of fade
740
- ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately
741
- ** ** Else loadContent() should wait for the transition to complete.
742
- ** ** So set timeout s.speed + 50
743
- <=> ** loadContent() will load slide content in to the particular slide
744
- ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function.
745
- ** ** preload will execute only when the previous slide is fully loaded (images iframe)
746
- ** ** avoid simultaneous image load
747
- <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value
748
- ** loadContent() <====> Preload();
749
-
750
- * @param {Number} index - index of the slide
751
- * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag
752
- * @param {Boolean} fromThumb - true if slide function called via thumbnail click
753
- * @param {String} direction - Direction of the slide(next/prev)
754
- */
755
- Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) {
756
-
757
- var _prevIndex = this.$outer.find('.lg-current').index();
758
- var _this = this;
759
-
760
- // Prevent if multiple call
761
- // Required for hsh plugin
762
- if (_this.lGalleryOn && (_prevIndex === index)) {
763
- return;
764
- }
765
-
766
- var _length = this.$slide.length;
767
- var _time = _this.lGalleryOn ? this.s.speed : 0;
768
-
769
- if (!_this.lgBusy) {
770
-
771
- if (this.s.download) {
772
- var _src;
773
- if (_this.s.dynamic) {
774
- _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src);
775
- } else {
776
- _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'));
777
-
778
- }
779
-
780
- if (_src) {
781
- $('#lg-download').attr('href', _src);
782
- _this.$outer.removeClass('lg-hide-download');
783
- } else {
784
- _this.$outer.addClass('lg-hide-download');
785
- }
786
- }
787
-
788
- this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
789
-
790
- _this.lgBusy = true;
791
-
792
- clearTimeout(_this.hideBartimeout);
793
-
794
- // Add title if this.s.appendSubHtmlTo === lg-sub-html
795
- if (this.s.appendSubHtmlTo === '.lg-sub-html') {
796
-
797
- // wait for slide animation to complete
798
- setTimeout(function() {
799
- _this.addHtml(index);
800
- }, _time);
801
- }
802
-
803
- this.arrowDisable(index);
804
-
805
- if (!direction) {
806
- if (index < _prevIndex) {
807
- direction = 'prev';
808
- } else if (index > _prevIndex) {
809
- direction = 'next';
810
- }
811
- }
812
-
813
- if (!fromTouch) {
814
-
815
- // remove all transitions
816
- _this.$outer.addClass('lg-no-trans');
817
-
818
- this.$slide.removeClass('lg-prev-slide lg-next-slide');
819
-
820
- if (direction === 'prev') {
821
-
822
- //prevslide
823
- this.$slide.eq(index).addClass('lg-prev-slide');
824
- this.$slide.eq(_prevIndex).addClass('lg-next-slide');
825
- } else {
826
-
827
- // next slide
828
- this.$slide.eq(index).addClass('lg-next-slide');
829
- this.$slide.eq(_prevIndex).addClass('lg-prev-slide');
830
- }
831
-
832
- // give 50 ms for browser to add/remove class
833
- setTimeout(function() {
834
- _this.$slide.removeClass('lg-current');
835
-
836
- //_this.$slide.eq(_prevIndex).removeClass('lg-current');
837
- _this.$slide.eq(index).addClass('lg-current');
838
-
839
- // reset all transitions
840
- _this.$outer.removeClass('lg-no-trans');
841
- }, 50);
842
- } else {
843
-
844
- this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide');
845
- var touchPrev;
846
- var touchNext;
847
- if (_length > 2) {
848
- touchPrev = index - 1;
849
- touchNext = index + 1;
850
-
851
- if ((index === 0) && (_prevIndex === _length - 1)) {
852
-
853
- // next slide
854
- touchNext = 0;
855
- touchPrev = _length - 1;
856
- } else if ((index === _length - 1) && (_prevIndex === 0)) {
857
-
858
- // prev slide
859
- touchNext = 0;
860
- touchPrev = _length - 1;
861
- }
862
-
863
- } else {
864
- touchPrev = 0;
865
- touchNext = 1;
866
- }
867
-
868
- if (direction === 'prev') {
869
- _this.$slide.eq(touchNext).addClass('lg-next-slide');
870
- } else {
871
- _this.$slide.eq(touchPrev).addClass('lg-prev-slide');
872
- }
873
-
874
- _this.$slide.eq(index).addClass('lg-current');
875
- }
876
-
877
- if (_this.lGalleryOn) {
878
- setTimeout(function() {
879
- _this.loadContent(index, true, 0);
880
- }, this.s.speed + 50);
881
-
882
- setTimeout(function() {
883
- _this.lgBusy = false;
884
- _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
885
- }, this.s.speed);
886
-
887
- } else {
888
- _this.loadContent(index, true, _this.s.backdropDuration);
889
-
890
- _this.lgBusy = false;
891
- _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
892
- }
893
-
894
- _this.lGalleryOn = true;
895
-
896
- if (this.s.counter) {
897
- $('#lg-counter-current').text(index + 1);
898
- }
899
-
900
- }
901
- _this.index = index;
902
-
903
- };
904
-
905
- /**
906
- * @desc Go to next slide
907
- * @param {Boolean} fromTouch - true if slide function called via touch event
908
- */
909
- Plugin.prototype.goToNextSlide = function(fromTouch) {
910
- var _this = this;
911
- var _loop = _this.s.loop;
912
- if (fromTouch && _this.$slide.length < 3) {
913
- _loop = false;
914
- }
915
-
916
- if (!_this.lgBusy) {
917
- if ((_this.index + 1) < _this.$slide.length) {
918
- _this.index++;
919
- _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
920
- _this.slide(_this.index, fromTouch, false, 'next');
921
- } else {
922
- if (_loop) {
923
- _this.index = 0;
924
- _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
925
- _this.slide(_this.index, fromTouch, false, 'next');
926
- } else if (_this.s.slideEndAnimatoin && !fromTouch) {
927
- _this.$outer.addClass('lg-right-end');
928
- setTimeout(function() {
929
- _this.$outer.removeClass('lg-right-end');
930
- }, 400);
931
- }
932
- }
933
- }
934
- };
935
-
936
- /**
937
- * @desc Go to previous slide
938
- * @param {Boolean} fromTouch - true if slide function called via touch event
939
- */
940
- Plugin.prototype.goToPrevSlide = function(fromTouch) {
941
- var _this = this;
942
- var _loop = _this.s.loop;
943
- if (fromTouch && _this.$slide.length < 3) {
944
- _loop = false;
945
- }
946
-
947
- if (!_this.lgBusy) {
948
- if (_this.index > 0) {
949
- _this.index--;
950
- _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
951
- _this.slide(_this.index, fromTouch, false, 'prev');
952
- } else {
953
- if (_loop) {
954
- _this.index = _this.$items.length - 1;
955
- _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
956
- _this.slide(_this.index, fromTouch, false, 'prev');
957
- } else if (_this.s.slideEndAnimatoin && !fromTouch) {
958
- _this.$outer.addClass('lg-left-end');
959
- setTimeout(function() {
960
- _this.$outer.removeClass('lg-left-end');
961
- }, 400);
962
- }
963
- }
964
- }
965
- };
966
-
967
- Plugin.prototype.keyPress = function() {
968
- var _this = this;
969
- if (this.$items.length > 1) {
970
- $(window).on('keyup.lg', function(e) {
971
- if (_this.$items.length > 1) {
972
- if (e.keyCode === 37) {
973
- e.preventDefault();
974
- _this.goToPrevSlide();
975
- }
976
-
977
- if (e.keyCode === 39) {
978
- e.preventDefault();
979
- _this.goToNextSlide();
980
- }
981
- }
982
- });
983
- }
984
-
985
- $(window).on('keydown.lg', function(e) {
986
- if (_this.s.escKey === true && e.keyCode === 27) {
987
- e.preventDefault();
988
- if (!_this.$outer.hasClass('lg-thumb-open')) {
989
- _this.destroy();
990
- } else {
991
- _this.$outer.removeClass('lg-thumb-open');
992
- }
993
- }
994
- });
995
- };
996
-
997
- Plugin.prototype.arrow = function() {
998
- var _this = this;
999
- this.$outer.find('.lg-prev').on('click.lg', function() {
1000
- _this.goToPrevSlide();
1001
- });
1002
-
1003
- this.$outer.find('.lg-next').on('click.lg', function() {
1004
- _this.goToNextSlide();
1005
- });
1006
- };
1007
-
1008
- Plugin.prototype.arrowDisable = function(index) {
1009
-
1010
- // Disable arrows if s.hideControlOnEnd is true
1011
- if (!this.s.loop && this.s.hideControlOnEnd) {
1012
- if ((index + 1) < this.$slide.length) {
1013
- this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled');
1014
- } else {
1015
- this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled');
1016
- }
1017
-
1018
- if (index > 0) {
1019
- this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled');
1020
- } else {
1021
- this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled');
1022
- }
1023
- }
1024
- };
1025
-
1026
- Plugin.prototype.setTranslate = function($el, xValue, yValue) {
1027
- // jQuery supports Automatic CSS prefixing since jQuery 1.8.0
1028
- if (this.s.useLeft) {
1029
- $el.css('left', xValue);
1030
- } else {
1031
- $el.css({
1032
- transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)'
1033
- });
1034
- }
1035
- };
1036
-
1037
- Plugin.prototype.touchMove = function(startCoords, endCoords) {
1038
-
1039
- var distance = endCoords - startCoords;
1040
-
1041
- if (Math.abs(distance) > 15) {
1042
- // reset opacity and transition duration
1043
- this.$outer.addClass('lg-dragging');
1044
-
1045
- // move current slide
1046
- this.setTranslate(this.$slide.eq(this.index), distance, 0);
1047
-
1048
- // move next and prev slide with current slide
1049
- this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0);
1050
- this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0);
1051
- }
1052
- };
1053
-
1054
- Plugin.prototype.touchEnd = function(distance) {
1055
- var _this = this;
1056
-
1057
- // keep slide animation for any mode while dragg/swipe
1058
- if (_this.s.mode !== 'lg-slide') {
1059
- _this.$outer.addClass('lg-slide');
1060
- }
1061
-
1062
- this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0');
1063
-
1064
- // set transition duration
1065
- setTimeout(function() {
1066
- _this.$outer.removeClass('lg-dragging');
1067
- if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
1068
- _this.goToNextSlide(true);
1069
- } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
1070
- _this.goToPrevSlide(true);
1071
- } else if (Math.abs(distance) < 5) {
1072
-
1073
- // Trigger click if distance is less than 5 pix
1074
- _this.$el.trigger('onSlideClick.lg');
1075
- }
1076
-
1077
- _this.$slide.removeAttr('style');
1078
- });
1079
-
1080
- // remove slide class once drag/swipe is completed if mode is not slide
1081
- setTimeout(function() {
1082
- if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') {
1083
- _this.$outer.removeClass('lg-slide');
1084
- }
1085
- }, _this.s.speed + 100);
1086
-
1087
- };
1088
-
1089
- Plugin.prototype.enableSwipe = function() {
1090
- var _this = this;
1091
- var startCoords = 0;
1092
- var endCoords = 0;
1093
- var isMoved = false;
1094
-
1095
- if (_this.s.enableSwipe && _this.doCss()) {
1096
-
1097
- _this.$slide.on('touchstart.lg', function(e) {
1098
- if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
1099
- e.preventDefault();
1100
- _this.manageSwipeClass();
1101
- startCoords = e.originalEvent.targetTouches[0].pageX;
1102
- }
1103
- });
1104
-
1105
- _this.$slide.on('touchmove.lg', function(e) {
1106
- if (!_this.$outer.hasClass('lg-zoomed')) {
1107
- e.preventDefault();
1108
- endCoords = e.originalEvent.targetTouches[0].pageX;
1109
- _this.touchMove(startCoords, endCoords);
1110
- isMoved = true;
1111
- }
1112
- });
1113
-
1114
- _this.$slide.on('touchend.lg', function() {
1115
- if (!_this.$outer.hasClass('lg-zoomed')) {
1116
- if (isMoved) {
1117
- isMoved = false;
1118
- _this.touchEnd(endCoords - startCoords);
1119
- } else {
1120
- _this.$el.trigger('onSlideClick.lg');
1121
- }
1122
- }
1123
- });
1124
- }
1125
-
1126
- };
1127
-
1128
- Plugin.prototype.enableDrag = function() {
1129
- var _this = this;
1130
- var startCoords = 0;
1131
- var endCoords = 0;
1132
- var isDraging = false;
1133
- var isMoved = false;
1134
- if (_this.s.enableDrag && _this.doCss()) {
1135
- _this.$slide.on('mousedown.lg', function(e) {
1136
- // execute only on .lg-object
1137
- if (!_this.$outer.hasClass('lg-zoomed')) {
1138
- if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
1139
- e.preventDefault();
1140
-
1141
- if (!_this.lgBusy) {
1142
- _this.manageSwipeClass();
1143
- startCoords = e.pageX;
1144
- isDraging = true;
1145
-
1146
- // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
1147
- _this.$outer.scrollLeft += 1;
1148
- _this.$outer.scrollLeft -= 1;
1149
-
1150
- // *
1151
-
1152
- _this.$outer.removeClass('lg-grab').addClass('lg-grabbing');
1153
-
1154
- _this.$el.trigger('onDragstart.lg');
1155
- }
1156
-
1157
- }
1158
- }
1159
- });
1160
-
1161
- $(window).on('mousemove.lg', function(e) {
1162
- if (isDraging) {
1163
- isMoved = true;
1164
- endCoords = e.pageX;
1165
- _this.touchMove(startCoords, endCoords);
1166
- _this.$el.trigger('onDragmove.lg');
1167
- }
1168
- });
1169
-
1170
- $(window).on('mouseup.lg', function(e) {
1171
- if (isMoved) {
1172
- isMoved = false;
1173
- _this.touchEnd(endCoords - startCoords);
1174
- _this.$el.trigger('onDragend.lg');
1175
- } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
1176
- _this.$el.trigger('onSlideClick.lg');
1177
- }
1178
-
1179
- // Prevent execution on click
1180
- if (isDraging) {
1181
- isDraging = false;
1182
- _this.$outer.removeClass('lg-grabbing').addClass('lg-grab');
1183
- }
1184
- });
1185
-
1186
- }
1187
- };
1188
-
1189
- Plugin.prototype.manageSwipeClass = function() {
1190
- var _touchNext = this.index + 1;
1191
- var _touchPrev = this.index - 1;
1192
- if (this.s.loop && this.$slide.length > 2) {
1193
- if (this.index === 0) {
1194
- _touchPrev = this.$slide.length - 1;
1195
- } else if (this.index === this.$slide.length - 1) {
1196
- _touchNext = 0;
1197
- }
1198
- }
1199
-
1200
- this.$slide.removeClass('lg-next-slide lg-prev-slide');
1201
- if (_touchPrev > -1) {
1202
- this.$slide.eq(_touchPrev).addClass('lg-prev-slide');
1203
- }
1204
-
1205
- this.$slide.eq(_touchNext).addClass('lg-next-slide');
1206
- };
1207
-
1208
- Plugin.prototype.mousewheel = function() {
1209
- var _this = this;
1210
- _this.$outer.on('mousewheel.lg', function(e) {
1211
-
1212
- if (!e.deltaY) {
1213
- return;
1214
- }
1215
-
1216
- if (e.deltaY > 0) {
1217
- _this.goToPrevSlide();
1218
- } else {
1219
- _this.goToNextSlide();
1220
- }
1221
-
1222
- e.preventDefault();
1223
- });
1224
-
1225
- };
1226
-
1227
- Plugin.prototype.closeGallery = function() {
1228
-
1229
- var _this = this;
1230
- var mousedown = false;
1231
- this.$outer.find('.lg-close').on('click.lg', function() {
1232
- _this.destroy();
1233
- });
1234
-
1235
- if (_this.s.closable) {
1236
-
1237
- // If you drag the slide and release outside gallery gets close on chrome
1238
- // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer
1239
- _this.$outer.on('mousedown.lg', function(e) {
1240
-
1241
- if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) {
1242
- mousedown = true;
1243
- } else {
1244
- mousedown = false;
1245
- }
1246
-
1247
- });
1248
-
1249
- _this.$outer.on('mouseup.lg', function(e) {
1250
-
1251
- if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) {
1252
- if (!_this.$outer.hasClass('lg-dragging')) {
1253
- _this.destroy();
1254
- }
1255
- }
1256
-
1257
- });
1258
-
1259
- }
1260
-
1261
- };
1262
-
1263
- Plugin.prototype.destroy = function(d) {
1264
-
1265
- var _this = this;
1266
-
1267
- if (!d) {
1268
- _this.$el.trigger('onBeforeClose.lg');
1269
- $(window).scrollTop(_this.prevScrollTop);
1270
- }
1271
-
1272
-
1273
- /**
1274
- * if d is false or undefined destroy will only close the gallery
1275
- * plugins instance remains with the element
1276
- *
1277
- * if d is true destroy will completely remove the plugin
1278
- */
1279
-
1280
- if (d) {
1281
- if (!_this.s.dynamic) {
1282
- // only when not using dynamic mode is $items a jquery collection
1283
- this.$items.off('click.lg click.lgcustom');
1284
- }
1285
-
1286
- $.removeData(_this.el, 'lightGallery');
1287
- }
1288
-
1289
- // Unbind all events added by lightGallery
1290
- this.$el.off('.lg.tm');
1291
-
1292
- // Distroy all lightGallery modules
1293
- $.each($.fn.lightGallery.modules, function(key) {
1294
- if (_this.modules[key]) {
1295
- _this.modules[key].destroy();
1296
- }
1297
- });
1298
-
1299
- this.lGalleryOn = false;
1300
-
1301
- clearTimeout(_this.hideBartimeout);
1302
- this.hideBartimeout = false;
1303
- $(window).off('.lg');
1304
- $('body').removeClass('lg-on lg-from-hash');
1305
-
1306
- if (_this.$outer) {
1307
- _this.$outer.removeClass('lg-visible');
1308
- }
1309
-
1310
- $('.lg-backdrop').removeClass('in');
1311
-
1312
- setTimeout(function() {
1313
- if (_this.$outer) {
1314
- _this.$outer.remove();
1315
- }
1316
-
1317
- $('.lg-backdrop').remove();
1318
-
1319
- if (!d) {
1320
- _this.$el.trigger('onCloseAfter.lg');
1321
- }
1322
-
1323
- }, _this.s.backdropDuration + 50);
1324
- };
1325
-
1326
- $.fn.lightGallery = function(options) {
1327
- return this.each(function() {
1328
- if (!$.data(this, 'lightGallery')) {
1329
- $.data(this, 'lightGallery', new Plugin(this, options));
1330
- } else {
1331
- try {
1332
- $(this).data('lightGallery').init();
1333
- } catch (err) {
1334
- console.error('lightGallery has not initiated properly');
1335
- }
1336
- }
1337
- });
1338
- };
1339
-
1340
- $.fn.lightGallery.modules = {};
1341
-
1342
- })();