jekyll-theme-chalk 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/404.html +39 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +91 -0
- data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.eot +0 -0
- data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.ttf +0 -0
- data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff +0 -0
- data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff2 +0 -0
- data/_assets/fonts/ionicons/ionicons.eot +0 -0
- data/_assets/fonts/ionicons/ionicons.ttf +0 -0
- data/_assets/fonts/ionicons/ionicons.woff +0 -0
- data/_assets/fonts/lato/Lato-300.eot +0 -0
- data/_assets/fonts/lato/Lato-300.ttf +0 -0
- data/_assets/fonts/lato/Lato-300.woff +0 -0
- data/_assets/fonts/lato/Lato-300.woff2 +0 -0
- data/_assets/fonts/lato/Lato-700.eot +0 -0
- data/_assets/fonts/lato/Lato-700.ttf +0 -0
- data/_assets/fonts/lato/Lato-700.woff +0 -0
- data/_assets/fonts/lato/Lato-700.woff2 +0 -0
- data/_assets/fonts/lato/Lato-regular.eot +0 -0
- data/_assets/fonts/lato/Lato-regular.ttf +0 -0
- data/_assets/fonts/lato/Lato-regular.woff +0 -0
- data/_assets/fonts/lato/Lato-regular.woff2 +0 -0
- data/_assets/images/about.jpg +0 -0
- data/_assets/images/about@2x.jpg +0 -0
- data/_assets/images/apple-touch-icon.png +0 -0
- data/_assets/images/documentation/chalk-intro.png +0 -0
- data/_assets/images/documentation/chalk-intro@2x.png +0 -0
- data/_assets/images/documentation/enlarge.gif +0 -0
- data/_assets/images/documentation/enlarge@2x.gif +0 -0
- data/_assets/images/documentation/sample-image.jpg +0 -0
- data/_assets/images/documentation/sample-image@2x.jpg +0 -0
- data/_assets/images/og-image.jpg +0 -0
- data/_assets/javascripts/application.js +17 -0
- data/_assets/javascripts/scrollappear.js +25 -0
- data/_assets/javascripts/vendor.js +4 -0
- data/_assets/javascripts/webfonts.js +7 -0
- data/_assets/stylesheets/.csscomb.json +196 -0
- data/_assets/stylesheets/.scss-lint.yml +33 -0
- data/_assets/stylesheets/_base.scss +151 -0
- data/_assets/stylesheets/_mixins.scss +28 -0
- data/_assets/stylesheets/_variables.scss +47 -0
- data/_assets/stylesheets/dark.scss +71 -0
- data/_assets/stylesheets/fonts.scss +63 -0
- data/_assets/stylesheets/layouts/_footer.scss +17 -0
- data/_assets/stylesheets/layouts/_grid.scss +102 -0
- data/_assets/stylesheets/light.scss +71 -0
- data/_assets/stylesheets/modules/_about.scss +10 -0
- data/_assets/stylesheets/modules/_articles.scss +213 -0
- data/_assets/stylesheets/modules/_embed.scss +31 -0
- data/_assets/stylesheets/modules/_header.scss +57 -0
- data/_assets/stylesheets/modules/_highlights-dark.scss +415 -0
- data/_assets/stylesheets/modules/_highlights-light.scss +409 -0
- data/_assets/stylesheets/modules/_icons.scss +83 -0
- data/_assets/stylesheets/modules/_scrollappear.scss +14 -0
- data/_assets/stylesheets/notfound-dark.scss +91 -0
- data/_assets/stylesheets/notfound-light.scss +91 -0
- data/_assets/stylesheets/vendor/_normalize.scss +461 -0
- data/_assets/yarn/.yarn-integrity +22 -0
- data/_assets/yarn/fluidbox/.gitattributes +22 -0
- data/_assets/yarn/fluidbox/.npmignore +220 -0
- data/_assets/yarn/fluidbox/.travis.yml +6 -0
- data/_assets/yarn/fluidbox/Gruntfile.js +8 -0
- data/_assets/yarn/fluidbox/LICENSE.md +23 -0
- data/_assets/yarn/fluidbox/README.html +750 -0
- data/_assets/yarn/fluidbox/README.md +396 -0
- data/_assets/yarn/fluidbox/bower.json +35 -0
- data/_assets/yarn/fluidbox/demo/css/styles.min.css +2 -0
- data/_assets/yarn/fluidbox/demo/css/styles.min.css.map +1 -0
- data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.eot +0 -0
- data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.svg +233 -0
- data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.ttf +0 -0
- data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.woff +0 -0
- data/_assets/yarn/fluidbox/demo/fonts/fontello.eot +0 -0
- data/_assets/yarn/fluidbox/demo/fonts/fontello.svg +13 -0
- data/_assets/yarn/fluidbox/demo/fonts/fontello.ttf +0 -0
- data/_assets/yarn/fluidbox/demo/fonts/fontello.woff +0 -0
- data/_assets/yarn/fluidbox/demo/index.html +758 -0
- data/_assets/yarn/fluidbox/demo/src/css/styles.scss +1131 -0
- data/_assets/yarn/fluidbox/dist/css/fluidbox.min.css +2 -0
- data/_assets/yarn/fluidbox/dist/css/fluidbox.min.css.map +1 -0
- data/_assets/yarn/fluidbox/dist/js/jquery.fluidbox.min.js +1 -0
- data/_assets/yarn/fluidbox/grunt/aliases.yaml +20 -0
- data/_assets/yarn/fluidbox/grunt/clean.js +5 -0
- data/_assets/yarn/fluidbox/grunt/concurrent.js +33 -0
- data/_assets/yarn/fluidbox/grunt/jshint.js +10 -0
- data/_assets/yarn/fluidbox/grunt/postcss.js +47 -0
- data/_assets/yarn/fluidbox/grunt/sass.js +42 -0
- data/_assets/yarn/fluidbox/grunt/uglify.js +7 -0
- data/_assets/yarn/fluidbox/grunt/watch.js +28 -0
- data/_assets/yarn/fluidbox/index.html +8 -0
- data/_assets/yarn/fluidbox/license.txt +21 -0
- data/_assets/yarn/fluidbox/package.json +61 -0
- data/_assets/yarn/fluidbox/src/css/_fluidbox.scss +95 -0
- data/_assets/yarn/fluidbox/src/css/fluidbox.scss +2 -0
- data/_assets/yarn/fluidbox/src/js/jquery.fluidbox.js +722 -0
- data/_assets/yarn/jquery/AUTHORS.txt +301 -0
- data/_assets/yarn/jquery/LICENSE.txt +36 -0
- data/_assets/yarn/jquery/README.md +67 -0
- data/_assets/yarn/jquery/bower.json +14 -0
- data/_assets/yarn/jquery/dist/core.js +476 -0
- data/_assets/yarn/jquery/dist/jquery.js +10253 -0
- data/_assets/yarn/jquery/dist/jquery.min.js +4 -0
- data/_assets/yarn/jquery/dist/jquery.min.map +1 -0
- data/_assets/yarn/jquery/dist/jquery.slim.js +8160 -0
- data/_assets/yarn/jquery/dist/jquery.slim.min.js +4 -0
- data/_assets/yarn/jquery/dist/jquery.slim.min.map +1 -0
- data/_assets/yarn/jquery/external/sizzle/LICENSE.txt +36 -0
- data/_assets/yarn/jquery/external/sizzle/dist/sizzle.js +2272 -0
- data/_assets/yarn/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/_assets/yarn/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/_assets/yarn/jquery/package.json +97 -0
- data/_assets/yarn/jquery/src/.eslintrc.json +5 -0
- data/_assets/yarn/jquery/src/ajax.js +855 -0
- data/_assets/yarn/jquery/src/ajax/jsonp.js +102 -0
- data/_assets/yarn/jquery/src/ajax/load.js +76 -0
- data/_assets/yarn/jquery/src/ajax/parseXML.js +30 -0
- data/_assets/yarn/jquery/src/ajax/script.js +77 -0
- data/_assets/yarn/jquery/src/ajax/var/location.js +5 -0
- data/_assets/yarn/jquery/src/ajax/var/nonce.js +7 -0
- data/_assets/yarn/jquery/src/ajax/var/rquery.js +5 -0
- data/_assets/yarn/jquery/src/ajax/xhr.js +169 -0
- data/_assets/yarn/jquery/src/attributes.js +13 -0
- data/_assets/yarn/jquery/src/attributes/attr.js +141 -0
- data/_assets/yarn/jquery/src/attributes/classes.js +174 -0
- data/_assets/yarn/jquery/src/attributes/prop.js +143 -0
- data/_assets/yarn/jquery/src/attributes/support.js +33 -0
- data/_assets/yarn/jquery/src/attributes/val.js +190 -0
- data/_assets/yarn/jquery/src/callbacks.js +234 -0
- data/_assets/yarn/jquery/src/core.js +476 -0
- data/_assets/yarn/jquery/src/core/DOMEval.js +16 -0
- data/_assets/yarn/jquery/src/core/access.js +70 -0
- data/_assets/yarn/jquery/src/core/init.js +128 -0
- data/_assets/yarn/jquery/src/core/nodeName.js +13 -0
- data/_assets/yarn/jquery/src/core/parseHTML.js +65 -0
- data/_assets/yarn/jquery/src/core/ready-no-deferred.js +96 -0
- data/_assets/yarn/jquery/src/core/ready.js +86 -0
- data/_assets/yarn/jquery/src/core/readyException.js +13 -0
- data/_assets/yarn/jquery/src/core/stripAndCollapse.js +14 -0
- data/_assets/yarn/jquery/src/core/support.js +20 -0
- data/_assets/yarn/jquery/src/core/var/rsingleTag.js +6 -0
- data/_assets/yarn/jquery/src/css.js +438 -0
- data/_assets/yarn/jquery/src/css/addGetHookIf.js +26 -0
- data/_assets/yarn/jquery/src/css/adjustCSS.js +71 -0
- data/_assets/yarn/jquery/src/css/curCSS.js +65 -0
- data/_assets/yarn/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/_assets/yarn/jquery/src/css/showHide.js +105 -0
- data/_assets/yarn/jquery/src/css/support.js +89 -0
- data/_assets/yarn/jquery/src/css/var/cssExpand.js +5 -0
- data/_assets/yarn/jquery/src/css/var/getStyles.js +17 -0
- data/_assets/yarn/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/_assets/yarn/jquery/src/css/var/rmargin.js +5 -0
- data/_assets/yarn/jquery/src/css/var/rnumnonpx.js +7 -0
- data/_assets/yarn/jquery/src/css/var/swap.js +26 -0
- data/_assets/yarn/jquery/src/data.js +179 -0
- data/_assets/yarn/jquery/src/data/Data.js +161 -0
- data/_assets/yarn/jquery/src/data/var/acceptData.js +19 -0
- data/_assets/yarn/jquery/src/data/var/dataPriv.js +7 -0
- data/_assets/yarn/jquery/src/data/var/dataUser.js +7 -0
- data/_assets/yarn/jquery/src/deferred.js +391 -0
- data/_assets/yarn/jquery/src/deferred/exceptionHook.js +21 -0
- data/_assets/yarn/jquery/src/deprecated.js +40 -0
- data/_assets/yarn/jquery/src/dimensions.js +56 -0
- data/_assets/yarn/jquery/src/effects.js +699 -0
- data/_assets/yarn/jquery/src/effects/Tween.js +123 -0
- data/_assets/yarn/jquery/src/effects/animatedSelector.js +15 -0
- data/_assets/yarn/jquery/src/event.js +746 -0
- data/_assets/yarn/jquery/src/event/ajax.js +22 -0
- data/_assets/yarn/jquery/src/event/alias.js +29 -0
- data/_assets/yarn/jquery/src/event/focusin.js +55 -0
- data/_assets/yarn/jquery/src/event/support.js +11 -0
- data/_assets/yarn/jquery/src/event/trigger.js +185 -0
- data/_assets/yarn/jquery/src/exports/amd.js +26 -0
- data/_assets/yarn/jquery/src/exports/global.js +34 -0
- data/_assets/yarn/jquery/src/jquery.js +41 -0
- data/_assets/yarn/jquery/src/manipulation.js +488 -0
- data/_assets/yarn/jquery/src/manipulation/_evalUrl.js +23 -0
- data/_assets/yarn/jquery/src/manipulation/buildFragment.js +104 -0
- data/_assets/yarn/jquery/src/manipulation/getAll.js +32 -0
- data/_assets/yarn/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/_assets/yarn/jquery/src/manipulation/support.js +35 -0
- data/_assets/yarn/jquery/src/manipulation/var/rcheckableType.js +5 -0
- data/_assets/yarn/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/_assets/yarn/jquery/src/manipulation/var/rtagName.js +5 -0
- data/_assets/yarn/jquery/src/manipulation/wrapMap.js +29 -0
- data/_assets/yarn/jquery/src/offset.js +229 -0
- data/_assets/yarn/jquery/src/queue.js +145 -0
- data/_assets/yarn/jquery/src/queue/delay.js +24 -0
- data/_assets/yarn/jquery/src/selector-native.js +237 -0
- data/_assets/yarn/jquery/src/selector-sizzle.js +19 -0
- data/_assets/yarn/jquery/src/selector.js +3 -0
- data/_assets/yarn/jquery/src/serialize.js +130 -0
- data/_assets/yarn/jquery/src/traversing.js +191 -0
- data/_assets/yarn/jquery/src/traversing/findFilter.js +106 -0
- data/_assets/yarn/jquery/src/traversing/var/dir.js +22 -0
- data/_assets/yarn/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/_assets/yarn/jquery/src/traversing/var/siblings.js +17 -0
- data/_assets/yarn/jquery/src/var/ObjectFunctionString.js +7 -0
- data/_assets/yarn/jquery/src/var/arr.js +5 -0
- data/_assets/yarn/jquery/src/var/class2type.js +6 -0
- data/_assets/yarn/jquery/src/var/concat.js +7 -0
- data/_assets/yarn/jquery/src/var/document.js +5 -0
- data/_assets/yarn/jquery/src/var/documentElement.js +7 -0
- data/_assets/yarn/jquery/src/var/fnToString.js +7 -0
- data/_assets/yarn/jquery/src/var/getProto.js +5 -0
- data/_assets/yarn/jquery/src/var/hasOwn.js +7 -0
- data/_assets/yarn/jquery/src/var/indexOf.js +7 -0
- data/_assets/yarn/jquery/src/var/pnum.js +5 -0
- data/_assets/yarn/jquery/src/var/push.js +7 -0
- data/_assets/yarn/jquery/src/var/rcssNum.js +9 -0
- data/_assets/yarn/jquery/src/var/rnothtmlwhite.js +8 -0
- data/_assets/yarn/jquery/src/var/slice.js +7 -0
- data/_assets/yarn/jquery/src/var/support.js +6 -0
- data/_assets/yarn/jquery/src/var/toString.js +7 -0
- data/_assets/yarn/jquery/src/wrap.js +77 -0
- data/_assets/yarn/retinajs/.babelrc +4 -0
- data/_assets/yarn/retinajs/.editorconfig +15 -0
- data/_assets/yarn/retinajs/.eslintignore +2 -0
- data/_assets/yarn/retinajs/.eslintrc +9 -0
- data/_assets/yarn/retinajs/.npmignore +7 -0
- data/_assets/yarn/retinajs/.travis.yml +20 -0
- data/_assets/yarn/retinajs/LICENSE +20 -0
- data/_assets/yarn/retinajs/README.md +267 -0
- data/_assets/yarn/retinajs/bower.json +25 -0
- data/_assets/yarn/retinajs/dist/_retina.sass +68 -0
- data/_assets/yarn/retinajs/dist/_retina.scss +102 -0
- data/_assets/yarn/retinajs/dist/retina.js +100 -0
- data/_assets/yarn/retinajs/dist/retina.js.map +1 -0
- data/_assets/yarn/retinajs/dist/retina.less +56 -0
- data/_assets/yarn/retinajs/dist/retina.min.js +2 -0
- data/_assets/yarn/retinajs/dist/retina.min.js.map +1 -0
- data/_assets/yarn/retinajs/dist/retina.styl +56 -0
- data/_assets/yarn/retinajs/es/_retina.sass +68 -0
- data/_assets/yarn/retinajs/es/_retina.scss +102 -0
- data/_assets/yarn/retinajs/es/retina.js +91 -0
- data/_assets/yarn/retinajs/es/retina.js.map +1 -0
- data/_assets/yarn/retinajs/es/retina.less +56 -0
- data/_assets/yarn/retinajs/es/retina.styl +56 -0
- data/_assets/yarn/retinajs/gulpfile.babel.js +154 -0
- data/_assets/yarn/retinajs/package.json +57 -0
- data/_assets/yarn/retinajs/src/_retina.sass +68 -0
- data/_assets/yarn/retinajs/src/_retina.scss +102 -0
- data/_assets/yarn/retinajs/src/retina.js +246 -0
- data/_assets/yarn/retinajs/src/retina.less +56 -0
- data/_assets/yarn/retinajs/src/retina.styl +56 -0
- data/_assets/yarn/retinajs/test/DOM.js +44 -0
- data/_assets/yarn/retinajs/test/fixtures/image.js +19 -0
- data/_assets/yarn/retinajs/test/fixtures/less_expected_output.css +18 -0
- data/_assets/yarn/retinajs/test/fixtures/scss_expected_output.css +13 -0
- data/_assets/yarn/retinajs/test/fixtures/test.less +10 -0
- data/_assets/yarn/retinajs/test/fixtures/test.scss +11 -0
- data/_assets/yarn/retinajs/test/fixtures/xml_http_request.js +24 -0
- data/_assets/yarn/retinajs/test/functional/public/google-logo.png +0 -0
- data/_assets/yarn/retinajs/test/functional/public/google-logo@2x.png +0 -0
- data/_assets/yarn/retinajs/test/functional/public/google-logo@3x.png +0 -0
- data/_assets/yarn/retinajs/test/functional/public/index.html +190 -0
- data/_assets/yarn/retinajs/test/functional/public/ipad.png +0 -0
- data/_assets/yarn/retinajs/test/functional/public/ipad@2x.png +0 -0
- data/_assets/yarn/retinajs/test/functional/public/ipad@3x.png +0 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/_retina.sass +68 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/_retina.scss +102 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/less-base.less +13 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/retina.less +56 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/retina.less.css +73 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/retina.sass.css +42 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/retina.scss.css +96 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/retina.styl +56 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/retina.styl.css +61 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/sass-base.sass +10 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/scss-base.scss +13 -0
- data/_assets/yarn/retinajs/test/functional/public/styles/styl-base.styl +10 -0
- data/_assets/yarn/retinajs/test/mocha-runner.js +7 -0
- data/_assets/yarn/retinajs/test/retina.spec.js +14 -0
- data/_assets/yarn/scrollreveal/.gitattributes +10 -0
- data/_assets/yarn/scrollreveal/.github/CONTRIBUTING.md +9 -0
- data/_assets/yarn/scrollreveal/.github/ISSUE_TEMPLATE.md +11 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/base.css +213 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/index.html +158 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/index.html +93 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/package.json.html +143 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/constructor.js.html +311 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/defaults.js.html +158 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/animate.js.html +395 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/delegate.js.html +179 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/index.html +145 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/initialize.js.html +197 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/rinse.js.html +311 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/style.js.html +617 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/index.html +119 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/clean.js.html +137 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/destroy.js.html +182 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/index.html +132 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/reveal.js.html +524 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/sync.js.html +125 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/noop.js.html +89 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/polyfills/index.html +93 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/polyfills/requestAnimationFrame.js.html +125 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/browser.js.html +272 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/core.js.html +434 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/generic.js.html +218 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/index.html +119 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/prettify.css +1 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/prettify.js +1 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/sort-arrow-sprite.png +0 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/sorter.js +158 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov.info +1016 -0
- data/_assets/yarn/scrollreveal/.ignore/coverage/server.coverage.js +11 -0
- data/_assets/yarn/scrollreveal/.ignore/sandbox/css/styles.css +32 -0
- data/_assets/yarn/scrollreveal/.ignore/sandbox/index.html +68 -0
- data/_assets/yarn/scrollreveal/.ignore/sandbox/js/scrollreveal.js +1271 -0
- data/_assets/yarn/scrollreveal/.ignore/sandbox/rollup.conf.sandbox.js +15 -0
- data/_assets/yarn/scrollreveal/.ignore/sandbox/server.sandbox.js +11 -0
- data/_assets/yarn/scrollreveal/.npmignore +8 -0
- data/_assets/yarn/scrollreveal/CHANGELOG.md +268 -0
- data/_assets/yarn/scrollreveal/LICENSE.md +12 -0
- data/_assets/yarn/scrollreveal/README.md +413 -0
- data/_assets/yarn/scrollreveal/bower.json +24 -0
- data/_assets/yarn/scrollreveal/dist/scrollreveal.js +860 -0
- data/_assets/yarn/scrollreveal/dist/scrollreveal.min.js +1 -0
- data/_assets/yarn/scrollreveal/gulpfile.js +33 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-clean.js +7 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-dev.js +6 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-dist-min.js +19 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-dist.js +6 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-server.js +9 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-validate-bower.js +13 -0
- data/_assets/yarn/scrollreveal/lib/gulp/gulp-watch.js +6 -0
- data/_assets/yarn/scrollreveal/src/scrollreveal.js +860 -0
- data/_assets/yarn/throttle-debounce-fn/.jscsrc +5 -0
- data/_assets/yarn/throttle-debounce-fn/.jshintrc +13 -0
- data/_assets/yarn/throttle-debounce-fn/.npmignore +1 -0
- data/_assets/yarn/throttle-debounce-fn/Gruntfile.js +76 -0
- data/_assets/yarn/throttle-debounce-fn/LICENSE.md +22 -0
- data/_assets/yarn/throttle-debounce-fn/README.md +55 -0
- data/_assets/yarn/throttle-debounce-fn/dist/throttle-debounce-fn.js +164 -0
- data/_assets/yarn/throttle-debounce-fn/dist/throttle-debounce-fn.min.js +10 -0
- data/_assets/yarn/throttle-debounce-fn/package.json +36 -0
- data/_assets/yarn/throttle-debounce-fn/src/throttle-debounce-fn.js +156 -0
- data/_assets/yarn/turbolinks/LICENSE +20 -0
- data/_assets/yarn/turbolinks/README.md +473 -0
- data/_assets/yarn/turbolinks/dist/turbolinks.js +6 -0
- data/_assets/yarn/turbolinks/src/turbolinks/BANNER.js.erb +4 -0
- data/_assets/yarn/turbolinks/src/turbolinks/VERSION +1 -0
- data/_assets/yarn/turbolinks/src/turbolinks/browser_adapter.coffee +61 -0
- data/_assets/yarn/turbolinks/src/turbolinks/compatibility.coffee +30 -0
- data/_assets/yarn/turbolinks/src/turbolinks/controller.coffee +239 -0
- data/_assets/yarn/turbolinks/src/turbolinks/error_renderer.coffee +21 -0
- data/_assets/yarn/turbolinks/src/turbolinks/head_details.coffee +51 -0
- data/_assets/yarn/turbolinks/src/turbolinks/helpers.coffee +57 -0
- data/_assets/yarn/turbolinks/src/turbolinks/history.coffee +48 -0
- data/_assets/yarn/turbolinks/src/turbolinks/http_request.coffee +88 -0
- data/_assets/yarn/turbolinks/src/turbolinks/index.coffee +18 -0
- data/_assets/yarn/turbolinks/src/turbolinks/location.coffee +70 -0
- data/_assets/yarn/turbolinks/src/turbolinks/progress_bar.coffee +83 -0
- data/_assets/yarn/turbolinks/src/turbolinks/renderer.coffee +27 -0
- data/_assets/yarn/turbolinks/src/turbolinks/scroll_manager.coffee +28 -0
- data/_assets/yarn/turbolinks/src/turbolinks/snapshot.coffee +47 -0
- data/_assets/yarn/turbolinks/src/turbolinks/snapshot_cache.coffee +43 -0
- data/_assets/yarn/turbolinks/src/turbolinks/snapshot_renderer.coffee +88 -0
- data/_assets/yarn/turbolinks/src/turbolinks/start.coffee +18 -0
- data/_assets/yarn/turbolinks/src/turbolinks/view.coffee +34 -0
- data/_assets/yarn/turbolinks/src/turbolinks/visit.coffee +162 -0
- data/_assets/yarn/webfontloader/CHANGELOG +419 -0
- data/_assets/yarn/webfontloader/LICENSE +176 -0
- data/_assets/yarn/webfontloader/README.md +394 -0
- data/_assets/yarn/webfontloader/package.json +37 -0
- data/_assets/yarn/webfontloader/src/closure.js +2 -0
- data/_assets/yarn/webfontloader/src/core/cssclassname.js +46 -0
- data/_assets/yarn/webfontloader/src/core/domhelper.js +405 -0
- data/_assets/yarn/webfontloader/src/core/eventdispatcher.js +195 -0
- data/_assets/yarn/webfontloader/src/core/font.js +140 -0
- data/_assets/yarn/webfontloader/src/core/fontmodule.js +16 -0
- data/_assets/yarn/webfontloader/src/core/fontmoduleloader.js +47 -0
- data/_assets/yarn/webfontloader/src/core/fontruler.js +60 -0
- data/_assets/yarn/webfontloader/src/core/fontwatcher.js +171 -0
- data/_assets/yarn/webfontloader/src/core/fontwatchrunner.js +249 -0
- data/_assets/yarn/webfontloader/src/core/initialize.js +97 -0
- data/_assets/yarn/webfontloader/src/core/nativefontwatchrunner.js +69 -0
- data/_assets/yarn/webfontloader/src/core/stylesheetwaiter.js +48 -0
- data/_assets/yarn/webfontloader/src/core/webfont.js +97 -0
- data/_assets/yarn/webfontloader/src/modules/custom.js +63 -0
- data/_assets/yarn/webfontloader/src/modules/fontdeck.js +66 -0
- data/_assets/yarn/webfontloader/src/modules/google/fontapiparser.js +181 -0
- data/_assets/yarn/webfontloader/src/modules/google/fontapiurlbuilder.js +77 -0
- data/_assets/yarn/webfontloader/src/modules/google/googlefontapi.js +54 -0
- data/_assets/yarn/webfontloader/src/modules/monotype.js +110 -0
- data/_assets/yarn/webfontloader/src/modules/typekit.js +73 -0
- data/_assets/yarn/webfontloader/webfontloader.js +17 -0
- data/_includes/footer.html +7 -0
- data/_includes/head.html +41 -0
- data/_includes/image.html +5 -0
- data/_includes/javascript.html +1 -0
- data/_includes/javascripts.html +19 -0
- data/_includes/navigation.html +75 -0
- data/_includes/stylesheet.html +1 -0
- data/_layouts/articles_by_tag.html +38 -0
- data/_layouts/default.html +16 -0
- data/_layouts/post.html +65 -0
- data/about.html +18 -0
- data/favicon.ico +0 -0
- data/feed.xml +20 -0
- data/index.html +49 -0
- data/robots.txt +5 -0
- metadata +596 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
@-webkit-keyframes a{0%{-webkit-transform:translate(-50%,-50%) rotateX(0) rotateY(0);transform:translate(-50%,-50%) rotateX(0) rotateY(0)}50%{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0)}to{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg)}}@keyframes a{0%{-webkit-transform:translate(-50%,-50%) rotateX(0) rotateY(0);transform:translate(-50%,-50%) rotateX(0) rotateY(0)}50%{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0)}to{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg)}}.fluidbox{outline:none}.fluidbox__overlay{background-color:hsla(0,0%,100%,.85);cursor:pointer;cursor:zoom-out;opacity:0;pointer-events:none;position:fixed;top:-100%;left:0;bottom:-100%;right:0;-webkit-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.fluidbox--opened .fluidbox__overlay{pointer-events:auto}.fluidbox__wrap{background-position:center center;background-size:cover;margin:0 auto;position:relative;-webkit-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.fluidbox--closed .fluidbox__thumb,.fluidbox__thumb{-webkit-transition:opacity 0s ease-in-out 0s;transition:opacity 0s ease-in-out 0s}.fluidbox__ghost{background-size:100% 100%;background-position:center center;background-repeat:no-repeat;position:absolute;-webkit-transition:opacity 0s 0s,-webkit-transform .5s 0s;transition:opacity 0s 0s,-webkit-transform .5s 0s;transition:opacity 0s 0s,transform .5s 0s;transition:opacity 0s 0s,transform .5s 0s,-webkit-transform .5s 0s}.fluidbox--opened .fluidbox__ghost{cursor:pointer;cursor:zoom-out}.fluidbox--closed .fluidbox__ghost{-webkit-transition:opacity 0s .5s,-webkit-transform .5s 0s;transition:opacity 0s .5s,-webkit-transform .5s 0s;transition:opacity 0s .5s,transform .5s 0s;transition:opacity 0s .5s,transform .5s 0s,-webkit-transform .5s 0s}.fluidbox__loader{opacity:0;-webkit-perspective:200px;perspective:200px;pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}.fluidbox__loader:before{background-color:hsla(0,0%,100%,.85);content:'';-webkit-transform-style:preserve-3d;transform-style:preserve-3d;position:absolute;top:50%;left:50%;width:20%;padding-bottom:20%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-delay:0s;transition-delay:0s}.fluidbox--loading .fluidbox__loader{opacity:1;-webkit-transition:opacity .5s ease-in-out .5s;transition:opacity .5s ease-in-out .5s}.fluidbox--loading .fluidbox__loader:before{-webkit-animation:a 1s 0s infinite ease-in-out forwards;animation:a 1s 0s infinite ease-in-out forwards}
|
2
|
+
/*# sourceMappingURL=fluidbox.min.css.map */
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/css/_fluidbox.scss"],"names":[],"mappings":"AAMA,qBACC,GAAM,6DAAoD,AAApD,oDAAoD,CAAA,AAC1D,IAAO,mEAAyD,AAAzD,0DAAyD,CAAA,AAChE,GAAO,yEAAyD,AAAzD,gEAAyD,CAAA,CAAA,AAHjE,aACC,GAAM,6DAAoD,AAApD,oDAAoD,CAAA,AAC1D,IAAO,mEAAyD,AAAzD,0DAAyD,CAAA,AAChE,GAAO,yEAAyD,AAAzD,gEAAyD,CAAA,CAAA,AAIjE,UACC,YAAc,CACd,AACD,mBACC,qCAfgC,AAgBhC,eAAgB,AAChB,gBAAiB,AACjB,UAAW,AACX,oBAAqB,AACrB,eAAgB,AAChB,UAAW,AACX,OAAQ,AACR,aAAc,AACd,QAAS,AAET,uCAA0D,AAA1D,8BAA0D,CAG1D,AADA,qCAAsB,mBAAqB,CAAG,AAE/C,gBACC,kCAAmC,AACnC,sBAAuB,AACvB,cAAe,AACf,kBAAmB,AACnB,uCAA0D,AAA1D,8BAA0D,CAC1D,AAIA,oDAAsB,6CAAsC,AAAtC,oCAAsC,CAAI,AAEjE,iBACC,0BAA2B,AAC3B,kCAAmC,AACnC,4BAA6B,AAC7B,kBAAmB,AACnB,0DAAsE,AAAtE,kDAAsE,AAAtE,0CAAsE,AAAtE,kEAAsE,CAWtE,AATA,mCACC,eAAgB,AAGhB,eAAiB,CACjB,AACD,mCACC,2DAAkG,AAAlG,mDAAkG,AAAlG,2CAAkG,AAAlG,mEAAkG,CAClG,AAEF,kBACC,UAAW,AACX,0BAAmB,AAAnB,kBAAmB,AACnB,oBAAqB,AACrB,kBAAmB,AACnB,MAAO,AACP,OAAQ,AACR,SAAU,AACV,OAAS,CAiBT,AAzBD,yBAYE,qCAvE+B,AAwE/B,WAAY,AACZ,oCAA6B,AAA7B,4BAA6B,AAC7B,kBAAmB,AACnB,QAAS,AACT,SAAU,AACV,UAAW,AACX,mBAAoB,AACpB,uCAAoB,AAApB,+BAAoB,AACpB,8CAA+B,AAA/B,sCAA+B,AAA/B,8BAA+B,AAA/B,gDAA+B,AAC/B,gCAlFiC,AAkFjC,wBAlFiC,AAmFjC,4BAAqB,AAArB,mBAAqB,CACrB,AAGF,qCACC,UAAW,AACX,+CAzFkC,AAyFlC,sCAzFkC,CA6FlC,AAND,4CAIE,wDAA+D,AAA/D,+CAA+D,CAC/D","file":"fluidbox.min.css"}
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(a,b,c,d){"use strict";function e(b,c){this.element=b;var d={};a.each(a(this.element).data(),function(a,b){var c=function(a){return a&&a[0].toLowerCase()+a.slice(1)},e=c(a.replace("fluidbox",""));(""!==e||null!==e)&&("false"==b?b=!1:"true"==b&&(b=!0),d[e]=b)}),this.settings=a.extend({},h,c,d),this.settings.viewportFill=Math.max(Math.min(parseFloat(this.settings.viewportFill),1),0),this.settings.stackIndex<this.settings.stackIndexDelta&&(settings.stackIndexDelta=settings.stackIndex),this._name=g,this.init()}var f=a(b),g=(a(c),"fluidbox"),h={immediateOpen:!1,loader:!1,maxWidth:0,maxHeight:0,resizeThrottle:500,stackIndex:1e3,stackIndexDelta:10,viewportFill:.95},i={},j=0;("undefined"==typeof console||"undefined"===console.warn)&&(console={},console.warn=function(){}),a.isFunction(a.throttle)||console.warn("Fluidbox: The jQuery debounce/throttle plugin is not found/loaded. Even though Fluidbox works without it, the window resize event will fire extremely rapidly in browsers, resulting in significant degradation in performance upon viewport resize.");var k=function(){var a,b=c.createElement("fakeelement"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]},l=k(),m={dom:function(){var b=a("<div />",{"class":"fluidbox__wrap",css:{zIndex:this.settings.stackIndex-this.settings.stackIndexDelta}});if(a(this.element).addClass("fluidbox--closed").wrapInner(b).find("img").first().css({opacity:1}).addClass("fluidbox__thumb").after('<div class="fluidbox__ghost" />'),this.settings.loader){var c=a("<div />",{"class":"fluidbox__loader",css:{zIndex:2}});a(this.element).find(".fluidbox__wrap").append(c)}},prepareFb:function(){var b=this,c=a(this.element);c.trigger("thumbloaddone.fluidbox"),m.measure.fbElements.call(this),b.bindEvents(),c.addClass("fluidbox--ready"),b.bindListeners(),c.trigger("ready.fluidbox")},measure:{viewport:function(){i.viewport={w:f.width(),h:f.height()}},fbElements:function(){var b=this,c=a(this.element),d=c.find("img").first(),e=c.find(".fluidbox__ghost"),f=c.find(".fluidbox__wrap");b.instanceData.thumb={natW:d[0].naturalWidth,natH:d[0].naturalHeight,w:d.width(),h:d.height()},e.css({width:d.width(),height:d.height(),top:d.offset().top-f.offset().top+parseInt(d.css("borderTopWidth"))+parseInt(d.css("paddingTop")),left:d.offset().left-f.offset().left+parseInt(d.css("borderLeftWidth"))+parseInt(d.css("paddingLeft"))})}},checkURL:function(a){var b=0;return/[\s+]/g.test(a)?(console.warn("Fluidbox: Fluidbox opening is halted because it has detected characters in your URL string that need to be properly encoded/escaped. Whitespace(s) have to be escaped manually. See RFC3986 documentation."),b=1):/[\"\'\(\)]/g.test(a)&&(console.warn("Fluidbox: Fluidbox opening will proceed, but it has detected characters in your URL string that need to be properly encoded/escaped. These will be escaped for you. See RFC3986 documentation."),b=0),b},formatURL:function(a){return a.replace(/"/g,"%22").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")}};a.extend(e.prototype,{init:function(){var b=this,c=a(this.element),d=c.find("img").first();if(m.measure.viewport(),(!b.instanceData||!b.instanceData.initialized)&&c.is("a")&&1===c.children().length&&(c.children().is("img")||c.children().is("picture")&&1===c.find("img").length)&&"none"!==c.css("display")&&"none"!==c.children().css("display")&&"none"!==c.parents().css("display")){c.removeClass("fluidbox--destroyed"),b.instanceData={},b.instanceData.initialized=!0,b.instanceData.originalNode=c.html(),j+=1,b.instanceData.id=j,c.addClass("fluidbox__instance-"+j),c.addClass("fluidbox--initialized"),m.dom.call(b),c.trigger("init.fluidbox");var e=new Image;d.width()>0&&d.height()>0?m.prepareFb.call(b):(e.onload=function(){m.prepareFb.call(b)},e.onerror=function(){c.trigger("thumbloadfail.fluidbox")},e.src=d.attr("src"))}},open:function(){var b=this,c=a(this.element),d=c.find("img").first(),e=c.find(".fluidbox__ghost"),f=c.find(".fluidbox__wrap");b.instanceData.state=1,e.off(l),a(".fluidbox--opened").fluidbox("close");var g=a("<div />",{"class":"fluidbox__overlay",css:{zIndex:-1}});if(f.append(g),c.removeClass("fluidbox--closed").addClass("fluidbox--loading"),m.checkURL(d.attr("src")))return b.close(),!1;e.css({"background-image":"url("+m.formatURL(d.attr("src"))+")",opacity:1}),m.measure.fbElements.call(b);var h;b.settings.immediateOpen?(c.addClass("fluidbox--opened fluidbox--loaded").find(".fluidbox__wrap").css({zIndex:b.settings.stackIndex+b.settings.stackIndexDelta}),c.trigger("openstart.fluidbox"),b.compute(),d.css({opacity:0}),a(".fluidbox__overlay").css({opacity:1}),e.one(l,function(){c.trigger("openend.fluidbox")}),h=new Image,h.onload=function(){if(c.trigger("imageloaddone.fluidbox"),1===b.instanceData.state){if(b.instanceData.thumb.natW=h.naturalWidth,b.instanceData.thumb.natH=h.naturalHeight,c.removeClass("fluidbox--loading"),m.checkURL(h.src))return b.close({error:!0}),!1;e.css({"background-image":"url("+m.formatURL(h.src)+")"}),b.compute()}},h.onerror=function(){b.close({error:!0}),c.trigger("imageloadfail.fluidbox"),c.trigger("delayedloadfail.fluidbox")},h.src=c.attr("href")):(h=new Image,h.onload=function(){return c.trigger("imageloaddone.fluidbox"),c.removeClass("fluidbox--loading").addClass("fluidbox--opened fluidbox--loaded").find(".fluidbox__wrap").css({zIndex:b.settings.stackIndex+b.settings.stackIndexDelta}),c.trigger("openstart.fluidbox"),m.checkURL(h.src)?(b.close({error:!0}),!1):(e.css({"background-image":"url("+m.formatURL(h.src)+")"}),b.instanceData.thumb.natW=h.naturalWidth,b.instanceData.thumb.natH=h.naturalHeight,b.compute(),d.css({opacity:0}),a(".fluidbox__overlay").css({opacity:1}),void e.one(l,function(){c.trigger("openend.fluidbox")}))},h.onerror=function(){b.close({error:!0}),c.trigger("imageloadfail.fluidbox")},h.src=c.attr("href"))},compute:function(){var b=this,c=a(this.element),d=c.find("img").first(),e=c.find(".fluidbox__ghost"),g=c.find(".fluidbox__wrap"),h=b.instanceData.thumb.natW,j=b.instanceData.thumb.natH,k=b.instanceData.thumb.w,l=b.instanceData.thumb.h,m=h/j,n=i.viewport.w/i.viewport.h;b.settings.maxWidth>0?(h=b.settings.maxWidth,j=h/m):b.settings.maxHeight>0&&(j=b.settings.maxHeight,h=j*m);var o,p,q,r,s;n>m?(o=j<i.viewport.h?j:i.viewport.h*b.settings.viewportFill,q=o/l,r=h*(l*q/j)/k,s=q):(p=h<i.viewport.w?h:i.viewport.w*b.settings.viewportFill,r=p/k,q=j*(k*r/h)/l,s=r),b.settings.maxWidth&&b.settings.maxHeight&&console.warn("Fluidbox: Both maxHeight and maxWidth are specified. You can only specify one. If both are specified, only the maxWidth property will be respected. This will not generate any error, but may cause unexpected sizing behavior.");var t=f.scrollTop()-d.offset().top+.5*(l*(s-1))+.5*(f.height()-l*s),u=.5*(k*(s-1))+.5*(f.width()-k*s)-d.offset().left,v=parseInt(100*r)/100+","+parseInt(100*q)/100;e.css({transform:"translate("+parseInt(100*u)/100+"px,"+parseInt(100*t)/100+"px) scale("+v+")",top:d.offset().top-g.offset().top,left:d.offset().left-g.offset().left}),c.find(".fluidbox__loader").css({transform:"translate("+parseInt(100*u)/100+"px,"+parseInt(100*t)/100+"px) scale("+v+")"}),c.trigger("computeend.fluidbox")},recompute:function(){this.compute()},close:function(b){var c=this,e=a(this.element),f=e.find("img").first(),g=e.find(".fluidbox__ghost"),h=e.find(".fluidbox__wrap"),i=e.find(".fluidbox__overlay"),j=a.extend(null,{error:!1},b);return null===c.instanceData.state||typeof c.instanceData.state==typeof d||0===c.instanceData.state?!1:(c.instanceData.state=0,e.trigger("closestart.fluidbox"),e.removeClass(function(a,b){return(b.match(/(^|\s)fluidbox--(opened|loaded|loading)+/g)||[]).join(" ")}).addClass("fluidbox--closed"),g.css({transform:"translate(0,0) scale(1,1)",top:f.offset().top-h.offset().top+parseInt(f.css("borderTopWidth"))+parseInt(f.css("paddingTop")),left:f.offset().left-h.offset().left+parseInt(f.css("borderLeftWidth"))+parseInt(f.css("paddingLeft"))}),e.find(".fluidbox__loader").css({transform:"none"}),g.one(l,function(){g.css({opacity:0}),f.css({opacity:1}),i.remove(),h.css({zIndex:c.settings.stackIndex-c.settings.stackIndexDelta}),e.trigger("closeend.fluidbox")}),j.error&&g.trigger("transitionend"),void i.css({opacity:0}))},bindEvents:function(){var b=this,c=a(this.element);c.on("click.fluidbox",function(a){a.preventDefault(),b.instanceData.state&&0!==b.instanceData.state?b.close():b.open()})},bindListeners:function(){var b=this,c=a(this.element),d=function(){m.measure.viewport(),m.measure.fbElements.call(b),c.hasClass("fluidbox--opened")&&b.compute()};a.isFunction(a.throttle)?f.on("resize.fluidbox"+b.instanceData.id,a.throttle(b.settings.resizeThrottle,d)):f.on("resize.fluidbox"+b.instanceData.id,d),c.on("reposition.fluidbox",function(){b.reposition()}),c.on("recompute.fluidbox, compute.fluidbox",function(){b.compute()}),c.on("destroy.fluidbox",function(){b.destroy()}),c.on("close.fluidbox",function(){b.close()})},unbind:function(){a(this.element).off("click.fluidbox reposition.fluidbox recompute.fluidbox compute.fluidbox destroy.fluidbox close.fluidbox"),f.off("resize.fluidbox"+this.instanceData.id)},reposition:function(){m.measure.fbElements.call(this)},destroy:function(){var b=this.instanceData.originalNode;this.unbind(),a.data(this.element,"plugin_"+g,null),a(this.element).removeClass(function(a,b){return(b.match(/(^|\s)fluidbox[--|__]\S+/g)||[]).join(" ")}).empty().html(b).addClass("fluidbox--destroyed").trigger("destroyed.fluidbox")},getMetadata:function(){return this.instanceData}}),a.fn[g]=function(b){var c=arguments;if(b===d||"object"==typeof b)return this.each(function(){a.data(this,"plugin_"+g)||a.data(this,"plugin_"+g,new e(this,b))});if("string"==typeof b&&"_"!==b[0]&&"init"!==b){var f;return this.each(function(){var d=a.data(this,"plugin_"+g);d instanceof e&&"function"==typeof d[b]?f=d[b].apply(d,Array.prototype.slice.call(c,1)):console.warn('Fluidbox: The method "'+b+'" used is not defined in Fluidbox. Please make sure you are calling the correct public method.')}),f!==d?f:this}return this}}(jQuery,window,document);
|
@@ -0,0 +1,20 @@
|
|
1
|
+
default:
|
2
|
+
description: 'Default (production) build'
|
3
|
+
tasks:
|
4
|
+
- prod
|
5
|
+
dev:
|
6
|
+
description: 'Development build'
|
7
|
+
tasks:
|
8
|
+
- 'concurrent:devFirst'
|
9
|
+
- 'concurrent:devSecond'
|
10
|
+
- 'concurrent:devThird'
|
11
|
+
devimg:
|
12
|
+
description: 'Development build and image tasks'
|
13
|
+
tasks:
|
14
|
+
- dev
|
15
|
+
prod:
|
16
|
+
description: 'Production build'
|
17
|
+
tasks:
|
18
|
+
- 'concurrent:prodFirst'
|
19
|
+
- 'concurrent:prodSecond'
|
20
|
+
- 'concurrent:prodThird'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module.exports = {
|
2
|
+
|
3
|
+
// Task options
|
4
|
+
options: {
|
5
|
+
limit: 3
|
6
|
+
},
|
7
|
+
|
8
|
+
// Dev tasks
|
9
|
+
devFirst: [
|
10
|
+
'clean',
|
11
|
+
'jshint'
|
12
|
+
],
|
13
|
+
devSecond: [
|
14
|
+
'sass:dev',
|
15
|
+
'uglify'
|
16
|
+
],
|
17
|
+
devThird: [
|
18
|
+
'postcss:dev'
|
19
|
+
],
|
20
|
+
|
21
|
+
// Production tasks
|
22
|
+
prodFirst: [
|
23
|
+
'clean',
|
24
|
+
'jshint'
|
25
|
+
],
|
26
|
+
prodSecond: [
|
27
|
+
'sass:prod',
|
28
|
+
'uglify'
|
29
|
+
],
|
30
|
+
prodThird: [
|
31
|
+
'postcss:prod'
|
32
|
+
]
|
33
|
+
};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module.exports = {
|
2
|
+
// Development settings
|
3
|
+
dev: {
|
4
|
+
options: {
|
5
|
+
map: true,
|
6
|
+
processors: [
|
7
|
+
require('autoprefixer')({browsers: '> 2.5%'})
|
8
|
+
]
|
9
|
+
},
|
10
|
+
files: [{
|
11
|
+
expand: true,
|
12
|
+
cwd: 'dist/css',
|
13
|
+
src: ['*.css'],
|
14
|
+
dest: 'dist/css',
|
15
|
+
ext: '.css'
|
16
|
+
}, {
|
17
|
+
expand: true,
|
18
|
+
cwd: 'demo/css',
|
19
|
+
src: ['*.css'],
|
20
|
+
dest: 'demo/css',
|
21
|
+
ext: '.css'
|
22
|
+
}]
|
23
|
+
},
|
24
|
+
// Production settings
|
25
|
+
prod: {
|
26
|
+
options: {
|
27
|
+
map: true,
|
28
|
+
processors: [
|
29
|
+
require('autoprefixer')({browsers: '> 2.5%'}),
|
30
|
+
require('cssnano')({zindex: false})
|
31
|
+
]
|
32
|
+
},
|
33
|
+
files: [{
|
34
|
+
expand: true,
|
35
|
+
cwd: 'dist/css',
|
36
|
+
src: ['*.css'],
|
37
|
+
dest: 'dist/css',
|
38
|
+
ext: '.min.css'
|
39
|
+
}, {
|
40
|
+
expand: true,
|
41
|
+
cwd: 'demo/css',
|
42
|
+
src: ['*.css'],
|
43
|
+
dest: 'demo/css',
|
44
|
+
ext: '.min.css'
|
45
|
+
}]
|
46
|
+
}
|
47
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module.exports = {
|
2
|
+
// Development settings
|
3
|
+
dev: {
|
4
|
+
options: {
|
5
|
+
outputStyle: 'nested',
|
6
|
+
sourceMap: true
|
7
|
+
},
|
8
|
+
files: [{
|
9
|
+
expand: true,
|
10
|
+
cwd: 'src/css',
|
11
|
+
src: ['*.scss'],
|
12
|
+
dest: 'dist/css',
|
13
|
+
ext: '.css'
|
14
|
+
}, {
|
15
|
+
expand: true,
|
16
|
+
cwd: 'demo/src/css',
|
17
|
+
src: ['*.scss'],
|
18
|
+
dest: 'demo/css',
|
19
|
+
ext: '.css'
|
20
|
+
}]
|
21
|
+
},
|
22
|
+
// Production settings
|
23
|
+
prod: {
|
24
|
+
options: {
|
25
|
+
outputStyle: 'nested',
|
26
|
+
sourceMap: true
|
27
|
+
},
|
28
|
+
files: [{
|
29
|
+
expand: true,
|
30
|
+
cwd: 'src/css',
|
31
|
+
src: ['*.scss'],
|
32
|
+
dest: 'dist/css',
|
33
|
+
ext: '.min.css'
|
34
|
+
}, {
|
35
|
+
expand: true,
|
36
|
+
cwd: 'demo/src/css',
|
37
|
+
src: ['*.scss'],
|
38
|
+
dest: 'demo/css',
|
39
|
+
ext: '.min.css'
|
40
|
+
}]
|
41
|
+
}
|
42
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module.exports = {
|
2
|
+
|
3
|
+
options: {
|
4
|
+
spawn: false,
|
5
|
+
livereload: true
|
6
|
+
},
|
7
|
+
|
8
|
+
scripts: {
|
9
|
+
files: [
|
10
|
+
'src/js/*.js'
|
11
|
+
],
|
12
|
+
tasks: [
|
13
|
+
'jshint',
|
14
|
+
'uglify'
|
15
|
+
]
|
16
|
+
},
|
17
|
+
|
18
|
+
styles: {
|
19
|
+
files: [
|
20
|
+
'src/css/*.scss',
|
21
|
+
'demo/src/css/*.scss'
|
22
|
+
],
|
23
|
+
tasks: [
|
24
|
+
'sass:prod',
|
25
|
+
'postcss:prod'
|
26
|
+
]
|
27
|
+
},
|
28
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Terry Mun
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
{
|
2
|
+
"name": "fluidbox",
|
3
|
+
"version": "2.0.5",
|
4
|
+
"description": "Replicating Medium's beautiful, minimalist lightbox module",
|
5
|
+
"homepage": "http://terrymun.github.io/Fluidbox/",
|
6
|
+
"author": "Terry Mun <hello@terrymun.com> (http://terrymun.com)",
|
7
|
+
"repository": {
|
8
|
+
"type": "git",
|
9
|
+
"url": "https://github.com/terrymun/Fluidbox/"
|
10
|
+
},
|
11
|
+
"main": "dist/js/jquery.fluidbox.min.js",
|
12
|
+
"maintainers": [
|
13
|
+
"Terry Mun <hello@terrymun.com>"
|
14
|
+
],
|
15
|
+
"keywords": [
|
16
|
+
"fluidbox",
|
17
|
+
"fluidbox.js",
|
18
|
+
"lightbox",
|
19
|
+
"responsive",
|
20
|
+
"modal"
|
21
|
+
],
|
22
|
+
"license": "MIT",
|
23
|
+
"dependencies": {
|
24
|
+
"jquery": ">=1.9"
|
25
|
+
},
|
26
|
+
"npmName": "fluidbox",
|
27
|
+
"npmFileMap": [
|
28
|
+
{
|
29
|
+
"basePath": "/dist/",
|
30
|
+
"files": [
|
31
|
+
"./dist/js/jquery.fluidbox.min.js",
|
32
|
+
"./dist/css/fluidbox.min.css"
|
33
|
+
]
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"scripts": {
|
37
|
+
"test": "echo \"Error: no test specified\" && exit 0"
|
38
|
+
},
|
39
|
+
"devDependencies": {
|
40
|
+
"autoprefixer": "^6.2.3",
|
41
|
+
"cssnano": "^3.4.0",
|
42
|
+
"grunt": "^0.4.5",
|
43
|
+
"grunt-concurrent": "^2.0.3",
|
44
|
+
"grunt-contrib-clean": "^0.6.0",
|
45
|
+
"grunt-contrib-jshint": "^0.11.3",
|
46
|
+
"grunt-contrib-uglify": "^0.11.0",
|
47
|
+
"grunt-contrib-watch": "^0.6.1",
|
48
|
+
"grunt-postcss": "^0.7.1",
|
49
|
+
"grunt-sass": "^1.1.0",
|
50
|
+
"jshint-stylish": "^2.1.0",
|
51
|
+
"load-grunt-config": "^0.17.2",
|
52
|
+
"time-grunt": "^1.2.1"
|
53
|
+
},
|
54
|
+
"ignore": [
|
55
|
+
"**/.*",
|
56
|
+
"node_modules",
|
57
|
+
"bower_components",
|
58
|
+
"bower.json",
|
59
|
+
"package.json"
|
60
|
+
]
|
61
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
// Variable
|
2
|
+
$fluidbox__transition-duration: .5s !default;
|
3
|
+
$fluidbox__overlay-bg-color: rgba(255,255,255,.85) !default;
|
4
|
+
$fluidbox__animation-bg-color: $fluidbox__overlay-bg-color !default;
|
5
|
+
|
6
|
+
// Animation
|
7
|
+
@keyframes fluidboxLoading {
|
8
|
+
0% { transform: translate(-50%, -50%) rotateX(0) rotateY(0); }
|
9
|
+
50% { transform: translate(-50%, -50%) rotateX(-180deg) rotateY(0); }
|
10
|
+
100% { transform: translate(-50%, -50%) rotateX(-180deg) rotateY(-180deg); }
|
11
|
+
}
|
12
|
+
|
13
|
+
// Rules
|
14
|
+
.fluidbox {
|
15
|
+
outline: none;
|
16
|
+
}
|
17
|
+
.fluidbox__overlay {
|
18
|
+
background-color: $fluidbox__overlay-bg-color;
|
19
|
+
cursor: pointer;
|
20
|
+
cursor: zoom-out;
|
21
|
+
opacity: 0;
|
22
|
+
pointer-events: none;
|
23
|
+
position: fixed;
|
24
|
+
top: -100%; /* Negative top and bottom is to fix some Safari cases where image got blurry */
|
25
|
+
left: 0;
|
26
|
+
bottom: -100%; /* Negative top and bottom is to fix some Safari cases where image got blurry */
|
27
|
+
right: 0;
|
28
|
+
/* Transition time for overlay is halved to ensure that flickering doesn't happen */
|
29
|
+
transition: all $fluidbox__transition-duration ease-in-out;
|
30
|
+
|
31
|
+
.fluidbox--opened & { pointer-events: auto;}
|
32
|
+
}
|
33
|
+
.fluidbox__wrap {
|
34
|
+
background-position: center center;
|
35
|
+
background-size: cover;
|
36
|
+
margin: 0 auto;
|
37
|
+
position: relative;
|
38
|
+
transition: all $fluidbox__transition-duration ease-in-out;
|
39
|
+
}
|
40
|
+
.fluidbox__thumb {
|
41
|
+
transition: opacity 0s ease-in-out 0s;
|
42
|
+
/* To prevent flickering, we delay the showing of the image */
|
43
|
+
.fluidbox--closed & { transition: opacity 0s ease-in-out 0s; }
|
44
|
+
}
|
45
|
+
.fluidbox__ghost {
|
46
|
+
background-size: 100% 100%;
|
47
|
+
background-position: center center;
|
48
|
+
background-repeat: no-repeat;
|
49
|
+
position: absolute;
|
50
|
+
transition: opacity 0s 0s, transform $fluidbox__transition-duration 0s;
|
51
|
+
|
52
|
+
.fluidbox--opened & {
|
53
|
+
cursor: pointer;
|
54
|
+
cursor: -webkit-zoom-out;
|
55
|
+
cursor: -moz-zoom-out;
|
56
|
+
cursor: zoom-out;
|
57
|
+
}
|
58
|
+
.fluidbox--closed & {
|
59
|
+
transition: opacity 0s $fluidbox__transition-duration, transform $fluidbox__transition-duration 0s;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
.fluidbox__loader {
|
63
|
+
opacity: 0;
|
64
|
+
perspective: 200px;
|
65
|
+
pointer-events: none;
|
66
|
+
position: absolute;
|
67
|
+
top: 0;
|
68
|
+
left: 0;
|
69
|
+
bottom: 0;
|
70
|
+
right: 0;
|
71
|
+
|
72
|
+
&::before {
|
73
|
+
/* You can replace this with any color you want, or even a loading gif if desired */
|
74
|
+
background-color: $fluidbox__animation-bg-color;
|
75
|
+
content: '';
|
76
|
+
transform-style: preserve-3d;
|
77
|
+
position: absolute;
|
78
|
+
top: 50%;
|
79
|
+
left: 50%;
|
80
|
+
width: 20%;
|
81
|
+
padding-bottom: 20%;
|
82
|
+
transform: translate(-50%, -50%);
|
83
|
+
transition-property: transform;
|
84
|
+
transition-duration: $fluidbox__transition-duration;
|
85
|
+
transition-delay: 0s;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
.fluidbox--loading .fluidbox__loader {
|
90
|
+
opacity: 1;
|
91
|
+
transition: opacity $fluidbox__transition-duration ease-in-out $fluidbox__transition-duration;
|
92
|
+
&::before {
|
93
|
+
animation: fluidboxLoading 1s 0s infinite ease-in-out forwards;
|
94
|
+
}
|
95
|
+
}
|
@@ -0,0 +1,722 @@
|
|
1
|
+
// the semi-colon before function invocation is a safety net against concatenated
|
2
|
+
// scripts and/or other plugins which may not be closed properly.
|
3
|
+
;(function ( $, window, document, undefined ) {
|
4
|
+
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
// undefined is used here as the undefined global variable in ECMAScript 3 is
|
8
|
+
// mutable (ie. it can be changed by someone else). undefined isn't really being
|
9
|
+
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined
|
10
|
+
// can no longer be modified.
|
11
|
+
|
12
|
+
// window and document are passed through as local variable rather than global
|
13
|
+
// as this (slightly) quickens the resolution process and can be more efficiently
|
14
|
+
// minified (especially when both are regularly referenced in your plugin).
|
15
|
+
|
16
|
+
// Create the defaults once
|
17
|
+
var $w = $(window),
|
18
|
+
$d = $(document),
|
19
|
+
pluginName = "fluidbox",
|
20
|
+
defaults = {
|
21
|
+
immediateOpen: false,
|
22
|
+
loader: false,
|
23
|
+
maxWidth: 0,
|
24
|
+
maxHeight: 0,
|
25
|
+
resizeThrottle: 500,
|
26
|
+
stackIndex: 1000,
|
27
|
+
stackIndexDelta: 10,
|
28
|
+
viewportFill: 0.95,
|
29
|
+
},
|
30
|
+
globalData = {},
|
31
|
+
keyboardEvents = ['keyup', 'keydown', 'keypress'];
|
32
|
+
|
33
|
+
// Global plugin instance tracker
|
34
|
+
var fbInstance = 0;
|
35
|
+
|
36
|
+
// Check the availability of the console object. This ensures compatibility with IE8.
|
37
|
+
if(typeof console === "undefined" || console.warn === "undefined" ) {
|
38
|
+
console = {};
|
39
|
+
console.warn = function(){};
|
40
|
+
}
|
41
|
+
|
42
|
+
// Check if dependencies are loaded
|
43
|
+
// 1. Ben Almen's debounce/throttle plugin
|
44
|
+
if (!$.isFunction($.throttle)) {
|
45
|
+
console.warn('Fluidbox: The jQuery debounce/throttle plugin is not found/loaded. Even though Fluidbox works without it, the window resize event will fire extremely rapidly in browsers, resulting in significant degradation in performance upon viewport resize.');
|
46
|
+
}
|
47
|
+
|
48
|
+
// ---------------------------------------------------------------------------------------------------------------------- //
|
49
|
+
// Dependency: David Walsh (http://davidwalsh.name/css-animation-callback) //
|
50
|
+
// and //
|
51
|
+
// Jonathan Suh (https://jonsuh.com/blog/detect-the-end-of-css-animations-and-transitions-with-javascript/) //
|
52
|
+
// ---------------------------------------------------------------------------------------------------------------------- //
|
53
|
+
var whichTransitionEvent = function() {
|
54
|
+
var t,
|
55
|
+
el = document.createElement("fakeelement");
|
56
|
+
|
57
|
+
var transitions = {
|
58
|
+
"transition" : "transitionend",
|
59
|
+
"OTransition" : "oTransitionEnd",
|
60
|
+
"MozTransition" : "transitionend",
|
61
|
+
"WebkitTransition": "webkitTransitionEnd"
|
62
|
+
};
|
63
|
+
|
64
|
+
for (t in transitions){
|
65
|
+
if (el.style[t] !== undefined){
|
66
|
+
return transitions[t];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
};
|
70
|
+
var customTransitionEnd = whichTransitionEvent();
|
71
|
+
|
72
|
+
// The actual plugin constructor
|
73
|
+
function Plugin (element, options) {
|
74
|
+
// Assign element
|
75
|
+
this.element = element;
|
76
|
+
|
77
|
+
// Manipulate HTML5 dataset object
|
78
|
+
// - Format: data-fluidbox-(setting-name). When converted into camel case: fluidboxSettingName
|
79
|
+
// - So, we will have to remove 'fluidbox' in the front, and change the first letter to lowercase
|
80
|
+
var elementData = {};
|
81
|
+
$.each($(this.element).data(), function(k,v) {
|
82
|
+
var capitalize = function(s) {
|
83
|
+
return s && s[0].toLowerCase() + s.slice(1);
|
84
|
+
},
|
85
|
+
key = capitalize(k.replace('fluidbox',''));
|
86
|
+
|
87
|
+
// Only push non-empty keys (that are part of the Fluidbox HTML5 data- attributes) into new object
|
88
|
+
if(key !== '' || key !== null) {
|
89
|
+
// Coerce boolean values
|
90
|
+
if (v == 'false') {
|
91
|
+
v = false;
|
92
|
+
} else if (v == 'true') {
|
93
|
+
v = true;
|
94
|
+
}
|
95
|
+
elementData[key] = v;
|
96
|
+
}
|
97
|
+
});
|
98
|
+
|
99
|
+
// Merge defaults into options, into dataset
|
100
|
+
this.settings = $.extend( {}, defaults, options, elementData);
|
101
|
+
|
102
|
+
// Coerce settings
|
103
|
+
this.settings.viewportFill = Math.max(Math.min(parseFloat(this.settings.viewportFill), 1), 0);
|
104
|
+
if(this.settings.stackIndex < this.settings.stackIndexDelta) {
|
105
|
+
settings.stackIndexDelta = settings.stackIndex;
|
106
|
+
}
|
107
|
+
|
108
|
+
// Store plugin name
|
109
|
+
this._name = pluginName;
|
110
|
+
|
111
|
+
// Initialize
|
112
|
+
this.init();
|
113
|
+
}
|
114
|
+
|
115
|
+
// Private functions
|
116
|
+
var _fun = {
|
117
|
+
dom: function() {
|
118
|
+
// Wrap and add ghost element
|
119
|
+
var $fb_innerWrap = $('<div />', {
|
120
|
+
'class': 'fluidbox__wrap',
|
121
|
+
css: {
|
122
|
+
zIndex: this.settings.stackIndex - this.settings.stackIndexDelta
|
123
|
+
}
|
124
|
+
});
|
125
|
+
$(this.element)
|
126
|
+
.addClass('fluidbox--closed')
|
127
|
+
.wrapInner($fb_innerWrap)
|
128
|
+
.find('img')
|
129
|
+
.first()
|
130
|
+
.css({ opacity: 1})
|
131
|
+
.addClass('fluidbox__thumb')
|
132
|
+
.after('<div class="fluidbox__ghost" />');
|
133
|
+
|
134
|
+
// Append loader
|
135
|
+
if(this.settings.loader) {
|
136
|
+
var $fbLoader = $('<div />', {
|
137
|
+
'class': 'fluidbox__loader',
|
138
|
+
css: {
|
139
|
+
zIndex: 2
|
140
|
+
}
|
141
|
+
});
|
142
|
+
$(this.element).find('.fluidbox__wrap').append($fbLoader);
|
143
|
+
}
|
144
|
+
},
|
145
|
+
prepareFb: function() {
|
146
|
+
var fb = this,
|
147
|
+
$fb = $(this.element);
|
148
|
+
|
149
|
+
// Thumbnail is successfully loaded, fire event
|
150
|
+
$fb.trigger('thumbloaddone.fluidbox');
|
151
|
+
|
152
|
+
// Get basic measurements and to resize the ghost element
|
153
|
+
_fun.measure.fbElements.call(this);
|
154
|
+
|
155
|
+
// Bind events
|
156
|
+
fb.bindEvents();
|
157
|
+
|
158
|
+
// Status: Fluidbox is ready to use
|
159
|
+
$fb.addClass('fluidbox--ready');
|
160
|
+
|
161
|
+
// Bind listeners
|
162
|
+
fb.bindListeners();
|
163
|
+
|
164
|
+
// Emit custom event
|
165
|
+
$fb.trigger('ready.fluidbox');
|
166
|
+
},
|
167
|
+
measure: {
|
168
|
+
viewport: function() {
|
169
|
+
globalData.viewport = {
|
170
|
+
w: $w.width(),
|
171
|
+
h: $w.height()
|
172
|
+
};
|
173
|
+
},
|
174
|
+
fbElements: function() {
|
175
|
+
var fb = this,
|
176
|
+
$fb = $(this.element),
|
177
|
+
$fbThumb = $fb.find('img').first(),
|
178
|
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
179
|
+
$fbWrap = $fb.find('.fluidbox__wrap');
|
180
|
+
|
181
|
+
// Store image dimensions in instance data
|
182
|
+
fb.instanceData.thumb = {
|
183
|
+
natW: $fbThumb[0].naturalWidth,
|
184
|
+
natH: $fbThumb[0].naturalHeight,
|
185
|
+
w: $fbThumb.width(),
|
186
|
+
h: $fbThumb.height()
|
187
|
+
};
|
188
|
+
|
189
|
+
// Set ghost dimensions
|
190
|
+
$fbGhost
|
191
|
+
.css({
|
192
|
+
width: $fbThumb.width(),
|
193
|
+
height: $fbThumb.height(),
|
194
|
+
top: $fbThumb.offset().top - $fbWrap.offset().top + parseInt($fbThumb.css('borderTopWidth')) + parseInt($fbThumb.css('paddingTop')),
|
195
|
+
left: $fbThumb.offset().left - $fbWrap.offset().left + parseInt($fbThumb.css('borderLeftWidth')) + parseInt($fbThumb.css('paddingLeft'))
|
196
|
+
});
|
197
|
+
}
|
198
|
+
},
|
199
|
+
checkURL: function(url) {
|
200
|
+
var exitCode = 0;
|
201
|
+
|
202
|
+
if(/[\s+]/g.test(url)) {
|
203
|
+
console.warn('Fluidbox: Fluidbox opening is halted because it has detected characters in your URL string that need to be properly encoded/escaped. Whitespace(s) have to be escaped manually. See RFC3986 documentation.');
|
204
|
+
exitCode = 1;
|
205
|
+
} else if(/[\"\'\(\)]/g.test(url)) {
|
206
|
+
console.warn('Fluidbox: Fluidbox opening will proceed, but it has detected characters in your URL string that need to be properly encoded/escaped. These will be escaped for you. See RFC3986 documentation.');
|
207
|
+
exitCode = 0;
|
208
|
+
}
|
209
|
+
return exitCode;
|
210
|
+
},
|
211
|
+
formatURL: function(url) {
|
212
|
+
return url
|
213
|
+
.replace(/"/g, '%22')
|
214
|
+
.replace(/'/g, '%27')
|
215
|
+
.replace(/\(/g, '%28')
|
216
|
+
.replace(/\)/g, '%29');
|
217
|
+
}
|
218
|
+
};
|
219
|
+
|
220
|
+
// Public functions
|
221
|
+
$.extend(Plugin.prototype, {
|
222
|
+
init: function () {
|
223
|
+
|
224
|
+
// Define elements
|
225
|
+
var fb = this,
|
226
|
+
$fb = $(this.element),
|
227
|
+
$fbThumb = $fb.find('img').first();
|
228
|
+
|
229
|
+
// Get basic measurements
|
230
|
+
_fun.measure.viewport();
|
231
|
+
|
232
|
+
// Only perform initialization when
|
233
|
+
// - It is not yet initialized
|
234
|
+
// + DOM checks are satisfied:
|
235
|
+
// +-- An anchor element is selected
|
236
|
+
// +-- Contains one and only one child
|
237
|
+
// +-- The only child is an image element OR a picture element
|
238
|
+
// +-- The element must not be hidden (itself or its parents)
|
239
|
+
if(
|
240
|
+
(!fb.instanceData || !fb.instanceData.initialized) &&
|
241
|
+
(
|
242
|
+
$fb.is('a') &&
|
243
|
+
$fb.children().length === 1 &&
|
244
|
+
(
|
245
|
+
$fb.children().is('img') || (
|
246
|
+
$fb.children().is('picture') &&
|
247
|
+
$fb.find('img').length === 1
|
248
|
+
)
|
249
|
+
) &&
|
250
|
+
$fb.css('display') !== 'none' &&
|
251
|
+
$fb.children().css('display') !== 'none' &&
|
252
|
+
$fb.parents().css('display') !== 'none'
|
253
|
+
)
|
254
|
+
) {
|
255
|
+
|
256
|
+
// Initialize and store original node
|
257
|
+
$fb.removeClass('fluidbox--destroyed');
|
258
|
+
fb.instanceData = {};
|
259
|
+
fb.instanceData.initialized = true;
|
260
|
+
fb.instanceData.originalNode = $fb.html();
|
261
|
+
|
262
|
+
// Append instance ID
|
263
|
+
fbInstance += 1;
|
264
|
+
fb.instanceData.id = fbInstance;
|
265
|
+
$fb.addClass('fluidbox__instance-'+fbInstance);
|
266
|
+
|
267
|
+
// Status: Fluidbox has been initialized
|
268
|
+
$fb.addClass('fluidbox--initialized');
|
269
|
+
|
270
|
+
// DOM replacement
|
271
|
+
_fun.dom.call(fb);
|
272
|
+
|
273
|
+
// Emit custom event
|
274
|
+
$fb.trigger('init.fluidbox');
|
275
|
+
|
276
|
+
// Wait for image to load, but only if image is not found in cache
|
277
|
+
var img = new Image();
|
278
|
+
if($fbThumb.width() > 0 && $fbThumb.height() > 0) {
|
279
|
+
// Thumbnail loaded from cache, let's prepare fluidbox
|
280
|
+
_fun.prepareFb.call(fb);
|
281
|
+
} else {
|
282
|
+
img.onload = function() {
|
283
|
+
// Thumbnail loaded, let's prepare fluidbox
|
284
|
+
_fun.prepareFb.call(fb);
|
285
|
+
};
|
286
|
+
img.onerror = function() {
|
287
|
+
// Trigger custom error event
|
288
|
+
$fb.trigger('thumbloadfail.fluidbox');
|
289
|
+
};
|
290
|
+
img.src = $fbThumb.attr('src');
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
},
|
295
|
+
open: function() {
|
296
|
+
|
297
|
+
// Open Fluidbox
|
298
|
+
var fb = this,
|
299
|
+
$fb = $(this.element),
|
300
|
+
$fbThumb = $fb.find('img').first(),
|
301
|
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
302
|
+
$fbWrap = $fb.find('.fluidbox__wrap');
|
303
|
+
|
304
|
+
// Update state
|
305
|
+
fb.instanceData.state = 1;
|
306
|
+
|
307
|
+
// Forcibly turn off transition end detection,
|
308
|
+
// otherwise users will get choppy transition if toggling between states rapidly
|
309
|
+
$fbGhost.off(customTransitionEnd);
|
310
|
+
|
311
|
+
// Close all other Fluidbox instances
|
312
|
+
$('.fluidbox--opened').fluidbox('close');
|
313
|
+
|
314
|
+
// Append overlay
|
315
|
+
var $fbOverlay = $('<div />', {
|
316
|
+
'class': 'fluidbox__overlay',
|
317
|
+
css: {
|
318
|
+
zIndex: -1
|
319
|
+
}
|
320
|
+
});
|
321
|
+
$fbWrap.append($fbOverlay);
|
322
|
+
|
323
|
+
// Add class to indicate larger image being loaded
|
324
|
+
$fb
|
325
|
+
.removeClass('fluidbox--closed')
|
326
|
+
.addClass('fluidbox--loading');
|
327
|
+
|
328
|
+
// Check of URL is properly formatted
|
329
|
+
if(_fun.checkURL($fbThumb.attr('src'))) {
|
330
|
+
fb.close();
|
331
|
+
return false;
|
332
|
+
}
|
333
|
+
|
334
|
+
// Set thumbnail image source as background image first, worry later
|
335
|
+
$fbGhost.css({
|
336
|
+
'background-image': 'url(' + _fun.formatURL($fbThumb.attr('src')) + ')',
|
337
|
+
opacity: 1
|
338
|
+
});
|
339
|
+
|
340
|
+
// Set dimensions for ghost
|
341
|
+
_fun.measure.fbElements.call(fb);
|
342
|
+
|
343
|
+
// Wait for ghost image to preload
|
344
|
+
var img;
|
345
|
+
if (fb.settings.immediateOpen) {
|
346
|
+
// Update classes
|
347
|
+
$fb
|
348
|
+
.addClass('fluidbox--opened fluidbox--loaded')
|
349
|
+
.find('.fluidbox__wrap')
|
350
|
+
.css({ zIndex: fb.settings.stackIndex + fb.settings.stackIndexDelta });
|
351
|
+
|
352
|
+
// Emit custom event
|
353
|
+
$fb.trigger('openstart.fluidbox');
|
354
|
+
|
355
|
+
// Compute
|
356
|
+
fb.compute();
|
357
|
+
|
358
|
+
// Hide thumbnail
|
359
|
+
$fbThumb.css({ opacity: 0 });
|
360
|
+
|
361
|
+
// Show overlay
|
362
|
+
$('.fluidbox__overlay').css({ opacity: 1 });
|
363
|
+
|
364
|
+
// Emit custom event when ghost image finishes transition
|
365
|
+
$fbGhost.one(customTransitionEnd, function() {
|
366
|
+
$fb.trigger('openend.fluidbox');
|
367
|
+
});
|
368
|
+
|
369
|
+
img = new Image();
|
370
|
+
img.onload = function() {
|
371
|
+
// Emit custom event
|
372
|
+
$fb.trigger('imageloaddone.fluidbox');
|
373
|
+
|
374
|
+
// Perform only if the Fluidbox instance is still open
|
375
|
+
if (fb.instanceData.state === 1) {
|
376
|
+
// Set new natural dimensions
|
377
|
+
fb.instanceData.thumb.natW = img.naturalWidth;
|
378
|
+
fb.instanceData.thumb.natH = img.naturalHeight;
|
379
|
+
|
380
|
+
// Remove loading status
|
381
|
+
$fb.removeClass('fluidbox--loading');
|
382
|
+
|
383
|
+
// Check of URL is properly formatted
|
384
|
+
if(_fun.checkURL(img.src)) {
|
385
|
+
fb.close({ error: true });
|
386
|
+
return false;
|
387
|
+
}
|
388
|
+
|
389
|
+
// Set new image background
|
390
|
+
$fbGhost.css({ 'background-image': 'url(' + _fun.formatURL(img.src) + ')' });
|
391
|
+
|
392
|
+
// Compute
|
393
|
+
fb.compute();
|
394
|
+
}
|
395
|
+
};
|
396
|
+
img.onerror = function() {
|
397
|
+
// Trigger closing
|
398
|
+
fb.close({ error: true });
|
399
|
+
|
400
|
+
// Emit custom event
|
401
|
+
$fb.trigger('imageloadfail.fluidbox');
|
402
|
+
$fb.trigger('delayedloadfail.fluidbox');
|
403
|
+
};
|
404
|
+
img.src = $fb.attr('href');
|
405
|
+
|
406
|
+
} else {
|
407
|
+
img = new Image();
|
408
|
+
img.onload = function() {
|
409
|
+
|
410
|
+
// Emit custom event
|
411
|
+
$fb.trigger('imageloaddone.fluidbox');
|
412
|
+
|
413
|
+
// Update classes
|
414
|
+
$fb
|
415
|
+
.removeClass('fluidbox--loading')
|
416
|
+
.addClass('fluidbox--opened fluidbox--loaded')
|
417
|
+
.find('.fluidbox__wrap')
|
418
|
+
.css({ zIndex: fb.settings.stackIndex + fb.settings.stackIndexDelta });
|
419
|
+
|
420
|
+
// Emit custom event
|
421
|
+
$fb.trigger('openstart.fluidbox');
|
422
|
+
|
423
|
+
// Check of URL is properly formatted
|
424
|
+
if(_fun.checkURL(img.src)) {
|
425
|
+
fb.close({ error: true });
|
426
|
+
return false;
|
427
|
+
}
|
428
|
+
|
429
|
+
// Set new image background
|
430
|
+
$fbGhost.css({ 'background-image': 'url(' + _fun.formatURL(img.src) + ')' });
|
431
|
+
|
432
|
+
// Set new natural dimensions
|
433
|
+
fb.instanceData.thumb.natW = img.naturalWidth;
|
434
|
+
fb.instanceData.thumb.natH = img.naturalHeight;
|
435
|
+
|
436
|
+
// Compute
|
437
|
+
fb.compute();
|
438
|
+
|
439
|
+
// Hide thumbnail
|
440
|
+
$fbThumb.css({ opacity: 0 });
|
441
|
+
|
442
|
+
// Show overlay
|
443
|
+
$('.fluidbox__overlay').css({ opacity: 1 });
|
444
|
+
|
445
|
+
// Emit custom event when ghost image finishes transition
|
446
|
+
$fbGhost.one(customTransitionEnd, function() {
|
447
|
+
$fb.trigger('openend.fluidbox');
|
448
|
+
});
|
449
|
+
};
|
450
|
+
img.onerror = function() {
|
451
|
+
// Trigger closing
|
452
|
+
fb.close({ error: true });
|
453
|
+
|
454
|
+
// Emit custom event
|
455
|
+
$fb.trigger('imageloadfail.fluidbox');
|
456
|
+
};
|
457
|
+
img.src = $fb.attr('href');
|
458
|
+
}
|
459
|
+
|
460
|
+
},
|
461
|
+
compute: function() {
|
462
|
+
var fb = this,
|
463
|
+
$fb = $(this.element),
|
464
|
+
$fbThumb = $fb.find('img').first(),
|
465
|
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
466
|
+
$fbWrap = $fb.find('.fluidbox__wrap');
|
467
|
+
|
468
|
+
// Shorthand for dimensions
|
469
|
+
var imgNatW = fb.instanceData.thumb.natW,
|
470
|
+
imgNatH = fb.instanceData.thumb.natH,
|
471
|
+
imgW = fb.instanceData.thumb.w,
|
472
|
+
imgH = fb.instanceData.thumb.h;
|
473
|
+
|
474
|
+
// Calculate aspect ratios
|
475
|
+
var thumbRatio = imgNatW / imgNatH,
|
476
|
+
viewportRatio = globalData.viewport.w / globalData.viewport.h;
|
477
|
+
|
478
|
+
// Replace dimensions if maxWidth or maxHeight is declared
|
479
|
+
if (fb.settings.maxWidth > 0) {
|
480
|
+
imgNatW = fb.settings.maxWidth;
|
481
|
+
imgNatH = imgNatW / thumbRatio;
|
482
|
+
} else if (fb.settings.maxHeight > 0) {
|
483
|
+
imgNatH = fb.settings.maxHeight;
|
484
|
+
imgNatW = imgNatH * thumbRatio;
|
485
|
+
}
|
486
|
+
|
487
|
+
// Compare image ratio with viewport ratio
|
488
|
+
var computedHeight, computedWidth, imgScaleY, imgScaleX, imgMinScale;
|
489
|
+
if (viewportRatio > thumbRatio) {
|
490
|
+
computedHeight = (imgNatH < globalData.viewport.h) ? imgNatH : globalData.viewport.h*fb.settings.viewportFill;
|
491
|
+
imgScaleY = computedHeight / imgH;
|
492
|
+
imgScaleX = imgNatW * (imgH * imgScaleY / imgNatH) / imgW;
|
493
|
+
imgMinScale = imgScaleY;
|
494
|
+
} else {
|
495
|
+
computedWidth = (imgNatW < globalData.viewport.w) ? imgNatW : globalData.viewport.w*fb.settings.viewportFill;
|
496
|
+
imgScaleX = computedWidth / imgW;
|
497
|
+
imgScaleY = imgNatH * (imgW * imgScaleX / imgNatW) / imgH;
|
498
|
+
imgMinScale = imgScaleX;
|
499
|
+
}
|
500
|
+
|
501
|
+
// Display console error if both maxHeight and maxWidth are specific
|
502
|
+
if (fb.settings.maxWidth && fb.settings.maxHeight)
|
503
|
+
console.warn('Fluidbox: Both maxHeight and maxWidth are specified. You can only specify one. If both are specified, only the maxWidth property will be respected. This will not generate any error, but may cause unexpected sizing behavior.');
|
504
|
+
|
505
|
+
// Scale
|
506
|
+
var offsetY = $w.scrollTop() - $fbThumb.offset().top + 0.5*(imgH*(imgMinScale-1)) + 0.5*($w.height() - imgH*imgMinScale),
|
507
|
+
offsetX = 0.5*(imgW*(imgMinScale-1)) + 0.5*($w.width() - imgW*imgMinScale) - $fbThumb.offset().left,
|
508
|
+
scale = parseInt(imgScaleX*100)/100 + ',' + parseInt(imgScaleY*100)/100;
|
509
|
+
|
510
|
+
// Apply styles to ghost and loader (if present)
|
511
|
+
$fbGhost
|
512
|
+
.css({
|
513
|
+
'transform': 'translate(' + parseInt(offsetX*100)/100 + 'px,' + parseInt(offsetY*100)/100 + 'px) scale(' + scale + ')',
|
514
|
+
top: $fbThumb.offset().top - $fbWrap.offset().top,
|
515
|
+
left: $fbThumb.offset().left - $fbWrap.offset().left
|
516
|
+
});
|
517
|
+
$fb.find('.fluidbox__loader').css({
|
518
|
+
'transform': 'translate(' + parseInt(offsetX*100)/100 + 'px,' + parseInt(offsetY*100)/100 + 'px) scale(' + scale + ')'
|
519
|
+
});
|
520
|
+
|
521
|
+
// Emit custom event
|
522
|
+
$fb.trigger('computeend.fluidbox');
|
523
|
+
},
|
524
|
+
recompute: function() {
|
525
|
+
// Recompute is simply an alias for the compute method
|
526
|
+
this.compute();
|
527
|
+
},
|
528
|
+
close: function(d) {
|
529
|
+
|
530
|
+
// Close Fluidbox
|
531
|
+
var fb = this,
|
532
|
+
$fb = $(this.element),
|
533
|
+
$fbThumb = $fb.find('img').first(),
|
534
|
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
535
|
+
$fbWrap = $fb.find('.fluidbox__wrap'),
|
536
|
+
$fbOverlay = $fb.find('.fluidbox__overlay'),
|
537
|
+
closeData = $.extend(null, {
|
538
|
+
error: false
|
539
|
+
}, d);
|
540
|
+
|
541
|
+
// Do not do anything if Fluidbox is not opened/closed, for performance reasons
|
542
|
+
if (fb.instanceData.state === null || typeof fb.instanceData.state === typeof undefined || fb.instanceData.state === 0) return false;
|
543
|
+
|
544
|
+
// Update state
|
545
|
+
fb.instanceData.state = 0;
|
546
|
+
|
547
|
+
// Emit custom event
|
548
|
+
$fb.trigger('closestart.fluidbox');
|
549
|
+
|
550
|
+
// Change classes
|
551
|
+
$fb
|
552
|
+
.removeClass(function(i,c) {
|
553
|
+
return (c.match (/(^|\s)fluidbox--(opened|loaded|loading)+/g) || []).join(' ');
|
554
|
+
})
|
555
|
+
.addClass('fluidbox--closed');
|
556
|
+
|
557
|
+
$fbGhost
|
558
|
+
.css({
|
559
|
+
'transform': 'translate(0,0) scale(1,1)',
|
560
|
+
top: $fbThumb.offset().top - $fbWrap.offset().top + parseInt($fbThumb.css('borderTopWidth')) + parseInt($fbThumb.css('paddingTop')),
|
561
|
+
left: $fbThumb.offset().left - $fbWrap.offset().left + parseInt($fbThumb.css('borderLeftWidth')) + parseInt($fbThumb.css('paddingLeft'))
|
562
|
+
});
|
563
|
+
|
564
|
+
$fb.find('.fluidbox__loader')
|
565
|
+
.css({
|
566
|
+
'transform': 'none'
|
567
|
+
});
|
568
|
+
|
569
|
+
$fbGhost.one(customTransitionEnd, function() {
|
570
|
+
$fbGhost.css({ opacity: 0 });
|
571
|
+
$fbThumb.css({ opacity: 1 });
|
572
|
+
$fbOverlay.remove();
|
573
|
+
$fbWrap.css({ zIndex: fb.settings.stackIndex - fb.settings.stackIndexDelta });
|
574
|
+
$fb.trigger('closeend.fluidbox');
|
575
|
+
});
|
576
|
+
|
577
|
+
// Manually trigger transitionend if an error is detected
|
578
|
+
// Errors will not trigger any transition changes to the ghost element
|
579
|
+
if(closeData.error) $fbGhost.trigger('transitionend');
|
580
|
+
|
581
|
+
// Fadeout overlay
|
582
|
+
$fbOverlay.css({ opacity: 0 });
|
583
|
+
},
|
584
|
+
bindEvents: function() {
|
585
|
+
var fb = this,
|
586
|
+
$fb = $(this.element);
|
587
|
+
|
588
|
+
// Click handler
|
589
|
+
$fb.on('click.fluidbox', function(e) {
|
590
|
+
e.preventDefault();
|
591
|
+
|
592
|
+
// Check state
|
593
|
+
// If state does not exist, or if Fluidbox is closed, we open it
|
594
|
+
if(!fb.instanceData.state || fb.instanceData.state === 0) {
|
595
|
+
|
596
|
+
// Open Fluidbox
|
597
|
+
fb.open();
|
598
|
+
|
599
|
+
// If state exists, we close it
|
600
|
+
} else {
|
601
|
+
|
602
|
+
// Close Fluidbox
|
603
|
+
fb.close();
|
604
|
+
}
|
605
|
+
});
|
606
|
+
},
|
607
|
+
bindListeners: function() {
|
608
|
+
var fb = this,
|
609
|
+
$fb = $(this.element);
|
610
|
+
|
611
|
+
// Window resize
|
612
|
+
// Namespaced using unique instance IDs so that we can unbind resize event specific to a Fluidbox instance
|
613
|
+
var resizeFunction = function() {
|
614
|
+
// Re-measure viewport dimensions
|
615
|
+
_fun.measure.viewport();
|
616
|
+
_fun.measure.fbElements.call(fb);
|
617
|
+
|
618
|
+
// Re-compute, but only for the active element
|
619
|
+
if($fb.hasClass('fluidbox--opened')) fb.compute();
|
620
|
+
};
|
621
|
+
if ($.isFunction($.throttle)) {
|
622
|
+
$w.on('resize.fluidbox'+fb.instanceData.id, $.throttle(fb.settings.resizeThrottle, resizeFunction));
|
623
|
+
} else {
|
624
|
+
$w.on('resize.fluidbox'+fb.instanceData.id, resizeFunction);
|
625
|
+
}
|
626
|
+
|
627
|
+
// Reposition
|
628
|
+
$fb.on('reposition.fluidbox', function() {
|
629
|
+
fb.reposition();
|
630
|
+
});
|
631
|
+
|
632
|
+
// Recompute
|
633
|
+
$fb.on('recompute.fluidbox, compute.fluidbox', function() {
|
634
|
+
fb.compute();
|
635
|
+
});
|
636
|
+
|
637
|
+
// Destroy
|
638
|
+
$fb.on('destroy.fluidbox', function() {
|
639
|
+
fb.destroy();
|
640
|
+
});
|
641
|
+
|
642
|
+
// Close
|
643
|
+
$fb.on('close.fluidbox', function() {
|
644
|
+
fb.close();
|
645
|
+
});
|
646
|
+
},
|
647
|
+
unbind: function() {
|
648
|
+
$(this.element).off('click.fluidbox reposition.fluidbox recompute.fluidbox compute.fluidbox destroy.fluidbox close.fluidbox');
|
649
|
+
$w.off('resize.fluidbox'+this.instanceData.id);
|
650
|
+
},
|
651
|
+
reposition: function() {
|
652
|
+
_fun.measure.fbElements.call(this);
|
653
|
+
},
|
654
|
+
destroy: function() {
|
655
|
+
// Cache original node
|
656
|
+
var originalNode = this.instanceData.originalNode;
|
657
|
+
|
658
|
+
// Unbind event hanlders
|
659
|
+
this.unbind();
|
660
|
+
|
661
|
+
// Destroy plugin data entirely
|
662
|
+
$.data(this.element, 'plugin_' + pluginName, null);
|
663
|
+
|
664
|
+
// DOM reversal
|
665
|
+
$(this.element)
|
666
|
+
.removeClass(function(i,c) {
|
667
|
+
return (c.match (/(^|\s)fluidbox[--|__]\S+/g) || []).join(' ');
|
668
|
+
})
|
669
|
+
.empty()
|
670
|
+
.html(originalNode)
|
671
|
+
.addClass('fluidbox--destroyed')
|
672
|
+
.trigger('destroyed.fluidbox');
|
673
|
+
},
|
674
|
+
getMetadata: function() {
|
675
|
+
// Return instance data
|
676
|
+
return this.instanceData;
|
677
|
+
}
|
678
|
+
});
|
679
|
+
|
680
|
+
// A really lightweight plugin wrapper around the constructor,
|
681
|
+
// preventing against multiple instantiations
|
682
|
+
$.fn[pluginName] = function (options) {
|
683
|
+
|
684
|
+
var args = arguments;
|
685
|
+
|
686
|
+
// Check the options parameter
|
687
|
+
// If it is undefined or is an object (plugin configuration),
|
688
|
+
// we create a new instance (conditionally, see inside) of the plugin
|
689
|
+
if (options === undefined || typeof options === 'object') {
|
690
|
+
|
691
|
+
return this.each(function() {
|
692
|
+
// Only if the plugin_fluidbox data is not present,
|
693
|
+
// to prevent multiple instances being created
|
694
|
+
if (!$.data(this, "plugin_" + pluginName)) {
|
695
|
+
|
696
|
+
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
|
697
|
+
}
|
698
|
+
});
|
699
|
+
|
700
|
+
// If it is defined, but it is a string, does not start with an underscore and does not call init(),
|
701
|
+
// we allow users to make calls to public methods
|
702
|
+
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
703
|
+
var returnVal;
|
704
|
+
|
705
|
+
this.each(function() {
|
706
|
+
var instance = $.data(this, 'plugin_' + pluginName);
|
707
|
+
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
708
|
+
returnVal = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
|
709
|
+
} else {
|
710
|
+
console.warn('Fluidbox: The method "' + options + '" used is not defined in Fluidbox. Please make sure you are calling the correct public method.');
|
711
|
+
}
|
712
|
+
});
|
713
|
+
return returnVal !== undefined ? returnVal : this;
|
714
|
+
}
|
715
|
+
|
716
|
+
// Return to allow chaining
|
717
|
+
return this;
|
718
|
+
};
|
719
|
+
|
720
|
+
|
721
|
+
|
722
|
+
})(jQuery, window, document);
|