phcthemes_web_theme_pack 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +0 -0
- data/Rakefile +32 -0
- data/app/assets/config/phcthemes_web_theme_pack_manifest.js +3 -0
- data/app/assets/javascripts/common/backstretch/jquery.backstretch.js +1602 -0
- data/app/assets/javascripts/common/bootstrap-datepicker/bootstrap-datepicker.js +2039 -0
- data/app/assets/javascripts/common/bootstrap-markdown/bootstrap-markdown.js +1390 -0
- data/app/assets/javascripts/common/bootstrap-select/bootstrap-select.js +3139 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js +51 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js +41 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js +40 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js +40 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js +44 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js +46 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js +39 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js.map +1 -0
- data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.min.js +8 -0
- data/app/assets/javascripts/common/bootstrap/bootstrap.bundle.js +7013 -0
- data/app/assets/javascripts/common/custom/custom.js +0 -0
- data/app/assets/javascripts/common/daterangepicker/daterangepicker.js +1565 -0
- data/app/assets/javascripts/common/flexslider/jquery.flexslider.js +1252 -0
- data/app/assets/javascripts/common/greenstock/greensock.js +36 -0
- data/app/assets/javascripts/common/icheck/icheck.js +509 -0
- data/app/assets/javascripts/common/imagesloaded/imagesloaded.pkgd.js +497 -0
- data/app/assets/javascripts/common/isotope/isotope.pkgd.js +3563 -0
- data/app/assets/javascripts/common/jquery-countdown/jquery.countdown.js +246 -0
- data/app/assets/javascripts/common/jquery-filterizer/jquery.filterizr.min.js +1 -0
- data/app/assets/javascripts/common/jquery-placeholder/jquery.placeholder.js +281 -0
- data/app/assets/javascripts/common/jquery-validation/jquery.validate.js +1650 -0
- data/app/assets/javascripts/common/jqvmap/jquery.vmap.js +1281 -0
- data/app/assets/javascripts/common/jqvmap/jquery.vmap.min.js +10 -0
- data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.africa.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.asia.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.australia.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.europe.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.algeria.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.argentina.js +1 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.brazil.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.canada.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.europe.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.france.js +1 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.germany.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.greece.js +1 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iran.js +6 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iraq.js +1 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.russia.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.tunisia.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.turkey.js +11 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.usa.js +2 -0
- data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.world.js +2 -0
- data/app/assets/javascripts/common/js-cookie/js.cookie.js +165 -0
- data/app/assets/javascripts/common/layerslider/layerslider.kreaturamedia.jquery.js +13 -0
- data/app/assets/javascripts/common/layerslider/layerslider.origami.js +13 -0
- data/app/assets/javascripts/common/layerslider/layerslider.timeline.js +13 -0
- data/app/assets/javascripts/common/layerslider/layerslider.transitions.js +13 -0
- data/app/assets/javascripts/common/leaflet/leaflet.js +5 -0
- data/app/assets/javascripts/common/magnific-popup/jquery.magnific-popup.js +1860 -0
- data/app/assets/javascripts/common/mapbox/mapbox.js +51 -0
- data/app/assets/javascripts/common/moderizer/modernizr.js +11 -0
- data/app/assets/javascripts/common/owl-carousel/owl.carousel.js +3448 -0
- data/app/assets/javascripts/common/pace/pace.js +935 -0
- data/app/assets/javascripts/common/paroller/jquery.paroller.js +228 -0
- data/app/assets/javascripts/common/particlejs/particles.js +1541 -0
- data/app/assets/javascripts/common/plyr/plyr.js +9137 -0
- data/app/assets/javascripts/common/rangeslider/rangeslider.js +498 -0
- data/app/assets/javascripts/common/retina/retina.js +100 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.actions.js +386 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.carousel.js +365 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.kenburn.js +199 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.layeranimation.js +2524 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.migration.js +260 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.navigation.js +1156 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.parallax.js +465 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.slideanims.js +1447 -0
- data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.video.js +1464 -0
- data/app/assets/javascripts/common/rev-slider/jquery.themepunch.revolution.js +3286 -0
- data/app/assets/javascripts/common/rev-slider/jquery.themepunch.tools.min.js +8710 -0
- data/app/assets/javascripts/common/scrollup/jquery.scrollUp.js +168 -0
- data/app/assets/javascripts/common/select2/select2.full.js +6597 -0
- data/app/assets/javascripts/common/selectbox/jquery.selectBox.js +1092 -0
- data/app/assets/javascripts/common/smooth-scroll/SmoothScroll.js +788 -0
- data/app/assets/javascripts/common/spectrum/spectrum.js +2323 -0
- data/app/assets/javascripts/common/stepper/jquery.fs.stepper.js +339 -0
- data/app/assets/javascripts/common/swiper/swiper.js +8124 -0
- data/app/assets/javascripts/common/typed/typed.js +1045 -0
- data/app/assets/javascripts/common/visable/jquery.visible.js +68 -0
- data/app/assets/javascripts/common/waypoints/jquery.waypoints.js +662 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_appstrap.js +11 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_basic.js +39 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_bold.js +34 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_coloradmin.js +12 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_devine_villas.js +20 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_smarty.js +57 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_xero.js +18 -0
- data/app/assets/javascripts/phcthemes_web_theme_pack_zoner.js +24 -0
- data/app/assets/javascripts/themes/appstrap/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/appstrap/theme/custom-script.js +69 -0
- data/app/assets/javascripts/themes/appstrap/theme/script.js +3096 -0
- data/app/assets/javascripts/themes/basic/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/bold/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/coloradmin/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/coloradmin/theme/apps.js +236 -0
- data/app/assets/javascripts/themes/devine_villas/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/devine_villas/theme/dashboard.js +19 -0
- data/app/assets/javascripts/themes/devine_villas/theme/main.js +384 -0
- data/app/assets/javascripts/themes/devine_villas/theme/map.js +563 -0
- data/app/assets/javascripts/themes/devine_villas/theme/searchmap.js +69 -0
- data/app/assets/javascripts/themes/smarty/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/smarty/theme/scripts.js +4271 -0
- data/app/assets/javascripts/themes/xero/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/xero/theme/app.js +696 -0
- data/app/assets/javascripts/themes/zoner/custom-maps/custom-map.js +289 -0
- data/app/assets/javascripts/themes/zoner/custom/custom.js +0 -0
- data/app/assets/javascripts/themes/zoner/draggable/draggable.js +196 -0
- data/app/assets/javascripts/themes/zoner/jquery-dependclass/dependclass.js +56 -0
- data/app/assets/javascripts/themes/zoner/jquery-slider/jquery.slider.js +700 -0
- data/app/assets/javascripts/themes/zoner/jquery-vanillabox/jquery.vanillabox.min.js +24 -0
- data/app/assets/javascripts/themes/zoner/jshashtable/hashtable.js +402 -0
- data/app/assets/javascripts/themes/zoner/numberformatter/numberformatter.js +566 -0
- data/app/assets/javascripts/themes/zoner/simple-js-templating/tmpl.js +35 -0
- data/app/assets/javascripts/themes/zoner/theme/main.js +667 -0
- data/app/assets/stylesheets/common/custom/custom.scss +0 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_appstrap.scss +28 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_basic.scss +0 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_bold.scss +21 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_coloradmin.scss +22 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_devine_villas.scss +28 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_smarty.scss +47 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_xero.scss +28 -0
- data/app/assets/stylesheets/phcthemes_web_theme_pack_zoner.scss +22 -0
- data/app/assets/stylesheets/themes/appstrap/custom/custom.scss +0 -0
- data/app/assets/stylesheets/themes/bold/custom/custom.scss +0 -0
- data/app/assets/stylesheets/themes/coloradmin/custom/custom.scss +0 -0
- data/app/assets/stylesheets/themes/devine_villas/custom/custom.scss +0 -0
- data/app/assets/stylesheets/themes/smarty/custom/custom.scss +0 -0
- data/app/assets/stylesheets/themes/xero/custom/custom.scss +0 -0
- data/app/assets/stylesheets/themes/zoner/custom/custom.scss +0 -0
- data/lib/phcthemes_web_theme_pack.rb +5 -0
- data/lib/phcthemes_web_theme_pack/engine.rb +13 -0
- data/lib/phcthemes_web_theme_pack/version.rb +3 -0
- data/lib/tasks/phcthemes_web_theme_pack_tasks.rake +4 -0
- metadata +375 -0
@@ -0,0 +1,1252 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery FlexSlider v2.7.2
|
3
|
+
* Copyright 2012 WooThemes
|
4
|
+
* Contributing Author: Tyler Smith
|
5
|
+
*/
|
6
|
+
;
|
7
|
+
(function ($) {
|
8
|
+
|
9
|
+
var focused = true;
|
10
|
+
|
11
|
+
//FlexSlider: Object Instance
|
12
|
+
$.flexslider = function(el, options) {
|
13
|
+
var slider = $(el);
|
14
|
+
|
15
|
+
// making variables public
|
16
|
+
|
17
|
+
//if rtl value was not passed and html is in rtl..enable it by default.
|
18
|
+
if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){
|
19
|
+
options.rtl=true;
|
20
|
+
}
|
21
|
+
slider.vars = $.extend({}, $.flexslider.defaults, options);
|
22
|
+
|
23
|
+
var namespace = slider.vars.namespace,
|
24
|
+
msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture,
|
25
|
+
touch = (( "ontouchstart" in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch,
|
26
|
+
// deprecating this idea, as devices are being released with both of these events
|
27
|
+
eventType = "click touchend MSPointerUp keyup",
|
28
|
+
watchedEvent = "",
|
29
|
+
watchedEventClearTimer,
|
30
|
+
vertical = slider.vars.direction === "vertical",
|
31
|
+
reverse = slider.vars.reverse,
|
32
|
+
carousel = (slider.vars.itemWidth > 0),
|
33
|
+
fade = slider.vars.animation === "fade",
|
34
|
+
asNav = slider.vars.asNavFor !== "",
|
35
|
+
methods = {};
|
36
|
+
|
37
|
+
// Store a reference to the slider object
|
38
|
+
$.data(el, "flexslider", slider);
|
39
|
+
|
40
|
+
// Private slider methods
|
41
|
+
methods = {
|
42
|
+
init: function() {
|
43
|
+
slider.animating = false;
|
44
|
+
// Get current slide and make sure it is a number
|
45
|
+
slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0), 10 );
|
46
|
+
if ( isNaN( slider.currentSlide ) ) { slider.currentSlide = 0; }
|
47
|
+
slider.animatingTo = slider.currentSlide;
|
48
|
+
slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last);
|
49
|
+
slider.containerSelector = slider.vars.selector.substr(0,slider.vars.selector.search(' '));
|
50
|
+
slider.slides = $(slider.vars.selector, slider);
|
51
|
+
slider.container = $(slider.containerSelector, slider);
|
52
|
+
slider.count = slider.slides.length;
|
53
|
+
// SYNC:
|
54
|
+
slider.syncExists = $(slider.vars.sync).length > 0;
|
55
|
+
// SLIDE:
|
56
|
+
if (slider.vars.animation === "slide") { slider.vars.animation = "swing"; }
|
57
|
+
slider.prop = (vertical) ? "top" : ( slider.vars.rtl ? "marginRight" : "marginLeft" );
|
58
|
+
slider.args = {};
|
59
|
+
// SLIDESHOW:
|
60
|
+
slider.manualPause = false;
|
61
|
+
slider.stopped = false;
|
62
|
+
//PAUSE WHEN INVISIBLE
|
63
|
+
slider.started = false;
|
64
|
+
slider.startTimeout = null;
|
65
|
+
// TOUCH/USECSS:
|
66
|
+
slider.transitions = !slider.vars.video && !fade && slider.vars.useCSS && (function() {
|
67
|
+
var obj = document.createElement('div'),
|
68
|
+
props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
69
|
+
for (var i in props) {
|
70
|
+
if ( obj.style[ props[i] ] !== undefined ) {
|
71
|
+
slider.pfx = props[i].replace('Perspective','').toLowerCase();
|
72
|
+
slider.prop = "-" + slider.pfx + "-transform";
|
73
|
+
return true;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
return false;
|
77
|
+
}());
|
78
|
+
slider.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
79
|
+
slider.ensureAnimationEnd = '';
|
80
|
+
// CONTROLSCONTAINER:
|
81
|
+
if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer);
|
82
|
+
// MANUAL:
|
83
|
+
if (slider.vars.manualControls !== "") slider.manualControls = $(slider.vars.manualControls).length > 0 && $(slider.vars.manualControls);
|
84
|
+
|
85
|
+
// CUSTOM DIRECTION NAV:
|
86
|
+
if (slider.vars.customDirectionNav !== "") slider.customDirectionNav = $(slider.vars.customDirectionNav).length === 2 && $(slider.vars.customDirectionNav);
|
87
|
+
|
88
|
+
// RANDOMIZE:
|
89
|
+
if (slider.vars.randomize) {
|
90
|
+
slider.slides.sort(function() { return (Math.round(Math.random())-0.5); });
|
91
|
+
slider.container.empty().append(slider.slides);
|
92
|
+
}
|
93
|
+
|
94
|
+
slider.doMath();
|
95
|
+
|
96
|
+
// INIT
|
97
|
+
slider.setup("init");
|
98
|
+
|
99
|
+
// CONTROLNAV:
|
100
|
+
if (slider.vars.controlNav) { methods.controlNav.setup(); }
|
101
|
+
|
102
|
+
// DIRECTIONNAV:
|
103
|
+
if (slider.vars.directionNav) { methods.directionNav.setup(); }
|
104
|
+
|
105
|
+
// KEYBOARD:
|
106
|
+
if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) {
|
107
|
+
$(document).bind('keyup', function(event) {
|
108
|
+
var keycode = event.keyCode;
|
109
|
+
if (!slider.animating && (keycode === 39 || keycode === 37)) {
|
110
|
+
var target = (slider.vars.rtl?
|
111
|
+
((keycode === 37) ? slider.getTarget('next') :
|
112
|
+
(keycode === 39) ? slider.getTarget('prev') : false)
|
113
|
+
:
|
114
|
+
((keycode === 39) ? slider.getTarget('next') :
|
115
|
+
(keycode === 37) ? slider.getTarget('prev') : false)
|
116
|
+
)
|
117
|
+
;
|
118
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
119
|
+
}
|
120
|
+
});
|
121
|
+
}
|
122
|
+
// MOUSEWHEEL:
|
123
|
+
if (slider.vars.mousewheel) {
|
124
|
+
slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
|
125
|
+
event.preventDefault();
|
126
|
+
var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
127
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
128
|
+
});
|
129
|
+
}
|
130
|
+
|
131
|
+
// PAUSEPLAY
|
132
|
+
if (slider.vars.pausePlay) { methods.pausePlay.setup(); }
|
133
|
+
|
134
|
+
//PAUSE WHEN INVISIBLE
|
135
|
+
if (slider.vars.slideshow && slider.vars.pauseInvisible) { methods.pauseInvisible.init(); }
|
136
|
+
|
137
|
+
// SLIDSESHOW
|
138
|
+
if (slider.vars.slideshow) {
|
139
|
+
if (slider.vars.pauseOnHover) {
|
140
|
+
slider.hover(function() {
|
141
|
+
if (!slider.manualPlay && !slider.manualPause) { slider.pause(); }
|
142
|
+
}, function() {
|
143
|
+
if (!slider.manualPause && !slider.manualPlay && !slider.stopped) { slider.play(); }
|
144
|
+
});
|
145
|
+
}
|
146
|
+
// initialize animation
|
147
|
+
//If we're visible, or we don't use PageVisibility API
|
148
|
+
if(!slider.vars.pauseInvisible || !methods.pauseInvisible.isHidden()) {
|
149
|
+
(slider.vars.initDelay > 0) ? slider.startTimeout = setTimeout(slider.play, slider.vars.initDelay) : slider.play();
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
// ASNAV:
|
154
|
+
if (asNav) { methods.asNav.setup(); }
|
155
|
+
|
156
|
+
// TOUCH
|
157
|
+
if (touch && slider.vars.touch) { methods.touch(); }
|
158
|
+
|
159
|
+
// FADE&&SMOOTHHEIGHT || SLIDE:
|
160
|
+
if (!fade || (fade && slider.vars.smoothHeight)) { $(window).bind("resize orientationchange focus", methods.resize); }
|
161
|
+
|
162
|
+
slider.find("img").attr("draggable", "false");
|
163
|
+
|
164
|
+
// API: start() Callback
|
165
|
+
setTimeout(function(){
|
166
|
+
slider.vars.start(slider);
|
167
|
+
}, 200);
|
168
|
+
},
|
169
|
+
asNav: {
|
170
|
+
setup: function() {
|
171
|
+
slider.asNav = true;
|
172
|
+
slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
|
173
|
+
slider.currentItem = slider.currentSlide;
|
174
|
+
slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
|
175
|
+
if(!msGesture){
|
176
|
+
slider.slides.on(eventType, function(e){
|
177
|
+
e.preventDefault();
|
178
|
+
var $slide = $(this),
|
179
|
+
target = $slide.index();
|
180
|
+
var posFromX;
|
181
|
+
if(slider.vars.rtl){
|
182
|
+
posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container
|
183
|
+
}
|
184
|
+
else
|
185
|
+
{
|
186
|
+
posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
|
187
|
+
}
|
188
|
+
if( posFromX <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
|
189
|
+
slider.flexAnimate(slider.getTarget("prev"), true);
|
190
|
+
} else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) {
|
191
|
+
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
192
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true);
|
193
|
+
}
|
194
|
+
});
|
195
|
+
}else{
|
196
|
+
el._slider = slider;
|
197
|
+
slider.slides.each(function (){
|
198
|
+
var that = this;
|
199
|
+
that._gesture = new MSGesture();
|
200
|
+
that._gesture.target = that;
|
201
|
+
that.addEventListener("MSPointerDown", function (e){
|
202
|
+
e.preventDefault();
|
203
|
+
if(e.currentTarget._gesture) {
|
204
|
+
e.currentTarget._gesture.addPointer(e.pointerId);
|
205
|
+
}
|
206
|
+
}, false);
|
207
|
+
that.addEventListener("MSGestureTap", function (e){
|
208
|
+
e.preventDefault();
|
209
|
+
var $slide = $(this),
|
210
|
+
target = $slide.index();
|
211
|
+
if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) {
|
212
|
+
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
213
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true);
|
214
|
+
}
|
215
|
+
});
|
216
|
+
});
|
217
|
+
}
|
218
|
+
}
|
219
|
+
},
|
220
|
+
controlNav: {
|
221
|
+
setup: function() {
|
222
|
+
if (!slider.manualControls) {
|
223
|
+
methods.controlNav.setupPaging();
|
224
|
+
} else { // MANUALCONTROLS:
|
225
|
+
methods.controlNav.setupManual();
|
226
|
+
}
|
227
|
+
},
|
228
|
+
setupPaging: function() {
|
229
|
+
var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
|
230
|
+
j = 1,
|
231
|
+
item,
|
232
|
+
slide;
|
233
|
+
|
234
|
+
slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
|
235
|
+
|
236
|
+
if (slider.pagingCount > 1) {
|
237
|
+
for (var i = 0; i < slider.pagingCount; i++) {
|
238
|
+
slide = slider.slides.eq(i);
|
239
|
+
|
240
|
+
if ( undefined === slide.attr( 'data-thumb-alt' ) ) {
|
241
|
+
slide.attr( 'data-thumb-alt', '' );
|
242
|
+
}
|
243
|
+
|
244
|
+
item = $( '<a></a>' ).attr( 'href', '#' ).text( j );
|
245
|
+
if ( slider.vars.controlNav === "thumbnails" ) {
|
246
|
+
item = $( '<img/>' ).attr( 'src', slide.attr( 'data-thumb' ) );
|
247
|
+
}
|
248
|
+
|
249
|
+
if ( '' !== slide.attr( 'data-thumb-alt' ) ) {
|
250
|
+
item.attr( 'alt', slide.attr( 'data-thumb-alt' ) );
|
251
|
+
}
|
252
|
+
|
253
|
+
if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) {
|
254
|
+
var captn = slide.attr( 'data-thumbcaption' );
|
255
|
+
if ( '' !== captn && undefined !== captn ) {
|
256
|
+
var caption = $('<span></span>' ).addClass( namespace + 'caption' ).text( captn );
|
257
|
+
item.append( caption );
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
var liElement = $( '<li>' );
|
262
|
+
item.appendTo( liElement );
|
263
|
+
liElement.append( '</li>' );
|
264
|
+
|
265
|
+
slider.controlNavScaffold.append(liElement);
|
266
|
+
j++;
|
267
|
+
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
// CONTROLSCONTAINER:
|
272
|
+
(slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold);
|
273
|
+
methods.controlNav.set();
|
274
|
+
|
275
|
+
methods.controlNav.active();
|
276
|
+
|
277
|
+
slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
|
278
|
+
event.preventDefault();
|
279
|
+
|
280
|
+
if (watchedEvent === "" || watchedEvent === event.type) {
|
281
|
+
var $this = $(this),
|
282
|
+
target = slider.controlNav.index($this);
|
283
|
+
|
284
|
+
if (!$this.hasClass(namespace + 'active')) {
|
285
|
+
slider.direction = (target > slider.currentSlide) ? "next" : "prev";
|
286
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
// setup flags to prevent event duplication
|
291
|
+
if (watchedEvent === "") {
|
292
|
+
watchedEvent = event.type;
|
293
|
+
}
|
294
|
+
methods.setToClearWatchedEvent();
|
295
|
+
|
296
|
+
});
|
297
|
+
},
|
298
|
+
setupManual: function() {
|
299
|
+
slider.controlNav = slider.manualControls;
|
300
|
+
methods.controlNav.active();
|
301
|
+
|
302
|
+
slider.controlNav.bind(eventType, function(event) {
|
303
|
+
event.preventDefault();
|
304
|
+
|
305
|
+
if (watchedEvent === "" || watchedEvent === event.type) {
|
306
|
+
var $this = $(this),
|
307
|
+
target = slider.controlNav.index($this);
|
308
|
+
|
309
|
+
if (!$this.hasClass(namespace + 'active')) {
|
310
|
+
(target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev";
|
311
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
312
|
+
}
|
313
|
+
}
|
314
|
+
|
315
|
+
// setup flags to prevent event duplication
|
316
|
+
if (watchedEvent === "") {
|
317
|
+
watchedEvent = event.type;
|
318
|
+
}
|
319
|
+
methods.setToClearWatchedEvent();
|
320
|
+
});
|
321
|
+
},
|
322
|
+
set: function() {
|
323
|
+
var selector = (slider.vars.controlNav === "thumbnails") ? 'img' : 'a';
|
324
|
+
slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider);
|
325
|
+
},
|
326
|
+
active: function() {
|
327
|
+
slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active");
|
328
|
+
},
|
329
|
+
update: function(action, pos) {
|
330
|
+
if (slider.pagingCount > 1 && action === "add") {
|
331
|
+
slider.controlNavScaffold.append($('<li><a href="#">' + slider.count + '</a></li>'));
|
332
|
+
} else if (slider.pagingCount === 1) {
|
333
|
+
slider.controlNavScaffold.find('li').remove();
|
334
|
+
} else {
|
335
|
+
slider.controlNav.eq(pos).closest('li').remove();
|
336
|
+
}
|
337
|
+
methods.controlNav.set();
|
338
|
+
(slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active();
|
339
|
+
}
|
340
|
+
},
|
341
|
+
directionNav: {
|
342
|
+
setup: function() {
|
343
|
+
var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li class="' + namespace + 'nav-prev"><a class="' + namespace + 'prev" href="#">' + slider.vars.prevText + '</a></li><li class="' + namespace + 'nav-next"><a class="' + namespace + 'next" href="#">' + slider.vars.nextText + '</a></li></ul>');
|
344
|
+
|
345
|
+
// CUSTOM DIRECTION NAV:
|
346
|
+
if (slider.customDirectionNav) {
|
347
|
+
slider.directionNav = slider.customDirectionNav;
|
348
|
+
// CONTROLSCONTAINER:
|
349
|
+
} else if (slider.controlsContainer) {
|
350
|
+
$(slider.controlsContainer).append(directionNavScaffold);
|
351
|
+
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer);
|
352
|
+
} else {
|
353
|
+
slider.append(directionNavScaffold);
|
354
|
+
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider);
|
355
|
+
}
|
356
|
+
|
357
|
+
methods.directionNav.update();
|
358
|
+
|
359
|
+
slider.directionNav.bind(eventType, function(event) {
|
360
|
+
event.preventDefault();
|
361
|
+
var target;
|
362
|
+
|
363
|
+
if (watchedEvent === "" || watchedEvent === event.type) {
|
364
|
+
target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev');
|
365
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
366
|
+
}
|
367
|
+
|
368
|
+
// setup flags to prevent event duplication
|
369
|
+
if (watchedEvent === "") {
|
370
|
+
watchedEvent = event.type;
|
371
|
+
}
|
372
|
+
methods.setToClearWatchedEvent();
|
373
|
+
});
|
374
|
+
},
|
375
|
+
update: function() {
|
376
|
+
var disabledClass = namespace + 'disabled';
|
377
|
+
if (slider.pagingCount === 1) {
|
378
|
+
slider.directionNav.addClass(disabledClass).attr('tabindex', '-1');
|
379
|
+
} else if (!slider.vars.animationLoop) {
|
380
|
+
if (slider.animatingTo === 0) {
|
381
|
+
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass).attr('tabindex', '-1');
|
382
|
+
} else if (slider.animatingTo === slider.last) {
|
383
|
+
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass).attr('tabindex', '-1');
|
384
|
+
} else {
|
385
|
+
slider.directionNav.removeClass(disabledClass).removeAttr('tabindex');
|
386
|
+
}
|
387
|
+
} else {
|
388
|
+
slider.directionNav.removeClass(disabledClass).removeAttr('tabindex');
|
389
|
+
}
|
390
|
+
}
|
391
|
+
},
|
392
|
+
pausePlay: {
|
393
|
+
setup: function() {
|
394
|
+
var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a href="#"></a></div>');
|
395
|
+
|
396
|
+
// CONTROLSCONTAINER:
|
397
|
+
if (slider.controlsContainer) {
|
398
|
+
slider.controlsContainer.append(pausePlayScaffold);
|
399
|
+
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer);
|
400
|
+
} else {
|
401
|
+
slider.append(pausePlayScaffold);
|
402
|
+
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider);
|
403
|
+
}
|
404
|
+
|
405
|
+
methods.pausePlay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play');
|
406
|
+
|
407
|
+
slider.pausePlay.bind(eventType, function(event) {
|
408
|
+
event.preventDefault();
|
409
|
+
|
410
|
+
if (watchedEvent === "" || watchedEvent === event.type) {
|
411
|
+
if ($(this).hasClass(namespace + 'pause')) {
|
412
|
+
slider.manualPause = true;
|
413
|
+
slider.manualPlay = false;
|
414
|
+
slider.pause();
|
415
|
+
} else {
|
416
|
+
slider.manualPause = false;
|
417
|
+
slider.manualPlay = true;
|
418
|
+
slider.play();
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
// setup flags to prevent event duplication
|
423
|
+
if (watchedEvent === "") {
|
424
|
+
watchedEvent = event.type;
|
425
|
+
}
|
426
|
+
methods.setToClearWatchedEvent();
|
427
|
+
});
|
428
|
+
},
|
429
|
+
update: function(state) {
|
430
|
+
(state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').html(slider.vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').html(slider.vars.pauseText);
|
431
|
+
}
|
432
|
+
},
|
433
|
+
touch: function() {
|
434
|
+
var startX,
|
435
|
+
startY,
|
436
|
+
offset,
|
437
|
+
cwidth,
|
438
|
+
dx,
|
439
|
+
startT,
|
440
|
+
onTouchStart,
|
441
|
+
onTouchMove,
|
442
|
+
onTouchEnd,
|
443
|
+
scrolling = false,
|
444
|
+
localX = 0,
|
445
|
+
localY = 0,
|
446
|
+
accDx = 0;
|
447
|
+
|
448
|
+
if(!msGesture){
|
449
|
+
onTouchStart = function(e) {
|
450
|
+
if (slider.animating) {
|
451
|
+
e.preventDefault();
|
452
|
+
} else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) {
|
453
|
+
slider.pause();
|
454
|
+
// CAROUSEL:
|
455
|
+
cwidth = (vertical) ? slider.h : slider. w;
|
456
|
+
startT = Number(new Date());
|
457
|
+
// CAROUSEL:
|
458
|
+
|
459
|
+
// Local vars for X and Y points.
|
460
|
+
localX = e.touches[0].pageX;
|
461
|
+
localY = e.touches[0].pageY;
|
462
|
+
|
463
|
+
offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
|
464
|
+
(carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) :
|
465
|
+
(carousel && slider.currentSlide === slider.last) ? slider.limit :
|
466
|
+
(carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide :
|
467
|
+
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
468
|
+
startX = (vertical) ? localY : localX;
|
469
|
+
startY = (vertical) ? localX : localY;
|
470
|
+
el.addEventListener('touchmove', onTouchMove, false);
|
471
|
+
el.addEventListener('touchend', onTouchEnd, false);
|
472
|
+
}
|
473
|
+
};
|
474
|
+
|
475
|
+
onTouchMove = function(e) {
|
476
|
+
// Local vars for X and Y points.
|
477
|
+
|
478
|
+
localX = e.touches[0].pageX;
|
479
|
+
localY = e.touches[0].pageY;
|
480
|
+
|
481
|
+
dx = (vertical) ? startX - localY : (slider.vars.rtl?-1:1)*(startX - localX);
|
482
|
+
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY));
|
483
|
+
var fxms = 500;
|
484
|
+
|
485
|
+
if ( ! scrolling || Number( new Date() ) - startT > fxms ) {
|
486
|
+
e.preventDefault();
|
487
|
+
if (!fade && slider.transitions) {
|
488
|
+
if (!slider.vars.animationLoop) {
|
489
|
+
dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
|
490
|
+
}
|
491
|
+
slider.setProps(offset + dx, "setTouch");
|
492
|
+
}
|
493
|
+
}
|
494
|
+
};
|
495
|
+
|
496
|
+
onTouchEnd = function(e) {
|
497
|
+
// finish the touch by undoing the touch session
|
498
|
+
el.removeEventListener('touchmove', onTouchMove, false);
|
499
|
+
|
500
|
+
if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
|
501
|
+
var updateDx = (reverse) ? -dx : dx,
|
502
|
+
target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
503
|
+
|
504
|
+
if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
|
505
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
506
|
+
} else {
|
507
|
+
if (!fade) { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); }
|
508
|
+
}
|
509
|
+
}
|
510
|
+
el.removeEventListener('touchend', onTouchEnd, false);
|
511
|
+
|
512
|
+
startX = null;
|
513
|
+
startY = null;
|
514
|
+
dx = null;
|
515
|
+
offset = null;
|
516
|
+
};
|
517
|
+
|
518
|
+
el.addEventListener('touchstart', onTouchStart, false);
|
519
|
+
}else{
|
520
|
+
el.style.msTouchAction = "none";
|
521
|
+
el._gesture = new MSGesture();
|
522
|
+
el._gesture.target = el;
|
523
|
+
el.addEventListener("MSPointerDown", onMSPointerDown, false);
|
524
|
+
el._slider = slider;
|
525
|
+
el.addEventListener("MSGestureChange", onMSGestureChange, false);
|
526
|
+
el.addEventListener("MSGestureEnd", onMSGestureEnd, false);
|
527
|
+
|
528
|
+
function onMSPointerDown(e){
|
529
|
+
e.stopPropagation();
|
530
|
+
if (slider.animating) {
|
531
|
+
e.preventDefault();
|
532
|
+
}else{
|
533
|
+
slider.pause();
|
534
|
+
el._gesture.addPointer(e.pointerId);
|
535
|
+
accDx = 0;
|
536
|
+
cwidth = (vertical) ? slider.h : slider. w;
|
537
|
+
startT = Number(new Date());
|
538
|
+
// CAROUSEL:
|
539
|
+
|
540
|
+
offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
|
541
|
+
(carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) :
|
542
|
+
(carousel && slider.currentSlide === slider.last) ? slider.limit :
|
543
|
+
(carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide :
|
544
|
+
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
548
|
+
function onMSGestureChange(e) {
|
549
|
+
e.stopPropagation();
|
550
|
+
var slider = e.target._slider;
|
551
|
+
if(!slider){
|
552
|
+
return;
|
553
|
+
}
|
554
|
+
var transX = -e.translationX,
|
555
|
+
transY = -e.translationY;
|
556
|
+
|
557
|
+
//Accumulate translations.
|
558
|
+
accDx = accDx + ((vertical) ? transY : transX);
|
559
|
+
dx = (slider.vars.rtl?-1:1)*accDx;
|
560
|
+
scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY));
|
561
|
+
|
562
|
+
if(e.detail === e.MSGESTURE_FLAG_INERTIA){
|
563
|
+
setImmediate(function (){
|
564
|
+
el._gesture.stop();
|
565
|
+
});
|
566
|
+
|
567
|
+
return;
|
568
|
+
}
|
569
|
+
|
570
|
+
if (!scrolling || Number(new Date()) - startT > 500) {
|
571
|
+
e.preventDefault();
|
572
|
+
if (!fade && slider.transitions) {
|
573
|
+
if (!slider.vars.animationLoop) {
|
574
|
+
dx = accDx / ((slider.currentSlide === 0 && accDx < 0 || slider.currentSlide === slider.last && accDx > 0) ? (Math.abs(accDx) / cwidth + 2) : 1);
|
575
|
+
}
|
576
|
+
slider.setProps(offset + dx, "setTouch");
|
577
|
+
}
|
578
|
+
}
|
579
|
+
}
|
580
|
+
|
581
|
+
function onMSGestureEnd(e) {
|
582
|
+
e.stopPropagation();
|
583
|
+
var slider = e.target._slider;
|
584
|
+
if(!slider){
|
585
|
+
return;
|
586
|
+
}
|
587
|
+
if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
|
588
|
+
var updateDx = (reverse) ? -dx : dx,
|
589
|
+
target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
590
|
+
|
591
|
+
if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
|
592
|
+
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
593
|
+
} else {
|
594
|
+
if (!fade) { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); }
|
595
|
+
}
|
596
|
+
}
|
597
|
+
|
598
|
+
startX = null;
|
599
|
+
startY = null;
|
600
|
+
dx = null;
|
601
|
+
offset = null;
|
602
|
+
accDx = 0;
|
603
|
+
}
|
604
|
+
}
|
605
|
+
},
|
606
|
+
resize: function() {
|
607
|
+
if (!slider.animating && slider.is(':visible')) {
|
608
|
+
if (!carousel) { slider.doMath(); }
|
609
|
+
|
610
|
+
if (fade) {
|
611
|
+
// SMOOTH HEIGHT:
|
612
|
+
methods.smoothHeight();
|
613
|
+
} else if (carousel) { //CAROUSEL:
|
614
|
+
slider.slides.width(slider.computedW);
|
615
|
+
slider.update(slider.pagingCount);
|
616
|
+
slider.setProps();
|
617
|
+
}
|
618
|
+
else if (vertical) { //VERTICAL:
|
619
|
+
slider.viewport.height(slider.h);
|
620
|
+
slider.setProps(slider.h, "setTotal");
|
621
|
+
} else {
|
622
|
+
// SMOOTH HEIGHT:
|
623
|
+
if (slider.vars.smoothHeight) { methods.smoothHeight(); }
|
624
|
+
slider.newSlides.width(slider.computedW);
|
625
|
+
slider.setProps(slider.computedW, "setTotal");
|
626
|
+
}
|
627
|
+
}
|
628
|
+
},
|
629
|
+
smoothHeight: function(dur) {
|
630
|
+
if (!vertical || fade) {
|
631
|
+
var $obj = (fade) ? slider : slider.viewport;
|
632
|
+
(dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).innerHeight()}, dur) : $obj.innerHeight(slider.slides.eq(slider.animatingTo).innerHeight());
|
633
|
+
}
|
634
|
+
},
|
635
|
+
sync: function(action) {
|
636
|
+
var $obj = $(slider.vars.sync).data("flexslider"),
|
637
|
+
target = slider.animatingTo;
|
638
|
+
|
639
|
+
switch (action) {
|
640
|
+
case "animate": $obj.flexAnimate(target, slider.vars.pauseOnAction, false, true); break;
|
641
|
+
case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break;
|
642
|
+
case "pause": $obj.pause(); break;
|
643
|
+
}
|
644
|
+
},
|
645
|
+
uniqueID: function($clone) {
|
646
|
+
// Append _clone to current level and children elements with id attributes
|
647
|
+
$clone.filter( '[id]' ).add($clone.find( '[id]' )).each(function() {
|
648
|
+
var $this = $(this);
|
649
|
+
$this.attr( 'id', $this.attr( 'id' ) + '_clone' );
|
650
|
+
});
|
651
|
+
return $clone;
|
652
|
+
},
|
653
|
+
pauseInvisible: {
|
654
|
+
visProp: null,
|
655
|
+
init: function() {
|
656
|
+
var visProp = methods.pauseInvisible.getHiddenProp();
|
657
|
+
if (visProp) {
|
658
|
+
var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange';
|
659
|
+
document.addEventListener(evtname, function() {
|
660
|
+
if (methods.pauseInvisible.isHidden()) {
|
661
|
+
if(slider.startTimeout) {
|
662
|
+
clearTimeout(slider.startTimeout); //If clock is ticking, stop timer and prevent from starting while invisible
|
663
|
+
} else {
|
664
|
+
slider.pause(); //Or just pause
|
665
|
+
}
|
666
|
+
}
|
667
|
+
else {
|
668
|
+
if(slider.started) {
|
669
|
+
slider.play(); //Initiated before, just play
|
670
|
+
} else {
|
671
|
+
if (slider.vars.initDelay > 0) {
|
672
|
+
setTimeout(slider.play, slider.vars.initDelay);
|
673
|
+
} else {
|
674
|
+
slider.play(); //Didn't init before: simply init or wait for it
|
675
|
+
}
|
676
|
+
}
|
677
|
+
}
|
678
|
+
});
|
679
|
+
}
|
680
|
+
},
|
681
|
+
isHidden: function() {
|
682
|
+
var prop = methods.pauseInvisible.getHiddenProp();
|
683
|
+
if (!prop) {
|
684
|
+
return false;
|
685
|
+
}
|
686
|
+
return document[prop];
|
687
|
+
},
|
688
|
+
getHiddenProp: function() {
|
689
|
+
var prefixes = ['webkit','moz','ms','o'];
|
690
|
+
// if 'hidden' is natively supported just return it
|
691
|
+
if ('hidden' in document) {
|
692
|
+
return 'hidden';
|
693
|
+
}
|
694
|
+
// otherwise loop over all the known prefixes until we find one
|
695
|
+
for ( var i = 0; i < prefixes.length; i++ ) {
|
696
|
+
if ((prefixes[i] + 'Hidden') in document) {
|
697
|
+
return prefixes[i] + 'Hidden';
|
698
|
+
}
|
699
|
+
}
|
700
|
+
// otherwise it's not supported
|
701
|
+
return null;
|
702
|
+
}
|
703
|
+
},
|
704
|
+
setToClearWatchedEvent: function() {
|
705
|
+
clearTimeout(watchedEventClearTimer);
|
706
|
+
watchedEventClearTimer = setTimeout(function() {
|
707
|
+
watchedEvent = "";
|
708
|
+
}, 3000);
|
709
|
+
}
|
710
|
+
};
|
711
|
+
|
712
|
+
// public methods
|
713
|
+
slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
|
714
|
+
if (!slider.vars.animationLoop && target !== slider.currentSlide) {
|
715
|
+
slider.direction = (target > slider.currentSlide) ? "next" : "prev";
|
716
|
+
}
|
717
|
+
|
718
|
+
if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
719
|
+
|
720
|
+
if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) {
|
721
|
+
if (asNav && withSync) {
|
722
|
+
var master = $(slider.vars.asNavFor).data('flexslider');
|
723
|
+
slider.atEnd = target === 0 || target === slider.count - 1;
|
724
|
+
master.flexAnimate(target, true, false, true, fromNav);
|
725
|
+
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
726
|
+
master.direction = slider.direction;
|
727
|
+
|
728
|
+
if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) {
|
729
|
+
slider.currentItem = target;
|
730
|
+
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
731
|
+
target = Math.floor(target/slider.visible);
|
732
|
+
} else {
|
733
|
+
slider.currentItem = target;
|
734
|
+
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
735
|
+
return false;
|
736
|
+
}
|
737
|
+
}
|
738
|
+
|
739
|
+
slider.animating = true;
|
740
|
+
slider.animatingTo = target;
|
741
|
+
|
742
|
+
// SLIDESHOW:
|
743
|
+
if (pause) { slider.pause(); }
|
744
|
+
|
745
|
+
// API: before() animation Callback
|
746
|
+
slider.vars.before(slider);
|
747
|
+
|
748
|
+
// SYNC:
|
749
|
+
if (slider.syncExists && !fromNav) { methods.sync("animate"); }
|
750
|
+
|
751
|
+
// CONTROLNAV
|
752
|
+
if (slider.vars.controlNav) { methods.controlNav.active(); }
|
753
|
+
|
754
|
+
// !CAROUSEL:
|
755
|
+
// CANDIDATE: slide active class (for add/remove slide)
|
756
|
+
if (!carousel) { slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide'); }
|
757
|
+
|
758
|
+
// INFINITE LOOP:
|
759
|
+
// CANDIDATE: atEnd
|
760
|
+
slider.atEnd = target === 0 || target === slider.last;
|
761
|
+
|
762
|
+
// DIRECTIONNAV:
|
763
|
+
if (slider.vars.directionNav) { methods.directionNav.update(); }
|
764
|
+
|
765
|
+
if (target === slider.last) {
|
766
|
+
// API: end() of cycle Callback
|
767
|
+
slider.vars.end(slider);
|
768
|
+
// SLIDESHOW && !INFINITE LOOP:
|
769
|
+
if (!slider.vars.animationLoop) { slider.pause(); }
|
770
|
+
}
|
771
|
+
|
772
|
+
// SLIDE:
|
773
|
+
if (!fade) {
|
774
|
+
var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW,
|
775
|
+
margin, slideString, calcNext;
|
776
|
+
|
777
|
+
// INFINITE LOOP / REVERSE:
|
778
|
+
if (carousel) {
|
779
|
+
margin = slider.vars.itemMargin;
|
780
|
+
calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo;
|
781
|
+
slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext;
|
782
|
+
} else if (slider.currentSlide === 0 && target === slider.count - 1 && slider.vars.animationLoop && slider.direction !== "next") {
|
783
|
+
slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0;
|
784
|
+
} else if (slider.currentSlide === slider.last && target === 0 && slider.vars.animationLoop && slider.direction !== "prev") {
|
785
|
+
slideString = (reverse) ? 0 : (slider.count + 1) * dimension;
|
786
|
+
} else {
|
787
|
+
slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
|
788
|
+
}
|
789
|
+
slider.setProps(slideString, "", slider.vars.animationSpeed);
|
790
|
+
if (slider.transitions) {
|
791
|
+
if (!slider.vars.animationLoop || !slider.atEnd) {
|
792
|
+
slider.animating = false;
|
793
|
+
slider.currentSlide = slider.animatingTo;
|
794
|
+
}
|
795
|
+
|
796
|
+
// Unbind previous transitionEnd events and re-bind new transitionEnd event
|
797
|
+
slider.container.unbind("webkitTransitionEnd transitionend");
|
798
|
+
slider.container.bind("webkitTransitionEnd transitionend", function() {
|
799
|
+
clearTimeout(slider.ensureAnimationEnd);
|
800
|
+
slider.wrapup(dimension);
|
801
|
+
});
|
802
|
+
|
803
|
+
// Insurance for the ever-so-fickle transitionEnd event
|
804
|
+
clearTimeout(slider.ensureAnimationEnd);
|
805
|
+
slider.ensureAnimationEnd = setTimeout(function() {
|
806
|
+
slider.wrapup(dimension);
|
807
|
+
}, slider.vars.animationSpeed + 100);
|
808
|
+
|
809
|
+
} else {
|
810
|
+
slider.container.animate(slider.args, slider.vars.animationSpeed, slider.vars.easing, function(){
|
811
|
+
slider.wrapup(dimension);
|
812
|
+
});
|
813
|
+
}
|
814
|
+
} else { // FADE:
|
815
|
+
if (!touch) {
|
816
|
+
slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing);
|
817
|
+
slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
|
818
|
+
} else {
|
819
|
+
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
|
820
|
+
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
|
821
|
+
slider.wrapup(dimension);
|
822
|
+
}
|
823
|
+
}
|
824
|
+
// SMOOTH HEIGHT:
|
825
|
+
if (slider.vars.smoothHeight) { methods.smoothHeight(slider.vars.animationSpeed); }
|
826
|
+
}
|
827
|
+
};
|
828
|
+
slider.wrapup = function(dimension) {
|
829
|
+
// SLIDE:
|
830
|
+
if (!fade && !carousel) {
|
831
|
+
if (slider.currentSlide === 0 && slider.animatingTo === slider.last && slider.vars.animationLoop) {
|
832
|
+
slider.setProps(dimension, "jumpEnd");
|
833
|
+
} else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && slider.vars.animationLoop) {
|
834
|
+
slider.setProps(dimension, "jumpStart");
|
835
|
+
}
|
836
|
+
}
|
837
|
+
slider.animating = false;
|
838
|
+
slider.currentSlide = slider.animatingTo;
|
839
|
+
// API: after() animation Callback
|
840
|
+
slider.vars.after(slider);
|
841
|
+
};
|
842
|
+
|
843
|
+
// SLIDESHOW:
|
844
|
+
slider.animateSlides = function() {
|
845
|
+
if (!slider.animating && focused ) { slider.flexAnimate(slider.getTarget("next")); }
|
846
|
+
};
|
847
|
+
// SLIDESHOW:
|
848
|
+
slider.pause = function() {
|
849
|
+
clearInterval(slider.animatedSlides);
|
850
|
+
slider.animatedSlides = null;
|
851
|
+
slider.playing = false;
|
852
|
+
// PAUSEPLAY:
|
853
|
+
if (slider.vars.pausePlay) { methods.pausePlay.update("play"); }
|
854
|
+
// SYNC:
|
855
|
+
if (slider.syncExists) { methods.sync("pause"); }
|
856
|
+
};
|
857
|
+
// SLIDESHOW:
|
858
|
+
slider.play = function() {
|
859
|
+
if (slider.playing) { clearInterval(slider.animatedSlides); }
|
860
|
+
slider.animatedSlides = slider.animatedSlides || setInterval(slider.animateSlides, slider.vars.slideshowSpeed);
|
861
|
+
slider.started = slider.playing = true;
|
862
|
+
// PAUSEPLAY:
|
863
|
+
if (slider.vars.pausePlay) { methods.pausePlay.update("pause"); }
|
864
|
+
// SYNC:
|
865
|
+
if (slider.syncExists) { methods.sync("play"); }
|
866
|
+
};
|
867
|
+
// STOP:
|
868
|
+
slider.stop = function () {
|
869
|
+
slider.pause();
|
870
|
+
slider.stopped = true;
|
871
|
+
};
|
872
|
+
slider.canAdvance = function(target, fromNav) {
|
873
|
+
// ASNAV:
|
874
|
+
var last = (asNav) ? slider.pagingCount - 1 : slider.last;
|
875
|
+
return (fromNav) ? true :
|
876
|
+
(asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true :
|
877
|
+
(asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false :
|
878
|
+
(target === slider.currentSlide && !asNav) ? false :
|
879
|
+
(slider.vars.animationLoop) ? true :
|
880
|
+
(slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false :
|
881
|
+
(slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false :
|
882
|
+
true;
|
883
|
+
};
|
884
|
+
slider.getTarget = function(dir) {
|
885
|
+
slider.direction = dir;
|
886
|
+
if (dir === "next") {
|
887
|
+
return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1;
|
888
|
+
} else {
|
889
|
+
return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1;
|
890
|
+
}
|
891
|
+
};
|
892
|
+
|
893
|
+
// SLIDE:
|
894
|
+
slider.setProps = function(pos, special, dur) {
|
895
|
+
var target = (function() {
|
896
|
+
var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo,
|
897
|
+
posCalc = (function() {
|
898
|
+
if (carousel) {
|
899
|
+
return (special === "setTouch") ? pos :
|
900
|
+
(reverse && slider.animatingTo === slider.last) ? 0 :
|
901
|
+
(reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) :
|
902
|
+
(slider.animatingTo === slider.last) ? slider.limit : posCheck;
|
903
|
+
} else {
|
904
|
+
switch (special) {
|
905
|
+
case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos;
|
906
|
+
case "setTouch": return (reverse) ? pos : pos;
|
907
|
+
case "jumpEnd": return (reverse) ? pos : slider.count * pos;
|
908
|
+
case "jumpStart": return (reverse) ? slider.count * pos : pos;
|
909
|
+
default: return pos;
|
910
|
+
}
|
911
|
+
}
|
912
|
+
}());
|
913
|
+
|
914
|
+
return (posCalc * ((slider.vars.rtl)?1:-1)) + "px";
|
915
|
+
}());
|
916
|
+
|
917
|
+
if (slider.transitions) {
|
918
|
+
if (slider.isFirefox) {
|
919
|
+
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + (parseInt(target)+'px') + ",0,0)";
|
920
|
+
} else {
|
921
|
+
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + ((slider.vars.rtl?-1:1)*parseInt(target)+'px') + ",0,0)";
|
922
|
+
}
|
923
|
+
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
|
924
|
+
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
|
925
|
+
slider.container.css("transition-duration", dur);
|
926
|
+
}
|
927
|
+
|
928
|
+
slider.args[slider.prop] = target;
|
929
|
+
if (slider.transitions || dur === undefined) { slider.container.css(slider.args); }
|
930
|
+
|
931
|
+
slider.container.css('transform',target);
|
932
|
+
};
|
933
|
+
|
934
|
+
slider.setup = function(type) {
|
935
|
+
// SLIDE:
|
936
|
+
if (!fade) {
|
937
|
+
var sliderOffset, arr;
|
938
|
+
|
939
|
+
if (type === "init") {
|
940
|
+
slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container);
|
941
|
+
// INFINITE LOOP:
|
942
|
+
slider.cloneCount = 0;
|
943
|
+
slider.cloneOffset = 0;
|
944
|
+
// REVERSE:
|
945
|
+
if (reverse) {
|
946
|
+
arr = $.makeArray(slider.slides).reverse();
|
947
|
+
slider.slides = $(arr);
|
948
|
+
slider.container.empty().append(slider.slides);
|
949
|
+
}
|
950
|
+
}
|
951
|
+
// INFINITE LOOP && !CAROUSEL:
|
952
|
+
if (slider.vars.animationLoop && !carousel) {
|
953
|
+
slider.cloneCount = 2;
|
954
|
+
slider.cloneOffset = 1;
|
955
|
+
// clear out old clones
|
956
|
+
if (type !== "init") { slider.container.find('.clone').remove(); }
|
957
|
+
slider.container.append(methods.uniqueID(slider.slides.first().clone().addClass('clone')).attr('aria-hidden', 'true'))
|
958
|
+
.prepend(methods.uniqueID(slider.slides.last().clone().addClass('clone')).attr('aria-hidden', 'true'));
|
959
|
+
}
|
960
|
+
slider.newSlides = $(slider.vars.selector, slider);
|
961
|
+
|
962
|
+
sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset;
|
963
|
+
// VERTICAL:
|
964
|
+
if (vertical && !carousel) {
|
965
|
+
slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
|
966
|
+
setTimeout(function(){
|
967
|
+
slider.newSlides.css({"display": "block"});
|
968
|
+
slider.doMath();
|
969
|
+
slider.viewport.height(slider.h);
|
970
|
+
slider.setProps(sliderOffset * slider.h, "init");
|
971
|
+
}, (type === "init") ? 100 : 0);
|
972
|
+
} else {
|
973
|
+
slider.container.width((slider.count + slider.cloneCount) * 200 + "%");
|
974
|
+
slider.setProps(sliderOffset * slider.computedW, "init");
|
975
|
+
setTimeout(function(){
|
976
|
+
slider.doMath();
|
977
|
+
if(slider.vars.rtl){
|
978
|
+
if (slider.isFirefox) {
|
979
|
+
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "right", "display": "block"});
|
980
|
+
} else {
|
981
|
+
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
|
982
|
+
}
|
983
|
+
|
984
|
+
}
|
985
|
+
else{
|
986
|
+
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
|
987
|
+
}
|
988
|
+
// SMOOTH HEIGHT:
|
989
|
+
if (slider.vars.smoothHeight) { methods.smoothHeight(); }
|
990
|
+
}, (type === "init") ? 100 : 0);
|
991
|
+
}
|
992
|
+
} else { // FADE:
|
993
|
+
if(slider.vars.rtl){
|
994
|
+
slider.slides.css({"width": "100%", "float": 'right', "marginLeft": "-100%", "position": "relative"});
|
995
|
+
}
|
996
|
+
else{
|
997
|
+
slider.slides.css({"width": "100%", "float": 'left', "marginRight": "-100%", "position": "relative"});
|
998
|
+
}
|
999
|
+
if (type === "init") {
|
1000
|
+
if (!touch) {
|
1001
|
+
//slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing);
|
1002
|
+
if (slider.vars.fadeFirstSlide == false) {
|
1003
|
+
slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).css({"opacity": 1});
|
1004
|
+
} else {
|
1005
|
+
slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing);
|
1006
|
+
}
|
1007
|
+
} else {
|
1008
|
+
slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2});
|
1009
|
+
}
|
1010
|
+
}
|
1011
|
+
// SMOOTH HEIGHT:
|
1012
|
+
if (slider.vars.smoothHeight) { methods.smoothHeight(); }
|
1013
|
+
}
|
1014
|
+
// !CAROUSEL:
|
1015
|
+
// CANDIDATE: active slide
|
1016
|
+
if (!carousel) { slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); }
|
1017
|
+
|
1018
|
+
//FlexSlider: init() Callback
|
1019
|
+
slider.vars.init(slider);
|
1020
|
+
};
|
1021
|
+
|
1022
|
+
slider.doMath = function() {
|
1023
|
+
var slide = slider.slides.first(),
|
1024
|
+
slideMargin = slider.vars.itemMargin,
|
1025
|
+
minItems = slider.vars.minItems,
|
1026
|
+
maxItems = slider.vars.maxItems;
|
1027
|
+
|
1028
|
+
slider.w = (slider.viewport===undefined) ? slider.width() : slider.viewport.width();
|
1029
|
+
if (slider.isFirefox) { slider.w = slider.width(); }
|
1030
|
+
slider.h = slide.height();
|
1031
|
+
slider.boxPadding = slide.outerWidth() - slide.width();
|
1032
|
+
|
1033
|
+
// CAROUSEL:
|
1034
|
+
if (carousel) {
|
1035
|
+
slider.itemT = slider.vars.itemWidth + slideMargin;
|
1036
|
+
slider.itemM = slideMargin;
|
1037
|
+
slider.minW = (minItems) ? minItems * slider.itemT : slider.w;
|
1038
|
+
slider.maxW = (maxItems) ? (maxItems * slider.itemT) - slideMargin : slider.w;
|
1039
|
+
slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * (minItems - 1)))/minItems :
|
1040
|
+
(slider.maxW < slider.w) ? (slider.w - (slideMargin * (maxItems - 1)))/maxItems :
|
1041
|
+
(slider.vars.itemWidth > slider.w) ? slider.w : slider.vars.itemWidth;
|
1042
|
+
|
1043
|
+
slider.visible = Math.floor(slider.w/(slider.itemW));
|
1044
|
+
slider.move = (slider.vars.move > 0 && slider.vars.move < slider.visible ) ? slider.vars.move : slider.visible;
|
1045
|
+
slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1);
|
1046
|
+
slider.last = slider.pagingCount - 1;
|
1047
|
+
slider.limit = (slider.pagingCount === 1) ? 0 :
|
1048
|
+
(slider.vars.itemWidth > slider.w) ? (slider.itemW * (slider.count - 1)) + (slideMargin * (slider.count - 1)) : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin;
|
1049
|
+
} else {
|
1050
|
+
slider.itemW = slider.w;
|
1051
|
+
slider.itemM = slideMargin;
|
1052
|
+
slider.pagingCount = slider.count;
|
1053
|
+
slider.last = slider.count - 1;
|
1054
|
+
}
|
1055
|
+
slider.computedW = slider.itemW - slider.boxPadding;
|
1056
|
+
slider.computedM = slider.itemM;
|
1057
|
+
};
|
1058
|
+
|
1059
|
+
slider.update = function(pos, action) {
|
1060
|
+
slider.doMath();
|
1061
|
+
|
1062
|
+
// update currentSlide and slider.animatingTo if necessary
|
1063
|
+
if (!carousel) {
|
1064
|
+
if (pos < slider.currentSlide) {
|
1065
|
+
slider.currentSlide += 1;
|
1066
|
+
} else if (pos <= slider.currentSlide && pos !== 0) {
|
1067
|
+
slider.currentSlide -= 1;
|
1068
|
+
}
|
1069
|
+
slider.animatingTo = slider.currentSlide;
|
1070
|
+
}
|
1071
|
+
|
1072
|
+
// update controlNav
|
1073
|
+
if (slider.vars.controlNav && !slider.manualControls) {
|
1074
|
+
if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) {
|
1075
|
+
methods.controlNav.update("add");
|
1076
|
+
} else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) {
|
1077
|
+
if (carousel && slider.currentSlide > slider.last) {
|
1078
|
+
slider.currentSlide -= 1;
|
1079
|
+
slider.animatingTo -= 1;
|
1080
|
+
}
|
1081
|
+
methods.controlNav.update("remove", slider.last);
|
1082
|
+
}
|
1083
|
+
}
|
1084
|
+
// update directionNav
|
1085
|
+
if (slider.vars.directionNav) { methods.directionNav.update(); }
|
1086
|
+
|
1087
|
+
};
|
1088
|
+
|
1089
|
+
slider.addSlide = function(obj, pos) {
|
1090
|
+
var $obj = $(obj);
|
1091
|
+
|
1092
|
+
slider.count += 1;
|
1093
|
+
slider.last = slider.count - 1;
|
1094
|
+
|
1095
|
+
// append new slide
|
1096
|
+
if (vertical && reverse) {
|
1097
|
+
(pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj);
|
1098
|
+
} else {
|
1099
|
+
(pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj);
|
1100
|
+
}
|
1101
|
+
|
1102
|
+
// update currentSlide, animatingTo, controlNav, and directionNav
|
1103
|
+
slider.update(pos, "add");
|
1104
|
+
|
1105
|
+
// update slider.slides
|
1106
|
+
slider.slides = $(slider.vars.selector + ':not(.clone)', slider);
|
1107
|
+
// re-setup the slider to accomdate new slide
|
1108
|
+
slider.setup();
|
1109
|
+
|
1110
|
+
//FlexSlider: added() Callback
|
1111
|
+
slider.vars.added(slider);
|
1112
|
+
};
|
1113
|
+
slider.removeSlide = function(obj) {
|
1114
|
+
var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj;
|
1115
|
+
|
1116
|
+
// update count
|
1117
|
+
slider.count -= 1;
|
1118
|
+
slider.last = slider.count - 1;
|
1119
|
+
|
1120
|
+
// remove slide
|
1121
|
+
if (isNaN(obj)) {
|
1122
|
+
$(obj, slider.slides).remove();
|
1123
|
+
} else {
|
1124
|
+
(vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove();
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
// update currentSlide, animatingTo, controlNav, and directionNav
|
1128
|
+
slider.doMath();
|
1129
|
+
slider.update(pos, "remove");
|
1130
|
+
|
1131
|
+
// update slider.slides
|
1132
|
+
slider.slides = $(slider.vars.selector + ':not(.clone)', slider);
|
1133
|
+
// re-setup the slider to accomdate new slide
|
1134
|
+
slider.setup();
|
1135
|
+
|
1136
|
+
// FlexSlider: removed() Callback
|
1137
|
+
slider.vars.removed(slider);
|
1138
|
+
};
|
1139
|
+
|
1140
|
+
//FlexSlider: Initialize
|
1141
|
+
methods.init();
|
1142
|
+
};
|
1143
|
+
|
1144
|
+
// Ensure the slider isn't focussed if the window loses focus.
|
1145
|
+
$( window ).blur( function ( e ) {
|
1146
|
+
focused = false;
|
1147
|
+
}).focus( function ( e ) {
|
1148
|
+
focused = true;
|
1149
|
+
});
|
1150
|
+
|
1151
|
+
//FlexSlider: Default Settings
|
1152
|
+
$.flexslider.defaults = {
|
1153
|
+
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
|
1154
|
+
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
|
1155
|
+
animation: "fade", //String: Select your animation type, "fade" or "slide"
|
1156
|
+
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
|
1157
|
+
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
|
1158
|
+
reverse: false, //{NEW} Boolean: Reverse the animation direction
|
1159
|
+
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
|
1160
|
+
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
|
1161
|
+
startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
|
1162
|
+
slideshow: true, //Boolean: Animate slider automatically
|
1163
|
+
slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
|
1164
|
+
animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds
|
1165
|
+
initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds
|
1166
|
+
randomize: false, //Boolean: Randomize slide order
|
1167
|
+
fadeFirstSlide: true, //Boolean: Fade in the first slide when animation type is "fade"
|
1168
|
+
thumbCaptions: false, //Boolean: Whether or not to put captions on thumbnails when using the "thumbnails" controlNav.
|
1169
|
+
|
1170
|
+
// Usability features
|
1171
|
+
pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
|
1172
|
+
pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
|
1173
|
+
pauseInvisible: true, //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage.
|
1174
|
+
useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available
|
1175
|
+
touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
|
1176
|
+
video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
|
1177
|
+
|
1178
|
+
// Primary Controls
|
1179
|
+
controlNav: true, //Boolean: Create navigation for paging control of each slide? Note: Leave true for manualControls usage
|
1180
|
+
directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false)
|
1181
|
+
prevText: "Previous", //String: Set the text for the "previous" directionNav item
|
1182
|
+
nextText: "Next", //String: Set the text for the "next" directionNav item
|
1183
|
+
|
1184
|
+
// Secondary Navigation
|
1185
|
+
keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys
|
1186
|
+
multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
|
1187
|
+
mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
|
1188
|
+
pausePlay: false, //Boolean: Create pause/play dynamic element
|
1189
|
+
pauseText: "Pause", //String: Set the text for the "pause" pausePlay item
|
1190
|
+
playText: "Play", //String: Set the text for the "play" pausePlay item
|
1191
|
+
|
1192
|
+
// Special properties
|
1193
|
+
controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found.
|
1194
|
+
manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
|
1195
|
+
customDirectionNav: "", //{NEW} jQuery Object/Selector: Custom prev / next button. Must be two jQuery elements. In order to make the events work they have to have the classes "prev" and "next" (plus namespace)
|
1196
|
+
sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
|
1197
|
+
asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
|
1198
|
+
|
1199
|
+
// Carousel Options
|
1200
|
+
itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
|
1201
|
+
itemMargin: 0, //{NEW} Integer: Margin between carousel items.
|
1202
|
+
minItems: 1, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
|
1203
|
+
maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
|
1204
|
+
move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
|
1205
|
+
allowOneSlide: true, //{NEW} Boolean: Whether or not to allow a slider comprised of a single slide
|
1206
|
+
|
1207
|
+
// Browser Specific
|
1208
|
+
isFirefox: false, // {NEW} Boolean: Set to true when Firefox is the browser used.
|
1209
|
+
|
1210
|
+
// Callback API
|
1211
|
+
start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
|
1212
|
+
before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
|
1213
|
+
after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
|
1214
|
+
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
|
1215
|
+
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
|
1216
|
+
removed: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is removed
|
1217
|
+
init: function() {}, //{NEW} Callback: function(slider) - Fires after the slider is initially setup
|
1218
|
+
rtl: false //{NEW} Boolean: Whether or not to enable RTL mode
|
1219
|
+
};
|
1220
|
+
|
1221
|
+
//FlexSlider: Plugin Function
|
1222
|
+
$.fn.flexslider = function(options) {
|
1223
|
+
if (options === undefined) { options = {}; }
|
1224
|
+
|
1225
|
+
if (typeof options === "object") {
|
1226
|
+
return this.each(function() {
|
1227
|
+
var $this = $(this),
|
1228
|
+
selector = (options.selector) ? options.selector : ".slides > li",
|
1229
|
+
$slides = $this.find(selector);
|
1230
|
+
|
1231
|
+
if ( ( $slides.length === 1 && options.allowOneSlide === false ) || $slides.length === 0 ) {
|
1232
|
+
$slides.fadeIn(400);
|
1233
|
+
if (options.start) { options.start($this); }
|
1234
|
+
} else if ($this.data('flexslider') === undefined) {
|
1235
|
+
new $.flexslider(this, options);
|
1236
|
+
}
|
1237
|
+
});
|
1238
|
+
} else {
|
1239
|
+
// Helper strings to quickly perform functions on the slider
|
1240
|
+
var $slider = $(this).data('flexslider');
|
1241
|
+
switch (options) {
|
1242
|
+
case "play": $slider.play(); break;
|
1243
|
+
case "pause": $slider.pause(); break;
|
1244
|
+
case "stop": $slider.stop(); break;
|
1245
|
+
case "next": $slider.flexAnimate($slider.getTarget("next"), true); break;
|
1246
|
+
case "prev":
|
1247
|
+
case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break;
|
1248
|
+
default: if (typeof options === "number") { $slider.flexAnimate(options, true); }
|
1249
|
+
}
|
1250
|
+
}
|
1251
|
+
};
|
1252
|
+
})(jQuery);
|