groundworkcss 0.4.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (411) hide show
  1. data/Gemfile.lock +63 -0
  2. data/README.md +90 -48
  3. data/app/assets/fonts/groundworkcss/museo-slab-500-webfont.eot +0 -0
  4. data/app/assets/fonts/groundworkcss/museo-slab-500-webfont.svg +1228 -0
  5. data/app/assets/fonts/groundworkcss/museo-slab-500-webfont.ttf +0 -0
  6. data/app/assets/fonts/groundworkcss/museo-slab-500-webfont.woff +0 -0
  7. data/app/assets/fonts/groundworkcss/quicksand-regular-webfont.eot +0 -0
  8. data/app/assets/fonts/groundworkcss/quicksand-regular-webfont.svg +1746 -0
  9. data/app/assets/fonts/groundworkcss/quicksand-regular-webfont.ttf +0 -0
  10. data/app/assets/fonts/groundworkcss/quicksand-regular-webfont.woff +0 -0
  11. data/app/assets/fonts/groundworkcss/redacted-regular.eot +0 -0
  12. data/app/assets/fonts/groundworkcss/redacted-regular.svg +242 -0
  13. data/app/assets/fonts/groundworkcss/redacted-regular.ttf +0 -0
  14. data/app/assets/fonts/groundworkcss/redacted-regular.woff +0 -0
  15. data/app/assets/fonts/groundworkcss/redacted-script-bold.eot +0 -0
  16. data/app/assets/fonts/groundworkcss/redacted-script-bold.svg +244 -0
  17. data/app/assets/fonts/groundworkcss/redacted-script-bold.ttf +0 -0
  18. data/app/assets/fonts/groundworkcss/redacted-script-bold.woff +0 -0
  19. data/app/assets/fonts/groundworkcss/redacted-script-light.eot +0 -0
  20. data/app/assets/fonts/groundworkcss/redacted-script-light.svg +244 -0
  21. data/app/assets/fonts/groundworkcss/redacted-script-light.ttf +0 -0
  22. data/app/assets/fonts/groundworkcss/redacted-script-light.woff +0 -0
  23. data/app/assets/fonts/groundworkcss/redacted-script-regular.eot +0 -0
  24. data/app/assets/fonts/groundworkcss/redacted-script-regular.svg +244 -0
  25. data/app/assets/fonts/groundworkcss/redacted-script-regular.ttf +0 -0
  26. data/app/assets/fonts/groundworkcss/redacted-script-regular.woff +0 -0
  27. data/app/assets/fonts/groundworkcss/sourcesanspro-regular-webfont.eot +0 -0
  28. data/app/assets/fonts/groundworkcss/sourcesanspro-regular-webfont.svg +978 -0
  29. data/app/assets/fonts/groundworkcss/sourcesanspro-regular-webfont.ttf +0 -0
  30. data/app/assets/fonts/groundworkcss/sourcesanspro-regular-webfont.woff +0 -0
  31. data/app/assets/images/groundworkcss/black_linen_v2.png +0 -0
  32. data/app/assets/images/groundworkcss/diag6-black.png +0 -0
  33. data/app/assets/images/groundworkcss/example-usage.png +0 -0
  34. data/app/assets/images/groundworkcss/favicon.ico +0 -0
  35. data/app/assets/images/groundworkcss/groundwork-logo.png +0 -0
  36. data/app/assets/images/groundworkcss/groundwork-logo.svg +1 -0
  37. data/app/assets/images/groundworkcss/layout-a.png +0 -0
  38. data/app/assets/images/groundworkcss/layout-b.png +0 -0
  39. data/app/assets/images/groundworkcss/layout-c.png +0 -0
  40. data/app/assets/javascripts/groundworkcss/all.js +4 -0
  41. data/app/assets/javascripts/groundworkcss/components/checklists.coffee +8 -0
  42. data/app/assets/javascripts/groundworkcss/components/dismissible.coffee +7 -3
  43. data/app/assets/javascripts/groundworkcss/components/equalizeColumns.coffee +3 -4
  44. data/app/assets/javascripts/groundworkcss/components/menus.coffee +22 -156
  45. data/app/assets/javascripts/groundworkcss/components/navigation.coffee +90 -0
  46. data/app/assets/javascripts/groundworkcss/components/tabs.coffee +83 -18
  47. data/app/assets/javascripts/groundworkcss/demo/ZeroClipboard.swf +0 -0
  48. data/app/assets/javascripts/groundworkcss/demo/jquery.snippet.min.js +12 -0
  49. data/app/assets/javascripts/groundworkcss/libs/boxsizing.htc +6 -3
  50. data/app/assets/javascripts/groundworkcss/plugins/jquery-placeholderText.coffee +90 -0
  51. data/app/assets/javascripts/groundworkcss/plugins/jquery-responsiveTables.coffee +0 -1
  52. data/app/assets/stylesheets/groundworkcss/_settings-rails3.scss +298 -262
  53. data/app/assets/stylesheets/groundworkcss/_settings-rails4.scss +298 -262
  54. data/app/assets/stylesheets/groundworkcss/_settings.scss +306 -268
  55. data/app/assets/stylesheets/groundworkcss/anim/_all-animations.scss +37 -0
  56. data/app/assets/stylesheets/groundworkcss/anim/_bounce.scss +253 -0
  57. data/app/assets/stylesheets/groundworkcss/anim/_fade.scss +279 -0
  58. data/app/assets/stylesheets/groundworkcss/anim/_flash.scss +14 -0
  59. data/app/assets/stylesheets/groundworkcss/anim/_flip.scss +115 -0
  60. data/app/assets/stylesheets/groundworkcss/anim/_hinge.scss +21 -0
  61. data/app/assets/stylesheets/groundworkcss/anim/_lightspeed.scss +28 -0
  62. data/app/assets/stylesheets/groundworkcss/anim/_pulse.scss +15 -0
  63. data/app/assets/stylesheets/groundworkcss/anim/_roll.scss +37 -0
  64. data/app/assets/stylesheets/groundworkcss/anim/_rotate.scss +171 -0
  65. data/app/assets/stylesheets/groundworkcss/anim/_shake.scss +15 -0
  66. data/app/assets/stylesheets/groundworkcss/anim/_spin.scss +57 -0
  67. data/app/assets/stylesheets/groundworkcss/anim/_swing.scss +18 -0
  68. data/app/assets/stylesheets/groundworkcss/anim/_tada.scss +17 -0
  69. data/app/assets/stylesheets/groundworkcss/anim/_wiggle.scss +28 -0
  70. data/app/assets/stylesheets/groundworkcss/anim/_wobble.scss +19 -0
  71. data/app/assets/stylesheets/groundworkcss/base/_all-base.scss +4 -1
  72. data/app/assets/stylesheets/groundworkcss/base/_flex-box.scss +8 -23
  73. data/app/assets/stylesheets/groundworkcss/base/_global.scss +25 -19
  74. data/app/assets/stylesheets/groundworkcss/base/_grid.scss +140 -52
  75. data/app/assets/stylesheets/groundworkcss/base/_hbox-vbox.scss +101 -0
  76. data/app/assets/stylesheets/groundworkcss/base/_helpers.scss +80 -47
  77. data/app/assets/stylesheets/groundworkcss/base/_reset.scss +13 -1
  78. data/app/assets/stylesheets/groundworkcss/core/_all-core.scss +10 -6
  79. data/app/assets/stylesheets/groundworkcss/core/_constants.scss +1 -11
  80. data/app/assets/stylesheets/groundworkcss/core/_defaults.scss +2 -295
  81. data/app/assets/stylesheets/groundworkcss/core/_mixins-core.scss +16 -42
  82. data/app/assets/stylesheets/groundworkcss/core/_palette.scss +123 -0
  83. data/app/assets/stylesheets/groundworkcss/demo/_jquery.snippet.groundwork.scss +145 -0
  84. data/app/assets/stylesheets/groundworkcss/demo/groundworkdocs.scss +102 -0
  85. data/app/assets/stylesheets/groundworkcss/demo/jquery.snippet.scss +35 -0
  86. data/app/assets/stylesheets/groundworkcss/groundwork-ie.scss +30 -63
  87. data/app/assets/stylesheets/groundworkcss/groundwork.scss +10 -11
  88. data/app/assets/stylesheets/groundworkcss/icons/_all-icons.scss +5 -2
  89. data/app/assets/stylesheets/groundworkcss/icons/font-awesome/_extras.scss +0 -39
  90. data/app/assets/stylesheets/groundworkcss/{libs/placeholder_polyfill.css → placeholder_polyfill.css} +0 -0
  91. data/app/assets/stylesheets/groundworkcss/responsive/_all-responsive.scss +2 -2
  92. data/app/assets/stylesheets/groundworkcss/responsive/_desktop.scss +138 -13
  93. data/app/assets/stylesheets/groundworkcss/responsive/_helpers-responsive.scss +21 -15
  94. data/app/assets/stylesheets/groundworkcss/responsive/_ipad.scss +144 -16
  95. data/app/assets/stylesheets/groundworkcss/responsive/_mobile.scss +148 -34
  96. data/app/assets/stylesheets/groundworkcss/responsive/_small-tablet.scss +133 -176
  97. data/app/assets/stylesheets/groundworkcss/type/_all-type.scss +8 -4
  98. data/app/assets/stylesheets/groundworkcss/type/_link-type-icons.scss +404 -0
  99. data/app/assets/stylesheets/groundworkcss/type/_typography.scss +291 -84
  100. data/app/assets/stylesheets/groundworkcss/type/_webfonts.scss +48 -5
  101. data/app/assets/stylesheets/groundworkcss/ui/_all-ui.scss +6 -4
  102. data/app/assets/stylesheets/groundworkcss/ui/_boxes.scss +102 -0
  103. data/app/assets/stylesheets/groundworkcss/ui/_buttons.scss +389 -0
  104. data/app/assets/stylesheets/groundworkcss/{form → ui}/_forms.scss +49 -33
  105. data/app/assets/stylesheets/groundworkcss/ui/_messages.scss +76 -32
  106. data/app/assets/stylesheets/groundworkcss/ui/_nav.scss +346 -0
  107. data/app/assets/stylesheets/groundworkcss/ui/_tables.scss +83 -29
  108. data/app/assets/stylesheets/groundworkcss/ui/_tabs.scss +192 -0
  109. data/app/views/groundworkdocs/animations.html.erb +156 -0
  110. data/app/views/groundworkdocs/boxes.html.erb +131 -0
  111. data/app/views/groundworkdocs/breakpoints.html.erb +143 -0
  112. data/app/views/groundworkdocs/buttons.html.erb +369 -0
  113. data/app/views/groundworkdocs/forms.html.erb +399 -0
  114. data/app/views/groundworkdocs/grid.html.erb +582 -0
  115. data/app/views/groundworkdocs/helpers.html.erb +326 -0
  116. data/app/views/groundworkdocs/home.html.erb +88 -0
  117. data/app/views/groundworkdocs/icons.html.erb +1428 -0
  118. data/app/views/groundworkdocs/layout_a.html.erb +122 -0
  119. data/app/views/groundworkdocs/layout_b.html.erb +37 -0
  120. data/app/views/groundworkdocs/layout_c.html.erb +116 -0
  121. data/app/views/groundworkdocs/media_queries.html.erb +75 -0
  122. data/app/views/groundworkdocs/messages.html.erb +92 -0
  123. data/app/views/groundworkdocs/navigation.html.erb +500 -0
  124. data/app/views/groundworkdocs/placeholder_text.html.erb +86 -0
  125. data/app/views/groundworkdocs/responsive_text.html.erb +90 -0
  126. data/app/views/groundworkdocs/tables.html.erb +554 -0
  127. data/app/views/groundworkdocs/tabs.html.erb +216 -0
  128. data/app/views/groundworkdocs/typography.html.erb +656 -0
  129. data/app/views/layouts/groundworkdocs.html.erb +126 -0
  130. data/groundworkcss.gemspec +2 -2
  131. data/lib/groundworkcss/generators/USAGE.md +24 -0
  132. data/lib/groundworkcss/generators/docs_generator.rb +61 -0
  133. data/lib/groundworkcss/generators/install_generator.rb +25 -8
  134. data/lib/groundworkcss/version.rb +1 -1
  135. data/lib/groundworkcss.rb +1 -1
  136. metadata +105 -292
  137. data/app/assets/fonts/groundworkcss/FontAwesome.otf +0 -0
  138. data/app/assets/fonts/groundworkcss/americantypewriterstd-bold.eot +0 -0
  139. data/app/assets/fonts/groundworkcss/americantypewriterstd-bold.svg +0 -128
  140. data/app/assets/fonts/groundworkcss/americantypewriterstd-bold.ttf +0 -0
  141. data/app/assets/fonts/groundworkcss/americantypewriterstd-bold.woff +0 -0
  142. data/app/assets/fonts/groundworkcss/average-sans-webfont.eot +0 -0
  143. data/app/assets/fonts/groundworkcss/average-sans-webfont.ttf +0 -0
  144. data/app/assets/fonts/groundworkcss/average-sans-webfont.woff +0 -0
  145. data/app/assets/images/groundworkcss/social-icons/500px-m.png +0 -0
  146. data/app/assets/images/groundworkcss/social-icons/500px-s.png +0 -0
  147. data/app/assets/images/groundworkcss/social-icons/500px.png +0 -0
  148. data/app/assets/images/groundworkcss/social-icons/500px.svg +0 -62
  149. data/app/assets/images/groundworkcss/social-icons/aboutme-m.png +0 -0
  150. data/app/assets/images/groundworkcss/social-icons/aboutme-s.png +0 -0
  151. data/app/assets/images/groundworkcss/social-icons/aboutme.png +0 -0
  152. data/app/assets/images/groundworkcss/social-icons/aboutme.svg +0 -42
  153. data/app/assets/images/groundworkcss/social-icons/adn-m.png +0 -0
  154. data/app/assets/images/groundworkcss/social-icons/adn-s.png +0 -0
  155. data/app/assets/images/groundworkcss/social-icons/adn.png +0 -0
  156. data/app/assets/images/groundworkcss/social-icons/adn.svg +0 -14
  157. data/app/assets/images/groundworkcss/social-icons/android-m.png +0 -0
  158. data/app/assets/images/groundworkcss/social-icons/android-s.png +0 -0
  159. data/app/assets/images/groundworkcss/social-icons/android.png +0 -0
  160. data/app/assets/images/groundworkcss/social-icons/android.svg +0 -30
  161. data/app/assets/images/groundworkcss/social-icons/apple-m.png +0 -0
  162. data/app/assets/images/groundworkcss/social-icons/apple-s.png +0 -0
  163. data/app/assets/images/groundworkcss/social-icons/apple.png +0 -0
  164. data/app/assets/images/groundworkcss/social-icons/apple.svg +0 -19
  165. data/app/assets/images/groundworkcss/social-icons/behance-m.png +0 -0
  166. data/app/assets/images/groundworkcss/social-icons/behance-s.png +0 -0
  167. data/app/assets/images/groundworkcss/social-icons/behance.png +0 -0
  168. data/app/assets/images/groundworkcss/social-icons/behance.svg +0 -48
  169. data/app/assets/images/groundworkcss/social-icons/bitbucket-m.png +0 -0
  170. data/app/assets/images/groundworkcss/social-icons/bitbucket-s.png +0 -0
  171. data/app/assets/images/groundworkcss/social-icons/bitbucket.png +0 -0
  172. data/app/assets/images/groundworkcss/social-icons/bitbucket.svg +0 -36
  173. data/app/assets/images/groundworkcss/social-icons/blogger-m.png +0 -0
  174. data/app/assets/images/groundworkcss/social-icons/blogger-s.png +0 -0
  175. data/app/assets/images/groundworkcss/social-icons/blogger.png +0 -0
  176. data/app/assets/images/groundworkcss/social-icons/blogger.svg +0 -22
  177. data/app/assets/images/groundworkcss/social-icons/coderwall-m.png +0 -0
  178. data/app/assets/images/groundworkcss/social-icons/coderwall-s.png +0 -0
  179. data/app/assets/images/groundworkcss/social-icons/coderwall.png +0 -0
  180. data/app/assets/images/groundworkcss/social-icons/coderwall.svg +0 -21
  181. data/app/assets/images/groundworkcss/social-icons/creativecloud-m.png +0 -0
  182. data/app/assets/images/groundworkcss/social-icons/creativecloud-s.png +0 -0
  183. data/app/assets/images/groundworkcss/social-icons/creativecloud.png +0 -0
  184. data/app/assets/images/groundworkcss/social-icons/creativecloud.svg +0 -48
  185. data/app/assets/images/groundworkcss/social-icons/dribbble-m.png +0 -0
  186. data/app/assets/images/groundworkcss/social-icons/dribbble-s.png +0 -0
  187. data/app/assets/images/groundworkcss/social-icons/dribbble.png +0 -0
  188. data/app/assets/images/groundworkcss/social-icons/dribbble.svg +0 -28
  189. data/app/assets/images/groundworkcss/social-icons/dropbox-m.png +0 -0
  190. data/app/assets/images/groundworkcss/social-icons/dropbox-s.png +0 -0
  191. data/app/assets/images/groundworkcss/social-icons/dropbox.png +0 -0
  192. data/app/assets/images/groundworkcss/social-icons/dropbox.svg +0 -73
  193. data/app/assets/images/groundworkcss/social-icons/evernote-m.png +0 -0
  194. data/app/assets/images/groundworkcss/social-icons/evernote-s.png +0 -0
  195. data/app/assets/images/groundworkcss/social-icons/evernote.png +0 -0
  196. data/app/assets/images/groundworkcss/social-icons/evernote.svg +0 -62
  197. data/app/assets/images/groundworkcss/social-icons/facebook-m.png +0 -0
  198. data/app/assets/images/groundworkcss/social-icons/facebook-s.png +0 -0
  199. data/app/assets/images/groundworkcss/social-icons/facebook.png +0 -0
  200. data/app/assets/images/groundworkcss/social-icons/facebook.svg +0 -15
  201. data/app/assets/images/groundworkcss/social-icons/fairheadcreative-m.png +0 -0
  202. data/app/assets/images/groundworkcss/social-icons/fairheadcreative-s.png +0 -0
  203. data/app/assets/images/groundworkcss/social-icons/fairheadcreative.png +0 -0
  204. data/app/assets/images/groundworkcss/social-icons/fairheadcreative.svg +0 -24
  205. data/app/assets/images/groundworkcss/social-icons/flickr-m.png +0 -0
  206. data/app/assets/images/groundworkcss/social-icons/flickr-s.png +0 -0
  207. data/app/assets/images/groundworkcss/social-icons/flickr.png +0 -0
  208. data/app/assets/images/groundworkcss/social-icons/flickr.svg +0 -14
  209. data/app/assets/images/groundworkcss/social-icons/foursquare-m.png +0 -0
  210. data/app/assets/images/groundworkcss/social-icons/foursquare-s.png +0 -0
  211. data/app/assets/images/groundworkcss/social-icons/foursquare.png +0 -0
  212. data/app/assets/images/groundworkcss/social-icons/foursquare.svg +0 -43
  213. data/app/assets/images/groundworkcss/social-icons/git-m.png +0 -0
  214. data/app/assets/images/groundworkcss/social-icons/git-s.png +0 -0
  215. data/app/assets/images/groundworkcss/social-icons/git.png +0 -0
  216. data/app/assets/images/groundworkcss/social-icons/git.svg +0 -22
  217. data/app/assets/images/groundworkcss/social-icons/github-m.png +0 -0
  218. data/app/assets/images/groundworkcss/social-icons/github-s.png +0 -0
  219. data/app/assets/images/groundworkcss/social-icons/github.png +0 -0
  220. data/app/assets/images/groundworkcss/social-icons/github.svg +0 -38
  221. data/app/assets/images/groundworkcss/social-icons/goodreads-m.png +0 -0
  222. data/app/assets/images/groundworkcss/social-icons/goodreads-s.png +0 -0
  223. data/app/assets/images/groundworkcss/social-icons/goodreads.png +0 -0
  224. data/app/assets/images/groundworkcss/social-icons/goodreads.svg +0 -38
  225. data/app/assets/images/groundworkcss/social-icons/googleplay-m.png +0 -0
  226. data/app/assets/images/groundworkcss/social-icons/googleplay-s.png +0 -0
  227. data/app/assets/images/groundworkcss/social-icons/googleplay.png +0 -0
  228. data/app/assets/images/groundworkcss/social-icons/googleplay.svg +0 -24
  229. data/app/assets/images/groundworkcss/social-icons/googleplus-m.png +0 -0
  230. data/app/assets/images/groundworkcss/social-icons/googleplus-s.png +0 -0
  231. data/app/assets/images/groundworkcss/social-icons/googleplus.png +0 -0
  232. data/app/assets/images/groundworkcss/social-icons/googleplus.svg +0 -52
  233. data/app/assets/images/groundworkcss/social-icons/html5-m.png +0 -0
  234. data/app/assets/images/groundworkcss/social-icons/html5-s.png +0 -0
  235. data/app/assets/images/groundworkcss/social-icons/html5.png +0 -0
  236. data/app/assets/images/groundworkcss/social-icons/html5.svg +0 -29
  237. data/app/assets/images/groundworkcss/social-icons/icloud-m.png +0 -0
  238. data/app/assets/images/groundworkcss/social-icons/icloud-s.png +0 -0
  239. data/app/assets/images/groundworkcss/social-icons/icloud.png +0 -0
  240. data/app/assets/images/groundworkcss/social-icons/icloud.svg +0 -26
  241. data/app/assets/images/groundworkcss/social-icons/instagram-m.png +0 -0
  242. data/app/assets/images/groundworkcss/social-icons/instagram-s.png +0 -0
  243. data/app/assets/images/groundworkcss/social-icons/instagram.png +0 -0
  244. data/app/assets/images/groundworkcss/social-icons/instagram.svg +0 -166
  245. data/app/assets/images/groundworkcss/social-icons/lastfm-m.png +0 -0
  246. data/app/assets/images/groundworkcss/social-icons/lastfm-s.png +0 -0
  247. data/app/assets/images/groundworkcss/social-icons/lastfm.png +0 -0
  248. data/app/assets/images/groundworkcss/social-icons/lastfm.svg +0 -44
  249. data/app/assets/images/groundworkcss/social-icons/linkedin-m.png +0 -0
  250. data/app/assets/images/groundworkcss/social-icons/linkedin-s.png +0 -0
  251. data/app/assets/images/groundworkcss/social-icons/linkedin.png +0 -0
  252. data/app/assets/images/groundworkcss/social-icons/linkedin.svg +0 -28
  253. data/app/assets/images/groundworkcss/social-icons/mail-m.png +0 -0
  254. data/app/assets/images/groundworkcss/social-icons/mail-s.png +0 -0
  255. data/app/assets/images/groundworkcss/social-icons/mail.png +0 -0
  256. data/app/assets/images/groundworkcss/social-icons/mail.svg +0 -27
  257. data/app/assets/images/groundworkcss/social-icons/mercurial-m.png +0 -0
  258. data/app/assets/images/groundworkcss/social-icons/mercurial-s.png +0 -0
  259. data/app/assets/images/groundworkcss/social-icons/mercurial.png +0 -0
  260. data/app/assets/images/groundworkcss/social-icons/mercurial.svg +0 -22
  261. data/app/assets/images/groundworkcss/social-icons/mixi-m.png +0 -0
  262. data/app/assets/images/groundworkcss/social-icons/mixi-s.png +0 -0
  263. data/app/assets/images/groundworkcss/social-icons/mixi.png +0 -0
  264. data/app/assets/images/groundworkcss/social-icons/mixi.svg +0 -32
  265. data/app/assets/images/groundworkcss/social-icons/msn-m.png +0 -0
  266. data/app/assets/images/groundworkcss/social-icons/msn-s.png +0 -0
  267. data/app/assets/images/groundworkcss/social-icons/msn.png +0 -0
  268. data/app/assets/images/groundworkcss/social-icons/msn.svg +0 -44
  269. data/app/assets/images/groundworkcss/social-icons/orkut-m.png +0 -0
  270. data/app/assets/images/groundworkcss/social-icons/orkut-s.png +0 -0
  271. data/app/assets/images/groundworkcss/social-icons/orkut.png +0 -0
  272. data/app/assets/images/groundworkcss/social-icons/orkut.svg +0 -23
  273. data/app/assets/images/groundworkcss/social-icons/picasa-m.png +0 -0
  274. data/app/assets/images/groundworkcss/social-icons/picasa-s.png +0 -0
  275. data/app/assets/images/groundworkcss/social-icons/picasa.png +0 -0
  276. data/app/assets/images/groundworkcss/social-icons/picasa.svg +0 -48
  277. data/app/assets/images/groundworkcss/social-icons/pinterest-m.png +0 -0
  278. data/app/assets/images/groundworkcss/social-icons/pinterest-s.png +0 -0
  279. data/app/assets/images/groundworkcss/social-icons/pinterest.png +0 -0
  280. data/app/assets/images/groundworkcss/social-icons/pinterest.svg +0 -42
  281. data/app/assets/images/groundworkcss/social-icons/pocketapp-m.png +0 -0
  282. data/app/assets/images/groundworkcss/social-icons/pocketapp-s.png +0 -0
  283. data/app/assets/images/groundworkcss/social-icons/pocketapp.png +0 -0
  284. data/app/assets/images/groundworkcss/social-icons/pocketapp.svg +0 -38
  285. data/app/assets/images/groundworkcss/social-icons/quora-m.png +0 -0
  286. data/app/assets/images/groundworkcss/social-icons/quora-s.png +0 -0
  287. data/app/assets/images/groundworkcss/social-icons/quora.png +0 -0
  288. data/app/assets/images/groundworkcss/social-icons/quora.svg +0 -20
  289. data/app/assets/images/groundworkcss/social-icons/rdio-m.png +0 -0
  290. data/app/assets/images/groundworkcss/social-icons/rdio-s.png +0 -0
  291. data/app/assets/images/groundworkcss/social-icons/rdio.png +0 -0
  292. data/app/assets/images/groundworkcss/social-icons/rdio.svg +0 -18
  293. data/app/assets/images/groundworkcss/social-icons/renren-m.png +0 -0
  294. data/app/assets/images/groundworkcss/social-icons/renren-s.png +0 -0
  295. data/app/assets/images/groundworkcss/social-icons/renren.png +0 -0
  296. data/app/assets/images/groundworkcss/social-icons/renren.svg +0 -79
  297. data/app/assets/images/groundworkcss/social-icons/rss-m.png +0 -0
  298. data/app/assets/images/groundworkcss/social-icons/rss-s.png +0 -0
  299. data/app/assets/images/groundworkcss/social-icons/rss.png +0 -0
  300. data/app/assets/images/groundworkcss/social-icons/rss.svg +0 -18
  301. data/app/assets/images/groundworkcss/social-icons/skitch-m.png +0 -0
  302. data/app/assets/images/groundworkcss/social-icons/skitch-s.png +0 -0
  303. data/app/assets/images/groundworkcss/social-icons/skitch.png +0 -0
  304. data/app/assets/images/groundworkcss/social-icons/skitch.svg +0 -24
  305. data/app/assets/images/groundworkcss/social-icons/skype-m.png +0 -0
  306. data/app/assets/images/groundworkcss/social-icons/skype-s.png +0 -0
  307. data/app/assets/images/groundworkcss/social-icons/skype.png +0 -0
  308. data/app/assets/images/groundworkcss/social-icons/skype.svg +0 -25
  309. data/app/assets/images/groundworkcss/social-icons/soundcloud-m.png +0 -0
  310. data/app/assets/images/groundworkcss/social-icons/soundcloud-s.png +0 -0
  311. data/app/assets/images/groundworkcss/social-icons/soundcloud.png +0 -0
  312. data/app/assets/images/groundworkcss/social-icons/soundcloud.svg +0 -60
  313. data/app/assets/images/groundworkcss/social-icons/spotify-m.png +0 -0
  314. data/app/assets/images/groundworkcss/social-icons/spotify-s.png +0 -0
  315. data/app/assets/images/groundworkcss/social-icons/spotify.png +0 -0
  316. data/app/assets/images/groundworkcss/social-icons/spotify.svg +0 -38
  317. data/app/assets/images/groundworkcss/social-icons/stackoverflow-m.png +0 -0
  318. data/app/assets/images/groundworkcss/social-icons/stackoverflow-s.png +0 -0
  319. data/app/assets/images/groundworkcss/social-icons/stackoverflow.png +0 -0
  320. data/app/assets/images/groundworkcss/social-icons/stackoverflow.svg +0 -32
  321. data/app/assets/images/groundworkcss/social-icons/stumbleupon-m.png +0 -0
  322. data/app/assets/images/groundworkcss/social-icons/stumbleupon-s.png +0 -0
  323. data/app/assets/images/groundworkcss/social-icons/stumbleupon.png +0 -0
  324. data/app/assets/images/groundworkcss/social-icons/stumbleupon.svg +0 -22
  325. data/app/assets/images/groundworkcss/social-icons/svn-m.png +0 -0
  326. data/app/assets/images/groundworkcss/social-icons/svn-s.png +0 -0
  327. data/app/assets/images/groundworkcss/social-icons/svn.png +0 -0
  328. data/app/assets/images/groundworkcss/social-icons/svn.svg +0 -25
  329. data/app/assets/images/groundworkcss/social-icons/tent-m.png +0 -0
  330. data/app/assets/images/groundworkcss/social-icons/tent-s.png +0 -0
  331. data/app/assets/images/groundworkcss/social-icons/tent.png +0 -0
  332. data/app/assets/images/groundworkcss/social-icons/tent.svg +0 -16
  333. data/app/assets/images/groundworkcss/social-icons/tripadvisor-m.png +0 -0
  334. data/app/assets/images/groundworkcss/social-icons/tripadvisor-s.png +0 -0
  335. data/app/assets/images/groundworkcss/social-icons/tripadvisor.png +0 -0
  336. data/app/assets/images/groundworkcss/social-icons/tripadvisor.svg +0 -30
  337. data/app/assets/images/groundworkcss/social-icons/tumblr-m.png +0 -0
  338. data/app/assets/images/groundworkcss/social-icons/tumblr-s.png +0 -0
  339. data/app/assets/images/groundworkcss/social-icons/tumblr.png +0 -0
  340. data/app/assets/images/groundworkcss/social-icons/tumblr.svg +0 -16
  341. data/app/assets/images/groundworkcss/social-icons/twitter-m.png +0 -0
  342. data/app/assets/images/groundworkcss/social-icons/twitter-s.png +0 -0
  343. data/app/assets/images/groundworkcss/social-icons/twitter.png +0 -0
  344. data/app/assets/images/groundworkcss/social-icons/twitter.svg +0 -24
  345. data/app/assets/images/groundworkcss/social-icons/vimeo-m.png +0 -0
  346. data/app/assets/images/groundworkcss/social-icons/vimeo-s.png +0 -0
  347. data/app/assets/images/groundworkcss/social-icons/vimeo.png +0 -0
  348. data/app/assets/images/groundworkcss/social-icons/vimeo.svg +0 -20
  349. data/app/assets/images/groundworkcss/social-icons/weibo-m.png +0 -0
  350. data/app/assets/images/groundworkcss/social-icons/weibo-s.png +0 -0
  351. data/app/assets/images/groundworkcss/social-icons/weibo.png +0 -0
  352. data/app/assets/images/groundworkcss/social-icons/weibo.svg +0 -54
  353. data/app/assets/images/groundworkcss/social-icons/windows-m.png +0 -0
  354. data/app/assets/images/groundworkcss/social-icons/windows-s.png +0 -0
  355. data/app/assets/images/groundworkcss/social-icons/windows.png +0 -0
  356. data/app/assets/images/groundworkcss/social-icons/windows.svg +0 -26
  357. data/app/assets/images/groundworkcss/social-icons/wordpress-m.png +0 -0
  358. data/app/assets/images/groundworkcss/social-icons/wordpress-s.png +0 -0
  359. data/app/assets/images/groundworkcss/social-icons/wordpress.png +0 -0
  360. data/app/assets/images/groundworkcss/social-icons/wordpress.svg +0 -50
  361. data/app/assets/images/groundworkcss/social-icons/xing-m.png +0 -0
  362. data/app/assets/images/groundworkcss/social-icons/xing-s.png +0 -0
  363. data/app/assets/images/groundworkcss/social-icons/xing.png +0 -0
  364. data/app/assets/images/groundworkcss/social-icons/xing.svg +0 -16
  365. data/app/assets/images/groundworkcss/social-icons/yelp-m.png +0 -0
  366. data/app/assets/images/groundworkcss/social-icons/yelp-s.png +0 -0
  367. data/app/assets/images/groundworkcss/social-icons/yelp.png +0 -0
  368. data/app/assets/images/groundworkcss/social-icons/yelp.svg +0 -54
  369. data/app/assets/images/groundworkcss/social-icons/youtube-m.png +0 -0
  370. data/app/assets/images/groundworkcss/social-icons/youtube-s.png +0 -0
  371. data/app/assets/images/groundworkcss/social-icons/youtube.png +0 -0
  372. data/app/assets/images/groundworkcss/social-icons/youtube.svg +0 -106
  373. data/app/assets/images/groundworkcss/social-icons/youversion-m.png +0 -0
  374. data/app/assets/images/groundworkcss/social-icons/youversion-s.png +0 -0
  375. data/app/assets/images/groundworkcss/social-icons/youversion.png +0 -0
  376. data/app/assets/images/groundworkcss/social-icons/youversion.svg +0 -54
  377. data/app/assets/images/groundworkcss/social-icons/zerply-m.png +0 -0
  378. data/app/assets/images/groundworkcss/social-icons/zerply-s.png +0 -0
  379. data/app/assets/images/groundworkcss/social-icons/zerply.png +0 -0
  380. data/app/assets/images/groundworkcss/social-icons/zerply.svg +0 -20
  381. data/app/assets/javascripts/groundworkcss/components/disabled.coffee +0 -18
  382. data/app/assets/javascripts/groundworkcss/components/modals.coffee +0 -46
  383. data/app/assets/javascripts/groundworkcss/components/pagination.coffee +0 -128
  384. data/app/assets/javascripts/groundworkcss/components/tiles.coffee +0 -32
  385. data/app/assets/javascripts/groundworkcss/index.js +0 -17
  386. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.caption2.js +0 -67
  387. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.carousel.js +0 -265
  388. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.center.js +0 -63
  389. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.ie-fade.js +0 -46
  390. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.scrollVert.js +0 -15
  391. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.shuffle.js +0 -62
  392. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.swipe.js +0 -70
  393. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.tile.js +0 -131
  394. data/app/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.video.js +0 -66
  395. data/app/assets/javascripts/groundworkcss/plugins/jquery-tooltip.coffee +0 -127
  396. data/app/assets/javascripts/groundworkcss/plugins/jquery.cycle2.js +0 -1426
  397. data/app/assets/javascripts/groundworkcss/plugins/jquery.magnific-popup.js +0 -1760
  398. data/app/assets/stylesheets/groundworkcss/base/_animations.scss +0 -29
  399. data/app/assets/stylesheets/groundworkcss/form/_all-form.scss +0 -11
  400. data/app/assets/stylesheets/groundworkcss/form/_tiles.scss +0 -98
  401. data/app/assets/stylesheets/groundworkcss/nav/_all-nav.scss +0 -12
  402. data/app/assets/stylesheets/groundworkcss/nav/_buttons.scss +0 -341
  403. data/app/assets/stylesheets/groundworkcss/nav/_navigation.scss +0 -409
  404. data/app/assets/stylesheets/groundworkcss/nav/_tabs.scss +0 -232
  405. data/app/assets/stylesheets/groundworkcss/social-icons-png.scss +0 -295
  406. data/app/assets/stylesheets/groundworkcss/social-icons-svg.scss +0 -99
  407. data/app/assets/stylesheets/groundworkcss/ui/_callouts.scss +0 -143
  408. data/app/assets/stylesheets/groundworkcss/ui/_modals.scss +0 -556
  409. data/app/assets/stylesheets/groundworkcss/ui/_tooltips.scss +0 -197
  410. data/groundworkcss-0.4.3.gem +0 -0
  411. data/lib/groundworkcss/railties.rb +0 -8
