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,56 @@
|
|
1
|
+
/**
|
2
|
+
* jquery.dependClass - Attach class based on first class in list of current element
|
3
|
+
*
|
4
|
+
* Written by
|
5
|
+
* Egor Khmelev (hmelyoff@gmail.com)
|
6
|
+
*
|
7
|
+
* Licensed under the MIT (MIT-LICENSE.txt).
|
8
|
+
*
|
9
|
+
* @author Egor Khmelev
|
10
|
+
* @version 0.1.0-BETA ($Id$)
|
11
|
+
*
|
12
|
+
**/
|
13
|
+
|
14
|
+
(function($) {
|
15
|
+
$.baseClass = function(obj){
|
16
|
+
obj = $(obj);
|
17
|
+
return obj.get(0).className.match(/([^ ]+)/)[1];
|
18
|
+
};
|
19
|
+
|
20
|
+
$.fn.addDependClass = function(className, delimiter){
|
21
|
+
var options = {
|
22
|
+
delimiter: delimiter ? delimiter : '-'
|
23
|
+
}
|
24
|
+
return this.each(function(){
|
25
|
+
var baseClass = $.baseClass(this);
|
26
|
+
if(baseClass)
|
27
|
+
$(this).addClass(baseClass + options.delimiter + className);
|
28
|
+
});
|
29
|
+
};
|
30
|
+
|
31
|
+
$.fn.removeDependClass = function(className, delimiter){
|
32
|
+
var options = {
|
33
|
+
delimiter: delimiter ? delimiter : '-'
|
34
|
+
}
|
35
|
+
return this.each(function(){
|
36
|
+
var baseClass = $.baseClass(this);
|
37
|
+
if(baseClass)
|
38
|
+
$(this).removeClass(baseClass + options.delimiter + className);
|
39
|
+
});
|
40
|
+
};
|
41
|
+
|
42
|
+
$.fn.toggleDependClass = function(className, delimiter){
|
43
|
+
var options = {
|
44
|
+
delimiter: delimiter ? delimiter : '-'
|
45
|
+
}
|
46
|
+
return this.each(function(){
|
47
|
+
var baseClass = $.baseClass(this);
|
48
|
+
if(baseClass)
|
49
|
+
if($(this).is("." + baseClass + options.delimiter + className))
|
50
|
+
$(this).removeClass(baseClass + options.delimiter + className);
|
51
|
+
else
|
52
|
+
$(this).addClass(baseClass + options.delimiter + className);
|
53
|
+
});
|
54
|
+
};
|
55
|
+
|
56
|
+
})(jQuery);
|
@@ -0,0 +1,700 @@
|
|
1
|
+
/**
|
2
|
+
* jquery.slider - Slider ui control in jQuery
|
3
|
+
*
|
4
|
+
* Written by
|
5
|
+
* Egor Khmelev (hmelyoff@gmail.com)
|
6
|
+
*
|
7
|
+
* Licensed under the MIT (MIT-LICENSE.txt).
|
8
|
+
*
|
9
|
+
* @author Egor Khmelev
|
10
|
+
* @version 1.1.0-RELEASE ($Id$)
|
11
|
+
*
|
12
|
+
* Dependencies
|
13
|
+
*
|
14
|
+
* jQuery (http://jquery.com)
|
15
|
+
* jquery.numberformatter (http://code.google.com/p/jquery-numberformatter/)
|
16
|
+
* tmpl (http://ejohn.org/blog/javascript-micro-templating/)
|
17
|
+
* jquery.dependClass
|
18
|
+
* draggable
|
19
|
+
*
|
20
|
+
**/
|
21
|
+
|
22
|
+
(function( $ ) {
|
23
|
+
|
24
|
+
function isArray( value ){
|
25
|
+
if( typeof value == "undefined" ) return false;
|
26
|
+
|
27
|
+
if (value instanceof Array || (!(value instanceof Object) &&
|
28
|
+
(Object.prototype.toString.call((value)) == '[object Array]') ||
|
29
|
+
typeof value.length == 'number' &&
|
30
|
+
typeof value.splice != 'undefined' &&
|
31
|
+
typeof value.propertyIsEnumerable != 'undefined' &&
|
32
|
+
!value.propertyIsEnumerable('splice')
|
33
|
+
)) {
|
34
|
+
return true;
|
35
|
+
}
|
36
|
+
|
37
|
+
return false;
|
38
|
+
}
|
39
|
+
|
40
|
+
$.slider = function( node, settings ){
|
41
|
+
var jNode = $(node);
|
42
|
+
if( !jNode.data( "jslider" ) )
|
43
|
+
jNode.data( "jslider", new jSlider( node, settings ) );
|
44
|
+
|
45
|
+
return jNode.data( "jslider" );
|
46
|
+
};
|
47
|
+
|
48
|
+
$.fn.slider = function( action, opt_value ){
|
49
|
+
var returnValue, args = arguments;
|
50
|
+
|
51
|
+
function isDef( val ){
|
52
|
+
return val !== undefined;
|
53
|
+
};
|
54
|
+
|
55
|
+
function isDefAndNotNull( val ){
|
56
|
+
return val != null;
|
57
|
+
};
|
58
|
+
|
59
|
+
this.each(function(){
|
60
|
+
var self = $.slider( this, action );
|
61
|
+
|
62
|
+
// do actions
|
63
|
+
if( typeof action == "string" ){
|
64
|
+
switch( action ){
|
65
|
+
case "value":
|
66
|
+
if( isDef( args[ 1 ] ) && isDef( args[ 2 ] ) ){
|
67
|
+
var pointers = self.getPointers();
|
68
|
+
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
69
|
+
pointers[0].set( args[ 1 ] );
|
70
|
+
pointers[0].setIndexOver();
|
71
|
+
}
|
72
|
+
|
73
|
+
if( isDefAndNotNull( pointers[1] ) && isDefAndNotNull( args[2] ) ){
|
74
|
+
pointers[1].set( args[ 2 ] );
|
75
|
+
pointers[1].setIndexOver();
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
else if( isDef( args[ 1 ] ) ){
|
80
|
+
var pointers = self.getPointers();
|
81
|
+
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
82
|
+
pointers[0].set( args[ 1 ] );
|
83
|
+
pointers[0].setIndexOver();
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
else
|
88
|
+
returnValue = self.getValue();
|
89
|
+
|
90
|
+
break;
|
91
|
+
|
92
|
+
case "prc":
|
93
|
+
if( isDef( args[ 1 ] ) && isDef( args[ 2 ] ) ){
|
94
|
+
var pointers = self.getPointers();
|
95
|
+
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
96
|
+
pointers[0]._set( args[ 1 ] );
|
97
|
+
pointers[0].setIndexOver();
|
98
|
+
}
|
99
|
+
|
100
|
+
if( isDefAndNotNull( pointers[1] ) && isDefAndNotNull( args[2] ) ){
|
101
|
+
pointers[1]._set( args[ 2 ] );
|
102
|
+
pointers[1].setIndexOver();
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
else if( isDef( args[ 1 ] ) ){
|
107
|
+
var pointers = self.getPointers();
|
108
|
+
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
109
|
+
pointers[0]._set( args[ 1 ] );
|
110
|
+
pointers[0].setIndexOver();
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
else
|
115
|
+
returnValue = self.getPrcValue();
|
116
|
+
|
117
|
+
break;
|
118
|
+
|
119
|
+
case "calculatedValue":
|
120
|
+
var value = self.getValue().split(";");
|
121
|
+
returnValue = "";
|
122
|
+
for (var i=0; i < value.length; i++) {
|
123
|
+
returnValue += (i > 0 ? ";" : "") + self.nice( value[i] );
|
124
|
+
};
|
125
|
+
|
126
|
+
break;
|
127
|
+
|
128
|
+
case "skin":
|
129
|
+
self.setSkin( args[1] );
|
130
|
+
|
131
|
+
break;
|
132
|
+
};
|
133
|
+
|
134
|
+
}
|
135
|
+
|
136
|
+
// return actual object
|
137
|
+
else if( !action && !opt_value ){
|
138
|
+
if( !isArray( returnValue ) )
|
139
|
+
returnValue = [];
|
140
|
+
|
141
|
+
returnValue.push( self );
|
142
|
+
}
|
143
|
+
});
|
144
|
+
|
145
|
+
// flatten array just with one slider
|
146
|
+
if( isArray( returnValue ) && returnValue.length == 1 )
|
147
|
+
returnValue = returnValue[ 0 ];
|
148
|
+
|
149
|
+
return returnValue || this;
|
150
|
+
};
|
151
|
+
|
152
|
+
var OPTIONS = {
|
153
|
+
|
154
|
+
settings: {
|
155
|
+
from: 1,
|
156
|
+
to: 10,
|
157
|
+
step: 1,
|
158
|
+
smooth: true,
|
159
|
+
limits: true,
|
160
|
+
round: 0,
|
161
|
+
format: { format: "#,##0.##" },
|
162
|
+
value: "5;7",
|
163
|
+
dimension: ""
|
164
|
+
},
|
165
|
+
|
166
|
+
className: "jslider",
|
167
|
+
selector: ".jslider-",
|
168
|
+
|
169
|
+
template: tmpl(
|
170
|
+
'<span class="<%=className%>">' +
|
171
|
+
'<table><tr><td>' +
|
172
|
+
'<div class="<%=className%>-bg">' +
|
173
|
+
'<i class="l"></i><i class="f"></i><i class="r"></i>' +
|
174
|
+
'<i class="v"></i>' +
|
175
|
+
'</div>' +
|
176
|
+
|
177
|
+
'<div class="<%=className%>-pointer"></div>' +
|
178
|
+
'<div class="<%=className%>-pointer <%=className%>-pointer-to"></div>' +
|
179
|
+
|
180
|
+
'<div class="<%=className%>-label"><span><%=settings.from%></span></div>' +
|
181
|
+
'<div class="<%=className%>-label <%=className%>-label-to"><span><%=settings.to%></span><%=settings.dimension%></div>' +
|
182
|
+
|
183
|
+
'<div class="<%=className%>-value"><span></span><%=settings.dimension%></div>' +
|
184
|
+
'<div class="<%=className%>-value <%=className%>-value-to"><span></span><%=settings.dimension%></div>' +
|
185
|
+
|
186
|
+
'<div class="<%=className%>-scale"><%=scale%></div>'+
|
187
|
+
|
188
|
+
'</td></tr></table>' +
|
189
|
+
'</span>'
|
190
|
+
)
|
191
|
+
|
192
|
+
};
|
193
|
+
|
194
|
+
function jSlider(){
|
195
|
+
return this.init.apply( this, arguments );
|
196
|
+
};
|
197
|
+
|
198
|
+
jSlider.prototype.init = function( node, settings ){
|
199
|
+
this.settings = $.extend(true, {}, OPTIONS.settings, settings ? settings : {});
|
200
|
+
|
201
|
+
// obj.sliderHandler = this;
|
202
|
+
this.inputNode = $( node ).hide();
|
203
|
+
|
204
|
+
this.settings.interval = this.settings.to-this.settings.from;
|
205
|
+
this.settings.value = this.inputNode.attr("value");
|
206
|
+
|
207
|
+
if( this.settings.calculate && $.isFunction( this.settings.calculate ) )
|
208
|
+
this.nice = this.settings.calculate;
|
209
|
+
|
210
|
+
if( this.settings.onstatechange && $.isFunction( this.settings.onstatechange ) )
|
211
|
+
this.onstatechange = this.settings.onstatechange;
|
212
|
+
|
213
|
+
this.is = {
|
214
|
+
init: false
|
215
|
+
};
|
216
|
+
this.o = {};
|
217
|
+
|
218
|
+
this.create();
|
219
|
+
};
|
220
|
+
|
221
|
+
jSlider.prototype.onstatechange = function(){
|
222
|
+
|
223
|
+
};
|
224
|
+
|
225
|
+
jSlider.prototype.create = function(){
|
226
|
+
var $this = this;
|
227
|
+
|
228
|
+
this.domNode = $( OPTIONS.template({
|
229
|
+
className: OPTIONS.className,
|
230
|
+
settings: {
|
231
|
+
from: this.nice( this.settings.from ),
|
232
|
+
to: this.nice( this.settings.to ),
|
233
|
+
dimension: this.settings.dimension
|
234
|
+
},
|
235
|
+
scale: this.generateScale()
|
236
|
+
}) );
|
237
|
+
|
238
|
+
this.inputNode.after( this.domNode );
|
239
|
+
this.drawScale();
|
240
|
+
|
241
|
+
// set skin class
|
242
|
+
if( this.settings.skin && this.settings.skin.length > 0 )
|
243
|
+
this.setSkin( this.settings.skin );
|
244
|
+
|
245
|
+
this.sizes = {
|
246
|
+
domWidth: this.domNode.width(),
|
247
|
+
domOffset: this.domNode.offset()
|
248
|
+
};
|
249
|
+
|
250
|
+
// find some objects
|
251
|
+
$.extend(this.o, {
|
252
|
+
pointers: {},
|
253
|
+
labels: {
|
254
|
+
0: {
|
255
|
+
o: this.domNode.find(OPTIONS.selector + "value").not(OPTIONS.selector + "value-to")
|
256
|
+
},
|
257
|
+
1: {
|
258
|
+
o: this.domNode.find(OPTIONS.selector + "value").filter(OPTIONS.selector + "value-to")
|
259
|
+
}
|
260
|
+
},
|
261
|
+
limits: {
|
262
|
+
0: this.domNode.find(OPTIONS.selector + "label").not(OPTIONS.selector + "label-to"),
|
263
|
+
1: this.domNode.find(OPTIONS.selector + "label").filter(OPTIONS.selector + "label-to")
|
264
|
+
}
|
265
|
+
});
|
266
|
+
|
267
|
+
$.extend(this.o.labels[0], {
|
268
|
+
value: this.o.labels[0].o.find("span")
|
269
|
+
});
|
270
|
+
|
271
|
+
$.extend(this.o.labels[1], {
|
272
|
+
value: this.o.labels[1].o.find("span")
|
273
|
+
});
|
274
|
+
|
275
|
+
|
276
|
+
if( !$this.settings.value.split(";")[1] ){
|
277
|
+
this.settings.single = true;
|
278
|
+
this.domNode.addDependClass("single");
|
279
|
+
}
|
280
|
+
|
281
|
+
if( !$this.settings.limits )
|
282
|
+
this.domNode.addDependClass("limitless");
|
283
|
+
|
284
|
+
this.domNode.find(OPTIONS.selector + "pointer").each(function( i ){
|
285
|
+
var value = $this.settings.value.split(";")[i];
|
286
|
+
if( value ){
|
287
|
+
$this.o.pointers[i] = new jSliderPointer( this, i, $this );
|
288
|
+
|
289
|
+
var prev = $this.settings.value.split(";")[i-1];
|
290
|
+
if( prev && new Number(value) < new Number(prev) ) value = prev;
|
291
|
+
|
292
|
+
value = value < $this.settings.from ? $this.settings.from : value;
|
293
|
+
value = value > $this.settings.to ? $this.settings.to : value;
|
294
|
+
|
295
|
+
$this.o.pointers[i].set( value, true );
|
296
|
+
}
|
297
|
+
});
|
298
|
+
|
299
|
+
this.o.value = this.domNode.find(".v");
|
300
|
+
this.is.init = true;
|
301
|
+
|
302
|
+
$.each(this.o.pointers, function(i){
|
303
|
+
$this.redraw(this);
|
304
|
+
});
|
305
|
+
|
306
|
+
(function(self){
|
307
|
+
$(window).resize(function(){
|
308
|
+
self.onresize();
|
309
|
+
});
|
310
|
+
})(this);
|
311
|
+
|
312
|
+
};
|
313
|
+
|
314
|
+
jSlider.prototype.setSkin = function( skin ){
|
315
|
+
if( this.skin_ )
|
316
|
+
this.domNode.removeDependClass( this.skin_, "_" );
|
317
|
+
|
318
|
+
this.domNode.addDependClass( this.skin_ = skin, "_" );
|
319
|
+
};
|
320
|
+
|
321
|
+
jSlider.prototype.setPointersIndex = function( i ){
|
322
|
+
$.each(this.getPointers(), function(i){
|
323
|
+
this.index( i );
|
324
|
+
});
|
325
|
+
};
|
326
|
+
|
327
|
+
jSlider.prototype.getPointers = function(){
|
328
|
+
return this.o.pointers;
|
329
|
+
};
|
330
|
+
|
331
|
+
jSlider.prototype.generateScale = function(){
|
332
|
+
if( this.settings.scale && this.settings.scale.length > 0 ){
|
333
|
+
var str = "";
|
334
|
+
var s = this.settings.scale;
|
335
|
+
var prc = Math.round((100/(s.length-1))*10)/10;
|
336
|
+
for( var i=0; i < s.length; i++ ){
|
337
|
+
str += '<span style="left: ' + i*prc + '%">' + ( s[i] != '|' ? '<ins>' + s[i] + '</ins>' : '' ) + '</span>';
|
338
|
+
};
|
339
|
+
return str;
|
340
|
+
} else return "";
|
341
|
+
|
342
|
+
return "";
|
343
|
+
};
|
344
|
+
|
345
|
+
jSlider.prototype.drawScale = function(){
|
346
|
+
this.domNode.find(OPTIONS.selector + "scale span ins").each(function(){
|
347
|
+
$(this).css({ marginLeft: -$(this).outerWidth()/2 });
|
348
|
+
});
|
349
|
+
};
|
350
|
+
|
351
|
+
jSlider.prototype.onresize = function(){
|
352
|
+
var self = this;
|
353
|
+
this.sizes = {
|
354
|
+
domWidth: this.domNode.width(),
|
355
|
+
domOffset: this.domNode.offset()
|
356
|
+
};
|
357
|
+
|
358
|
+
$.each(this.o.pointers, function(i){
|
359
|
+
self.redraw(this);
|
360
|
+
});
|
361
|
+
};
|
362
|
+
|
363
|
+
jSlider.prototype.update = function(){
|
364
|
+
this.onresize();
|
365
|
+
this.drawScale();
|
366
|
+
};
|
367
|
+
|
368
|
+
jSlider.prototype.limits = function( x, pointer ){
|
369
|
+
// smooth
|
370
|
+
if( !this.settings.smooth ){
|
371
|
+
var step = this.settings.step*100 / ( this.settings.interval );
|
372
|
+
x = Math.round( x/step ) * step;
|
373
|
+
}
|
374
|
+
|
375
|
+
var another = this.o.pointers[1-pointer.uid];
|
376
|
+
if( another && pointer.uid && x < another.value.prc ) x = another.value.prc;
|
377
|
+
if( another && !pointer.uid && x > another.value.prc ) x = another.value.prc;
|
378
|
+
|
379
|
+
// base limit
|
380
|
+
if( x < 0 ) x = 0;
|
381
|
+
if( x > 100 ) x = 100;
|
382
|
+
|
383
|
+
return Math.round( x*10 ) / 10;
|
384
|
+
};
|
385
|
+
|
386
|
+
jSlider.prototype.redraw = function( pointer ){
|
387
|
+
if( !this.is.init ) return false;
|
388
|
+
|
389
|
+
this.setValue();
|
390
|
+
|
391
|
+
// redraw range line
|
392
|
+
if( this.o.pointers[0] && this.o.pointers[1] )
|
393
|
+
this.o.value.css({ left: this.o.pointers[0].value.prc + "%", width: ( this.o.pointers[1].value.prc - this.o.pointers[0].value.prc ) + "%" });
|
394
|
+
|
395
|
+
this.o.labels[pointer.uid].value.html(
|
396
|
+
this.nice(
|
397
|
+
pointer.value.origin
|
398
|
+
)
|
399
|
+
);
|
400
|
+
|
401
|
+
// redraw position of labels
|
402
|
+
this.redrawLabels( pointer );
|
403
|
+
|
404
|
+
};
|
405
|
+
|
406
|
+
jSlider.prototype.redrawLabels = function( pointer ){
|
407
|
+
|
408
|
+
function setPosition( label, sizes, prc ){
|
409
|
+
sizes.margin = -sizes.label/2;
|
410
|
+
|
411
|
+
// left limit
|
412
|
+
label_left = sizes.border + sizes.margin;
|
413
|
+
if( label_left < 0 )
|
414
|
+
sizes.margin -= label_left;
|
415
|
+
|
416
|
+
// right limit
|
417
|
+
if( sizes.border+sizes.label / 2 > self.sizes.domWidth ){
|
418
|
+
sizes.margin = 0;
|
419
|
+
sizes.right = true;
|
420
|
+
} else
|
421
|
+
sizes.right = false;
|
422
|
+
|
423
|
+
label.o.css({ left: prc + "%", marginLeft: sizes.margin, right: "auto" });
|
424
|
+
if( sizes.right ) label.o.css({ left: "auto", right: 0 });
|
425
|
+
return sizes;
|
426
|
+
}
|
427
|
+
|
428
|
+
var self = this;
|
429
|
+
var label = this.o.labels[pointer.uid];
|
430
|
+
var prc = pointer.value.prc;
|
431
|
+
|
432
|
+
var sizes = {
|
433
|
+
label: label.o.outerWidth(),
|
434
|
+
right: false,
|
435
|
+
border: ( prc * this.sizes.domWidth ) / 100
|
436
|
+
};
|
437
|
+
|
438
|
+
if( !this.settings.single ){
|
439
|
+
// glue if near;
|
440
|
+
var another = this.o.pointers[1-pointer.uid];
|
441
|
+
var another_label = this.o.labels[another.uid];
|
442
|
+
|
443
|
+
switch( pointer.uid ){
|
444
|
+
case 0:
|
445
|
+
if( sizes.border+sizes.label / 2 > another_label.o.offset().left-this.sizes.domOffset.left ){
|
446
|
+
another_label.o.css({ visibility: "hidden" });
|
447
|
+
another_label.value.html( this.nice( another.value.origin ) );
|
448
|
+
|
449
|
+
label.o.css({ visibility: "visible" });
|
450
|
+
|
451
|
+
prc = ( another.value.prc - prc ) / 2 + prc;
|
452
|
+
if( another.value.prc != pointer.value.prc ){
|
453
|
+
label.value.html( this.nice(pointer.value.origin) + " – " + this.nice(another.value.origin) );
|
454
|
+
sizes.label = label.o.outerWidth();
|
455
|
+
sizes.border = ( prc * this.sizes.domWidth ) / 100;
|
456
|
+
}
|
457
|
+
} else {
|
458
|
+
another_label.o.css({ visibility: "visible" });
|
459
|
+
}
|
460
|
+
break;
|
461
|
+
|
462
|
+
case 1:
|
463
|
+
if( sizes.border - sizes.label / 2 < another_label.o.offset().left - this.sizes.domOffset.left + another_label.o.outerWidth() ){
|
464
|
+
another_label.o.css({ visibility: "hidden" });
|
465
|
+
another_label.value.html( this.nice(another.value.origin) );
|
466
|
+
|
467
|
+
label.o.css({ visibility: "visible" });
|
468
|
+
|
469
|
+
prc = ( prc - another.value.prc ) / 2 + another.value.prc;
|
470
|
+
if( another.value.prc != pointer.value.prc ){
|
471
|
+
label.value.html( this.nice(another.value.origin) + " – " + this.nice(pointer.value.origin) );
|
472
|
+
sizes.label = label.o.outerWidth();
|
473
|
+
sizes.border = ( prc * this.sizes.domWidth ) / 100;
|
474
|
+
}
|
475
|
+
} else {
|
476
|
+
another_label.o.css({ visibility: "visible" });
|
477
|
+
}
|
478
|
+
break;
|
479
|
+
}
|
480
|
+
}
|
481
|
+
|
482
|
+
sizes = setPosition( label, sizes, prc );
|
483
|
+
|
484
|
+
/* draw second label */
|
485
|
+
if( another_label ){
|
486
|
+
var sizes = {
|
487
|
+
label: another_label.o.outerWidth(),
|
488
|
+
right: false,
|
489
|
+
border: ( another.value.prc * this.sizes.domWidth ) / 100
|
490
|
+
};
|
491
|
+
sizes = setPosition( another_label, sizes, another.value.prc );
|
492
|
+
}
|
493
|
+
|
494
|
+
this.redrawLimits();
|
495
|
+
};
|
496
|
+
|
497
|
+
jSlider.prototype.redrawLimits = function(){
|
498
|
+
if( this.settings.limits ){
|
499
|
+
|
500
|
+
var limits = [ true, true ];
|
501
|
+
|
502
|
+
for( key in this.o.pointers ){
|
503
|
+
|
504
|
+
if( !this.settings.single || key == 0 ){
|
505
|
+
|
506
|
+
var pointer = this.o.pointers[key];
|
507
|
+
var label = this.o.labels[pointer.uid];
|
508
|
+
var label_left = label.o.offset().left - this.sizes.domOffset.left;
|
509
|
+
|
510
|
+
var limit = this.o.limits[0];
|
511
|
+
if( label_left < limit.outerWidth() )
|
512
|
+
limits[0] = false;
|
513
|
+
|
514
|
+
var limit = this.o.limits[1];
|
515
|
+
if( label_left + label.o.outerWidth() > this.sizes.domWidth - limit.outerWidth() )
|
516
|
+
limits[1] = false;
|
517
|
+
}
|
518
|
+
|
519
|
+
};
|
520
|
+
|
521
|
+
for( var i=0; i < limits.length; i++ ){
|
522
|
+
if( limits[i] )
|
523
|
+
this.o.limits[i].fadeIn("fast");
|
524
|
+
else
|
525
|
+
this.o.limits[i].fadeOut("fast");
|
526
|
+
};
|
527
|
+
|
528
|
+
}
|
529
|
+
};
|
530
|
+
|
531
|
+
jSlider.prototype.setValue = function(){
|
532
|
+
var value = this.getValue();
|
533
|
+
this.inputNode.attr( "value", value );
|
534
|
+
this.onstatechange.call( this, value );
|
535
|
+
};
|
536
|
+
|
537
|
+
jSlider.prototype.getValue = function(){
|
538
|
+
if(!this.is.init) return false;
|
539
|
+
var $this = this;
|
540
|
+
|
541
|
+
var value = "";
|
542
|
+
$.each( this.o.pointers, function(i){
|
543
|
+
if( this.value.prc != undefined && !isNaN(this.value.prc) ) value += (i > 0 ? ";" : "") + $this.prcToValue( this.value.prc );
|
544
|
+
});
|
545
|
+
return value;
|
546
|
+
};
|
547
|
+
|
548
|
+
jSlider.prototype.getPrcValue = function(){
|
549
|
+
if(!this.is.init) return false;
|
550
|
+
var $this = this;
|
551
|
+
|
552
|
+
var value = "";
|
553
|
+
$.each( this.o.pointers, function(i){
|
554
|
+
if( this.value.prc != undefined && !isNaN(this.value.prc) ) value += (i > 0 ? ";" : "") + this.value.prc;
|
555
|
+
});
|
556
|
+
return value;
|
557
|
+
};
|
558
|
+
|
559
|
+
jSlider.prototype.prcToValue = function( prc ){
|
560
|
+
|
561
|
+
if( this.settings.heterogeneity && this.settings.heterogeneity.length > 0 ){
|
562
|
+
var h = this.settings.heterogeneity;
|
563
|
+
|
564
|
+
var _start = 0;
|
565
|
+
var _from = this.settings.from;
|
566
|
+
|
567
|
+
for( var i=0; i <= h.length; i++ ){
|
568
|
+
if( h[i] ) var v = h[i].split("/");
|
569
|
+
else var v = [100, this.settings.to];
|
570
|
+
|
571
|
+
v[0] = new Number(v[0]);
|
572
|
+
v[1] = new Number(v[1]);
|
573
|
+
|
574
|
+
if( prc >= _start && prc <= v[0] ) {
|
575
|
+
var value = _from + ( (prc-_start) * (v[1]-_from) ) / (v[0]-_start);
|
576
|
+
}
|
577
|
+
|
578
|
+
_start = v[0];
|
579
|
+
_from = v[1];
|
580
|
+
};
|
581
|
+
|
582
|
+
} else {
|
583
|
+
var value = this.settings.from + ( prc * this.settings.interval ) / 100;
|
584
|
+
}
|
585
|
+
|
586
|
+
return this.round( value );
|
587
|
+
};
|
588
|
+
|
589
|
+
jSlider.prototype.valueToPrc = function( value, pointer ){
|
590
|
+
if( this.settings.heterogeneity && this.settings.heterogeneity.length > 0 ){
|
591
|
+
var h = this.settings.heterogeneity;
|
592
|
+
|
593
|
+
var _start = 0;
|
594
|
+
var _from = this.settings.from;
|
595
|
+
|
596
|
+
for (var i=0; i <= h.length; i++) {
|
597
|
+
if(h[i]) var v = h[i].split("/");
|
598
|
+
else var v = [100, this.settings.to];
|
599
|
+
v[0] = new Number(v[0]); v[1] = new Number(v[1]);
|
600
|
+
|
601
|
+
if(value >= _from && value <= v[1]){
|
602
|
+
var prc = pointer.limits(_start + (value-_from)*(v[0]-_start)/(v[1]-_from));
|
603
|
+
}
|
604
|
+
|
605
|
+
_start = v[0]; _from = v[1];
|
606
|
+
};
|
607
|
+
|
608
|
+
} else {
|
609
|
+
var prc = pointer.limits((value-this.settings.from)*100/this.settings.interval);
|
610
|
+
}
|
611
|
+
|
612
|
+
return prc;
|
613
|
+
};
|
614
|
+
|
615
|
+
jSlider.prototype.round = function( value ){
|
616
|
+
value = Math.round( value / this.settings.step ) * this.settings.step;
|
617
|
+
if( this.settings.round ) value = Math.round( value * Math.pow(10, this.settings.round) ) / Math.pow(10, this.settings.round);
|
618
|
+
else value = Math.round( value );
|
619
|
+
return value;
|
620
|
+
};
|
621
|
+
|
622
|
+
jSlider.prototype.nice = function( value ){
|
623
|
+
value = value.toString().replace(/,/gi, ".").replace(/ /gi, "");;
|
624
|
+
|
625
|
+
if( $.formatNumber ){
|
626
|
+
return $.formatNumber( new Number(value), this.settings.format || {} ).replace( /-/gi, "−" );
|
627
|
+
}
|
628
|
+
|
629
|
+
else {
|
630
|
+
return new Number(value);
|
631
|
+
}
|
632
|
+
};
|
633
|
+
|
634
|
+
|
635
|
+
function jSliderPointer(){
|
636
|
+
Draggable.apply( this, arguments );
|
637
|
+
}
|
638
|
+
jSliderPointer.prototype = new Draggable();
|
639
|
+
|
640
|
+
jSliderPointer.prototype.oninit = function( ptr, id, _constructor ){
|
641
|
+
this.uid = id;
|
642
|
+
this.parent = _constructor;
|
643
|
+
this.value = {};
|
644
|
+
this.settings = this.parent.settings;
|
645
|
+
};
|
646
|
+
|
647
|
+
jSliderPointer.prototype.onmousedown = function(evt){
|
648
|
+
this._parent = {
|
649
|
+
offset: this.parent.domNode.offset(),
|
650
|
+
width: this.parent.domNode.width()
|
651
|
+
};
|
652
|
+
this.ptr.addDependClass("hover");
|
653
|
+
this.setIndexOver();
|
654
|
+
};
|
655
|
+
|
656
|
+
jSliderPointer.prototype.onmousemove = function( evt, x ){
|
657
|
+
var coords = this._getPageCoords( evt );
|
658
|
+
this._set( this.calc( coords.x ) );
|
659
|
+
};
|
660
|
+
|
661
|
+
jSliderPointer.prototype.onmouseup = function( evt ){
|
662
|
+
if( this.parent.settings.callback && $.isFunction(this.parent.settings.callback) )
|
663
|
+
this.parent.settings.callback.call( this.parent, this.parent.getValue() );
|
664
|
+
|
665
|
+
this.ptr.removeDependClass("hover");
|
666
|
+
};
|
667
|
+
|
668
|
+
jSliderPointer.prototype.setIndexOver = function(){
|
669
|
+
this.parent.setPointersIndex( 1 );
|
670
|
+
this.index( 2 );
|
671
|
+
};
|
672
|
+
|
673
|
+
jSliderPointer.prototype.index = function( i ){
|
674
|
+
this.ptr.css({ zIndex: i });
|
675
|
+
};
|
676
|
+
|
677
|
+
jSliderPointer.prototype.limits = function( x ){
|
678
|
+
return this.parent.limits( x, this );
|
679
|
+
};
|
680
|
+
|
681
|
+
jSliderPointer.prototype.calc = function(coords){
|
682
|
+
var x = this.limits(((coords-this._parent.offset.left)*100)/this._parent.width);
|
683
|
+
return x;
|
684
|
+
};
|
685
|
+
|
686
|
+
jSliderPointer.prototype.set = function( value, opt_origin ){
|
687
|
+
this.value.origin = this.parent.round(value);
|
688
|
+
this._set( this.parent.valueToPrc( value, this ), opt_origin );
|
689
|
+
};
|
690
|
+
|
691
|
+
jSliderPointer.prototype._set = function( prc, opt_origin ){
|
692
|
+
if( !opt_origin )
|
693
|
+
this.value.origin = this.parent.prcToValue(prc);
|
694
|
+
|
695
|
+
this.value.prc = prc;
|
696
|
+
this.ptr.css({ left: prc + "%" });
|
697
|
+
this.parent.redraw(this);
|
698
|
+
};
|
699
|
+
|
700
|
+
})(jQuery);
|