groundworkcss 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/README.md +165 -0
- data/Rakefile +1 -0
- data/groundworkcss.gemspec +27 -0
- data/lib/groundworkcss.rb +7 -0
- data/lib/groundworkcss/engine.rb +4 -0
- data/lib/groundworkcss/generators/install_generator.rb +27 -0
- data/lib/groundworkcss/railties.rb +8 -0
- data/lib/groundworkcss/version.rb +3 -0
- data/vendor/assets/fonts/groundworkcss/americantypewriterstd-bold.eot +0 -0
- data/vendor/assets/fonts/groundworkcss/americantypewriterstd-bold.svg +128 -0
- data/vendor/assets/fonts/groundworkcss/americantypewriterstd-bold.ttf +0 -0
- data/vendor/assets/fonts/groundworkcss/americantypewriterstd-bold.woff +0 -0
- data/vendor/assets/fonts/groundworkcss/average-sans-webfont.eot +0 -0
- data/vendor/assets/fonts/groundworkcss/average-sans-webfont.ttf +0 -0
- data/vendor/assets/fonts/groundworkcss/average-sans-webfont.woff +0 -0
- data/vendor/assets/fonts/groundworkcss/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/groundworkcss/fontawesome-webfont.svg +284 -0
- data/vendor/assets/fonts/groundworkcss/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/groundworkcss/fontawesome-webfont.woff +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/500px-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/500px-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/500px.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/500px.svg +62 -0
- data/vendor/assets/images/groundworkcss/social-icons/aboutme-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/aboutme-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/aboutme.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/aboutme.svg +42 -0
- data/vendor/assets/images/groundworkcss/social-icons/adn-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/adn-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/adn.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/adn.svg +14 -0
- data/vendor/assets/images/groundworkcss/social-icons/android-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/android-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/android.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/android.svg +30 -0
- data/vendor/assets/images/groundworkcss/social-icons/apple-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/apple-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/apple.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/apple.svg +19 -0
- data/vendor/assets/images/groundworkcss/social-icons/behance-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/behance-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/behance.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/behance.svg +48 -0
- data/vendor/assets/images/groundworkcss/social-icons/bitbucket-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/bitbucket-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/bitbucket.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/bitbucket.svg +36 -0
- data/vendor/assets/images/groundworkcss/social-icons/blogger-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/blogger-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/blogger.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/blogger.svg +22 -0
- data/vendor/assets/images/groundworkcss/social-icons/coderwall-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/coderwall-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/coderwall.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/coderwall.svg +21 -0
- data/vendor/assets/images/groundworkcss/social-icons/creativecloud-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/creativecloud-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/creativecloud.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/creativecloud.svg +48 -0
- data/vendor/assets/images/groundworkcss/social-icons/dribbble-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/dribbble-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/dribbble.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/dribbble.svg +28 -0
- data/vendor/assets/images/groundworkcss/social-icons/dropbox-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/dropbox-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/dropbox.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/dropbox.svg +73 -0
- data/vendor/assets/images/groundworkcss/social-icons/evernote-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/evernote-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/evernote.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/evernote.svg +62 -0
- data/vendor/assets/images/groundworkcss/social-icons/facebook-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/facebook-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/facebook.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/facebook.svg +15 -0
- data/vendor/assets/images/groundworkcss/social-icons/fairheadcreative-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/fairheadcreative-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/fairheadcreative.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/fairheadcreative.svg +24 -0
- data/vendor/assets/images/groundworkcss/social-icons/flickr-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/flickr-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/flickr.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/flickr.svg +14 -0
- data/vendor/assets/images/groundworkcss/social-icons/foursquare-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/foursquare-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/foursquare.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/foursquare.svg +43 -0
- data/vendor/assets/images/groundworkcss/social-icons/git-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/git-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/git.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/git.svg +22 -0
- data/vendor/assets/images/groundworkcss/social-icons/github-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/github-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/github.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/github.svg +38 -0
- data/vendor/assets/images/groundworkcss/social-icons/goodreads-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/goodreads-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/goodreads.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/goodreads.svg +38 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplay-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplay-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplay.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplay.svg +24 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplus-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplus-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplus.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/googleplus.svg +52 -0
- data/vendor/assets/images/groundworkcss/social-icons/html5-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/html5-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/html5.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/html5.svg +29 -0
- data/vendor/assets/images/groundworkcss/social-icons/icloud-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/icloud-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/icloud.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/icloud.svg +26 -0
- data/vendor/assets/images/groundworkcss/social-icons/instagram-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/instagram-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/instagram.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/instagram.svg +166 -0
- data/vendor/assets/images/groundworkcss/social-icons/lastfm-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/lastfm-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/lastfm.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/lastfm.svg +44 -0
- data/vendor/assets/images/groundworkcss/social-icons/linkedin-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/linkedin-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/linkedin.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/linkedin.svg +28 -0
- data/vendor/assets/images/groundworkcss/social-icons/mail-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mail-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mail.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mail.svg +27 -0
- data/vendor/assets/images/groundworkcss/social-icons/mercurial-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mercurial-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mercurial.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mercurial.svg +22 -0
- data/vendor/assets/images/groundworkcss/social-icons/mixi-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mixi-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mixi.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/mixi.svg +32 -0
- data/vendor/assets/images/groundworkcss/social-icons/msn-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/msn-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/msn.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/msn.svg +44 -0
- data/vendor/assets/images/groundworkcss/social-icons/orkut-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/orkut-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/orkut.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/orkut.svg +23 -0
- data/vendor/assets/images/groundworkcss/social-icons/picasa-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/picasa-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/picasa.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/picasa.svg +48 -0
- data/vendor/assets/images/groundworkcss/social-icons/pinterest-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/pinterest-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/pinterest.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/pinterest.svg +42 -0
- data/vendor/assets/images/groundworkcss/social-icons/pocketapp-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/pocketapp-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/pocketapp.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/pocketapp.svg +38 -0
- data/vendor/assets/images/groundworkcss/social-icons/quora-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/quora-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/quora.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/quora.svg +20 -0
- data/vendor/assets/images/groundworkcss/social-icons/rdio-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/rdio-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/rdio.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/rdio.svg +18 -0
- data/vendor/assets/images/groundworkcss/social-icons/renren-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/renren-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/renren.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/renren.svg +79 -0
- data/vendor/assets/images/groundworkcss/social-icons/rss-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/rss-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/rss.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/rss.svg +18 -0
- data/vendor/assets/images/groundworkcss/social-icons/skitch-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/skitch-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/skitch.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/skitch.svg +24 -0
- data/vendor/assets/images/groundworkcss/social-icons/skype-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/skype-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/skype.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/skype.svg +25 -0
- data/vendor/assets/images/groundworkcss/social-icons/soundcloud-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/soundcloud-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/soundcloud.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/soundcloud.svg +60 -0
- data/vendor/assets/images/groundworkcss/social-icons/spotify-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/spotify-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/spotify.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/spotify.svg +38 -0
- data/vendor/assets/images/groundworkcss/social-icons/stackoverflow-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/stackoverflow-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/stackoverflow.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/stackoverflow.svg +32 -0
- data/vendor/assets/images/groundworkcss/social-icons/stumbleupon-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/stumbleupon-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/stumbleupon.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/stumbleupon.svg +22 -0
- data/vendor/assets/images/groundworkcss/social-icons/svn-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/svn-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/svn.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/svn.svg +25 -0
- data/vendor/assets/images/groundworkcss/social-icons/tent-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tent-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tent.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tent.svg +16 -0
- data/vendor/assets/images/groundworkcss/social-icons/tripadvisor-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tripadvisor-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tripadvisor.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tripadvisor.svg +30 -0
- data/vendor/assets/images/groundworkcss/social-icons/tumblr-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tumblr-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tumblr.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/tumblr.svg +16 -0
- data/vendor/assets/images/groundworkcss/social-icons/twitter-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/twitter-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/twitter.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/twitter.svg +24 -0
- data/vendor/assets/images/groundworkcss/social-icons/vimeo-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/vimeo-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/vimeo.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/vimeo.svg +20 -0
- data/vendor/assets/images/groundworkcss/social-icons/weibo-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/weibo-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/weibo.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/weibo.svg +54 -0
- data/vendor/assets/images/groundworkcss/social-icons/windows-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/windows-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/windows.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/windows.svg +26 -0
- data/vendor/assets/images/groundworkcss/social-icons/wordpress-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/wordpress-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/wordpress.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/wordpress.svg +50 -0
- data/vendor/assets/images/groundworkcss/social-icons/xing-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/xing-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/xing.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/xing.svg +16 -0
- data/vendor/assets/images/groundworkcss/social-icons/yelp-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/yelp-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/yelp.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/yelp.svg +54 -0
- data/vendor/assets/images/groundworkcss/social-icons/youtube-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/youtube-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/youtube.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/youtube.svg +106 -0
- data/vendor/assets/images/groundworkcss/social-icons/youversion-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/youversion-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/youversion.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/youversion.svg +54 -0
- data/vendor/assets/images/groundworkcss/social-icons/zerply-m.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/zerply-s.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/zerply.png +0 -0
- data/vendor/assets/images/groundworkcss/social-icons/zerply.svg +20 -0
- data/vendor/assets/javascripts/groundworkcss/components/disabled.coffee +18 -0
- data/vendor/assets/javascripts/groundworkcss/components/dismissible.coffee +4 -0
- data/vendor/assets/javascripts/groundworkcss/components/equalizeColumns.coffee +22 -0
- data/vendor/assets/javascripts/groundworkcss/components/forms.coffee +36 -0
- data/vendor/assets/javascripts/groundworkcss/components/menus.coffee +174 -0
- data/vendor/assets/javascripts/groundworkcss/components/modals.coffee +46 -0
- data/vendor/assets/javascripts/groundworkcss/components/pagination.coffee +128 -0
- data/vendor/assets/javascripts/groundworkcss/components/responsiveTables.coffee +24 -0
- data/vendor/assets/javascripts/groundworkcss/components/responsiveText.coffee +38 -0
- data/vendor/assets/javascripts/groundworkcss/components/tabs.coffee +20 -0
- data/vendor/assets/javascripts/groundworkcss/components/tiles.coffee +32 -0
- data/vendor/assets/javascripts/groundworkcss/components/tooltips.coffee +5 -0
- data/vendor/assets/javascripts/groundworkcss/index.js +20 -0
- data/vendor/assets/javascripts/groundworkcss/libs/boxsizing.htc +501 -0
- data/vendor/assets/javascripts/groundworkcss/libs/html5shiv.min.js +8 -0
- data/vendor/assets/javascripts/groundworkcss/libs/modernizr-2.6.2.min.js +4 -0
- data/vendor/assets/javascripts/groundworkcss/libs/placeholder_polyfill.jquery.js +212 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.caption2.js +67 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.carousel.js +265 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.center.js +63 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.ie-fade.js +46 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.scrollVert.js +15 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.shuffle.js +62 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.swipe.js +70 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.tile.js +131 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.video.js +66 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-modals.js +193 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-responsiveTables.coffee +61 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-responsiveText.coffee +32 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-tooltip.coffee +124 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.cycle2.js +1426 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.magnific-popup.js +1760 -0
- data/vendor/assets/stylesheets/groundworkcss/_rails-settings.scss +202 -0
- data/vendor/assets/stylesheets/groundworkcss/_settings.scss +1 -0
- data/vendor/assets/stylesheets/groundworkcss/base/_all.scss +11 -0
- data/vendor/assets/stylesheets/groundworkcss/base/_animations.scss +29 -0
- data/vendor/assets/stylesheets/groundworkcss/base/_global.scss +64 -0
- data/vendor/assets/stylesheets/groundworkcss/base/_grid.scss +172 -0
- data/vendor/assets/stylesheets/groundworkcss/base/_helpers.scss +254 -0
- data/vendor/assets/stylesheets/groundworkcss/base/_reset.scss +81 -0
- data/vendor/assets/stylesheets/groundworkcss/core/_all.scss +11 -0
- data/vendor/assets/stylesheets/groundworkcss/core/_constants.scss +121 -0
- data/vendor/assets/stylesheets/groundworkcss/core/_defaults.scss +202 -0
- data/vendor/assets/stylesheets/groundworkcss/core/_mixins.scss +206 -0
- data/vendor/assets/stylesheets/groundworkcss/font-awesome-ie7.min.css +22 -0
- data/vendor/assets/stylesheets/groundworkcss/form/_all.scss +10 -0
- data/vendor/assets/stylesheets/groundworkcss/form/_forms.scss +240 -0
- data/vendor/assets/stylesheets/groundworkcss/form/_tiles.scss +100 -0
- data/vendor/assets/stylesheets/groundworkcss/groundwork-ie.scss +130 -0
- data/vendor/assets/stylesheets/groundworkcss/groundwork.scss +22 -0
- data/vendor/assets/stylesheets/groundworkcss/index.scss +3 -0
- data/vendor/assets/stylesheets/groundworkcss/magnific-popup.css +393 -0
- data/vendor/assets/stylesheets/groundworkcss/misc/_all.scss +9 -0
- data/vendor/assets/stylesheets/groundworkcss/misc/_social-icons.scss +96 -0
- data/vendor/assets/stylesheets/groundworkcss/nav/_all.scss +11 -0
- data/vendor/assets/stylesheets/groundworkcss/nav/_buttons.scss +334 -0
- data/vendor/assets/stylesheets/groundworkcss/nav/_navigation.scss +400 -0
- data/vendor/assets/stylesheets/groundworkcss/nav/_tabs.scss +230 -0
- data/vendor/assets/stylesheets/groundworkcss/no-svg.scss +355 -0
- data/vendor/assets/stylesheets/groundworkcss/placeholder_polyfill.css +32 -0
- data/vendor/assets/stylesheets/groundworkcss/responsive/_all.scss +13 -0
- data/vendor/assets/stylesheets/groundworkcss/responsive/_desktop.scss +26 -0
- data/vendor/assets/stylesheets/groundworkcss/responsive/_helpers.scss +16 -0
- data/vendor/assets/stylesheets/groundworkcss/responsive/_ipad.scss +28 -0
- data/vendor/assets/stylesheets/groundworkcss/responsive/_mobile.scss +44 -0
- data/vendor/assets/stylesheets/groundworkcss/responsive/_small-tablet.scss +196 -0
- data/vendor/assets/stylesheets/groundworkcss/type/_all.scss +9 -0
- data/vendor/assets/stylesheets/groundworkcss/type/_font-awesome.scss +542 -0
- data/vendor/assets/stylesheets/groundworkcss/type/_typography.scss +360 -0
- data/vendor/assets/stylesheets/groundworkcss/type/_webfonts.scss +28 -0
- data/vendor/assets/stylesheets/groundworkcss/ui/_all.scss +13 -0
- data/vendor/assets/stylesheets/groundworkcss/ui/_callouts.scss +130 -0
- data/vendor/assets/stylesheets/groundworkcss/ui/_messages.scss +124 -0
- data/vendor/assets/stylesheets/groundworkcss/ui/_modals.scss +558 -0
- data/vendor/assets/stylesheets/groundworkcss/ui/_tables.scss +142 -0
- data/vendor/assets/stylesheets/groundworkcss/ui/_tooltips.scss +196 -0
- metadata +427 -0
@@ -0,0 +1,1760 @@
|
|
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">×</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);
|