@@ -1,1760 +0,0 @@
1
- /*! Magnific Popup - v0.8.5 - 2013-05-15
2
- * http://dimsemenov.com/plugins/magnific-popup/
3
- * Copyright (c) 2013 Dmitry Semenov; */
4
- ;(function($) {
5
-
6
- /*>>core*/
7
- /**
8
- *
9
- * Magnific Popup Core JS file
10
- *
11
- */
12
-
13
-
14
- /**
15
- * Private static constants
16
- */
17
- var CLOSE_EVENT = 'Close',
18
- BEFORE_APPEND_EVENT = 'BeforeAppend',
19
- MARKUP_PARSE_EVENT = 'MarkupParse',
20
- OPEN_EVENT = 'Open',
21
- CHANGE_EVENT = 'Change',
22
- NS = 'mfp',
23
- EVENT_NS = '.' + NS,
24
- READY_CLASS = 'mfp-ready',
25
- REMOVING_CLASS = 'mfp-removing',
26
- PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
27
-
28
-
29
- /**
30
- * Private vars
31
- */
32
- var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
33
- MagnificPopup = function(){},
34
- _isJQ = !!(window.jQuery),
35
- _prevStatus,
36
- _window = $(window),
37
- _body,
38
- _document,
39
- _prevContentType,
40
- _wrapClasses,
41
- _currPopupType;
42
-
43
-
44
- /**
45
- * Private functions
46
- */
47
- var _mfpOn = function(name, f) {
48
- mfp.ev.on(NS + name + EVENT_NS, f);
49
- },
50
- _getEl = function(className, appendTo, html, raw) {
51
- var el = document.createElement('div');
52
- el.className = 'mfp-'+className;
53
- if(html) {
54
- el.innerHTML = html;
55
- }
56
- if(!raw) {
57
- el = $(el);
58
- if(appendTo) {
59
- el.appendTo(appendTo);
60
- }
61
- } else if(appendTo) {
62
- appendTo.appendChild(el);
63
- }
64
- return el;
65
- },
66
- _mfpTrigger = function(e, data) {
67
- mfp.ev.triggerHandler(NS + e, data);
68
-
69
- if(mfp.st.callbacks) {
70
- // converts "mfpEventName" to "eventName" callback and triggers it if it's present
71
- e = e.charAt(0).toLowerCase() + e.slice(1);
72
- if(mfp.st.callbacks[e]) {
73
- mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
74
- }
75
- }
76
- },
77
- _setFocus = function() {
78
- (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
79
- },
80
- _getCloseBtn = function(type) {
81
- if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
82
- mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
83
- _currPopupType = type;
84
- }
85
- return mfp.currTemplate.closeBtn;
86
- },
87
- // Initialize Magnific Popup only when called at least once
88
- _checkInstance = function() {
89
- if(!$.magnificPopup.instance) {
90
- mfp = new MagnificPopup();
91
- mfp.init();
92
- $.magnificPopup.instance = mfp;
93
- }
94
- },
95
- // Check to close popup or not
96
- // "target" is an element that was clicked
97
- _checkIfClose = function(target) {
98
-
99
- if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
100
- return;
101
- }
102
-
103
- var closeOnContent = mfp.st.closeOnContentClick;
104
- var closeOnBg = mfp.st.closeOnBgClick;
105
-
106
- if(closeOnContent && closeOnBg) {
107
- return true;
108
- } else {
109
-
110
- // We close the popup if click is on close button or on preloader. Or if there is no content.
111
- if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
112
- return true;
113
- }
114
-
115
- // if click is outside the content
116
- if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
117
- if(closeOnBg) {
118
- return true;
119
- }
120
- } else if(closeOnContent) {
121
- return true;
122
- }
123
-
124
- }
125
- return false;
126
- };
127
-
128
-
129
-
130
- /**
131
- * Public functions
132
- */
133
- MagnificPopup.prototype = {
134
-
135
- constructor: MagnificPopup,
136
-
137
- /**
138
- * Initializes Magnific Popup plugin.
139
- * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
140
- */
141
- init: function() {
142
- var appVersion = navigator.appVersion;
143
- mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
144
- mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1,
145
- mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
146
- mfp.isAndroid = (/android/gi).test(appVersion);
147
- mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
148
- // We disable fixed positioned lightbox on devices that don't handle it nicely.
149
- // If you know a better way of detecting this - let me know.
150
- mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
151
- _body = $(document.body);
152
- _document = $(document);
153
-
154
- mfp.popupsCache = {};
155
- },
156
-
157
- /**
158
- * Opens popup
159
- * @param data [description]
160
- */
161
- open: function(data) {
162
-
163
- mfp.items = data.items.length ? data.items : [data.items];
164
-
165
- if(mfp.isOpen) {
166
- mfp.updateItemHTML();
167
- return;
168
- }
169
-
170
- var i;
171
-
172
- mfp.types = [];
173
- _wrapClasses = '';
174
-
175
- mfp.ev = data.el || _document;
176
-
177
- if(data.isObj) {
178
- mfp.index = data.index || 0;
179
- } else {
180
- mfp.index = 0;
181
- var items = data.items,
182
- item;
183
- for(i = 0; i < items.length; i++) {
184
- item = items[i];
185
- if(item.parsed) {
186
- item = item.el[0];
187
- }
188
- if(item === data.el[0]) {
189
- mfp.index = i;
190
- break;
191
- }
192
- }
193
- }
194
-
195
-
196
- if(data.key) {
197
- if(!mfp.popupsCache[data.key]) {
198
- mfp.popupsCache[data.key] = {};
199
- }
200
- mfp.currTemplate = mfp.popupsCache[data.key];
201
- } else {
202
- mfp.currTemplate = {};
203
- }
204
-
205
-
206
-
207
- mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
208
- mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
209
-
210
-
211
-
212
- // Building markup
213
- // main containers are created only once
214
- if(!mfp.bgOverlay) {
215
-
216
- // Dark overlay
217
- mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
218
- mfp.close();
219
- });
220
-
221
- mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
222
- if(_checkIfClose(e.target)) {
223
- mfp.close();
224
- }
225
- });
226
-
227
- mfp.container = _getEl('container', mfp.wrap);
228
- }
229
-
230
- mfp.contentContainer = _getEl('content');
231
- if(mfp.st.preloader) {
232
- mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
233
- }
234
-
235
-
236
- // Initializing modules
237
- var modules = $.magnificPopup.modules;
238
- for(i = 0; i < modules.length; i++) {
239
- var n = modules[i];
240
- n = n.charAt(0).toUpperCase() + n.slice(1);
241
- mfp['init'+n].call(mfp);
242
- }
243
- _mfpTrigger('BeforeOpen');
244
-
245
-
246
- // Close button
247
- if(!mfp.st.closeBtnInside) {
248
- mfp.wrap.append( _getCloseBtn() );
249
- } else {
250
- _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
251
- values.close_replaceWith = _getCloseBtn(item.type);
252
- });
253
- _wrapClasses += ' mfp-close-btn-in';
254
- }
255
-
256
- if(mfp.st.alignTop) {
257
- _wrapClasses += ' mfp-align-top';
258
- }
259
-
260
-
261
-
262
- if(mfp.fixedContentPos) {
263
- mfp.wrap.css({
264
- overflow: mfp.st.overflowY,
265
- overflowX: 'hidden',
266
- overflowY: mfp.st.overflowY
267
- });
268
- } else {
269
- mfp.wrap.css({
270
- top: _window.scrollTop(),
271
- position: 'absolute'
272
- });
273
- }
274
- if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
275
- mfp.bgOverlay.css({
276
- height: _document.height(),
277
- position: 'absolute'
278
- });
279
- }
280
-
281
-
282
-
283
- // Close on ESC key
284
- _document.on('keyup' + EVENT_NS, function(e) {
285
- if(e.keyCode === 27) {
286
- mfp.close();
287
- }
288
- });
289
-
290
- _window.on('resize' + EVENT_NS, function() {
291
- mfp.updateSize();
292
- });
293
-
294
-
295
- if(!mfp.st.closeOnContentClick) {
296
- _wrapClasses += ' mfp-auto-cursor';
297
- }
298
-
299
- if(_wrapClasses)
300
- mfp.wrap.addClass(_wrapClasses);
301
-
302
-
303
- // this triggers recalculation of layout, so we get it once to not to trigger twice
304
- var windowHeight = mfp.wH = _window.height();
305
-
306
-
307
- var bodyStyles = {};
308
-
309
- if( mfp.fixedContentPos ) {
310
- var s = mfp._getScrollbarSize();
311
- if(s) {
312
- bodyStyles.paddingRight = s;
313
- }
314
- }
315
-
316
- if(mfp.fixedContentPos) {
317
- if(!mfp.isIE7) {
318
- bodyStyles.overflow = 'hidden';
319
- } else {
320
- // ie7 double-scroll bug
321
- $('body, html').css('overflow', 'hidden');
322
- }
323
- }
324
-
325
-
326
-
327
- var classesToadd = mfp.st.mainClass;
328
- if(mfp.isIE7) {
329
- classesToadd += ' mfp-ie7';
330
- }
331
- if(classesToadd) {
332
- mfp._addClassToMFP( classesToadd );
333
- }
334
-
335
- // add content
336
- mfp.updateItemHTML();
337
-
338
- _mfpTrigger('BuildControls');
339
-
340
-
341
- // remove scrollbar, add padding e.t.c
342
- _body.css(bodyStyles);
343
-
344
- // add everything to DOM
345
- mfp.bgOverlay.add(mfp.wrap).prependTo( document.body );
346
-
347
-
348
-
349
- // Save last focused element
350
- mfp._lastFocusedEl = document.activeElement;
351
-
352
- // Wait for next cycle to allow CSS transition
353
- setTimeout(function() {
354
-
355
- if(mfp.content) {
356
- mfp._addClassToMFP(READY_CLASS);
357
- _setFocus();
358
- } else {
359
- // if content is not defined (not loaded e.t.c) we add class only for BG
360
- mfp.bgOverlay.addClass(READY_CLASS);
361
- }
362
-
363
- // Trap the focus in popup
364
- _document.on('focusin' + EVENT_NS, function (e) {
365
- if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
366
- _setFocus();
367
- return false;
368
- }
369
- });
370
-
371
- }, 16);
372
-
373
- mfp.isOpen = true;
374
- mfp.updateSize(windowHeight);
375
- _mfpTrigger(OPEN_EVENT);
376
- },
377
-
378
- /**
379
- * Closes the popup
380
- */
381
- close: function() {
382
- if(!mfp.isOpen) return;
383
-
384
- mfp.isOpen = false;
385
- // for CSS3 animation
386
- if(mfp.st.removalDelay && !mfp.isLowIE) {
387
- mfp._addClassToMFP(REMOVING_CLASS);
388
- setTimeout(function() {
389
- mfp._close();
390
- }, mfp.st.removalDelay);
391
- } else {
392
- mfp._close();
393
- }
394
- },
395
-
396
- /**
397
- * Helper for close() function
398
- */
399
- _close: function() {
400
- _mfpTrigger(CLOSE_EVENT);
401
-
402
- var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
403
-
404
- mfp.bgOverlay.detach();
405
- mfp.wrap.detach();
406
- mfp.container.empty();
407
-
408
- if(mfp.st.mainClass) {
409
- classesToRemove += mfp.st.mainClass + ' ';
410
- }
411
-
412
- mfp._removeClassFromMFP(classesToRemove);
413
-
414
- if(mfp.fixedContentPos) {
415
- var bodyStyles = {paddingRight: 0};
416
- if(mfp.isIE7) {
417
- $('body, html').css('overflow', 'auto');
418
- } else {
419
- bodyStyles.overflow = 'visible';
420
- }
421
- _body.css(bodyStyles);
422
- }
423
-
424
- _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
425
- mfp.ev.off(EVENT_NS);
426
-
427
- // clean up DOM elements that aren't removed
428
- mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
429
- mfp.bgOverlay.attr('class', 'mfp-bg');
430
- mfp.container.attr('class', 'mfp-container');
431
-
432
- // remove close button from target element
433
- if(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true ) {
434
- if(mfp.currTemplate.closeBtn)
435
- mfp.currTemplate.closeBtn.detach();
436
- }
437
-
438
-
439
- if(mfp._lastFocusedEl) {
440
- $(mfp._lastFocusedEl).focus(); // put tab focus back
441
- }
442
- mfp.currItem = null;
443
- mfp.content = null;
444
- mfp.currTemplate = null;
445
- mfp.prevHeight = 0;
446
- },
447
-
448
- updateSize: function(winHeight) {
449
-
450
- if(mfp.isIOS) {
451
- // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
452
- var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
453
- var height = window.innerHeight * zoomLevel;
454
- mfp.wrap.css('height', height);
455
- mfp.wH = height;
456
- } else {
457
- mfp.wH = winHeight || _window.height();
458
- }
459
-
460
- _mfpTrigger('Resize');
461
-
462
- },
463
-
464
- /**
465
- * Set content of popup based on current index
466
- */
467
- updateItemHTML: function() {
468
- var item = mfp.items[mfp.index];
469
-
470
- // Detach and perform modifications
471
- mfp.contentContainer.detach();
472
-
473
- if(mfp.content)
474
- mfp.content.detach();
475
-
476
- if(!item.parsed) {
477
- item = mfp.parseEl( mfp.index );
478
- }
479
-
480
- var type = item.type;
481
-
482
- _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
483
- // BeforeChange event works like so:
484
- // _mfpOn('BeforeChange', function(e, prevType, newType) { });
485
-
486
- mfp.currItem = item;
487
-
488
-
489
-
490
-
491
-
492
- if(!mfp.currTemplate[type]) {
493
- var markup = mfp.st[type] ? mfp.st[type].markup : false;
494
-
495
- // allows to modify markup
496
- _mfpTrigger('FirstMarkupParse', markup);
497
-
498
- if(markup) {
499
- mfp.currTemplate[type] = $(markup);
500
- } else {
501
- // if there is no markup found we just define that template is parsed
502
- mfp.currTemplate[type] = true;
503
- }
504
- }
505
-
506
- if(_prevContentType && _prevContentType !== item.type) {
507
- mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
508
- }
509
-
510
- var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
511
- mfp.appendContent(newContent, type);
512
-
513
- item.preloaded = true;
514
-
515
- _mfpTrigger(CHANGE_EVENT, item);
516
- _prevContentType = item.type;
517
-
518
- // Append container back after its content changed
519
- mfp.container.prepend(mfp.contentContainer);
520
-
521
- _mfpTrigger('AfterChange');
522
- },
523
-
524
-
525
- /**
526
- * Set HTML content of popup
527
- */
528
- appendContent: function(newContent, type) {
529
- mfp.content = newContent;
530
-
531
- if(newContent) {
532
- if(mfp.st.closeBtnInside && mfp.currTemplate[type] === true) {
533
- // if there is no markup, we just append close button element inside
534
- if(!mfp.content.find('.mfp-close').length) {
535
- mfp.content.append(_getCloseBtn());
536
- }
537
- } else {
538
- mfp.content = newContent;
539
- }
540
- } else {
541
- mfp.content = '';
542
- }
543
-
544
- _mfpTrigger(BEFORE_APPEND_EVENT);
545
- mfp.container.addClass('mfp-'+type+'-holder');
546
-
547
- mfp.contentContainer.append(mfp.content);
548
- },
549
-
550
-
551
-
552
-
553
- /**
554
- * Creates Magnific Popup data object based on given data
555
- * @param {int} index Index of item to parse
556
- */
557
- parseEl: function(index) {
558
- var item = mfp.items[index],
559
- type = item.type;
560
-
561
-
562
- if(item.tagName) {
563
- item = { el: $(item) };
564
- } else {
565
- item = { data: item, src: item.src };
566
- }
567
-
568
- if(item.el) {
569
- var types = mfp.types;
570
-
571
- // check for 'mfp-TYPE' class
572
- for(var i = 0; i < types.length; i++) {
573
- if( item.el.hasClass('mfp-'+types[i]) ) {
574
- type = types[i];
575
- break;
576
- }
577
- }
578
-
579
- item.src = item.el.attr('data-mfp-src');
580
- if(!item.src) {
581
- item.src = item.el.attr('href');
582
- }
583
- }
584
-
585
- item.type = type || mfp.st.type || 'inline';
586
- item.index = index;
587
- item.parsed = true;
588
- mfp.items[index] = item;
589
- _mfpTrigger('ElementParse', item);
590
-
591
- return mfp.items[index];
592
- },
593
-
594
-
595
- /**
596
- * Initializes single popup or a group of popups
597
- */
598
- addGroup: function(el, options) {
599
- var eHandler = function(e) {
600
- e.mfpEl = this;
601
- mfp._openClick(e, el, options);
602
- };
603
-
604
- if(!options) {
605
- options = {};
606
- }
607
-
608
- var eName = 'click.magnificPopup';
609
- options.mainEl = el;
610
-
611
- if(options.items) {
612
- options.isObj = true;
613
- el.off(eName).on(eName, eHandler);
614
- } else {
615
- options.isObj = false;
616
- if(options.delegate) {
617
- el.off(eName).on(eName, options.delegate , eHandler);
618
- } else {
619
- options.items = el;
620
- el.off(eName).on(eName, eHandler);
621
- }
622
- }
623
- },
624
- _openClick: function(e, el, options) {
625
- var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
626
- if( midClick || e.which !== 2 ) {
627
- var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
628
-
629
- if(disableOn) {
630
- if($.isFunction(disableOn)) {
631
- if( !disableOn.call(mfp) ) {
632
- return true;
633
- }
634
- } else { // else it's number
635
- if( _window.width() < disableOn ) {
636
- return true;
637
- }
638
- }
639
- }
640
-
641
- if(e.type)
642
- e.preventDefault();
643
-
644
- options.el = $(e.mfpEl);
645
- if(options.delegate) {
646
- options.items = el.find(options.delegate);
647
- }
648
- mfp.open(options);
649
- }
650
- },
651
-
652
-
653
- /**
654
- * Updates text on preloader
655
- */
656
- updateStatus: function(status, text) {
657
-
658
- if(mfp.preloader) {
659
- if(_prevStatus !== status) {
660
- mfp.container.removeClass('mfp-s-'+_prevStatus);
661
- }
662
-
663
- if(!text && status === 'loading') {
664
- text = mfp.st.tLoading;
665
- }
666
-
667
- var data = {
668
- status: status,
669
- text: text
670
- };
671
- // allows to modify status
672
- _mfpTrigger('UpdateStatus', data);
673
-
674
- status = data.status;
675
- text = data.text;
676
-
677
- mfp.preloader.html(text);
678
-
679
- mfp.preloader.find('a').click(function(e) {
680
- e.stopImmediatePropagation();
681
- });
682
-
683
- mfp.container.addClass('mfp-s-'+status);
684
- _prevStatus = status;
685
- }
686
- },
687
-
688
-
689
- /*
690
- "Private" helpers that aren't private at all
691
- */
692
- _addClassToMFP: function(cName) {
693
- mfp.bgOverlay.addClass(cName);
694
- mfp.wrap.addClass(cName);
695
- },
696
- _removeClassFromMFP: function(cName) {
697
- this.bgOverlay.removeClass(cName);
698
- mfp.wrap.removeClass(cName);
699
- },
700
- _hasScrollBar: function(winHeight) {
701
- if(document.body.clientHeight > (winHeight || _window.height()) ) {
702
- return true;
703
- }
704
- return false;
705
- },
706
-
707
- _parseMarkup: function(template, values, item) {
708
- var arr;
709
- if(item.data) {
710
- values = $.extend(item.data, values);
711
- }
712
- _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
713
-
714
- $.each(values, function(key, value) {
715
- if(value === undefined || value === false) {
716
- return true;
717
- }
718
- arr = key.split('_');
719
- if(arr.length > 1) {
720
- var el = template.find(EVENT_NS + '-'+arr[0]);
721
-
722
- if(el.length > 0) {
723
- var attr = arr[1];
724
- if(attr === 'replaceWith') {
725
- if(el[0] !== value[0]) {
726
- el.replaceWith(value);
727
- }
728
- } else if(attr === 'img') {
729
- if(el.is('img')) {
730
- el.attr('src', value);
731
- } else {
732
- el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
733
- }
734
- } else {
735
- el.attr(arr[1], value);
736
- }
737
- }
738
-
739
- } else {
740
- template.find(EVENT_NS + '-'+key).html(value);
741
- }
742
- });
743
- },
744
-
745
- _getScrollbarSize: function() {
746
- // thx David
747
- if(mfp.scrollbarSize === undefined) {
748
- var scrollDiv = document.createElement("div");
749
- scrollDiv.id = "mfp-sbm";
750
- scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
751
- document.body.appendChild(scrollDiv);
752
- mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
753
- document.body.removeChild(scrollDiv);
754
- }
755
- return mfp.scrollbarSize;
756
- }
757
-
758
- }; /* MagnificPopup core prototype end */
759
-
760
-
761
-
762
-
763
- /**
764
- * Public static functions
765
- */
766
- $.magnificPopup = {
767
- instance: null,
768
- proto: MagnificPopup.prototype,
769
- modules: [],
770
-
771
- open: function(options, index) {
772
- _checkInstance();
773
-
774
- if(!options)
775
- options = {};
776
-
777
- options.isObj = true;
778
- options.index = index || 0;
779
- return this.instance.open(options);
780
- },
781
-
782
- close: function() {
783
- return $.magnificPopup.instance.close();
784
- },
785
-
786
- registerModule: function(name, module) {
787
- if(module.options) {
788
- $.magnificPopup.defaults[name] = module.options;
789
- }
790
- $.extend(this.proto, module.proto);
791
- this.modules.push(name);
792
- },
793
-
794
- defaults: {
795
-
796
- // Info about options is in docs:
797
- // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
798
-
799
- disableOn: 0,
800
-
801
- key: null,
802
-
803
- midClick: false,
804
-
805
- mainClass: '',
806
-
807
- preloader: true,
808
-
809
- focus: '', // CSS selector of input to focus after popup is opened
810
-
811
- closeOnContentClick: false,
812
-
813
- closeOnBgClick: true,
814
-
815
- closeBtnInside: true,
816
-
817
- alignTop: false,
818
-
819
- removalDelay: 0,
820
-
821
- fixedContentPos: 'auto',
822
-
823
- fixedBgPos: 'auto',
824
-
825
- overflowY: 'auto',
826
-
827
- closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
828
-
829
- tClose: 'Close (Esc)',
830
-
831
- tLoading: 'Loading...'
832
-
833
- }
834
- };
835
-
836
-
837
-
838
- $.fn.magnificPopup = function(options) {
839
- _checkInstance();
840
-
841
- var jqEl = $(this);
842
-
843
- // We call some API method of first param is a string
844
- if (typeof options === "string" ) {
845
-
846
- if(options === 'open') {
847
- var items,
848
- itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
849
- index = parseInt(arguments[1], 10) || 0;
850
-
851
- if(itemOpts.items) {
852
- items = itemOpts.items[index];
853
- } else {
854
- items = jqEl;
855
- if(itemOpts.delegate) {
856
- items = items.find(itemOpts.delegate);
857
- }
858
- items = items.eq( index );
859
- }
860
- mfp._openClick({mfpEl:items}, jqEl, itemOpts);
861
- } else {
862
- if(mfp.isOpen)
863
- mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
864
- }
865
-
866
- } else {
867
-
868
- /*
869
- * As Zepto doesn't support .data() method for objects
870
- * and it works only in normal browsers
871
- * we assign "options" object directly to the DOM element. FTW!
872
- */
873
- if(_isJQ) {
874
- jqEl.data('magnificPopup', options);
875
- } else {
876
- jqEl[0].magnificPopup = options;
877
- }
878
-
879
- mfp.addGroup(jqEl, options);
880
-
881
- }
882
- return jqEl;
883
- };
884
-
885
-
886
- //Quick benchmark
887
- /*
888
- var start = performance.now(),
889
- i,
890
- rounds = 1000;
891
-
892
- for(i = 0; i < rounds; i++) {
893
-
894
- }
895
- console.log('Test #1:', performance.now() - start);
896
-
897
- start = performance.now();
898
- for(i = 0; i < rounds; i++) {
899
-
900
- }
901
- console.log('Test #2:', performance.now() - start);
902
- */
903
-
904
- /*>>core*/
905
-
906
- /*>>inline*/
907
-
908
- var INLINE_NS = 'inline',
909
- _hiddenClass,
910
- _inlinePlaceholder,
911
- _lastInlineElement,
912
- _putInlineElementsBack = function() {
913
- if(_lastInlineElement) {
914
- _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
915
- _lastInlineElement = null;
916
- }
917
- };
918
-
919
- $.magnificPopup.registerModule(INLINE_NS, {
920
- options: {
921
- hiddenClass: 'hide', // will be appended with `mfp-` prefix
922
- markup: '',
923
- tNotFound: 'Content not found'
924
- },
925
- proto: {
926
-
927
- initInline: function() {
928
- mfp.types.push(INLINE_NS);
929
-
930
- _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
931
- _putInlineElementsBack();
932
- });
933
- },
934
-
935
- getInline: function(item, template) {
936
-
937
- _putInlineElementsBack();
938
-
939
- if(item.src) {
940
- var inlineSt = mfp.st.inline,
941
- el = $(item.src);
942
-
943
- if(el.length) {
944
-
945
- // If target element has parent - we replace it with placeholder and put it back after popup is closed
946
- if(el[0].parentNode !== null) {
947
- if(!_inlinePlaceholder) {
948
- _hiddenClass = inlineSt.hiddenClass;
949
- _inlinePlaceholder = _getEl(_hiddenClass);
950
- _hiddenClass = 'mfp-'+_hiddenClass;
951
- }
952
- // replace target inline element with placeholder
953
- _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
954
- }
955
-
956
- mfp.updateStatus('ready');
957
- } else {
958
- mfp.updateStatus('error', inlineSt.tNotFound);
959
- el = $('<div>');
960
- }
961
-
962
- item.inlineElement = el;
963
- return el;
964
- }
965
-
966
- mfp.updateStatus('ready');
967
- mfp._parseMarkup(template, {}, item);
968
- return template;
969
- }
970
- }
971
- });
972
-
973
- /*>>inline*/
974
-
975
- /*>>ajax*/
976
- var AJAX_NS = 'ajax',
977
- _ajaxCur,
978
- _removeAjaxCursor = function() {
979
- if(_ajaxCur) {
980
- _body.removeClass(_ajaxCur);
981
- }
982
- };
983
-
984
- $.magnificPopup.registerModule(AJAX_NS, {
985
-
986
- options: {
987
- settings: null,
988
- cursor: 'mfp-ajax-cur',
989
- tError: '<a href="%url%">The content</a> could not be loaded.'
990
- },
991
-
992
- proto: {
993
- initAjax: function() {
994
- mfp.types.push(AJAX_NS);
995
- _ajaxCur = mfp.st.ajax.cursor;
996
-
997
- _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, function() {
998
- _removeAjaxCursor();
999
- if(mfp.req) {
1000
- mfp.req.abort();
1001
- }
1002
- });
1003
- },
1004
-
1005
- getAjax: function(item) {
1006
-
1007
- if(_ajaxCur)
1008
- _body.addClass(_ajaxCur);
1009
-
1010
- mfp.updateStatus('loading');
1011
-
1012
- var opts = $.extend({
1013
- url: item.src,
1014
- success: function(data, textStatus, jqXHR) {
1015
-
1016
- _mfpTrigger('ParseAjax', jqXHR);
1017
-
1018
- mfp.appendContent( $(jqXHR.responseText), AJAX_NS );
1019
-
1020
- item.finished = true;
1021
-
1022
- _removeAjaxCursor();
1023
-
1024
- _setFocus();
1025
-
1026
- setTimeout(function() {
1027
- mfp.wrap.addClass(READY_CLASS);
1028
- }, 16);
1029
-
1030
- mfp.updateStatus('ready');
1031
-
1032
- },
1033
- error: function() {
1034
- _removeAjaxCursor();
1035
- item.finished = item.loadError = true;
1036
- mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1037
- }
1038
- }, mfp.st.ajax.settings);
1039
-
1040
- mfp.req = $.ajax(opts);
1041
-
1042
- return '';
1043
- }
1044
- }
1045
- });
1046
-
1047
-
1048
-
1049
-
1050
-
1051
-
1052
-
1053
- /*>>ajax*/
1054
-
1055
- /*>>image*/
1056
- var _imgInterval,
1057
- _getTitle = function(item) {
1058
- if(item.data && item.data.title !== undefined)
1059
- return item.data.title;
1060
-
1061
- var src = mfp.st.image.titleSrc;
1062
-
1063
- if(src) {
1064
- if($.isFunction(src)) {
1065
- return src.call(mfp, item);
1066
- } else if(item.el) {
1067
- return item.el.attr(src) || '';
1068
- }
1069
- }
1070
- return '';
1071
- };
1072
-
1073
- $.magnificPopup.registerModule('image', {
1074
-
1075
- options: {
1076
- markup: '<div class="mfp-figure">'+
1077
- '<div class="mfp-close"></div>'+
1078
- '<div class="mfp-img"></div>'+
1079
- '<div class="mfp-bottom-bar">'+
1080
- '<div class="mfp-title"></div>'+
1081
- '<div class="mfp-counter"></div>'+
1082
- '</div>'+
1083
- '</div>',
1084
- cursor: 'mfp-zoom-out-cur',
1085
- titleSrc: 'title',
1086
- verticalFit: true,
1087
- tError: '<a href="%url%">The image</a> could not be loaded.'
1088
- },
1089
-
1090
- proto: {
1091
- initImage: function() {
1092
- var imgSt = mfp.st.image,
1093
- ns = '.image';
1094
-
1095
- mfp.types.push('image');
1096
-
1097
- _mfpOn(OPEN_EVENT+ns, function() {
1098
- if(mfp.currItem.type === 'image' && imgSt.cursor) {
1099
- _body.addClass(imgSt.cursor);
1100
- }
1101
- });
1102
-
1103
- _mfpOn(CLOSE_EVENT+ns, function() {
1104
- if(imgSt.cursor) {
1105
- _body.removeClass(imgSt.cursor);
1106
- }
1107
- _window.off('resize' + EVENT_NS);
1108
- });
1109
-
1110
- _mfpOn('Resize'+ns, mfp.resizeImage);
1111
- if(mfp.isLowIE) {
1112
- _mfpOn('AfterChange', mfp.resizeImage);
1113
- }
1114
- },
1115
- resizeImage: function() {
1116
- var item = mfp.currItem;
1117
- if(!item.img) return;
1118
-
1119
- if(mfp.st.image.verticalFit) {
1120
- var decr = 0;
1121
- // fix box-sizing in ie7/8
1122
- if(mfp.isLowIE) {
1123
- decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1124
- }
1125
- item.img.css('max-height', mfp.wH-decr);
1126
- }
1127
- },
1128
- _onImageHasSize: function(item) {
1129
- if(item.img) {
1130
-
1131
- item.hasSize = true;
1132
-
1133
- if(_imgInterval) {
1134
- clearInterval(_imgInterval);
1135
- }
1136
-
1137
- item.isCheckingImgSize = false;
1138
-
1139
- _mfpTrigger('ImageHasSize', item);
1140
-
1141
- if(item.imgHidden) {
1142
- if(mfp.content)
1143
- mfp.content.removeClass('mfp-loading');
1144
-
1145
- item.imgHidden = false;
1146
- }
1147
-
1148
- }
1149
- },
1150
-
1151
- /**
1152
- * Function that loops until the image has size to display elements that rely on it asap
1153
- */
1154
- findImageSize: function(item) {
1155
-
1156
- var counter = 0,
1157
- img = item.img[0],
1158
- mfpSetInterval = function(delay) {
1159
-
1160
- if(_imgInterval) {
1161
- clearInterval(_imgInterval);
1162
- }
1163
- // decelerating interval that checks for size of an image
1164
- _imgInterval = setInterval(function() {
1165
- if(img.naturalWidth > 0) {
1166
- mfp._onImageHasSize(item);
1167
- return;
1168
- }
1169
-
1170
- if(counter > 200) {
1171
- clearInterval(_imgInterval);
1172
- }
1173
-
1174
- counter++;
1175
- if(counter === 3) {
1176
- mfpSetInterval(10);
1177
- } else if(counter === 40) {
1178
- mfpSetInterval(50);
1179
- } else if(counter === 100) {
1180
- mfpSetInterval(500);
1181
- }
1182
- }, delay);
1183
- };
1184
-
1185
- mfpSetInterval(1);
1186
- },
1187
-
1188
- getImage: function(item, template) {
1189
-
1190
- var guard = 0,
1191
-
1192
- // image load complete handler
1193
- onLoadComplete = function() {
1194
- if(item) {
1195
- if (item.img[0].complete) {
1196
- item.img.off('.mfploader');
1197
-
1198
- if(item === mfp.currItem){
1199
- mfp._onImageHasSize(item);
1200
-
1201
- mfp.updateStatus('ready');
1202
- }
1203
-
1204
- item.hasSize = true;
1205
- item.loaded = true;
1206
-
1207
- }
1208
- else {
1209
- // if image complete check fails 200 times (20 sec), we assume that there was an error.
1210
- guard++;
1211
- if(guard < 200) {
1212
- setTimeout(onLoadComplete,100);
1213
- } else {
1214
- onLoadError();
1215
- }
1216
- }
1217
- }
1218
- },
1219
-
1220
- // image error handler
1221
- onLoadError = function() {
1222
- if(item) {
1223
- item.img.off('.mfploader');
1224
- if(item === mfp.currItem){
1225
- mfp._onImageHasSize(item);
1226
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1227
- }
1228
-
1229
- item.hasSize = true;
1230
- item.loaded = true;
1231
- item.loadError = true;
1232
- }
1233
- },
1234
- imgSt = mfp.st.image;
1235
-
1236
-
1237
- var el = template.find('.mfp-img');
1238
- if(el.length) {
1239
- var img = new Image();
1240
- img.className = 'mfp-img';
1241
- item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1242
- img.src = item.src;
1243
-
1244
- // without clone() "error" event is not firing when IMG is replaced by new IMG
1245
- // TODO: find a way to avoid such cloning
1246
- if(el.is('img')) {
1247
- item.img = item.img.clone();
1248
- }
1249
- }
1250
-
1251
- mfp._parseMarkup(template, {
1252
- title: _getTitle(item),
1253
- img_replaceWith: item.img
1254
- }, item);
1255
-
1256
- mfp.resizeImage();
1257
-
1258
- if(item.hasSize) {
1259
- if(_imgInterval) clearInterval(_imgInterval);
1260
-
1261
- if(item.loadError) {
1262
- template.addClass('mfp-loading');
1263
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1264
- } else {
1265
- template.removeClass('mfp-loading');
1266
- mfp.updateStatus('ready');
1267
- }
1268
- return template;
1269
- }
1270
-
1271
- mfp.updateStatus('loading');
1272
- item.loading = true;
1273
-
1274
- if(!item.hasSize) {
1275
- item.imgHidden = true;
1276
- template.addClass('mfp-loading');
1277
- mfp.findImageSize(item);
1278
- }
1279
-
1280
- return template;
1281
- }
1282
- }
1283
- });
1284
-
1285
-
1286
-
1287
- /*>>image*/
1288
-
1289
- /*>>iframe*/
1290
-
1291
- var IFRAME_NS = 'iframe',
1292
- _emptyPage = '//about:blank',
1293
-
1294
- _fixIframeBugs = function(isShowing) {
1295
- if(mfp.currTemplate[IFRAME_NS]) {
1296
- var el = mfp.currTemplate[IFRAME_NS].find('iframe');
1297
- if(el.length) {
1298
- // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
1299
- if(!isShowing) {
1300
- el[0].src = _emptyPage;
1301
- }
1302
-
1303
- // IE8 black screen bug fix
1304
- if(mfp.isIE8) {
1305
- el.css('display', isShowing ? 'block' : 'none');
1306
- }
1307
- }
1308
- }
1309
- };
1310
-
1311
- $.magnificPopup.registerModule(IFRAME_NS, {
1312
-
1313
- options: {
1314
- markup: '<div class="mfp-iframe-scaler">'+
1315
- '<div class="mfp-close"></div>'+
1316
- '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
1317
- '</div>',
1318
-
1319
- srcAction: 'iframe_src',
1320
-
1321
- // we don't care and support only one default type of URL by default
1322
- patterns: {
1323
- youtube: {
1324
- index: 'youtube.com',
1325
- id: 'v=',
1326
- src: '//www.youtube.com/embed/%id%?autoplay=1'
1327
- },
1328
- vimeo: {
1329
- index: 'vimeo.com/',
1330
- id: '/',
1331
- src: '//player.vimeo.com/video/%id%?autoplay=1'
1332
- },
1333
- gmaps: {
1334
- index: '//maps.google.',
1335
- src: '%id%&output=embed'
1336
- }
1337
- }
1338
- },
1339
-
1340
- proto: {
1341
- initIframe: function() {
1342
- mfp.types.push(IFRAME_NS);
1343
-
1344
- _mfpOn('BeforeChange', function(e, prevType, newType) {
1345
- if(prevType !== newType) {
1346
- if(prevType === IFRAME_NS) {
1347
- _fixIframeBugs(); // iframe if removed
1348
- } else if(newType === IFRAME_NS) {
1349
- _fixIframeBugs(true); // iframe is showing
1350
- }
1351
- }// else {
1352
- // iframe source is switched, don't do anything
1353
- //}
1354
- });
1355
-
1356
- _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, _fixIframeBugs);
1357
- },
1358
-
1359
- getIframe: function(item, template) {
1360
- var embedSrc = item.src;
1361
- var iframeSt = mfp.st.iframe;
1362
-
1363
- $.each(iframeSt.patterns, function() {
1364
- if(embedSrc.indexOf( this.index ) > -1) {
1365
- if(this.id) {
1366
- if(typeof this.id === 'string') {
1367
- embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
1368
- } else {
1369
- embedSrc = this.id.call( this, embedSrc );
1370
- }
1371
- }
1372
- embedSrc = this.src.replace('%id%', embedSrc );
1373
- return false; // break;
1374
- }
1375
- });
1376
-
1377
- var dataObj = {};
1378
- if(iframeSt.srcAction) {
1379
- dataObj[iframeSt.srcAction] = embedSrc;
1380
- }
1381
- mfp._parseMarkup(template, dataObj, item);
1382
-
1383
- mfp.updateStatus('ready');
1384
-
1385
- return template;
1386
- }
1387
- }
1388
- });
1389
-
1390
-
1391
-
1392
- /*>>iframe*/
1393
-
1394
- /*>>gallery*/
1395
- /**
1396
- * Get looped index depending on number of slides
1397
- */
1398
- var _getLoopedId = function(index) {
1399
- var numSlides = mfp.items.length;
1400
- if(index > numSlides - 1) {
1401
- return index - numSlides;
1402
- } else if(index < 0) {
1403
- return numSlides + index;
1404
- }
1405
- return index;
1406
- },
1407
- _replaceCurrTotal = function(text, curr, total) {
1408
- return text.replace('%curr%', curr + 1).replace('%total%', total);
1409
- };
1410
-
1411
- $.magnificPopup.registerModule('gallery', {
1412
-
1413
- options: {
1414
- enabled: false,
1415
- arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
1416
- preload: [0,2],
1417
- navigateByImgClick: true,
1418
- arrows: true,
1419
-
1420
- tPrev: 'Previous (Left arrow key)',
1421
- tNext: 'Next (Right arrow key)',
1422
- tCounter: '%curr% of %total%'
1423
- },
1424
-
1425
- proto: {
1426
- initGallery: function() {
1427
-
1428
- var gSt = mfp.st.gallery,
1429
- ns = '.mfp-gallery',
1430
- supportsFastClick = Boolean($.fn.mfpFastClick);
1431
-
1432
- mfp.direction = true; // true - next, false - prev
1433
-
1434
- if(!gSt || !gSt.enabled ) return false;
1435
-
1436
- _wrapClasses += ' mfp-gallery';
1437
-
1438
- _mfpOn(OPEN_EVENT+ns, function() {
1439
-
1440
- if(gSt.navigateByImgClick) {
1441
- mfp.wrap.on('click'+ns, '.mfp-img', function() {
1442
- mfp.next();
1443
- return false;
1444
- });
1445
- }
1446
-
1447
- _document.on('keydown'+ns, function(e) {
1448
- if (e.keyCode === 37) {
1449
- mfp.prev();
1450
- } else if (e.keyCode === 39) {
1451
- mfp.next();
1452
- }
1453
- });
1454
- });
1455
-
1456
- _mfpOn('UpdateStatus'+ns, function(e, data) {
1457
- if(data.text) {
1458
- data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
1459
- }
1460
- });
1461
-
1462
- _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
1463
- var l = mfp.items.length;
1464
- values.counter = l ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
1465
- });
1466
-
1467
- _mfpOn('BuildControls' + ns, function() {
1468
- if(gSt.arrows && !mfp.arrowLeft) {
1469
- var markup = gSt.arrowMarkup,
1470
- arrowLeft = mfp.arrowLeft = $( markup.replace('%title%', gSt.tPrev).replace('%dir%', 'left') ).addClass(PREVENT_CLOSE_CLASS),
1471
- arrowRight = mfp.arrowRight = $( markup.replace('%title%', gSt.tNext).replace('%dir%', 'right') ).addClass(PREVENT_CLOSE_CLASS);
1472
-
1473
- var eName = supportsFastClick ? 'mfpFastClick' : 'click';
1474
- arrowLeft[eName](function() {
1475
- mfp.prev();
1476
- });
1477
- arrowRight[eName](function() {
1478
- mfp.next();
1479
- });
1480
-
1481
- // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
1482
- if(mfp.isIE7) {
1483
- _getEl('b', arrowLeft[0], false, true);
1484
- _getEl('a', arrowLeft[0], false, true);
1485
- _getEl('b', arrowRight[0], false, true);
1486
- _getEl('a', arrowRight[0], false, true);
1487
- }
1488
-
1489
- mfp.container.append(arrowLeft.add(arrowRight));
1490
- }
1491
- });
1492
-
1493
- _mfpOn(CHANGE_EVENT+ns, function() {
1494
- if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
1495
-
1496
- mfp._preloadTimeout = setTimeout(function() {
1497
- mfp.preloadNearbyImages();
1498
- mfp._preloadTimeout = null;
1499
- }, 16);
1500
- });
1501
-
1502
-
1503
- _mfpOn(CLOSE_EVENT+ns, function() {
1504
- _document.off(ns);
1505
- mfp.wrap.off('click'+ns);
1506
-
1507
- if(supportsFastClick) {
1508
- mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
1509
- }
1510
- mfp.arrowRight = mfp.arrowLeft = null;
1511
- });
1512
-
1513
- },
1514
- next: function() {
1515
- mfp.direction = true;
1516
- mfp.index = _getLoopedId(mfp.index + 1);
1517
- mfp.updateItemHTML();
1518
- },
1519
- prev: function() {
1520
- mfp.direction = false;
1521
- mfp.index = _getLoopedId(mfp.index - 1);
1522
- mfp.updateItemHTML();
1523
- },
1524
- goTo: function(newIndex) {
1525
- mfp.direction = (newIndex >= mfp.index);
1526
- mfp.index = newIndex;
1527
- mfp.updateItemHTML();
1528
- },
1529
- preloadNearbyImages: function() {
1530
- var p = mfp.st.gallery.preload,
1531
- preloadBefore = Math.min(p[0], mfp.items.length),
1532
- preloadAfter = Math.min(p[1], mfp.items.length),
1533
- i;
1534
-
1535
- for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
1536
- mfp._preloadItem(mfp.index+i);
1537
- }
1538
- for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
1539
- mfp._preloadItem(mfp.index-i);
1540
- }
1541
- },
1542
- _preloadItem: function(index) {
1543
- index = _getLoopedId(index);
1544
-
1545
- if(mfp.items[index].preloaded) {
1546
- return;
1547
- }
1548
-
1549
- var item = mfp.items[index];
1550
- if(!item.parsed) {
1551
- item = mfp.parseEl( index );
1552
- }
1553
-
1554
- _mfpTrigger('LazyLoad', item);
1555
-
1556
- if(item.type === 'image') {
1557
- item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
1558
- item.hasSize = true;
1559
- }).on('error.mfploader', function() {
1560
- item.hasSize = true;
1561
- item.loadError = true;
1562
- }).attr('src', item.src);
1563
- }
1564
-
1565
-
1566
- item.preloaded = true;
1567
- }
1568
- }
1569
- });
1570
-
1571
- /*
1572
- Touch Support that might be implemented some day
1573
-
1574
- addSwipeGesture: function() {
1575
- var startX,
1576
- moved,
1577
- multipleTouches;
1578
-
1579
- return;
1580
-
1581
- var namespace = '.mfp',
1582
- addEventNames = function(pref, down, move, up, cancel) {
1583
- mfp._tStart = pref + down + namespace;
1584
- mfp._tMove = pref + move + namespace;
1585
- mfp._tEnd = pref + up + namespace;
1586
- mfp._tCancel = pref + cancel + namespace;
1587
- };
1588
-
1589
- if(window.navigator.msPointerEnabled) {
1590
- addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
1591
- } else if('ontouchstart' in window) {
1592
- addEventNames('touch', 'start', 'move', 'end', 'cancel');
1593
- } else {
1594
- return;
1595
- }
1596
- _window.on(mfp._tStart, function(e) {
1597
- var oE = e.originalEvent;
1598
- multipleTouches = moved = false;
1599
- startX = oE.pageX || oE.changedTouches[0].pageX;
1600
- }).on(mfp._tMove, function(e) {
1601
- if(e.originalEvent.touches.length > 1) {
1602
- multipleTouches = e.originalEvent.touches.length;
1603
- } else {
1604
- //e.preventDefault();
1605
- moved = true;
1606
- }
1607
- }).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
1608
- if(moved && !multipleTouches) {
1609
- var oE = e.originalEvent,
1610
- diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
1611
-
1612
- if(diff > 20) {
1613
- mfp.next();
1614
- } else if(diff < -20) {
1615
- mfp.prev();
1616
- }
1617
- }
1618
- });
1619
- },
1620
- */
1621
-
1622
-
1623
- /*>>gallery*/
1624
-
1625
- /*>>retina*/
1626
-
1627
- var RETINA_NS = 'retina';
1628
-
1629
- $.magnificPopup.registerModule(RETINA_NS, {
1630
- options: {
1631
- replaceSrc: function(item) {
1632
- return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
1633
- },
1634
- ratio: 1 // Function or number. Set to 1 to disable.
1635
- },
1636
- proto: {
1637
- initRetina: function() {
1638
- if(window.devicePixelRatio > 1) {
1639
-
1640
- var st = mfp.st.retina,
1641
- ratio = st.ratio;
1642
-
1643
- ratio = !isNaN(ratio) ? ratio : ratio();
1644
-
1645
- if(ratio > 1) {
1646
- _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
1647
- item.img.css({
1648
- 'max-width': item.img[0].naturalWidth / ratio,
1649
- 'width': '100%'
1650
- });
1651
- });
1652
- _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
1653
- item.src = st.replaceSrc(item, ratio);
1654
- });
1655
- }
1656
- }
1657
-
1658
- }
1659
- }
1660
- });
1661
-
1662
- /*>>retina*/
1663
-
1664
- /*>>fastclick*/
1665
- /**
1666
- * FastClick event implementation. (removes 300ms delay on touch devices)
1667
- * Based on https://developers.google.com/mobile/articles/fast_buttons
1668
- *
1669
- * You may use it outside the Magnific Popup by calling just:
1670
- *
1671
- * $('.your-el').mfpFastClick(function() {
1672
- * console.log('Clicked!');
1673
- * });
1674
- *
1675
- * To unbind:
1676
- * $('.your-el').destroyMfpFastClick();
1677
- *
1678
- *
1679
- * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
1680
- * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
1681
- *
1682
- */
1683
-
1684
- (function() {
1685
- var ghostClickDelay = 1000,
1686
- supportsTouch = 'ontouchstart' in window,
1687
- unbindTouchMove = function() {
1688
- _window.off('touchmove'+ns+' touchend'+ns);
1689
- },
1690
- eName = 'mfpFastClick',
1691
- ns = '.'+eName;
1692
-
1693
-
1694
- // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
1695
- $.fn.mfpFastClick = function(callback) {
1696
-
1697
- return $(this).each(function() {
1698
-
1699
- var elem = $(this),
1700
- lock;
1701
-
1702
- if( supportsTouch ) {
1703
-
1704
- var timeout,
1705
- startX,
1706
- startY,
1707
- pointerMoved,
1708
- point,
1709
- numPointers;
1710
-
1711
- elem.on('touchstart' + ns, function(e) {
1712
- pointerMoved = false;
1713
- numPointers = 1;
1714
-
1715
- point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
1716
- startX = point.clientX;
1717
- startY = point.clientY;
1718
-
1719
- _window.on('touchmove'+ns, function(e) {
1720
- point = e.originalEvent ? e.originalEvent.touches : e.touches;
1721
- numPointers = point.length;
1722
- point = point[0];
1723
- if (Math.abs(point.clientX - startX) > 10 ||
1724
- Math.abs(point.clientY - startY) > 10) {
1725
- pointerMoved = true;
1726
- unbindTouchMove();
1727
- }
1728
- }).on('touchend'+ns, function(e) {
1729
- unbindTouchMove();
1730
- if(pointerMoved || numPointers > 1) {
1731
- return;
1732
- }
1733
- lock = true;
1734
- e.preventDefault();
1735
- clearTimeout(timeout);
1736
- timeout = setTimeout(function() {
1737
- lock = false;
1738
- }, ghostClickDelay);
1739
- callback();
1740
- });
1741
- });
1742
-
1743
- }
1744
-
1745
- elem.on('click' + ns, function() {
1746
- if(!lock) {
1747
- callback();
1748
- }
1749
- });
1750
- });
1751
- };
1752
-
1753
- $.fn.destroyMfpFastClick = function() {
1754
- $(this).off('touchstart' + ns + ' click' + ns);
1755
- if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
1756
- };
1757
- })();
1758
-
1759
- /*>>fastclick*/
1760
- })(window.jQuery || window.Zepto);