phcthemes_admin_panel_pack 4.0.7 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +2 -0
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcthemes_admin_panel_pack_manifest.js +9 -9
  6. data/app/assets/javascripts/common/backstretch/jquery.backstretch.js +1602 -1602
  7. data/app/assets/javascripts/common/bootstrap/bootstrap.bundle.js +7023 -7023
  8. data/app/assets/javascripts/common/bootstrap/bootstrap.three.js +2377 -2377
  9. data/app/assets/javascripts/common/bootstrap-datepicker/bootstrap-datepicker.js +2039 -2039
  10. data/app/assets/javascripts/common/bootstrap-markdown/bootstrap-markdown.js +1390 -1390
  11. data/app/assets/javascripts/common/bootstrap-select/bootstrap-select.js +0 -0
  12. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js +0 -0
  13. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js.map +0 -0
  14. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.min.js +7 -7
  15. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js +0 -0
  16. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js.map +0 -0
  17. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.min.js +7 -7
  18. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js +0 -0
  19. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js.map +0 -0
  20. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.min.js +7 -7
  21. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js +0 -0
  22. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js.map +0 -0
  23. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.min.js +7 -7
  24. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js +0 -0
  25. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js.map +0 -0
  26. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.min.js +7 -7
  27. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js +0 -0
  28. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js.map +0 -0
  29. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.min.js +7 -7
  30. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js +0 -0
  31. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js.map +0 -0
  32. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.min.js +7 -7
  33. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js +0 -0
  34. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js.map +0 -0
  35. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.min.js +7 -7
  36. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js +0 -0
  37. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js.map +0 -0
  38. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.min.js +7 -7
  39. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js +0 -0
  40. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js.map +0 -0
  41. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.min.js +7 -7
  42. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js +0 -0
  43. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js.map +0 -0
  44. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.min.js +7 -7
  45. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js +0 -0
  46. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js.map +0 -0
  47. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.min.js +7 -7
  48. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js +0 -0
  49. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js.map +0 -0
  50. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.min.js +7 -7
  51. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js +0 -0
  52. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js.map +0 -0
  53. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.min.js +7 -7
  54. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js +0 -0
  55. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js.map +0 -0
  56. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.min.js +7 -7
  57. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js +0 -0
  58. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js.map +0 -0
  59. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.min.js +7 -7
  60. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js +0 -0
  61. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js.map +0 -0
  62. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.min.js +7 -7
  63. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js +0 -0
  64. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js.map +0 -0
  65. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.min.js +7 -7
  66. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js +0 -0
  67. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js.map +0 -0
  68. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.min.js +7 -7
  69. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js +0 -0
  70. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js.map +0 -0
  71. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.min.js +7 -7
  72. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js +0 -0
  73. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js.map +0 -0
  74. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.min.js +7 -7
  75. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js +0 -0
  76. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js.map +0 -0
  77. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.min.js +7 -7
  78. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js +0 -0
  79. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js.map +0 -0
  80. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.min.js +7 -7
  81. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js +0 -0
  82. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js.map +0 -0
  83. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.min.js +7 -7
  84. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js +0 -0
  85. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js.map +0 -0
  86. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.min.js +7 -7
  87. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js +0 -0
  88. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js.map +0 -0
  89. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.min.js +7 -7
  90. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js +0 -0
  91. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js.map +0 -0
  92. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.min.js +7 -7
  93. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js +0 -0
  94. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js.map +0 -0
  95. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.min.js +7 -7
  96. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js +0 -0
  97. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js.map +0 -0
  98. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.min.js +7 -7
  99. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js +0 -0
  100. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js.map +0 -0
  101. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.min.js +7 -7
  102. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js +0 -0
  103. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js.map +0 -0
  104. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.min.js +7 -7
  105. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js +0 -0
  106. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js.map +0 -0
  107. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.min.js +7 -7
  108. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js +0 -0
  109. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js.map +0 -0
  110. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.min.js +7 -7
  111. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js +0 -0
  112. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js.map +0 -0
  113. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.min.js +7 -7
  114. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js +0 -0
  115. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js.map +0 -0
  116. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.min.js +7 -7
  117. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js +0 -0
  118. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js.map +0 -0
  119. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.min.js +7 -7
  120. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js +0 -0
  121. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js.map +0 -0
  122. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.min.js +7 -7
  123. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js +0 -0
  124. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js.map +0 -0
  125. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.min.js +7 -7
  126. data/app/assets/javascripts/common/chartjs/chart.js +0 -0
  127. data/app/assets/javascripts/common/ckeditor/ckeditor.js +6 -6
  128. data/app/assets/javascripts/common/ckeditor/ckeditor.js.map +0 -0
  129. data/app/assets/javascripts/common/ckeditor/translations/af.js +0 -0
  130. data/app/assets/javascripts/common/ckeditor/translations/ar.js +0 -0
  131. data/app/assets/javascripts/common/ckeditor/translations/ast.js +0 -0
  132. data/app/assets/javascripts/common/ckeditor/translations/az.js +0 -0
  133. data/app/assets/javascripts/common/ckeditor/translations/bg.js +0 -0
  134. data/app/assets/javascripts/common/ckeditor/translations/ca.js +0 -0
  135. data/app/assets/javascripts/common/ckeditor/translations/cs.js +0 -0
  136. data/app/assets/javascripts/common/ckeditor/translations/da.js +0 -0
  137. data/app/assets/javascripts/common/ckeditor/translations/de-ch.js +0 -0
  138. data/app/assets/javascripts/common/ckeditor/translations/de.js +0 -0
  139. data/app/assets/javascripts/common/ckeditor/translations/el.js +0 -0
  140. data/app/assets/javascripts/common/ckeditor/translations/en-au.js +0 -0
  141. data/app/assets/javascripts/common/ckeditor/translations/en-gb.js +0 -0
  142. data/app/assets/javascripts/common/ckeditor/translations/eo.js +0 -0
  143. data/app/assets/javascripts/common/ckeditor/translations/es.js +0 -0
  144. data/app/assets/javascripts/common/ckeditor/translations/et.js +0 -0
  145. data/app/assets/javascripts/common/ckeditor/translations/eu.js +0 -0
  146. data/app/assets/javascripts/common/ckeditor/translations/fa.js +0 -0
  147. data/app/assets/javascripts/common/ckeditor/translations/fi.js +0 -0
  148. data/app/assets/javascripts/common/ckeditor/translations/fr.js +0 -0
  149. data/app/assets/javascripts/common/ckeditor/translations/gl.js +0 -0
  150. data/app/assets/javascripts/common/ckeditor/translations/gu.js +0 -0
  151. data/app/assets/javascripts/common/ckeditor/translations/he.js +0 -0
  152. data/app/assets/javascripts/common/ckeditor/translations/hr.js +0 -0
  153. data/app/assets/javascripts/common/ckeditor/translations/hu.js +0 -0
  154. data/app/assets/javascripts/common/ckeditor/translations/id.js +0 -0
  155. data/app/assets/javascripts/common/ckeditor/translations/it.js +0 -0
  156. data/app/assets/javascripts/common/ckeditor/translations/ja.js +0 -0
  157. data/app/assets/javascripts/common/ckeditor/translations/km.js +0 -0
  158. data/app/assets/javascripts/common/ckeditor/translations/kn.js +0 -0
  159. data/app/assets/javascripts/common/ckeditor/translations/ko.js +0 -0
  160. data/app/assets/javascripts/common/ckeditor/translations/ku.js +0 -0
  161. data/app/assets/javascripts/common/ckeditor/translations/lt.js +0 -0
  162. data/app/assets/javascripts/common/ckeditor/translations/lv.js +0 -0
  163. data/app/assets/javascripts/common/ckeditor/translations/nb.js +0 -0
  164. data/app/assets/javascripts/common/ckeditor/translations/ne.js +0 -0
  165. data/app/assets/javascripts/common/ckeditor/translations/nl.js +0 -0
  166. data/app/assets/javascripts/common/ckeditor/translations/no.js +0 -0
  167. data/app/assets/javascripts/common/ckeditor/translations/oc.js +0 -0
  168. data/app/assets/javascripts/common/ckeditor/translations/pl.js +0 -0
  169. data/app/assets/javascripts/common/ckeditor/translations/pt-br.js +0 -0
  170. data/app/assets/javascripts/common/ckeditor/translations/pt.js +0 -0
  171. data/app/assets/javascripts/common/ckeditor/translations/ro.js +0 -0
  172. data/app/assets/javascripts/common/ckeditor/translations/ru.js +0 -0
  173. data/app/assets/javascripts/common/ckeditor/translations/si.js +0 -0
  174. data/app/assets/javascripts/common/ckeditor/translations/sk.js +0 -0
  175. data/app/assets/javascripts/common/ckeditor/translations/sl.js +0 -0
  176. data/app/assets/javascripts/common/ckeditor/translations/sq.js +0 -0
  177. data/app/assets/javascripts/common/ckeditor/translations/sr-latn.js +0 -0
  178. data/app/assets/javascripts/common/ckeditor/translations/sr.js +0 -0
  179. data/app/assets/javascripts/common/ckeditor/translations/sv.js +0 -0
  180. data/app/assets/javascripts/common/ckeditor/translations/th.js +0 -0
  181. data/app/assets/javascripts/common/ckeditor/translations/tr.js +0 -0
  182. data/app/assets/javascripts/common/ckeditor/translations/tt.js +0 -0
  183. data/app/assets/javascripts/common/ckeditor/translations/ug.js +0 -0
  184. data/app/assets/javascripts/common/ckeditor/translations/uk.js +0 -0
  185. data/app/assets/javascripts/common/ckeditor/translations/vi.js +0 -0
  186. data/app/assets/javascripts/common/ckeditor/translations/zh-cn.js +0 -0
  187. data/app/assets/javascripts/common/ckeditor/translations/zh.js +0 -0
  188. data/app/assets/javascripts/common/clipboardjs/clipboard.js +977 -977
  189. data/app/assets/javascripts/common/covervid/covervid.js +94 -94
  190. data/app/assets/javascripts/common/custom/custom.js +0 -0
  191. data/app/assets/javascripts/common/datatables/datatables.js +15310 -15310
  192. data/app/assets/javascripts/common/daterangepicker/daterangepicker.js +1565 -1565
  193. data/app/assets/javascripts/common/fastclick/fastclick.js +841 -841
  194. data/app/assets/javascripts/common/flexslider/jquery.flexslider.js +1252 -1252
  195. data/app/assets/javascripts/common/greenstock/greensock.js +35 -35
  196. data/app/assets/javascripts/common/html5sortable/jquery.sortable.js +98 -98
  197. data/app/assets/javascripts/common/icheck/icheck.js +509 -509
  198. data/app/assets/javascripts/common/imagesloaded/imagesloaded.pkgd.js +497 -497
  199. data/app/assets/javascripts/common/isotope/isotope.pkgd.js +3563 -3563
  200. data/app/assets/javascripts/common/jquery/jquery-3.4.1.js +10598 -10598
  201. data/app/assets/javascripts/common/jquery-countdown/jquery.countdown.js +245 -245
  202. data/app/assets/javascripts/common/jquery-filterizer/jquery.filterizr.min.js +0 -0
  203. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.autogrow.js +37 -37
  204. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.charcounter.js +53 -53
  205. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.checkbox.js +54 -54
  206. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.datepicker.js +59 -59
  207. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.js +823 -823
  208. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.masked.js +46 -46
  209. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.time.js +71 -71
  210. data/app/assets/javascripts/common/jquery-jvectormap/jquery-jvectormap.js +44 -44
  211. data/app/assets/javascripts/common/jquery-placeholder/jquery.placeholder.js +281 -281
  212. data/app/assets/javascripts/common/jquery-slimscroll/jquery.slimscroll.js +474 -474
  213. data/app/assets/javascripts/common/jquery-sparkline/jquery.sparkline.js +3054 -3054
  214. data/app/assets/javascripts/common/jquery-ui/jquery-ui.js +18705 -18705
  215. data/app/assets/javascripts/common/jquery-validation/jquery.validate.js +0 -0
  216. data/app/assets/javascripts/common/jqvmap/jquery.vmap.js +1281 -1281
  217. data/app/assets/javascripts/common/jqvmap/jquery.vmap.min.js +9 -9
  218. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.africa.js +2 -2
  219. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.asia.js +2 -2
  220. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.australia.js +2 -2
  221. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.europe.js +2 -2
  222. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -2
  223. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -2
  224. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.algeria.js +2 -2
  225. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.argentina.js +1 -1
  226. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.brazil.js +2 -2
  227. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.canada.js +1 -1
  228. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.europe.js +2 -2
  229. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.france.js +1 -1
  230. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.germany.js +2 -2
  231. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.greece.js +1 -1
  232. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iran.js +6 -6
  233. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iraq.js +1 -1
  234. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.russia.js +2 -2
  235. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.tunisia.js +2 -2
  236. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.turkey.js +11 -11
  237. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.usa.js +2 -2
  238. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.world.js +2 -2
  239. data/app/assets/javascripts/common/js-cookie/js.cookie.js +165 -165
  240. data/app/assets/javascripts/common/layerslider/layerslider.kreaturamedia.jquery.js +12 -12
  241. data/app/assets/javascripts/common/layerslider/layerslider.origami.js +12 -12
  242. data/app/assets/javascripts/common/layerslider/layerslider.timeline.js +12 -12
  243. data/app/assets/javascripts/common/layerslider/layerslider.transitions.js +12 -12
  244. data/app/assets/javascripts/common/lazysizes/lazysizes.js +754 -754
  245. data/app/assets/javascripts/common/leaflet/leaflet.js +4 -4
  246. data/app/assets/javascripts/common/magnific-popup/jquery.magnific-popup.js +1859 -1859
  247. data/app/assets/javascripts/common/mapbox/mapbox.js +51 -51
  248. data/app/assets/javascripts/common/metismenu/metisMenu.js +340 -340
  249. data/app/assets/javascripts/common/moderizer/modernizr.js +11 -11
  250. data/app/assets/javascripts/common/nouislider/nouislider.js +2637 -2637
  251. data/app/assets/javascripts/common/owl-carousel/owl.carousel.js +3448 -3448
  252. data/app/assets/javascripts/common/pace/pace.js +935 -935
  253. data/app/assets/javascripts/common/paroller/jquery.paroller.js +228 -228
  254. data/app/assets/javascripts/common/particlejs/particles.js +1540 -1540
  255. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.common.js +1318 -1318
  256. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.esm.js +1316 -1316
  257. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.js +1324 -1324
  258. data/app/assets/javascripts/common/plyr/plyr.js +9137 -9137
  259. data/app/assets/javascripts/common/rangeslider/rangeslider.js +498 -498
  260. data/app/assets/javascripts/common/retina/retina.js +100 -100
  261. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.actions.js +0 -0
  262. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.carousel.js +0 -0
  263. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.kenburn.js +0 -0
  264. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.layeranimation.js +0 -0
  265. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.migration.js +0 -0
  266. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.navigation.js +0 -0
  267. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.parallax.js +0 -0
  268. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.slideanims.js +0 -0
  269. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.video.js +0 -0
  270. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.revolution.js +0 -0
  271. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.tools.min.js +0 -0
  272. data/app/assets/javascripts/common/scrollme/jquery.scrollme.js +455 -455
  273. data/app/assets/javascripts/common/scrollup/jquery.scrollUp.js +168 -168
  274. data/app/assets/javascripts/common/select2/select2.full.js +6597 -6597
  275. data/app/assets/javascripts/common/selectbox/jquery.selectBox.js +1091 -1091
  276. data/app/assets/javascripts/common/slick/slick.js +3004 -3004
  277. data/app/assets/javascripts/common/smooth-scroll/SmoothScroll.js +788 -788
  278. data/app/assets/javascripts/common/spectrum/spectrum.js +2323 -2323
  279. data/app/assets/javascripts/common/stepper/jquery.fs.stepper.js +339 -339
  280. data/app/assets/javascripts/common/swiper/swiper.js +8124 -8124
  281. data/app/assets/javascripts/common/toaster/toastr.js +476 -476
  282. data/app/assets/javascripts/common/typed/typed.js +1044 -1044
  283. data/app/assets/javascripts/common/visable/jquery.visible.js +68 -68
  284. data/app/assets/javascripts/common/waypoints/jquery.waypoints.js +661 -661
  285. data/app/assets/javascripts/common/wow/wow.js +508 -508
  286. data/app/assets/javascripts/phcthemes_admin_panel_pack_adminlte.js +12 -12
  287. data/app/assets/javascripts/phcthemes_admin_panel_pack_boomerang.js +0 -0
  288. data/app/assets/javascripts/phcthemes_admin_panel_pack_coloradmin.js +5 -5
  289. data/app/assets/javascripts/phcthemes_admin_panel_pack_inspinia.js +10 -10
  290. data/app/assets/javascripts/phcthemes_admin_panel_pack_metronic.js +6 -6
  291. data/app/assets/javascripts/phcthemes_admin_panel_pack_quilpro.js +5 -5
  292. data/app/assets/javascripts/phcthemes_admin_panel_pack_starlight.js +5 -5
  293. data/app/assets/javascripts/themes/adminlte/theme/adminlte.js +1141 -1141
  294. data/app/assets/javascripts/themes/coloradmin/theme/color_admin_app.min.js +0 -0
  295. data/app/assets/javascripts/themes/coloradmin/theme/color_admin_default.js +0 -0
  296. data/app/assets/javascripts/themes/inspinia/theme/inspinia.js +279 -279
  297. data/app/assets/javascripts/themes/metronic/theme/plugins.bundle.js +0 -0
  298. data/app/assets/javascripts/themes/metronic/theme/prismjs.bundle.js +1922 -1922
  299. data/app/assets/javascripts/themes/metronic/theme/scripts.bundle.js +0 -0
  300. data/app/assets/javascripts/themes/metronic/theme/widgets.js +0 -0
  301. data/app/assets/stylesheets/common/hanna_hearts/hanna_hearts.scss +0 -0
  302. data/app/assets/stylesheets/phcthemes_admin_panel_pack_adminlte.scss +16 -16
  303. data/app/assets/stylesheets/phcthemes_admin_panel_pack_boomerang.scss +27 -27
  304. data/app/assets/stylesheets/phcthemes_admin_panel_pack_coloradmin.scss +11 -11
  305. data/app/assets/stylesheets/phcthemes_admin_panel_pack_inspinia.scss +18 -18
  306. data/app/assets/stylesheets/phcthemes_admin_panel_pack_metronic.scss +15 -15
  307. data/app/assets/stylesheets/phcthemes_admin_panel_pack_quilpro.scss +19 -19
  308. data/app/assets/stylesheets/phcthemes_admin_panel_pack_starlight.scss +15 -15
  309. data/lib/phcthemes_admin_panel_pack/engine.rb +20 -20
  310. data/lib/phcthemes_admin_panel_pack/version.rb +3 -3
  311. data/lib/phcthemes_admin_panel_pack.rb +6 -6
  312. data/lib/tasks/phcthemes_admin_panel_pack_tasks.rake +4 -4
  313. metadata +3 -3
@@ -1,754 +1,754 @@
1
- (function(window, factory) {
2
- var lazySizes = factory(window, window.document, Date);
3
- window.lazySizes = lazySizes;
4
- if(typeof module == 'object' && module.exports){
5
- module.exports = lazySizes;
6
- }
7
- }(typeof window != 'undefined' ?
8
- window : {}, function l(window, document, Date) { // Pass in the windoe Date function also for SSR because the Date class can be lost
9
- 'use strict';
10
- /*jshint eqnull:true */
11
-
12
- var lazysizes, lazySizesCfg;
13
-
14
- (function(){
15
- var prop;
16
-
17
- var lazySizesDefaults = {
18
- lazyClass: 'lazyload',
19
- loadedClass: 'lazyloaded',
20
- loadingClass: 'lazyloading',
21
- preloadClass: 'lazypreload',
22
- errorClass: 'lazyerror',
23
- //strictClass: 'lazystrict',
24
- autosizesClass: 'lazyautosizes',
25
- srcAttr: 'data-src',
26
- srcsetAttr: 'data-srcset',
27
- sizesAttr: 'data-sizes',
28
- //preloadAfterLoad: false,
29
- minSize: 40,
30
- customMedia: {},
31
- init: true,
32
- expFactor: 1.5,
33
- hFac: 0.8,
34
- loadMode: 2,
35
- loadHidden: true,
36
- ricTimeout: 0,
37
- throttleDelay: 125,
38
- };
39
-
40
- lazySizesCfg = window.lazySizesConfig || window.lazysizesConfig || {};
41
-
42
- for(prop in lazySizesDefaults){
43
- if(!(prop in lazySizesCfg)){
44
- lazySizesCfg[prop] = lazySizesDefaults[prop];
45
- }
46
- }
47
- })();
48
-
49
- if (!document || !document.getElementsByClassName) {
50
- return {
51
- init: function () {},
52
- cfg: lazySizesCfg,
53
- noSupport: true,
54
- };
55
- }
56
-
57
- var docElem = document.documentElement;
58
-
59
- var supportPicture = window.HTMLPictureElement;
60
-
61
- var _addEventListener = 'addEventListener';
62
-
63
- var _getAttribute = 'getAttribute';
64
-
65
- /**
66
- * Update to bind to window because 'this' becomes null during SSR
67
- * builds.
68
- */
69
- var addEventListener = window[_addEventListener].bind(window);
70
-
71
- var setTimeout = window.setTimeout;
72
-
73
- var requestAnimationFrame = window.requestAnimationFrame || setTimeout;
74
-
75
- var requestIdleCallback = window.requestIdleCallback;
76
-
77
- var regPicture = /^picture$/i;
78
-
79
- var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];
80
-
81
- var regClassCache = {};
82
-
83
- var forEach = Array.prototype.forEach;
84
-
85
- var hasClass = function(ele, cls) {
86
- if(!regClassCache[cls]){
87
- regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
88
- }
89
- return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls];
90
- };
91
-
92
- var addClass = function(ele, cls) {
93
- if (!hasClass(ele, cls)){
94
- ele.setAttribute('class', (ele[_getAttribute]('class') || '').trim() + ' ' + cls);
95
- }
96
- };
97
-
98
- var removeClass = function(ele, cls) {
99
- var reg;
100
- if ((reg = hasClass(ele,cls))) {
101
- ele.setAttribute('class', (ele[_getAttribute]('class') || '').replace(reg, ' '));
102
- }
103
- };
104
-
105
- var addRemoveLoadEvents = function(dom, fn, add){
106
- var action = add ? _addEventListener : 'removeEventListener';
107
- if(add){
108
- addRemoveLoadEvents(dom, fn);
109
- }
110
- loadEvents.forEach(function(evt){
111
- dom[action](evt, fn);
112
- });
113
- };
114
-
115
- var triggerEvent = function(elem, name, detail, noBubbles, noCancelable){
116
- var event = document.createEvent('Event');
117
-
118
- if(!detail){
119
- detail = {};
120
- }
121
-
122
- detail.instance = lazysizes;
123
-
124
- event.initEvent(name, !noBubbles, !noCancelable);
125
-
126
- event.detail = detail;
127
-
128
- elem.dispatchEvent(event);
129
- return event;
130
- };
131
-
132
- var updatePolyfill = function (el, full){
133
- var polyfill;
134
- if( !supportPicture && ( polyfill = (window.picturefill || lazySizesCfg.pf) ) ){
135
- if(full && full.src && !el[_getAttribute]('srcset')){
136
- el.setAttribute('srcset', full.src);
137
- }
138
- polyfill({reevaluate: true, elements: [el]});
139
- } else if(full && full.src){
140
- el.src = full.src;
141
- }
142
- };
143
-
144
- var getCSS = function (elem, style){
145
- return (getComputedStyle(elem, null) || {})[style];
146
- };
147
-
148
- var getWidth = function(elem, parent, width){
149
- width = width || elem.offsetWidth;
150
-
151
- while(width < lazySizesCfg.minSize && parent && !elem._lazysizesWidth){
152
- width = parent.offsetWidth;
153
- parent = parent.parentNode;
154
- }
155
-
156
- return width;
157
- };
158
-
159
- var rAF = (function(){
160
- var running, waiting;
161
- var firstFns = [];
162
- var secondFns = [];
163
- var fns = firstFns;
164
-
165
- var run = function(){
166
- var runFns = fns;
167
-
168
- fns = firstFns.length ? secondFns : firstFns;
169
-
170
- running = true;
171
- waiting = false;
172
-
173
- while(runFns.length){
174
- runFns.shift()();
175
- }
176
-
177
- running = false;
178
- };
179
-
180
- var rafBatch = function(fn, queue){
181
- if(running && !queue){
182
- fn.apply(this, arguments);
183
- } else {
184
- fns.push(fn);
185
-
186
- if(!waiting){
187
- waiting = true;
188
- (document.hidden ? setTimeout : requestAnimationFrame)(run);
189
- }
190
- }
191
- };
192
-
193
- rafBatch._lsFlush = run;
194
-
195
- return rafBatch;
196
- })();
197
-
198
- var rAFIt = function(fn, simple){
199
- return simple ?
200
- function() {
201
- rAF(fn);
202
- } :
203
- function(){
204
- var that = this;
205
- var args = arguments;
206
- rAF(function(){
207
- fn.apply(that, args);
208
- });
209
- }
210
- ;
211
- };
212
-
213
- var throttle = function(fn){
214
- var running;
215
- var lastTime = 0;
216
- var gDelay = lazySizesCfg.throttleDelay;
217
- var rICTimeout = lazySizesCfg.ricTimeout;
218
- var run = function(){
219
- running = false;
220
- lastTime = Date.now();
221
- fn();
222
- };
223
- var idleCallback = requestIdleCallback && rICTimeout > 49 ?
224
- function(){
225
- requestIdleCallback(run, {timeout: rICTimeout});
226
-
227
- if(rICTimeout !== lazySizesCfg.ricTimeout){
228
- rICTimeout = lazySizesCfg.ricTimeout;
229
- }
230
- } :
231
- rAFIt(function(){
232
- setTimeout(run);
233
- }, true)
234
- ;
235
-
236
- return function(isPriority){
237
- var delay;
238
-
239
- if((isPriority = isPriority === true)){
240
- rICTimeout = 33;
241
- }
242
-
243
- if(running){
244
- return;
245
- }
246
-
247
- running = true;
248
-
249
- delay = gDelay - (Date.now() - lastTime);
250
-
251
- if(delay < 0){
252
- delay = 0;
253
- }
254
-
255
- if(isPriority || delay < 9){
256
- idleCallback();
257
- } else {
258
- setTimeout(idleCallback, delay);
259
- }
260
- };
261
- };
262
-
263
- //based on http://modernjavascript.blogspot.de/2013/08/building-better-debounce.html
264
- var debounce = function(func) {
265
- var timeout, timestamp;
266
- var wait = 99;
267
- var run = function(){
268
- timeout = null;
269
- func();
270
- };
271
- var later = function() {
272
- var last = Date.now() - timestamp;
273
-
274
- if (last < wait) {
275
- setTimeout(later, wait - last);
276
- } else {
277
- (requestIdleCallback || run)(run);
278
- }
279
- };
280
-
281
- return function() {
282
- timestamp = Date.now();
283
-
284
- if (!timeout) {
285
- timeout = setTimeout(later, wait);
286
- }
287
- };
288
- };
289
-
290
- var loader = (function(){
291
- var preloadElems, isCompleted, resetPreloadingTimer, loadMode, started;
292
-
293
- var eLvW, elvH, eLtop, eLleft, eLright, eLbottom, isBodyHidden;
294
-
295
- var regImg = /^img$/i;
296
- var regIframe = /^iframe$/i;
297
-
298
- var supportScroll = ('onscroll' in window) && !(/(gle|ing)bot/.test(navigator.userAgent));
299
-
300
- var shrinkExpand = 0;
301
- var currentExpand = 0;
302
-
303
- var isLoading = 0;
304
- var lowRuns = -1;
305
-
306
- var resetPreloading = function(e){
307
- isLoading--;
308
- if(!e || isLoading < 0 || !e.target){
309
- isLoading = 0;
310
- }
311
- };
312
-
313
- var isVisible = function (elem) {
314
- if (isBodyHidden == null) {
315
- isBodyHidden = getCSS(document.body, 'visibility') == 'hidden';
316
- }
317
-
318
- return isBodyHidden || !(getCSS(elem.parentNode, 'visibility') == 'hidden' && getCSS(elem, 'visibility') == 'hidden');
319
- };
320
-
321
- var isNestedVisible = function(elem, elemExpand){
322
- var outerRect;
323
- var parent = elem;
324
- var visible = isVisible(elem);
325
-
326
- eLtop -= elemExpand;
327
- eLbottom += elemExpand;
328
- eLleft -= elemExpand;
329
- eLright += elemExpand;
330
-
331
- while(visible && (parent = parent.offsetParent) && parent != document.body && parent != docElem){
332
- visible = ((getCSS(parent, 'opacity') || 1) > 0);
333
-
334
- if(visible && getCSS(parent, 'overflow') != 'visible'){
335
- outerRect = parent.getBoundingClientRect();
336
- visible = eLright > outerRect.left &&
337
- eLleft < outerRect.right &&
338
- eLbottom > outerRect.top - 1 &&
339
- eLtop < outerRect.bottom + 1
340
- ;
341
- }
342
- }
343
-
344
- return visible;
345
- };
346
-
347
- var checkElements = function() {
348
- var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal,
349
- beforeExpandVal, defaultExpand, preloadExpand, hFac;
350
- var lazyloadElems = lazysizes.elements;
351
-
352
- if((loadMode = lazySizesCfg.loadMode) && isLoading < 8 && (eLlen = lazyloadElems.length)){
353
-
354
- i = 0;
355
-
356
- lowRuns++;
357
-
358
- for(; i < eLlen; i++){
359
-
360
- if(!lazyloadElems[i] || lazyloadElems[i]._lazyRace){continue;}
361
-
362
- if(!supportScroll || (lazysizes.prematureUnveil && lazysizes.prematureUnveil(lazyloadElems[i]))){unveilElement(lazyloadElems[i]);continue;}
363
-
364
- if(!(elemExpandVal = lazyloadElems[i][_getAttribute]('data-expand')) || !(elemExpand = elemExpandVal * 1)){
365
- elemExpand = currentExpand;
366
- }
367
-
368
- if (!defaultExpand) {
369
- defaultExpand = (!lazySizesCfg.expand || lazySizesCfg.expand < 1) ?
370
- docElem.clientHeight > 500 && docElem.clientWidth > 500 ? 500 : 370 :
371
- lazySizesCfg.expand;
372
-
373
- lazysizes._defEx = defaultExpand;
374
-
375
- preloadExpand = defaultExpand * lazySizesCfg.expFactor;
376
- hFac = lazySizesCfg.hFac;
377
- isBodyHidden = null;
378
-
379
- if(currentExpand < preloadExpand && isLoading < 1 && lowRuns > 2 && loadMode > 2 && !document.hidden){
380
- currentExpand = preloadExpand;
381
- lowRuns = 0;
382
- } else if(loadMode > 1 && lowRuns > 1 && isLoading < 6){
383
- currentExpand = defaultExpand;
384
- } else {
385
- currentExpand = shrinkExpand;
386
- }
387
- }
388
-
389
- if(beforeExpandVal !== elemExpand){
390
- eLvW = innerWidth + (elemExpand * hFac);
391
- elvH = innerHeight + elemExpand;
392
- elemNegativeExpand = elemExpand * -1;
393
- beforeExpandVal = elemExpand;
394
- }
395
-
396
- rect = lazyloadElems[i].getBoundingClientRect();
397
-
398
- if ((eLbottom = rect.bottom) >= elemNegativeExpand &&
399
- (eLtop = rect.top) <= elvH &&
400
- (eLright = rect.right) >= elemNegativeExpand * hFac &&
401
- (eLleft = rect.left) <= eLvW &&
402
- (eLbottom || eLright || eLleft || eLtop) &&
403
- (lazySizesCfg.loadHidden || isVisible(lazyloadElems[i])) &&
404
- ((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
405
- unveilElement(lazyloadElems[i]);
406
- loadedSomething = true;
407
- if(isLoading > 9){break;}
408
- } else if(!loadedSomething && isCompleted && !autoLoadElem &&
409
- isLoading < 4 && lowRuns < 4 && loadMode > 2 &&
410
- (preloadElems[0] || lazySizesCfg.preloadAfterLoad) &&
411
- (preloadElems[0] || (!elemExpandVal && ((eLbottom || eLright || eLleft || eLtop) || lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr) != 'auto')))){
412
- autoLoadElem = preloadElems[0] || lazyloadElems[i];
413
- }
414
- }
415
-
416
- if(autoLoadElem && !loadedSomething){
417
- unveilElement(autoLoadElem);
418
- }
419
- }
420
- };
421
-
422
- var throttledCheckElements = throttle(checkElements);
423
-
424
- var switchLoadingClass = function(e){
425
- var elem = e.target;
426
-
427
- if (elem._lazyCache) {
428
- delete elem._lazyCache;
429
- return;
430
- }
431
-
432
- resetPreloading(e);
433
- addClass(elem, lazySizesCfg.loadedClass);
434
- removeClass(elem, lazySizesCfg.loadingClass);
435
- addRemoveLoadEvents(elem, rafSwitchLoadingClass);
436
- triggerEvent(elem, 'lazyloaded');
437
- };
438
- var rafedSwitchLoadingClass = rAFIt(switchLoadingClass);
439
- var rafSwitchLoadingClass = function(e){
440
- rafedSwitchLoadingClass({target: e.target});
441
- };
442
-
443
- var changeIframeSrc = function(elem, src){
444
- try {
445
- elem.contentWindow.location.replace(src);
446
- } catch(e){
447
- elem.src = src;
448
- }
449
- };
450
-
451
- var handleSources = function(source){
452
- var customMedia;
453
-
454
- var sourceSrcset = source[_getAttribute](lazySizesCfg.srcsetAttr);
455
-
456
- if( (customMedia = lazySizesCfg.customMedia[source[_getAttribute]('data-media') || source[_getAttribute]('media')]) ){
457
- source.setAttribute('media', customMedia);
458
- }
459
-
460
- if(sourceSrcset){
461
- source.setAttribute('srcset', sourceSrcset);
462
- }
463
- };
464
-
465
- var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){
466
- var src, srcset, parent, isPicture, event, firesLoad;
467
-
468
- if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){
469
-
470
- if(sizes){
471
- if(isAuto){
472
- addClass(elem, lazySizesCfg.autosizesClass);
473
- } else {
474
- elem.setAttribute('sizes', sizes);
475
- }
476
- }
477
-
478
- srcset = elem[_getAttribute](lazySizesCfg.srcsetAttr);
479
- src = elem[_getAttribute](lazySizesCfg.srcAttr);
480
-
481
- if(isImg) {
482
- parent = elem.parentNode;
483
- isPicture = parent && regPicture.test(parent.nodeName || '');
484
- }
485
-
486
- firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));
487
-
488
- event = {target: elem};
489
-
490
- addClass(elem, lazySizesCfg.loadingClass);
491
-
492
- if(firesLoad){
493
- clearTimeout(resetPreloadingTimer);
494
- resetPreloadingTimer = setTimeout(resetPreloading, 2500);
495
- addRemoveLoadEvents(elem, rafSwitchLoadingClass, true);
496
- }
497
-
498
- if(isPicture){
499
- forEach.call(parent.getElementsByTagName('source'), handleSources);
500
- }
501
-
502
- if(srcset){
503
- elem.setAttribute('srcset', srcset);
504
- } else if(src && !isPicture){
505
- if(regIframe.test(elem.nodeName)){
506
- changeIframeSrc(elem, src);
507
- } else {
508
- elem.src = src;
509
- }
510
- }
511
-
512
- if(isImg && (srcset || isPicture)){
513
- updatePolyfill(elem, {src: src});
514
- }
515
- }
516
-
517
- if(elem._lazyRace){
518
- delete elem._lazyRace;
519
- }
520
- removeClass(elem, lazySizesCfg.lazyClass);
521
-
522
- rAF(function(){
523
- // Part of this can be removed as soon as this fix is older: https://bugs.chromium.org/p/chromium/issues/detail?id=7731 (2015)
524
- var isLoaded = elem.complete && elem.naturalWidth > 1;
525
-
526
- if( !firesLoad || isLoaded){
527
- if (isLoaded) {
528
- addClass(elem, 'ls-is-cached');
529
- }
530
- switchLoadingClass(event);
531
- elem._lazyCache = true;
532
- setTimeout(function(){
533
- if ('_lazyCache' in elem) {
534
- delete elem._lazyCache;
535
- }
536
- }, 9);
537
- }
538
- if (elem.loading == 'lazy') {
539
- isLoading--;
540
- }
541
- }, true);
542
- });
543
-
544
- var unveilElement = function (elem){
545
- if (elem._lazyRace) {return;}
546
- var detail;
547
-
548
- var isImg = regImg.test(elem.nodeName);
549
-
550
- //allow using sizes="auto", but don't use. it's invalid. Use data-sizes="auto" or a valid value for sizes instead (i.e.: sizes="80vw")
551
- var sizes = isImg && (elem[_getAttribute](lazySizesCfg.sizesAttr) || elem[_getAttribute]('sizes'));
552
- var isAuto = sizes == 'auto';
553
-
554
- if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesCfg.errorClass) && hasClass(elem, lazySizesCfg.lazyClass)){return;}
555
-
556
- detail = triggerEvent(elem, 'lazyunveilread').detail;
557
-
558
- if(isAuto){
559
- autoSizer.updateElem(elem, true, elem.offsetWidth);
560
- }
561
-
562
- elem._lazyRace = true;
563
- isLoading++;
564
-
565
- lazyUnveil(elem, detail, isAuto, sizes, isImg);
566
- };
567
-
568
- var afterScroll = debounce(function(){
569
- lazySizesCfg.loadMode = 3;
570
- throttledCheckElements();
571
- });
572
-
573
- var altLoadmodeScrollListner = function(){
574
- if(lazySizesCfg.loadMode == 3){
575
- lazySizesCfg.loadMode = 2;
576
- }
577
- afterScroll();
578
- };
579
-
580
- var onload = function(){
581
- if(isCompleted){return;}
582
- if(Date.now() - started < 999){
583
- setTimeout(onload, 999);
584
- return;
585
- }
586
-
587
-
588
- isCompleted = true;
589
-
590
- lazySizesCfg.loadMode = 3;
591
-
592
- throttledCheckElements();
593
-
594
- addEventListener('scroll', altLoadmodeScrollListner, true);
595
- };
596
-
597
- return {
598
- _: function(){
599
- started = Date.now();
600
-
601
- lazysizes.elements = document.getElementsByClassName(lazySizesCfg.lazyClass);
602
- preloadElems = document.getElementsByClassName(lazySizesCfg.lazyClass + ' ' + lazySizesCfg.preloadClass);
603
-
604
- addEventListener('scroll', throttledCheckElements, true);
605
-
606
- addEventListener('resize', throttledCheckElements, true);
607
-
608
- addEventListener('pageshow', function (e) {
609
- if (e.persisted) {
610
- var loadingElements = document.querySelectorAll('.' + lazySizesCfg.loadingClass);
611
-
612
- if (loadingElements.length && loadingElements.forEach) {
613
- requestAnimationFrame(function () {
614
- loadingElements.forEach( function (img) {
615
- if (img.complete) {
616
- unveilElement(img);
617
- }
618
- });
619
- });
620
- }
621
- }
622
- });
623
-
624
- if(window.MutationObserver){
625
- new MutationObserver( throttledCheckElements ).observe( docElem, {childList: true, subtree: true, attributes: true} );
626
- } else {
627
- docElem[_addEventListener]('DOMNodeInserted', throttledCheckElements, true);
628
- docElem[_addEventListener]('DOMAttrModified', throttledCheckElements, true);
629
- setInterval(throttledCheckElements, 999);
630
- }
631
-
632
- addEventListener('hashchange', throttledCheckElements, true);
633
-
634
- //, 'fullscreenchange'
635
- ['focus', 'mouseover', 'click', 'load', 'transitionend', 'animationend'].forEach(function(name){
636
- document[_addEventListener](name, throttledCheckElements, true);
637
- });
638
-
639
- if((/d$|^c/.test(document.readyState))){
640
- onload();
641
- } else {
642
- addEventListener('load', onload);
643
- document[_addEventListener]('DOMContentLoaded', throttledCheckElements);
644
- setTimeout(onload, 20000);
645
- }
646
-
647
- if(lazysizes.elements.length){
648
- checkElements();
649
- rAF._lsFlush();
650
- } else {
651
- throttledCheckElements();
652
- }
653
- },
654
- checkElems: throttledCheckElements,
655
- unveil: unveilElement,
656
- _aLSL: altLoadmodeScrollListner,
657
- };
658
- })();
659
-
660
-
661
- var autoSizer = (function(){
662
- var autosizesElems;
663
-
664
- var sizeElement = rAFIt(function(elem, parent, event, width){
665
- var sources, i, len;
666
- elem._lazysizesWidth = width;
667
- width += 'px';
668
-
669
- elem.setAttribute('sizes', width);
670
-
671
- if(regPicture.test(parent.nodeName || '')){
672
- sources = parent.getElementsByTagName('source');
673
- for(i = 0, len = sources.length; i < len; i++){
674
- sources[i].setAttribute('sizes', width);
675
- }
676
- }
677
-
678
- if(!event.detail.dataAttr){
679
- updatePolyfill(elem, event.detail);
680
- }
681
- });
682
- var getSizeElement = function (elem, dataAttr, width){
683
- var event;
684
- var parent = elem.parentNode;
685
-
686
- if(parent){
687
- width = getWidth(elem, parent, width);
688
- event = triggerEvent(elem, 'lazybeforesizes', {width: width, dataAttr: !!dataAttr});
689
-
690
- if(!event.defaultPrevented){
691
- width = event.detail.width;
692
-
693
- if(width && width !== elem._lazysizesWidth){
694
- sizeElement(elem, parent, event, width);
695
- }
696
- }
697
- }
698
- };
699
-
700
- var updateElementsSizes = function(){
701
- var i;
702
- var len = autosizesElems.length;
703
- if(len){
704
- i = 0;
705
-
706
- for(; i < len; i++){
707
- getSizeElement(autosizesElems[i]);
708
- }
709
- }
710
- };
711
-
712
- var debouncedUpdateElementsSizes = debounce(updateElementsSizes);
713
-
714
- return {
715
- _: function(){
716
- autosizesElems = document.getElementsByClassName(lazySizesCfg.autosizesClass);
717
- addEventListener('resize', debouncedUpdateElementsSizes);
718
- },
719
- checkElems: debouncedUpdateElementsSizes,
720
- updateElem: getSizeElement
721
- };
722
- })();
723
-
724
- var init = function(){
725
- if(!init.i && document.getElementsByClassName){
726
- init.i = true;
727
- autoSizer._();
728
- loader._();
729
- }
730
- };
731
-
732
- setTimeout(function(){
733
- if(lazySizesCfg.init){
734
- init();
735
- }
736
- });
737
-
738
- lazysizes = {
739
- cfg: lazySizesCfg,
740
- autoSizer: autoSizer,
741
- loader: loader,
742
- init: init,
743
- uP: updatePolyfill,
744
- aC: addClass,
745
- rC: removeClass,
746
- hC: hasClass,
747
- fire: triggerEvent,
748
- gW: getWidth,
749
- rAF: rAF,
750
- };
751
-
752
- return lazysizes;
753
- }
754
- ));
1
+ (function(window, factory) {
2
+ var lazySizes = factory(window, window.document, Date);
3
+ window.lazySizes = lazySizes;
4
+ if(typeof module == 'object' && module.exports){
5
+ module.exports = lazySizes;
6
+ }
7
+ }(typeof window != 'undefined' ?
8
+ window : {}, function l(window, document, Date) { // Pass in the windoe Date function also for SSR because the Date class can be lost
9
+ 'use strict';
10
+ /*jshint eqnull:true */
11
+
12
+ var lazysizes, lazySizesCfg;
13
+
14
+ (function(){
15
+ var prop;
16
+
17
+ var lazySizesDefaults = {
18
+ lazyClass: 'lazyload',
19
+ loadedClass: 'lazyloaded',
20
+ loadingClass: 'lazyloading',
21
+ preloadClass: 'lazypreload',
22
+ errorClass: 'lazyerror',
23
+ //strictClass: 'lazystrict',
24
+ autosizesClass: 'lazyautosizes',
25
+ srcAttr: 'data-src',
26
+ srcsetAttr: 'data-srcset',
27
+ sizesAttr: 'data-sizes',
28
+ //preloadAfterLoad: false,
29
+ minSize: 40,
30
+ customMedia: {},
31
+ init: true,
32
+ expFactor: 1.5,
33
+ hFac: 0.8,
34
+ loadMode: 2,
35
+ loadHidden: true,
36
+ ricTimeout: 0,
37
+ throttleDelay: 125,
38
+ };
39
+
40
+ lazySizesCfg = window.lazySizesConfig || window.lazysizesConfig || {};
41
+
42
+ for(prop in lazySizesDefaults){
43
+ if(!(prop in lazySizesCfg)){
44
+ lazySizesCfg[prop] = lazySizesDefaults[prop];
45
+ }
46
+ }
47
+ })();
48
+
49
+ if (!document || !document.getElementsByClassName) {
50
+ return {
51
+ init: function () {},
52
+ cfg: lazySizesCfg,
53
+ noSupport: true,
54
+ };
55
+ }
56
+
57
+ var docElem = document.documentElement;
58
+
59
+ var supportPicture = window.HTMLPictureElement;
60
+
61
+ var _addEventListener = 'addEventListener';
62
+
63
+ var _getAttribute = 'getAttribute';
64
+
65
+ /**
66
+ * Update to bind to window because 'this' becomes null during SSR
67
+ * builds.
68
+ */
69
+ var addEventListener = window[_addEventListener].bind(window);
70
+
71
+ var setTimeout = window.setTimeout;
72
+
73
+ var requestAnimationFrame = window.requestAnimationFrame || setTimeout;
74
+
75
+ var requestIdleCallback = window.requestIdleCallback;
76
+
77
+ var regPicture = /^picture$/i;
78
+
79
+ var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];
80
+
81
+ var regClassCache = {};
82
+
83
+ var forEach = Array.prototype.forEach;
84
+
85
+ var hasClass = function(ele, cls) {
86
+ if(!regClassCache[cls]){
87
+ regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
88
+ }
89
+ return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls];
90
+ };
91
+
92
+ var addClass = function(ele, cls) {
93
+ if (!hasClass(ele, cls)){
94
+ ele.setAttribute('class', (ele[_getAttribute]('class') || '').trim() + ' ' + cls);
95
+ }
96
+ };
97
+
98
+ var removeClass = function(ele, cls) {
99
+ var reg;
100
+ if ((reg = hasClass(ele,cls))) {
101
+ ele.setAttribute('class', (ele[_getAttribute]('class') || '').replace(reg, ' '));
102
+ }
103
+ };
104
+
105
+ var addRemoveLoadEvents = function(dom, fn, add){
106
+ var action = add ? _addEventListener : 'removeEventListener';
107
+ if(add){
108
+ addRemoveLoadEvents(dom, fn);
109
+ }
110
+ loadEvents.forEach(function(evt){
111
+ dom[action](evt, fn);
112
+ });
113
+ };
114
+
115
+ var triggerEvent = function(elem, name, detail, noBubbles, noCancelable){
116
+ var event = document.createEvent('Event');
117
+
118
+ if(!detail){
119
+ detail = {};
120
+ }
121
+
122
+ detail.instance = lazysizes;
123
+
124
+ event.initEvent(name, !noBubbles, !noCancelable);
125
+
126
+ event.detail = detail;
127
+
128
+ elem.dispatchEvent(event);
129
+ return event;
130
+ };
131
+
132
+ var updatePolyfill = function (el, full){
133
+ var polyfill;
134
+ if( !supportPicture && ( polyfill = (window.picturefill || lazySizesCfg.pf) ) ){
135
+ if(full && full.src && !el[_getAttribute]('srcset')){
136
+ el.setAttribute('srcset', full.src);
137
+ }
138
+ polyfill({reevaluate: true, elements: [el]});
139
+ } else if(full && full.src){
140
+ el.src = full.src;
141
+ }
142
+ };
143
+
144
+ var getCSS = function (elem, style){
145
+ return (getComputedStyle(elem, null) || {})[style];
146
+ };
147
+
148
+ var getWidth = function(elem, parent, width){
149
+ width = width || elem.offsetWidth;
150
+
151
+ while(width < lazySizesCfg.minSize && parent && !elem._lazysizesWidth){
152
+ width = parent.offsetWidth;
153
+ parent = parent.parentNode;
154
+ }
155
+
156
+ return width;
157
+ };
158
+
159
+ var rAF = (function(){
160
+ var running, waiting;
161
+ var firstFns = [];
162
+ var secondFns = [];
163
+ var fns = firstFns;
164
+
165
+ var run = function(){
166
+ var runFns = fns;
167
+
168
+ fns = firstFns.length ? secondFns : firstFns;
169
+
170
+ running = true;
171
+ waiting = false;
172
+
173
+ while(runFns.length){
174
+ runFns.shift()();
175
+ }
176
+
177
+ running = false;
178
+ };
179
+
180
+ var rafBatch = function(fn, queue){
181
+ if(running && !queue){
182
+ fn.apply(this, arguments);
183
+ } else {
184
+ fns.push(fn);
185
+
186
+ if(!waiting){
187
+ waiting = true;
188
+ (document.hidden ? setTimeout : requestAnimationFrame)(run);
189
+ }
190
+ }
191
+ };
192
+
193
+ rafBatch._lsFlush = run;
194
+
195
+ return rafBatch;
196
+ })();
197
+
198
+ var rAFIt = function(fn, simple){
199
+ return simple ?
200
+ function() {
201
+ rAF(fn);
202
+ } :
203
+ function(){
204
+ var that = this;
205
+ var args = arguments;
206
+ rAF(function(){
207
+ fn.apply(that, args);
208
+ });
209
+ }
210
+ ;
211
+ };
212
+
213
+ var throttle = function(fn){
214
+ var running;
215
+ var lastTime = 0;
216
+ var gDelay = lazySizesCfg.throttleDelay;
217
+ var rICTimeout = lazySizesCfg.ricTimeout;
218
+ var run = function(){
219
+ running = false;
220
+ lastTime = Date.now();
221
+ fn();
222
+ };
223
+ var idleCallback = requestIdleCallback && rICTimeout > 49 ?
224
+ function(){
225
+ requestIdleCallback(run, {timeout: rICTimeout});
226
+
227
+ if(rICTimeout !== lazySizesCfg.ricTimeout){
228
+ rICTimeout = lazySizesCfg.ricTimeout;
229
+ }
230
+ } :
231
+ rAFIt(function(){
232
+ setTimeout(run);
233
+ }, true)
234
+ ;
235
+
236
+ return function(isPriority){
237
+ var delay;
238
+
239
+ if((isPriority = isPriority === true)){
240
+ rICTimeout = 33;
241
+ }
242
+
243
+ if(running){
244
+ return;
245
+ }
246
+
247
+ running = true;
248
+
249
+ delay = gDelay - (Date.now() - lastTime);
250
+
251
+ if(delay < 0){
252
+ delay = 0;
253
+ }
254
+
255
+ if(isPriority || delay < 9){
256
+ idleCallback();
257
+ } else {
258
+ setTimeout(idleCallback, delay);
259
+ }
260
+ };
261
+ };
262
+
263
+ //based on http://modernjavascript.blogspot.de/2013/08/building-better-debounce.html
264
+ var debounce = function(func) {
265
+ var timeout, timestamp;
266
+ var wait = 99;
267
+ var run = function(){
268
+ timeout = null;
269
+ func();
270
+ };
271
+ var later = function() {
272
+ var last = Date.now() - timestamp;
273
+
274
+ if (last < wait) {
275
+ setTimeout(later, wait - last);
276
+ } else {
277
+ (requestIdleCallback || run)(run);
278
+ }
279
+ };
280
+
281
+ return function() {
282
+ timestamp = Date.now();
283
+
284
+ if (!timeout) {
285
+ timeout = setTimeout(later, wait);
286
+ }
287
+ };
288
+ };
289
+
290
+ var loader = (function(){
291
+ var preloadElems, isCompleted, resetPreloadingTimer, loadMode, started;
292
+
293
+ var eLvW, elvH, eLtop, eLleft, eLright, eLbottom, isBodyHidden;
294
+
295
+ var regImg = /^img$/i;
296
+ var regIframe = /^iframe$/i;
297
+
298
+ var supportScroll = ('onscroll' in window) && !(/(gle|ing)bot/.test(navigator.userAgent));
299
+
300
+ var shrinkExpand = 0;
301
+ var currentExpand = 0;
302
+
303
+ var isLoading = 0;
304
+ var lowRuns = -1;
305
+
306
+ var resetPreloading = function(e){
307
+ isLoading--;
308
+ if(!e || isLoading < 0 || !e.target){
309
+ isLoading = 0;
310
+ }
311
+ };
312
+
313
+ var isVisible = function (elem) {
314
+ if (isBodyHidden == null) {
315
+ isBodyHidden = getCSS(document.body, 'visibility') == 'hidden';
316
+ }
317
+
318
+ return isBodyHidden || !(getCSS(elem.parentNode, 'visibility') == 'hidden' && getCSS(elem, 'visibility') == 'hidden');
319
+ };
320
+
321
+ var isNestedVisible = function(elem, elemExpand){
322
+ var outerRect;
323
+ var parent = elem;
324
+ var visible = isVisible(elem);
325
+
326
+ eLtop -= elemExpand;
327
+ eLbottom += elemExpand;
328
+ eLleft -= elemExpand;
329
+ eLright += elemExpand;
330
+
331
+ while(visible && (parent = parent.offsetParent) && parent != document.body && parent != docElem){
332
+ visible = ((getCSS(parent, 'opacity') || 1) > 0);
333
+
334
+ if(visible && getCSS(parent, 'overflow') != 'visible'){
335
+ outerRect = parent.getBoundingClientRect();
336
+ visible = eLright > outerRect.left &&
337
+ eLleft < outerRect.right &&
338
+ eLbottom > outerRect.top - 1 &&
339
+ eLtop < outerRect.bottom + 1
340
+ ;
341
+ }
342
+ }
343
+
344
+ return visible;
345
+ };
346
+
347
+ var checkElements = function() {
348
+ var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal,
349
+ beforeExpandVal, defaultExpand, preloadExpand, hFac;
350
+ var lazyloadElems = lazysizes.elements;
351
+
352
+ if((loadMode = lazySizesCfg.loadMode) && isLoading < 8 && (eLlen = lazyloadElems.length)){
353
+
354
+ i = 0;
355
+
356
+ lowRuns++;
357
+
358
+ for(; i < eLlen; i++){
359
+
360
+ if(!lazyloadElems[i] || lazyloadElems[i]._lazyRace){continue;}
361
+
362
+ if(!supportScroll || (lazysizes.prematureUnveil && lazysizes.prematureUnveil(lazyloadElems[i]))){unveilElement(lazyloadElems[i]);continue;}
363
+
364
+ if(!(elemExpandVal = lazyloadElems[i][_getAttribute]('data-expand')) || !(elemExpand = elemExpandVal * 1)){
365
+ elemExpand = currentExpand;
366
+ }
367
+
368
+ if (!defaultExpand) {
369
+ defaultExpand = (!lazySizesCfg.expand || lazySizesCfg.expand < 1) ?
370
+ docElem.clientHeight > 500 && docElem.clientWidth > 500 ? 500 : 370 :
371
+ lazySizesCfg.expand;
372
+
373
+ lazysizes._defEx = defaultExpand;
374
+
375
+ preloadExpand = defaultExpand * lazySizesCfg.expFactor;
376
+ hFac = lazySizesCfg.hFac;
377
+ isBodyHidden = null;
378
+
379
+ if(currentExpand < preloadExpand && isLoading < 1 && lowRuns > 2 && loadMode > 2 && !document.hidden){
380
+ currentExpand = preloadExpand;
381
+ lowRuns = 0;
382
+ } else if(loadMode > 1 && lowRuns > 1 && isLoading < 6){
383
+ currentExpand = defaultExpand;
384
+ } else {
385
+ currentExpand = shrinkExpand;
386
+ }
387
+ }
388
+
389
+ if(beforeExpandVal !== elemExpand){
390
+ eLvW = innerWidth + (elemExpand * hFac);
391
+ elvH = innerHeight + elemExpand;
392
+ elemNegativeExpand = elemExpand * -1;
393
+ beforeExpandVal = elemExpand;
394
+ }
395
+
396
+ rect = lazyloadElems[i].getBoundingClientRect();
397
+
398
+ if ((eLbottom = rect.bottom) >= elemNegativeExpand &&
399
+ (eLtop = rect.top) <= elvH &&
400
+ (eLright = rect.right) >= elemNegativeExpand * hFac &&
401
+ (eLleft = rect.left) <= eLvW &&
402
+ (eLbottom || eLright || eLleft || eLtop) &&
403
+ (lazySizesCfg.loadHidden || isVisible(lazyloadElems[i])) &&
404
+ ((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
405
+ unveilElement(lazyloadElems[i]);
406
+ loadedSomething = true;
407
+ if(isLoading > 9){break;}
408
+ } else if(!loadedSomething && isCompleted && !autoLoadElem &&
409
+ isLoading < 4 && lowRuns < 4 && loadMode > 2 &&
410
+ (preloadElems[0] || lazySizesCfg.preloadAfterLoad) &&
411
+ (preloadElems[0] || (!elemExpandVal && ((eLbottom || eLright || eLleft || eLtop) || lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr) != 'auto')))){
412
+ autoLoadElem = preloadElems[0] || lazyloadElems[i];
413
+ }
414
+ }
415
+
416
+ if(autoLoadElem && !loadedSomething){
417
+ unveilElement(autoLoadElem);
418
+ }
419
+ }
420
+ };
421
+
422
+ var throttledCheckElements = throttle(checkElements);
423
+
424
+ var switchLoadingClass = function(e){
425
+ var elem = e.target;
426
+
427
+ if (elem._lazyCache) {
428
+ delete elem._lazyCache;
429
+ return;
430
+ }
431
+
432
+ resetPreloading(e);
433
+ addClass(elem, lazySizesCfg.loadedClass);
434
+ removeClass(elem, lazySizesCfg.loadingClass);
435
+ addRemoveLoadEvents(elem, rafSwitchLoadingClass);
436
+ triggerEvent(elem, 'lazyloaded');
437
+ };
438
+ var rafedSwitchLoadingClass = rAFIt(switchLoadingClass);
439
+ var rafSwitchLoadingClass = function(e){
440
+ rafedSwitchLoadingClass({target: e.target});
441
+ };
442
+
443
+ var changeIframeSrc = function(elem, src){
444
+ try {
445
+ elem.contentWindow.location.replace(src);
446
+ } catch(e){
447
+ elem.src = src;
448
+ }
449
+ };
450
+
451
+ var handleSources = function(source){
452
+ var customMedia;
453
+
454
+ var sourceSrcset = source[_getAttribute](lazySizesCfg.srcsetAttr);
455
+
456
+ if( (customMedia = lazySizesCfg.customMedia[source[_getAttribute]('data-media') || source[_getAttribute]('media')]) ){
457
+ source.setAttribute('media', customMedia);
458
+ }
459
+
460
+ if(sourceSrcset){
461
+ source.setAttribute('srcset', sourceSrcset);
462
+ }
463
+ };
464
+
465
+ var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){
466
+ var src, srcset, parent, isPicture, event, firesLoad;
467
+
468
+ if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){
469
+
470
+ if(sizes){
471
+ if(isAuto){
472
+ addClass(elem, lazySizesCfg.autosizesClass);
473
+ } else {
474
+ elem.setAttribute('sizes', sizes);
475
+ }
476
+ }
477
+
478
+ srcset = elem[_getAttribute](lazySizesCfg.srcsetAttr);
479
+ src = elem[_getAttribute](lazySizesCfg.srcAttr);
480
+
481
+ if(isImg) {
482
+ parent = elem.parentNode;
483
+ isPicture = parent && regPicture.test(parent.nodeName || '');
484
+ }
485
+
486
+ firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));
487
+
488
+ event = {target: elem};
489
+
490
+ addClass(elem, lazySizesCfg.loadingClass);
491
+
492
+ if(firesLoad){
493
+ clearTimeout(resetPreloadingTimer);
494
+ resetPreloadingTimer = setTimeout(resetPreloading, 2500);
495
+ addRemoveLoadEvents(elem, rafSwitchLoadingClass, true);
496
+ }
497
+
498
+ if(isPicture){
499
+ forEach.call(parent.getElementsByTagName('source'), handleSources);
500
+ }
501
+
502
+ if(srcset){
503
+ elem.setAttribute('srcset', srcset);
504
+ } else if(src && !isPicture){
505
+ if(regIframe.test(elem.nodeName)){
506
+ changeIframeSrc(elem, src);
507
+ } else {
508
+ elem.src = src;
509
+ }
510
+ }
511
+
512
+ if(isImg && (srcset || isPicture)){
513
+ updatePolyfill(elem, {src: src});
514
+ }
515
+ }
516
+
517
+ if(elem._lazyRace){
518
+ delete elem._lazyRace;
519
+ }
520
+ removeClass(elem, lazySizesCfg.lazyClass);
521
+
522
+ rAF(function(){
523
+ // Part of this can be removed as soon as this fix is older: https://bugs.chromium.org/p/chromium/issues/detail?id=7731 (2015)
524
+ var isLoaded = elem.complete && elem.naturalWidth > 1;
525
+
526
+ if( !firesLoad || isLoaded){
527
+ if (isLoaded) {
528
+ addClass(elem, 'ls-is-cached');
529
+ }
530
+ switchLoadingClass(event);
531
+ elem._lazyCache = true;
532
+ setTimeout(function(){
533
+ if ('_lazyCache' in elem) {
534
+ delete elem._lazyCache;
535
+ }
536
+ }, 9);
537
+ }
538
+ if (elem.loading == 'lazy') {
539
+ isLoading--;
540
+ }
541
+ }, true);
542
+ });
543
+
544
+ var unveilElement = function (elem){
545
+ if (elem._lazyRace) {return;}
546
+ var detail;
547
+
548
+ var isImg = regImg.test(elem.nodeName);
549
+
550
+ //allow using sizes="auto", but don't use. it's invalid. Use data-sizes="auto" or a valid value for sizes instead (i.e.: sizes="80vw")
551
+ var sizes = isImg && (elem[_getAttribute](lazySizesCfg.sizesAttr) || elem[_getAttribute]('sizes'));
552
+ var isAuto = sizes == 'auto';
553
+
554
+ if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesCfg.errorClass) && hasClass(elem, lazySizesCfg.lazyClass)){return;}
555
+
556
+ detail = triggerEvent(elem, 'lazyunveilread').detail;
557
+
558
+ if(isAuto){
559
+ autoSizer.updateElem(elem, true, elem.offsetWidth);
560
+ }
561
+
562
+ elem._lazyRace = true;
563
+ isLoading++;
564
+
565
+ lazyUnveil(elem, detail, isAuto, sizes, isImg);
566
+ };
567
+
568
+ var afterScroll = debounce(function(){
569
+ lazySizesCfg.loadMode = 3;
570
+ throttledCheckElements();
571
+ });
572
+
573
+ var altLoadmodeScrollListner = function(){
574
+ if(lazySizesCfg.loadMode == 3){
575
+ lazySizesCfg.loadMode = 2;
576
+ }
577
+ afterScroll();
578
+ };
579
+
580
+ var onload = function(){
581
+ if(isCompleted){return;}
582
+ if(Date.now() - started < 999){
583
+ setTimeout(onload, 999);
584
+ return;
585
+ }
586
+
587
+
588
+ isCompleted = true;
589
+
590
+ lazySizesCfg.loadMode = 3;
591
+
592
+ throttledCheckElements();
593
+
594
+ addEventListener('scroll', altLoadmodeScrollListner, true);
595
+ };
596
+
597
+ return {
598
+ _: function(){
599
+ started = Date.now();
600
+
601
+ lazysizes.elements = document.getElementsByClassName(lazySizesCfg.lazyClass);
602
+ preloadElems = document.getElementsByClassName(lazySizesCfg.lazyClass + ' ' + lazySizesCfg.preloadClass);
603
+
604
+ addEventListener('scroll', throttledCheckElements, true);
605
+
606
+ addEventListener('resize', throttledCheckElements, true);
607
+
608
+ addEventListener('pageshow', function (e) {
609
+ if (e.persisted) {
610
+ var loadingElements = document.querySelectorAll('.' + lazySizesCfg.loadingClass);
611
+
612
+ if (loadingElements.length && loadingElements.forEach) {
613
+ requestAnimationFrame(function () {
614
+ loadingElements.forEach( function (img) {
615
+ if (img.complete) {
616
+ unveilElement(img);
617
+ }
618
+ });
619
+ });
620
+ }
621
+ }
622
+ });
623
+
624
+ if(window.MutationObserver){
625
+ new MutationObserver( throttledCheckElements ).observe( docElem, {childList: true, subtree: true, attributes: true} );
626
+ } else {
627
+ docElem[_addEventListener]('DOMNodeInserted', throttledCheckElements, true);
628
+ docElem[_addEventListener]('DOMAttrModified', throttledCheckElements, true);
629
+ setInterval(throttledCheckElements, 999);
630
+ }
631
+
632
+ addEventListener('hashchange', throttledCheckElements, true);
633
+
634
+ //, 'fullscreenchange'
635
+ ['focus', 'mouseover', 'click', 'load', 'transitionend', 'animationend'].forEach(function(name){
636
+ document[_addEventListener](name, throttledCheckElements, true);
637
+ });
638
+
639
+ if((/d$|^c/.test(document.readyState))){
640
+ onload();
641
+ } else {
642
+ addEventListener('load', onload);
643
+ document[_addEventListener]('DOMContentLoaded', throttledCheckElements);
644
+ setTimeout(onload, 20000);
645
+ }
646
+
647
+ if(lazysizes.elements.length){
648
+ checkElements();
649
+ rAF._lsFlush();
650
+ } else {
651
+ throttledCheckElements();
652
+ }
653
+ },
654
+ checkElems: throttledCheckElements,
655
+ unveil: unveilElement,
656
+ _aLSL: altLoadmodeScrollListner,
657
+ };
658
+ })();
659
+
660
+
661
+ var autoSizer = (function(){
662
+ var autosizesElems;
663
+
664
+ var sizeElement = rAFIt(function(elem, parent, event, width){
665
+ var sources, i, len;
666
+ elem._lazysizesWidth = width;
667
+ width += 'px';
668
+
669
+ elem.setAttribute('sizes', width);
670
+
671
+ if(regPicture.test(parent.nodeName || '')){
672
+ sources = parent.getElementsByTagName('source');
673
+ for(i = 0, len = sources.length; i < len; i++){
674
+ sources[i].setAttribute('sizes', width);
675
+ }
676
+ }
677
+
678
+ if(!event.detail.dataAttr){
679
+ updatePolyfill(elem, event.detail);
680
+ }
681
+ });
682
+ var getSizeElement = function (elem, dataAttr, width){
683
+ var event;
684
+ var parent = elem.parentNode;
685
+
686
+ if(parent){
687
+ width = getWidth(elem, parent, width);
688
+ event = triggerEvent(elem, 'lazybeforesizes', {width: width, dataAttr: !!dataAttr});
689
+
690
+ if(!event.defaultPrevented){
691
+ width = event.detail.width;
692
+
693
+ if(width && width !== elem._lazysizesWidth){
694
+ sizeElement(elem, parent, event, width);
695
+ }
696
+ }
697
+ }
698
+ };
699
+
700
+ var updateElementsSizes = function(){
701
+ var i;
702
+ var len = autosizesElems.length;
703
+ if(len){
704
+ i = 0;
705
+
706
+ for(; i < len; i++){
707
+ getSizeElement(autosizesElems[i]);
708
+ }
709
+ }
710
+ };
711
+
712
+ var debouncedUpdateElementsSizes = debounce(updateElementsSizes);
713
+
714
+ return {
715
+ _: function(){
716
+ autosizesElems = document.getElementsByClassName(lazySizesCfg.autosizesClass);
717
+ addEventListener('resize', debouncedUpdateElementsSizes);
718
+ },
719
+ checkElems: debouncedUpdateElementsSizes,
720
+ updateElem: getSizeElement
721
+ };
722
+ })();
723
+
724
+ var init = function(){
725
+ if(!init.i && document.getElementsByClassName){
726
+ init.i = true;
727
+ autoSizer._();
728
+ loader._();
729
+ }
730
+ };
731
+
732
+ setTimeout(function(){
733
+ if(lazySizesCfg.init){
734
+ init();
735
+ }
736
+ });
737
+
738
+ lazysizes = {
739
+ cfg: lazySizesCfg,
740
+ autoSizer: autoSizer,
741
+ loader: loader,
742
+ init: init,
743
+ uP: updatePolyfill,
744
+ aC: addClass,
745
+ rC: removeClass,
746
+ hC: hasClass,
747
+ fire: triggerEvent,
748
+ gW: getWidth,
749
+ rAF: rAF,
750
+ };
751
+
752
+ return lazysizes;
753
+ }
754
+ ));