compass-jquery-plugin 0.3.0.beta.1 → 0.3.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/compass-jquery-plugin.gemspec +2 -2
- data/gem_tasks/jrails13.rake +0 -1
- data/gem_tasks/jrails14.rake +1 -2
- data/lib/jquery.ui.rb +2 -2
- data/templates/dynatree/jquery.dynatree.js +2036 -2036
- data/templates/dynatree/jquery.dynatree.min.js +59 -59
- data/templates/dynatree/jquery.ui/dynatree.aero.scss +144 -144
- data/templates/dynatree/jquery.ui/dynatree.aqua.scss +144 -144
- data/templates/dynatree/jquery.ui/dynatree.crystal.scss +144 -144
- data/templates/dynatree/jquery.ui/dynatree.xp.scss +239 -239
- data/templates/dynatree/manifest.rb +127 -127
- data/templates/jqgrid/config/initializers/jqgrid.rb +2 -2
- data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +15 -15
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +15 -15
- data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +8 -8
- data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +8 -8
- data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-dk.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +13 -13
- data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +12 -12
- data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +126 -126
- data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +13 -13
- data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +10 -10
- data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +8 -8
- data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +16 -16
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +8 -8
- data/templates/jqgrid/i18n/jqgrid/locale-sp.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +16 -16
- data/templates/jqgrid/jquery.jqGrid.js +10477 -10471
- data/templates/jqgrid/jquery.jqGrid.min.js +430 -430
- data/templates/jqgrid/jquery.ui/jqGrid.scss +669 -669
- data/templates/jqgrid/manifest.rb +66 -66
- data/templates/jqtouch/jqtouch/iphone-emulator.scss +21 -21
- data/templates/jqtouch/jqtouch/jqt.apple.scss +584 -584
- data/templates/jqtouch/jqtouch/jqt.jqt.scss +528 -528
- data/templates/jqtouch/jqtouch/jqtouch.scss +310 -310
- data/templates/jqtouch/jquery.jqtouch.js +1026 -1026
- data/templates/jqtouch/jquery.jqtouch.min.js +26 -26
- data/templates/jqtouch/manifest.rb +52 -52
- data/templates/jrails-1.3/config/initializers/jrails.rb +28 -28
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ar.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ar.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-bg.js +20 -20
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-bg.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ca.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ca.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-cs.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-cs.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-da.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-da.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-de.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-de.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-el.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-el.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-eo.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-eo.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-es.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-es.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fa.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fa.min.js +3 -3
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fi.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fi.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fr.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fr.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-he.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-he.min.js +3 -3
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hr.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hr.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hu.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hu.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hy.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hy.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-id.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-id.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-is.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-is.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-it.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-it.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ja.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ja.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ko.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ko.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lt.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lt.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lv.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lv.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ms.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ms.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-nl.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-nl.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-no.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pl.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pl.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pt-BR.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pt-BR.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ro.js +22 -22
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ro.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ru.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ru.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sk.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sk.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sl.js +20 -20
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sl.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sq.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sq.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr-SR.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr-SR.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr.min.js +3 -3
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sv.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sv.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-th.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-th.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-tr.js +18 -18
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-tr.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-uk.js +24 -24
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-uk.min.js +4 -4
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-CN.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-CN.min.js +2 -2
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-TW.js +19 -19
- data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-TW.min.js +2 -2
- data/templates/jrails-1.3/jquery-1.3.2.js +7637 -7637
- data/templates/jrails-1.3/jquery-1.3.2.min.js +178 -178
- data/templates/jrails-1.3/jquery-ui-1.7.2.js +18316 -18316
- data/templates/jrails-1.3/jquery-ui-1.7.2.min.js +688 -688
- data/templates/jrails-1.3/jquery.contextMenu.js +210 -210
- data/templates/jrails-1.3/jquery.contextMenu.min.js +8 -8
- data/templates/jrails-1.3/jquery.haml.js +293 -293
- data/templates/jrails-1.3/jquery.haml.min.js +5 -5
- data/templates/jrails-1.3/jquery.pngFix.js +10 -10
- data/templates/jrails-1.3/jquery.pngFix.min.js +2 -2
- data/templates/jrails-1.3/jquery.themeswitchertool.js +190 -190
- data/templates/jrails-1.3/jquery.themeswitchertool.min.js +8 -8
- data/templates/jrails-1.3/jquery.ui/_theme.scss +1281 -1281
- data/templates/jrails-1.3/jquery.ui/base.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/black-tie.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/blitzer.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/contextMenu.scss +49 -49
- data/templates/jrails-1.3/jquery.ui/cupertino.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/dark-hive.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/dot-luv.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/eggplant.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/excite-bike.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/flick.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/hot-sneaks.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/humanity.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/le-frog.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/mint-choc.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/overcast.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/pepper-grinder.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/redmond.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/smoothness.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/south-street.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/sunny.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/swanky-purse.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/trontastic.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/ui-darkness.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/ui-lightness.scss +85 -85
- data/templates/jrails-1.3/jquery.ui/vader.scss +85 -85
- data/templates/jrails-1.3/jrails.js +197 -197
- data/templates/jrails-1.3/jrails.min.js +8 -8
- data/templates/jrails-1.3/manifest.rb +496 -496
- data/templates/jrails-1.4/config/initializers/jrails.rb +30 -30
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-af.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-af.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ar.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ar.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-az.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-az.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bg.js +24 -24
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bg.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bs.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bs.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ca.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ca.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-cs.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-cs.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-da.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-da.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-de.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-de.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-el.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-el.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-en-GB.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-en-GB.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eo.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eo.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-es.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-es.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-et.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-et.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eu.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eu.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fa.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fa.min.js +3 -3
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fi.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fi.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fo.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fo.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr-CH.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr-CH.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-he.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-he.min.js +3 -3
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hr.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hr.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hu.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hu.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hy.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hy.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-id.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-id.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-is.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-is.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-it.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-it.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ja.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ja.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ko.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ko.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lt.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lt.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lv.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lv.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ms.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ms.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-nl.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-nl.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-no.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pl.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pl.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pt-BR.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pt-BR.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ro.js +26 -26
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ro.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ru.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ru.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sk.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sk.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sl.js +24 -24
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sl.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sq.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sq.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr-SR.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr-SR.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sv.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sv.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ta.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ta.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-th.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-th.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-tr.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-tr.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-uk.js +22 -22
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-uk.min.js +4 -4
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-vi.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-vi.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-CN.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-CN.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-HK.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-HK.min.js +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-TW.js +23 -23
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-TW.min.js +2 -2
- data/templates/jrails-1.4/jquery-1.4.2.js +9501 -9501
- data/templates/jrails-1.4/jquery-1.4.2.min.js +210 -210
- data/templates/jrails-1.4/jquery-ui-1.8.js +21904 -21904
- data/templates/jrails-1.4/jquery-ui-1.8.min.js +766 -766
- data/templates/jrails-1.4/jquery.bgiframe.js +9 -9
- data/templates/jrails-1.4/jquery.bgiframe.min.js +2 -2
- data/templates/jrails-1.4/jquery.compat-1.3.js +291 -291
- data/templates/jrails-1.4/jquery.compat-1.3.min.js +6 -6
- data/templates/jrails-1.4/jquery.contextMenu.js +210 -210
- data/templates/jrails-1.4/jquery.contextMenu.min.js +8 -8
- data/templates/jrails-1.4/jquery.haml.js +293 -293
- data/templates/jrails-1.4/jquery.haml.min.js +5 -5
- data/templates/jrails-1.4/jquery.metadata.js +121 -121
- data/templates/jrails-1.4/jquery.metadata.min.js +2 -2
- data/templates/jrails-1.4/jquery.pngFix.js +10 -10
- data/templates/jrails-1.4/jquery.pngFix.min.js +2 -2
- data/templates/jrails-1.4/jquery.themeswitchertool.js +190 -190
- data/templates/jrails-1.4/jquery.themeswitchertool.min.js +8 -8
- data/templates/jrails-1.4/jquery.ui/_theme.scss +1433 -1433
- data/templates/jrails-1.4/jquery.ui/base.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/black-tie.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/blitzer.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/contextMenu.scss +49 -49
- data/templates/jrails-1.4/jquery.ui/cupertino.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/dark-hive.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/dot-luv.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/eggplant.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/excite-bike.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/flick.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/hot-sneaks.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/humanity.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/le-frog.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/mint-choc.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/overcast.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/pepper-grinder.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/redmond.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/smoothness.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/south-street.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/start.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/sunny.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/swanky-purse.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/trontastic.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/ui-darkness.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/ui-lightness.scss +90 -90
- data/templates/jrails-1.4/jquery.ui/vader.scss +90 -90
- data/templates/jrails-1.4/jrails.js +197 -197
- data/templates/jrails-1.4/jrails.min.js +8 -8
- data/templates/jrails-1.4/manifest.rb +568 -568
- data/templates/ribbon/config/initializers/ribbon.rb +3 -3
- data/templates/ribbon/jquery.ribbon.js +225 -225
- data/templates/ribbon/jquery.ribbon.min.js +14 -14
- data/templates/ribbon/jquery.ui/ribbon.simple.scss +271 -271
- data/templates/ribbon/jquery.ui/ribbon.windows7.scss +454 -454
- data/templates/ribbon/manifest.rb +52 -52
- data/templates/secret_sauce/app/views/ui/_ui_grid_for_without_block.js.haml +144 -144
- data/templates/secret_sauce/config/initializers/secret_sauce.rb +6 -6
- data/templates/secret_sauce/jquery.ui/secret_sauce.scss +33 -33
- data/templates/secret_sauce/manifest.rb +10 -10
- data/templates/secret_sauce/secret_sauce.js +11 -11
- data/templates/secret_sauce/secret_sauce.min.js +1 -1
- metadata +3 -3
@@ -1,1027 +1,1027 @@
|
|
1
|
-
/*
|
2
|
-
|
3
|
-
_/ _/_/ _/_/_/_/_/ _/
|
4
|
-
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
5
|
-
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
6
|
-
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
7
|
-
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
8
|
-
_/
|
9
|
-
_/
|
10
|
-
|
11
|
-
Created by David Kaneda <http://www.davidkaneda.com>
|
12
|
-
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
13
|
-
|
14
|
-
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
15
|
-
and pinch/zoom <http://www.pinchzoom.com/>
|
16
|
-
|
17
|
-
(c) 2009 by jQTouch project members.
|
18
|
-
See LICENSE.txt for license.
|
19
|
-
|
20
|
-
$Revision: 147 $
|
21
|
-
$Date: 2010-04-19 03:45:31 +0200 (Mo, 19. Apr 2010) $
|
22
|
-
$LastChangedBy: davidcolbykaneda $
|
23
|
-
|
24
|
-
*/
|
25
|
-
|
26
|
-
(function($) {
|
27
|
-
$.jQTouch = function(options) {
|
28
|
-
|
29
|
-
// Set support values
|
30
|
-
$.support.WebKitCSSMatrix = (typeof WebKitCSSMatrix == "object");
|
31
|
-
$.support.touch = (typeof Touch == "object");
|
32
|
-
$.support.WebKitAnimationEvent = (typeof WebKitTransitionEvent == "object");
|
33
|
-
|
34
|
-
// Initialize internal variables
|
35
|
-
var $body,
|
36
|
-
$head=$('head'),
|
37
|
-
hist=[],
|
38
|
-
newPageCount=0,
|
39
|
-
jQTSettings={},
|
40
|
-
hashCheckInterval,
|
41
|
-
currentPage,
|
42
|
-
orientation,
|
43
|
-
isMobileWebKit = RegExp(" Mobile/").test(navigator.userAgent),
|
44
|
-
tapReady=true,
|
45
|
-
lastAnimationTime=0,
|
46
|
-
touchSelectors=[],
|
47
|
-
publicObj={},
|
48
|
-
extensions=$.jQTouch.prototype.extensions,
|
49
|
-
defaultAnimations=['slide','flip','slideup','swap','cube','pop','dissolve','fade','back'],
|
50
|
-
animations=[],
|
51
|
-
hairextensions='';
|
52
|
-
// Get the party started
|
53
|
-
init(options);
|
54
|
-
|
55
|
-
function init(options) {
|
56
|
-
|
57
|
-
var defaults = {
|
58
|
-
addGlossToIcon: true,
|
59
|
-
backSelector: '.back, .cancel, .goback',
|
60
|
-
cacheGetRequests: true,
|
61
|
-
cubeSelector: '.cube',
|
62
|
-
dissolveSelector: '.dissolve',
|
63
|
-
fadeSelector: '.fade',
|
64
|
-
fixedViewport: true,
|
65
|
-
flipSelector: '.flip',
|
66
|
-
formSelector: 'form',
|
67
|
-
fullScreen: true,
|
68
|
-
fullScreenClass: 'fullscreen',
|
69
|
-
icon: null,
|
70
|
-
touchSelector: 'a, .touch',
|
71
|
-
popSelector: '.pop',
|
72
|
-
preloadImages: false,
|
73
|
-
slideSelector: '#jqt > * > ul li a, .slide',
|
74
|
-
slideupSelector: '.slideup',
|
75
|
-
startupScreen: null,
|
76
|
-
statusBar: 'default', // other options: black-translucent, black
|
77
|
-
submitSelector: '.submit',
|
78
|
-
swapSelector: '.swap',
|
79
|
-
useAnimations: true,
|
80
|
-
useFastTouch: true // Experimental.
|
81
|
-
};
|
82
|
-
jQTSettings = $.extend({}, defaults, options);
|
83
|
-
|
84
|
-
// Preload images
|
85
|
-
if (jQTSettings.preloadImages) {
|
86
|
-
for (var i = jQTSettings.preloadImages.length - 1; i >= 0; i--) {
|
87
|
-
(new Image()).src = jQTSettings.preloadImages[i];
|
88
|
-
};
|
89
|
-
}
|
90
|
-
// Set icon
|
91
|
-
if (jQTSettings.icon) {
|
92
|
-
var precomposed = (jQTSettings.addGlossToIcon) ? '' : '-precomposed';
|
93
|
-
hairextensions += '<link rel="apple-touch-icon' + precomposed + '" href="' + jQTSettings.icon + '" />';
|
94
|
-
}
|
95
|
-
// Set startup screen
|
96
|
-
if (jQTSettings.startupScreen) {
|
97
|
-
hairextensions += '<link rel="apple-touch-startup-image" href="' + jQTSettings.startupScreen + '" />';
|
98
|
-
}
|
99
|
-
// Set viewport
|
100
|
-
if (jQTSettings.fixedViewport) {
|
101
|
-
hairextensions += '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>';
|
102
|
-
}
|
103
|
-
// Set full-screen
|
104
|
-
if (jQTSettings.fullScreen) {
|
105
|
-
hairextensions += '<meta name="apple-mobile-web-app-capable" content="yes" />';
|
106
|
-
if (jQTSettings.statusBar) {
|
107
|
-
hairextensions += '<meta name="apple-mobile-web-app-status-bar-style" content="' + jQTSettings.statusBar + '" />';
|
108
|
-
}
|
109
|
-
}
|
110
|
-
if (hairextensions) {
|
111
|
-
$head.prepend(hairextensions);
|
112
|
-
}
|
113
|
-
|
114
|
-
// Initialize on document ready:
|
115
|
-
$(document).ready(function() {
|
116
|
-
|
117
|
-
// Add extensions
|
118
|
-
for (var i in extensions) {
|
119
|
-
var fn = extensions[i];
|
120
|
-
if ($.isFunction(fn)) {
|
121
|
-
$.extend(publicObj, fn(publicObj));
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
// Add animations
|
126
|
-
for (var i in defaultAnimations) {
|
127
|
-
var name = defaultAnimations[i];
|
128
|
-
var selector = jQTSettings[name + 'Selector'];
|
129
|
-
if (typeof(selector) == 'string') {
|
130
|
-
addAnimation({name:name, selector:selector});
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
touchSelectors.push('input');
|
135
|
-
touchSelectors.push(jQTSettings.touchSelector);
|
136
|
-
touchSelectors.push(jQTSettings.backSelector);
|
137
|
-
touchSelectors.push(jQTSettings.submitSelector);
|
138
|
-
$(touchSelectors.join(', ')).css('-webkit-touch-callout', 'none');
|
139
|
-
$(jQTSettings.backSelector).tap(liveTap);
|
140
|
-
$(jQTSettings.submitSelector).tap(submitParentForm);
|
141
|
-
|
142
|
-
$body = $('#jqt');
|
143
|
-
|
144
|
-
if (jQTSettings.fullScreenClass && window.navigator.standalone == true) {
|
145
|
-
$body.addClass(jQTSettings.fullScreenClass + ' ' + jQTSettings.statusBar);
|
146
|
-
}
|
147
|
-
|
148
|
-
// Create custom live events
|
149
|
-
$body
|
150
|
-
.bind('touchstart', handleTouch)
|
151
|
-
.bind('orientationchange', updateOrientation)
|
152
|
-
.trigger('orientationchange')
|
153
|
-
.submit(submitForm);
|
154
|
-
|
155
|
-
if (jQTSettings.useFastTouch && $.support.touch) {
|
156
|
-
$body.click(function(e) {
|
157
|
-
var $el = $(e.target);
|
158
|
-
|
159
|
-
if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA' && $el.attr('nodeName')!=='INPUT') {
|
160
|
-
$el = $el.closest('a, area');
|
161
|
-
}
|
162
|
-
|
163
|
-
if ($el.isExternalLink()) {
|
164
|
-
return true;
|
165
|
-
} else {
|
166
|
-
return false;
|
167
|
-
}
|
168
|
-
});
|
169
|
-
|
170
|
-
// This additionally gets rid of form focusses
|
171
|
-
$body.mousedown(function(e) {
|
172
|
-
var timeDiff = (new Date()).getTime() - lastAnimationTime;
|
173
|
-
if (timeDiff < 200) {
|
174
|
-
return false;
|
175
|
-
}
|
176
|
-
});
|
177
|
-
}
|
178
|
-
|
179
|
-
// Make sure exactly one child of body has "current" class
|
180
|
-
if ($('#jqt > .current').length == 0) {
|
181
|
-
currentPage = $('#jqt > *:first');
|
182
|
-
} else {
|
183
|
-
currentPage = $('#jqt > .current:first');
|
184
|
-
$('#jqt > .current').removeClass('current');
|
185
|
-
}
|
186
|
-
|
187
|
-
// Go to the top of the "current" page
|
188
|
-
$(currentPage).addClass('current');
|
189
|
-
location.hash = '#' + $(currentPage).attr('id');
|
190
|
-
addPageToHistory(currentPage);
|
191
|
-
scrollTo(0, 0);
|
192
|
-
startHashCheck();
|
193
|
-
});
|
194
|
-
}
|
195
|
-
|
196
|
-
// PUBLIC FUNCTIONS
|
197
|
-
function goBack(to) {
|
198
|
-
// Init the param
|
199
|
-
if (hist.length <= 1)
|
200
|
-
{
|
201
|
-
window.history.go(-2);
|
202
|
-
}
|
203
|
-
|
204
|
-
var numberOfPages = Math.min(parseInt(to || 1, 10), hist.length-1),
|
205
|
-
curPage = hist[0];
|
206
|
-
|
207
|
-
// Search through the history for an ID
|
208
|
-
if(isNaN(numberOfPages) && typeof(to) === "string" && to != '#' ) {
|
209
|
-
for( var i=1, length=hist.length; i < length; i++ ) {
|
210
|
-
if( '#' + hist[i].id === to ) {
|
211
|
-
numberOfPages = i;
|
212
|
-
break;
|
213
|
-
}
|
214
|
-
}
|
215
|
-
}
|
216
|
-
|
217
|
-
// If still nothing, assume one
|
218
|
-
if(isNaN(numberOfPages) || numberOfPages < 1) {
|
219
|
-
numberOfPages = 1;
|
220
|
-
};
|
221
|
-
|
222
|
-
if (hist.length > 1) {
|
223
|
-
// Remove all pages in front of the target page
|
224
|
-
hist.splice(0, numberOfPages);
|
225
|
-
animatePages(curPage.page, hist[0].page, curPage.animation, curPage.reverse === false);
|
226
|
-
} else {
|
227
|
-
location.hash = '#' + curPage.id;
|
228
|
-
}
|
229
|
-
|
230
|
-
return publicObj;
|
231
|
-
}
|
232
|
-
function goTo(toPage, animation, reverse) {
|
233
|
-
var fromPage = hist[0].page;
|
234
|
-
|
235
|
-
if (typeof(animation) === 'string') {
|
236
|
-
for (var i = animations.length - 1; i >= 0; i--) {
|
237
|
-
if (animations[i].name === animation) {
|
238
|
-
animation = animations[i];
|
239
|
-
break;
|
240
|
-
}
|
241
|
-
}
|
242
|
-
}
|
243
|
-
if (typeof(toPage) === 'string') {
|
244
|
-
nextPage = $(toPage);
|
245
|
-
if (nextPage.length < 1)
|
246
|
-
{
|
247
|
-
showPageByHref(toPage, {
|
248
|
-
'animation': animation
|
249
|
-
});
|
250
|
-
return;
|
251
|
-
}
|
252
|
-
else
|
253
|
-
{
|
254
|
-
toPage = nextPage;
|
255
|
-
}
|
256
|
-
|
257
|
-
}
|
258
|
-
if (animatePages(fromPage, toPage, animation, reverse)) {
|
259
|
-
addPageToHistory(toPage, animation, reverse);
|
260
|
-
return publicObj;
|
261
|
-
} else {
|
262
|
-
console.error('Could not animate pages.');
|
263
|
-
return false;
|
264
|
-
}
|
265
|
-
}
|
266
|
-
function getOrientation() {
|
267
|
-
return orientation;
|
268
|
-
}
|
269
|
-
|
270
|
-
// PRIVATE FUNCTIONS
|
271
|
-
function liveTap(e){
|
272
|
-
|
273
|
-
// Grab the clicked element
|
274
|
-
var $el = $(e.target);
|
275
|
-
|
276
|
-
if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA') {
|
277
|
-
$el = $el.closest('a, area');
|
278
|
-
}
|
279
|
-
|
280
|
-
var target = $el.attr('target'),
|
281
|
-
hash = $el.attr('hash'),
|
282
|
-
animation=null;
|
283
|
-
|
284
|
-
if (tapReady == false || !$el.length) {
|
285
|
-
console.warn('Not able to tap element.');
|
286
|
-
return false;
|
287
|
-
}
|
288
|
-
|
289
|
-
if ($el.isExternalLink()) {
|
290
|
-
$el.removeClass('active');
|
291
|
-
return true;
|
292
|
-
}
|
293
|
-
|
294
|
-
// Figure out the animation to use
|
295
|
-
for (var i = animations.length - 1; i >= 0; i--) {
|
296
|
-
if ($el.is(animations[i].selector)) {
|
297
|
-
animation = animations[i];
|
298
|
-
break;
|
299
|
-
}
|
300
|
-
};
|
301
|
-
|
302
|
-
// User clicked an internal link, fullscreen mode
|
303
|
-
if (target == '_webapp') {
|
304
|
-
window.location = $el.attr('href');
|
305
|
-
}
|
306
|
-
// User clicked a back button
|
307
|
-
else if ($el.is(jQTSettings.backSelector)) {
|
308
|
-
goBack(hash);
|
309
|
-
}
|
310
|
-
// Allow tap on item with no href
|
311
|
-
else if ($el.attr('href') == '#') {
|
312
|
-
$el.unselect();
|
313
|
-
return true;
|
314
|
-
}
|
315
|
-
// Branch on internal or external href
|
316
|
-
else if (hash && hash!='#') {
|
317
|
-
$el.addClass('active');
|
318
|
-
goTo($(hash).data('referrer', $el), animation, $(this).hasClass('reverse'));
|
319
|
-
} else {
|
320
|
-
$el.addClass('loading active');
|
321
|
-
showPageByHref($el.attr('href'), {
|
322
|
-
animation: animation,
|
323
|
-
callback: function() {
|
324
|
-
$el.removeClass('loading'); setTimeout($.fn.unselect, 250, $el);
|
325
|
-
},
|
326
|
-
$referrer: $el
|
327
|
-
});
|
328
|
-
}
|
329
|
-
return false;
|
330
|
-
}
|
331
|
-
function addPageToHistory(page, animation, reverse) {
|
332
|
-
// Grab some info
|
333
|
-
var pageId = page.attr('id');
|
334
|
-
// Prepend info to page history
|
335
|
-
hist.unshift({
|
336
|
-
page: page,
|
337
|
-
animation: animation,
|
338
|
-
reverse: reverse || false,
|
339
|
-
id: pageId
|
340
|
-
});
|
341
|
-
}
|
342
|
-
function animatePages(fromPage, toPage, animation, backwards) {
|
343
|
-
// Error check for target page
|
344
|
-
if (toPage.length === 0) {
|
345
|
-
$.fn.unselect();
|
346
|
-
console.error('Target element is missing.');
|
347
|
-
return false;
|
348
|
-
}
|
349
|
-
|
350
|
-
// Error check for fromPage=toPage
|
351
|
-
if (toPage.hasClass('current')) {
|
352
|
-
$.fn.unselect();
|
353
|
-
console.error('Target element is the current page.');
|
354
|
-
return false;
|
355
|
-
}
|
356
|
-
|
357
|
-
// Collapse the keyboard
|
358
|
-
$(':focus').blur();
|
359
|
-
|
360
|
-
fromPage.css('top', -window.pageYOffset);
|
361
|
-
toPage.css('top', 0);
|
362
|
-
|
363
|
-
// Make sure we are scrolled up to hide location bar
|
364
|
-
scrollTo(0, 0);
|
365
|
-
|
366
|
-
// Define callback to run after animation completes
|
367
|
-
var callback = function animationEnd(event) {
|
368
|
-
if (animation) {
|
369
|
-
toPage.removeClass('in ' + animation.name);
|
370
|
-
fromPage.removeClass('current out ' + animation.name);
|
371
|
-
if (backwards) {
|
372
|
-
toPage.toggleClass('reverse');
|
373
|
-
fromPage.toggleClass('reverse');
|
374
|
-
}
|
375
|
-
} else {
|
376
|
-
fromPage.removeClass('current');
|
377
|
-
}
|
378
|
-
|
379
|
-
toPage.trigger('pageAnimationEnd', { direction: 'in' });
|
380
|
-
fromPage.trigger('pageAnimationEnd', { direction: 'out' });
|
381
|
-
|
382
|
-
clearInterval(hashCheckInterval);
|
383
|
-
currentPage = toPage;
|
384
|
-
location.hash = '#' + currentPage.attr('id');
|
385
|
-
startHashCheck();
|
386
|
-
|
387
|
-
var $originallink = toPage.data('referrer');
|
388
|
-
if ($originallink) {
|
389
|
-
$originallink.unselect();
|
390
|
-
}
|
391
|
-
lastAnimationTime = (new Date()).getTime();
|
392
|
-
tapReady = true;
|
393
|
-
}
|
394
|
-
|
395
|
-
fromPage.trigger('pageAnimationStart', { direction: 'out' });
|
396
|
-
toPage.trigger('pageAnimationStart', { direction: 'in' });
|
397
|
-
|
398
|
-
if ($.support.WebKitAnimationEvent && animation && jQTSettings.useAnimations) {
|
399
|
-
toPage.one('webkitAnimationEnd', callback);
|
400
|
-
tapReady = false;
|
401
|
-
if (backwards) {
|
402
|
-
toPage.toggleClass('reverse');
|
403
|
-
fromPage.toggleClass('reverse');
|
404
|
-
}
|
405
|
-
toPage.addClass(animation.name + ' in current');
|
406
|
-
fromPage.addClass(animation.name + ' out');
|
407
|
-
|
408
|
-
} else {
|
409
|
-
toPage.addClass('current');
|
410
|
-
callback();
|
411
|
-
}
|
412
|
-
|
413
|
-
return true;
|
414
|
-
}
|
415
|
-
function hashCheck() {
|
416
|
-
var curid = currentPage.attr('id');
|
417
|
-
if (location.hash != '#' + curid) {
|
418
|
-
clearInterval(hashCheckInterval);
|
419
|
-
goBack(location.hash);
|
420
|
-
}
|
421
|
-
else if (location.hash == '') {
|
422
|
-
location.hash = '#' + curid;
|
423
|
-
}
|
424
|
-
}
|
425
|
-
function startHashCheck() {
|
426
|
-
hashCheckInterval = setInterval(hashCheck, 100);
|
427
|
-
}
|
428
|
-
function insertPages(nodes, animation) {
|
429
|
-
var targetPage = null;
|
430
|
-
$(nodes).each(function(index, node) {
|
431
|
-
var $node = $(this);
|
432
|
-
if (!$node.attr('id')) {
|
433
|
-
$node.attr('id', 'page-' + (++newPageCount));
|
434
|
-
}
|
435
|
-
|
436
|
-
$body.trigger('pageInserted', {page: $node.appendTo($body)});
|
437
|
-
|
438
|
-
if ($node.hasClass('current') || !targetPage) {
|
439
|
-
targetPage = $node;
|
440
|
-
}
|
441
|
-
});
|
442
|
-
if (targetPage !== null) {
|
443
|
-
goTo(targetPage, animation);
|
444
|
-
return targetPage;
|
445
|
-
} else {
|
446
|
-
return false;
|
447
|
-
}
|
448
|
-
}
|
449
|
-
function showPageByHref(href, options) {
|
450
|
-
var defaults = {
|
451
|
-
data: null,
|
452
|
-
method: 'GET',
|
453
|
-
animation: null,
|
454
|
-
callback: null,
|
455
|
-
$referrer: null
|
456
|
-
};
|
457
|
-
|
458
|
-
var settings = $.extend({}, defaults, options);
|
459
|
-
|
460
|
-
if (href != '#') {
|
461
|
-
$.ajax({
|
462
|
-
url: href,
|
463
|
-
data: settings.data,
|
464
|
-
type: settings.method,
|
465
|
-
success: function (data, textStatus) {
|
466
|
-
var firstPage = insertPages(data, settings.animation);
|
467
|
-
if (firstPage) {
|
468
|
-
if (settings.method == 'GET' && jQTSettings.cacheGetRequests === true && settings.$referrer) {
|
469
|
-
settings.$referrer.attr('href', '#' + firstPage.attr('id'));
|
470
|
-
}
|
471
|
-
if (settings.callback) {
|
472
|
-
settings.callback(true);
|
473
|
-
}
|
474
|
-
}
|
475
|
-
},
|
476
|
-
error: function (data) {
|
477
|
-
if (settings.$referrer) {
|
478
|
-
settings.$referrer.unselect();
|
479
|
-
}
|
480
|
-
if (settings.callback) {
|
481
|
-
settings.callback(false);
|
482
|
-
}
|
483
|
-
}
|
484
|
-
});
|
485
|
-
}
|
486
|
-
else if (settings.$referrer) {
|
487
|
-
settings.$referrer.unselect();
|
488
|
-
}
|
489
|
-
}
|
490
|
-
function submitForm(e, callback) {
|
491
|
-
var $form = (typeof(e)==='string') ? $(e).eq(0) : (e.target ? $(e.target) : $(e));
|
492
|
-
|
493
|
-
if ($form.length && $form.is(jQTSettings.formSelector)) {
|
494
|
-
showPageByHref($form.attr('action'), {
|
495
|
-
data: $form.serialize(),
|
496
|
-
method: $form.attr('method') || "POST",
|
497
|
-
animation: animations[0] || null,
|
498
|
-
callback: callback
|
499
|
-
});
|
500
|
-
return false;
|
501
|
-
}
|
502
|
-
return true;
|
503
|
-
}
|
504
|
-
function submitParentForm(e) {
|
505
|
-
var $form = $(this).closest('form');
|
506
|
-
if ($form.length) {
|
507
|
-
var evt = $.Event("submit");
|
508
|
-
evt.preventDefault();
|
509
|
-
$form.trigger(evt);
|
510
|
-
return false;
|
511
|
-
}
|
512
|
-
return true;
|
513
|
-
}
|
514
|
-
function addAnimation(animation) {
|
515
|
-
if (typeof(animation.selector) == 'string' && typeof(animation.name) == 'string') {
|
516
|
-
animations.push(animation);
|
517
|
-
$(animation.selector).tap(liveTap);
|
518
|
-
touchSelectors.push(animation.selector);
|
519
|
-
}
|
520
|
-
}
|
521
|
-
function updateOrientation() {
|
522
|
-
orientation = Math.abs(window.orientation) == 90 ? 'landscape' : 'profile';
|
523
|
-
$body.removeClass('profile landscape').addClass(orientation).trigger('turn', {orientation: orientation});
|
524
|
-
// scrollTo(0, 0);
|
525
|
-
}
|
526
|
-
function handleTouch(e) {
|
527
|
-
var $el = $(e.target);
|
528
|
-
|
529
|
-
// Only handle touchSelectors
|
530
|
-
if (!$(e.target).is(touchSelectors.join(', '))) {
|
531
|
-
var $link = $(e.target).closest('a, area');
|
532
|
-
|
533
|
-
if ($link.length && $link.is(touchSelectors.join(', '))) {
|
534
|
-
$el = $link;
|
535
|
-
} else {
|
536
|
-
return;
|
537
|
-
}
|
538
|
-
}
|
539
|
-
|
540
|
-
if (e) {
|
541
|
-
var hoverTimeout = null,
|
542
|
-
startX = event.changedTouches[0].clientX,
|
543
|
-
startY = event.changedTouches[0].clientY,
|
544
|
-
startTime = (new Date).getTime(),
|
545
|
-
deltaX = 0,
|
546
|
-
deltaY = 0,
|
547
|
-
deltaT = 0;
|
548
|
-
|
549
|
-
// Let's bind these after the fact, so we can keep some internal values
|
550
|
-
$el.bind('touchmove', touchmove).bind('touchend', touchend);
|
551
|
-
|
552
|
-
hoverTimeout = setTimeout(function() {
|
553
|
-
$el.makeActive();
|
554
|
-
}, 100);
|
555
|
-
|
556
|
-
}
|
557
|
-
|
558
|
-
// Private touch functions (TODO: insert dirty joke)
|
559
|
-
function touchmove(e) {
|
560
|
-
|
561
|
-
updateChanges();
|
562
|
-
var absX = Math.abs(deltaX);
|
563
|
-
var absY = Math.abs(deltaY);
|
564
|
-
|
565
|
-
// Check for swipe
|
566
|
-
if (absX > absY && (absX > 35) && deltaT < 1000) {
|
567
|
-
$el.trigger('swipe', {direction: (deltaX < 0) ? 'left' : 'right', deltaX: deltaX, deltaY: deltaY }).unbind('touchmove',touchmove).unbind('touchend',touchend);
|
568
|
-
} else if (absY > 1) {
|
569
|
-
$el.removeClass('active');
|
570
|
-
}
|
571
|
-
|
572
|
-
clearTimeout(hoverTimeout);
|
573
|
-
}
|
574
|
-
|
575
|
-
function touchend() {
|
576
|
-
updateChanges();
|
577
|
-
|
578
|
-
if (deltaY === 0 && deltaX === 0) {
|
579
|
-
$el.makeActive();
|
580
|
-
$el.trigger('tap');
|
581
|
-
} else {
|
582
|
-
$el.removeClass('active');
|
583
|
-
}
|
584
|
-
$el.unbind('touchmove',touchmove).unbind('touchend',touchend);
|
585
|
-
clearTimeout(hoverTimeout);
|
586
|
-
}
|
587
|
-
|
588
|
-
function updateChanges() {
|
589
|
-
var first = event.changedTouches[0] || null;
|
590
|
-
deltaX = first.pageX - startX;
|
591
|
-
deltaY = first.pageY - startY;
|
592
|
-
deltaT = (new Date).getTime() - startTime;
|
593
|
-
}
|
594
|
-
|
595
|
-
} // End touch handler
|
596
|
-
|
597
|
-
// Public jQuery Fns
|
598
|
-
$.fn.unselect = function(obj) {
|
599
|
-
if (obj) {
|
600
|
-
obj.removeClass('active');
|
601
|
-
} else {
|
602
|
-
$('.active').removeClass('active');
|
603
|
-
}
|
604
|
-
}
|
605
|
-
$.fn.makeActive = function() {
|
606
|
-
return $(this).addClass('active');
|
607
|
-
}
|
608
|
-
$.fn.swipe = function(fn) {
|
609
|
-
if ($.isFunction(fn)) {
|
610
|
-
return $(this).bind('swipe', fn);
|
611
|
-
} else {
|
612
|
-
return $(this).trigger('swipe');
|
613
|
-
}
|
614
|
-
}
|
615
|
-
$.fn.tap = function(fn) {
|
616
|
-
if ($.isFunction(fn)) {
|
617
|
-
var tapEvent = (jQTSettings.useFastTouch && $.support.touch) ? 'tap' : 'click';
|
618
|
-
return $(this).live(tapEvent, fn);
|
619
|
-
} else {
|
620
|
-
return $(this).trigger('tap');
|
621
|
-
}
|
622
|
-
}
|
623
|
-
$.fn.isExternalLink = function() {
|
624
|
-
var $el = $(this);
|
625
|
-
return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('input[type="checkbox"], input[type="radio"], a[href^="http://maps.google.com:"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));
|
626
|
-
}
|
627
|
-
|
628
|
-
publicObj = {
|
629
|
-
getOrientation: getOrientation,
|
630
|
-
goBack: goBack,
|
631
|
-
goTo: goTo,
|
632
|
-
addAnimation: addAnimation,
|
633
|
-
submitForm: submitForm
|
634
|
-
}
|
635
|
-
|
636
|
-
return publicObj;
|
637
|
-
}
|
638
|
-
|
639
|
-
// Extensions directly manipulate the jQTouch object, before it's initialized.
|
640
|
-
$.jQTouch.prototype.extensions = [];
|
641
|
-
$.jQTouch.addExtension = function(extension) {
|
642
|
-
$.jQTouch.prototype.extensions.push(extension);
|
643
|
-
}
|
644
|
-
|
645
|
-
})(jQuery);
|
646
|
-
|
647
|
-
/*
|
648
|
-
|
649
|
-
_/ _/_/ _/_/_/_/_/ _/
|
650
|
-
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
651
|
-
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
652
|
-
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
653
|
-
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
654
|
-
_/
|
655
|
-
_/
|
656
|
-
|
657
|
-
Created by David Kaneda <http://www.davidkaneda.com>
|
658
|
-
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
659
|
-
|
660
|
-
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
661
|
-
and pinch/zoom <http://www.pinchzoom.com/>
|
662
|
-
|
663
|
-
(c) 2009 by jQTouch project members.
|
664
|
-
See LICENSE.txt for license.
|
665
|
-
|
666
|
-
*/
|
667
|
-
|
668
|
-
(function($) {
|
669
|
-
|
670
|
-
$.fn.transition = function(css, options) {
|
671
|
-
return this.each(function(){
|
672
|
-
var $el = $(this);
|
673
|
-
var defaults = {
|
674
|
-
speed : '300ms',
|
675
|
-
callback: null,
|
676
|
-
ease: 'ease-in-out'
|
677
|
-
};
|
678
|
-
var settings = $.extend({}, defaults, options);
|
679
|
-
if(settings.speed === 0) {
|
680
|
-
$el.css(css);
|
681
|
-
window.setTimeout(settings.callback, 0);
|
682
|
-
} else {
|
683
|
-
if ($.browser.safari)
|
684
|
-
{
|
685
|
-
var s = [];
|
686
|
-
for(var i in css) {
|
687
|
-
s.push(i);
|
688
|
-
}
|
689
|
-
$el.css({
|
690
|
-
webkitTransitionProperty: s.join(", "),
|
691
|
-
webkitTransitionDuration: settings.speed,
|
692
|
-
webkitTransitionTimingFunction: settings.ease
|
693
|
-
});
|
694
|
-
if (settings.callback) {
|
695
|
-
$el.one('webkitTransitionEnd', settings.callback);
|
696
|
-
}
|
697
|
-
setTimeout(function(el){ el.css(css) }, 0, $el);
|
698
|
-
}
|
699
|
-
else
|
700
|
-
{
|
701
|
-
$el.animate(css, settings.speed, settings.callback);
|
702
|
-
}
|
703
|
-
}
|
704
|
-
});
|
705
|
-
}
|
706
|
-
})(jQuery);
|
707
|
-
|
708
|
-
/*
|
709
|
-
|
710
|
-
_/ _/_/ _/_/_/_/_/ _/
|
711
|
-
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
712
|
-
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
713
|
-
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
714
|
-
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
715
|
-
_/
|
716
|
-
_/
|
717
|
-
|
718
|
-
Created by David Kaneda <http://www.davidkaneda.com>
|
719
|
-
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
720
|
-
|
721
|
-
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
722
|
-
and pinch/zoom <http://www.pinchzoom.com/>
|
723
|
-
|
724
|
-
(c) 2009 by jQTouch project members.
|
725
|
-
See LICENSE.txt for license.
|
726
|
-
|
727
|
-
*/
|
728
|
-
|
729
|
-
(function($) {
|
730
|
-
if ($.jQTouch)
|
731
|
-
{
|
732
|
-
$.jQTouch.addExtension(function AutoTitles(jQT){
|
733
|
-
|
734
|
-
var titleSelector='.toolbar h1';
|
735
|
-
|
736
|
-
$(function(){
|
737
|
-
$('#jqt').bind('pageAnimationStart', function(e, data){
|
738
|
-
if (data.direction === 'in'){
|
739
|
-
var $title = $(titleSelector, $(e.target));
|
740
|
-
var $ref = $(e.target).data('referrer');
|
741
|
-
if ($title.length && $ref){
|
742
|
-
$title.html($ref.text());
|
743
|
-
}
|
744
|
-
}
|
745
|
-
});
|
746
|
-
});
|
747
|
-
|
748
|
-
function setTitleSelector(ts){
|
749
|
-
titleSelector=ts;
|
750
|
-
}
|
751
|
-
|
752
|
-
return {
|
753
|
-
setTitleSelector: setTitleSelector
|
754
|
-
}
|
755
|
-
|
756
|
-
});
|
757
|
-
}
|
758
|
-
})(jQuery);
|
759
|
-
|
760
|
-
/*
|
761
|
-
|
762
|
-
_/ _/_/ _/_/_/_/_/ _/
|
763
|
-
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
764
|
-
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
765
|
-
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
766
|
-
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
767
|
-
_/
|
768
|
-
_/
|
769
|
-
|
770
|
-
Created by David Kaneda <http://www.davidkaneda.com>
|
771
|
-
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
772
|
-
|
773
|
-
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
774
|
-
and pinch/zoom <http://www.pinchzoom.com/>
|
775
|
-
|
776
|
-
(c) 2009 by jQTouch project members.
|
777
|
-
See LICENSE.txt for license.
|
778
|
-
|
779
|
-
*/
|
780
|
-
|
781
|
-
(function($) {
|
782
|
-
if ($.jQTouch)
|
783
|
-
{
|
784
|
-
$.jQTouch.addExtension(function Floaty(jQT){
|
785
|
-
|
786
|
-
$.fn.makeFloaty = function(options){
|
787
|
-
var defaults = {
|
788
|
-
align: 'top',
|
789
|
-
spacing: 20,
|
790
|
-
time: '.3s'
|
791
|
-
}
|
792
|
-
var settings = $.extend({}, defaults, options);
|
793
|
-
settings.align = (settings.align == 'top') ? 'top' : 'bottom';
|
794
|
-
|
795
|
-
return this.each(function(){
|
796
|
-
var $el = $(this);
|
797
|
-
|
798
|
-
$el.css({
|
799
|
-
'-webkit-transition': 'top ' + settings.time + ' ease-in-out',
|
800
|
-
'display': 'block',
|
801
|
-
'min-height': '0 !important'
|
802
|
-
}).data('settings', settings);
|
803
|
-
|
804
|
-
$(document).bind('scroll', function(){
|
805
|
-
if ($el.data('floatyVisible') === true)
|
806
|
-
{
|
807
|
-
$el.scrollFloaty();
|
808
|
-
}
|
809
|
-
});
|
810
|
-
$el.scrollFloaty();
|
811
|
-
});
|
812
|
-
}
|
813
|
-
|
814
|
-
$.fn.scrollFloaty = function(){
|
815
|
-
return this.each(function(){
|
816
|
-
var $el = $(this);
|
817
|
-
var settings = $el.data('settings');
|
818
|
-
var wHeight = $('html').attr('clientHeight'); // WRONG
|
819
|
-
|
820
|
-
var newY = window.pageYOffset +
|
821
|
-
((settings.align == 'top') ?
|
822
|
-
settings.spacing : wHeight - settings.spacing - $el.get(0).offsetHeight);
|
823
|
-
|
824
|
-
$el.css('top', newY).data('floatyVisible', true);
|
825
|
-
});
|
826
|
-
}
|
827
|
-
|
828
|
-
$.fn.hideFloaty = function(){
|
829
|
-
return this.each(function(){
|
830
|
-
var $el = $(this);
|
831
|
-
var oh = $el.get(0).offsetHeight;
|
832
|
-
|
833
|
-
$el.css('top', -oh-10).data('floatyVisible', false);
|
834
|
-
});
|
835
|
-
}
|
836
|
-
|
837
|
-
$.fn.toggleFloaty = function(){
|
838
|
-
return this.each(function(){
|
839
|
-
var $el = $(this);
|
840
|
-
if ($el.data('floatyVisible') === true){
|
841
|
-
$el.hideFloaty();
|
842
|
-
}
|
843
|
-
else
|
844
|
-
{
|
845
|
-
$el.scrollFloaty();
|
846
|
-
}
|
847
|
-
});
|
848
|
-
}
|
849
|
-
});
|
850
|
-
}
|
851
|
-
})(jQuery);
|
852
|
-
|
853
|
-
/*
|
854
|
-
|
855
|
-
_/ _/_/ _/_/_/_/_/ _/
|
856
|
-
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
857
|
-
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
858
|
-
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
859
|
-
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
860
|
-
_/
|
861
|
-
_/
|
862
|
-
|
863
|
-
Created by David Kaneda <http://www.davidkaneda.com>
|
864
|
-
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
865
|
-
|
866
|
-
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
867
|
-
and pinch/zoom <http://www.pinchzoom.com/>
|
868
|
-
|
869
|
-
(c) 2009 by jQTouch project members.
|
870
|
-
See LICENSE.txt for license.
|
871
|
-
|
872
|
-
*/
|
873
|
-
|
874
|
-
(function($) {
|
875
|
-
if ($.jQTouch)
|
876
|
-
{
|
877
|
-
$.jQTouch.addExtension(function Location(){
|
878
|
-
|
879
|
-
var latitude, longitude, callback;
|
880
|
-
|
881
|
-
function checkGeoLocation() {
|
882
|
-
return navigator.geolocation;
|
883
|
-
}
|
884
|
-
function updateLocation(fn) {
|
885
|
-
if (checkGeoLocation())
|
886
|
-
{
|
887
|
-
callback = fn;
|
888
|
-
navigator.geolocation.getCurrentPosition(savePosition);
|
889
|
-
return true;
|
890
|
-
} else {
|
891
|
-
console.log('Device not capable of geo-location.');
|
892
|
-
fn(false);
|
893
|
-
return false;
|
894
|
-
}
|
895
|
-
}
|
896
|
-
function savePosition(position) {
|
897
|
-
latitude = position.coords.latitude;
|
898
|
-
longitude = position.coords.longitude;
|
899
|
-
if (callback) {
|
900
|
-
callback(getLocation());
|
901
|
-
}
|
902
|
-
}
|
903
|
-
function getLocation() {
|
904
|
-
if (latitude && longitude) {
|
905
|
-
return {
|
906
|
-
latitude: latitude,
|
907
|
-
longitude: longitude
|
908
|
-
}
|
909
|
-
} else {
|
910
|
-
console.log('No location available. Try calling updateLocation() first.');
|
911
|
-
return false;
|
912
|
-
}
|
913
|
-
}
|
914
|
-
return {
|
915
|
-
updateLocation: updateLocation,
|
916
|
-
getLocation: getLocation
|
917
|
-
}
|
918
|
-
});
|
919
|
-
}
|
920
|
-
})(jQuery);
|
921
|
-
|
922
|
-
/*
|
923
|
-
|
924
|
-
_/ _/_/ _/_/_/_/_/ _/
|
925
|
-
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
926
|
-
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
927
|
-
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
928
|
-
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
929
|
-
_/
|
930
|
-
_/
|
931
|
-
|
932
|
-
Created by David Kaneda <http://www.davidkaneda.com>
|
933
|
-
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
934
|
-
|
935
|
-
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
936
|
-
|
937
|
-
Lots of this code is specifically derived from Jonathan's book,
|
938
|
-
"Building iPhone Apps with HTML, CSS, and JavaScript"
|
939
|
-
|
940
|
-
(c) 2009 by jQTouch project members.
|
941
|
-
See LICENSE.txt for license.
|
942
|
-
|
943
|
-
*/
|
944
|
-
|
945
|
-
(function($) {
|
946
|
-
if ($.jQTouch)
|
947
|
-
{
|
948
|
-
$.jQTouch.addExtension(function Offline(){
|
949
|
-
|
950
|
-
// Convenience array of status values
|
951
|
-
var cacheStatusValues = [];
|
952
|
-
cacheStatusValues[0] = 'uncached';
|
953
|
-
cacheStatusValues[1] = 'idle';
|
954
|
-
cacheStatusValues[2] = 'checking';
|
955
|
-
cacheStatusValues[3] = 'downloading';
|
956
|
-
cacheStatusValues[4] = 'updateready';
|
957
|
-
cacheStatusValues[5] = 'obsolete';
|
958
|
-
|
959
|
-
// Listeners for all possible events
|
960
|
-
var cache = window.applicationCache;
|
961
|
-
//cache.addEventListener('cached', logEvent, false);
|
962
|
-
//cache.addEventListener('checking', logEvent, false);
|
963
|
-
//cache.addEventListener('downloading', logEvent, false);
|
964
|
-
//cache.addEventListener('error', logEvent, false);
|
965
|
-
//cache.addEventListener('noupdate', logEvent, false);
|
966
|
-
//cache.addEventListener('obsolete', logEvent, false);
|
967
|
-
//cache.addEventListener('progress', logEvent, false);
|
968
|
-
//cache.addEventListener('updateready', logEvent, false);
|
969
|
-
window.addEventListener('cached', logEvent, false);
|
970
|
-
window.addEventListener('checking', logEvent, false);
|
971
|
-
window.addEventListener('downloading', logEvent, false);
|
972
|
-
window.addEventListener('error', logEvent, false);
|
973
|
-
window.addEventListener('noupdate', logEvent, false);
|
974
|
-
window.addEventListener('obsolete', logEvent, false);
|
975
|
-
window.addEventListener('progress', logEvent, false);
|
976
|
-
window.addEventListener('updateready', logEvent, false);
|
977
|
-
|
978
|
-
// Log every event to the console
|
979
|
-
function logEvent(e) {
|
980
|
-
var online, status, type, message;
|
981
|
-
online = (isOnline()) ? 'yes' : 'no';
|
982
|
-
status = cacheStatusValues[cache.status];
|
983
|
-
type = e.type;
|
984
|
-
message = 'online: ' + online;
|
985
|
-
message+= ', event: ' + type;
|
986
|
-
message+= ', status: ' + status;
|
987
|
-
if (type == 'error' && navigator.onLine) {
|
988
|
-
message+= ' There was an unknown error, check your Cache Manifest.';
|
989
|
-
}
|
990
|
-
console.log(message);
|
991
|
-
}
|
992
|
-
|
993
|
-
function isOnline() {
|
994
|
-
return navigator.onLine;
|
995
|
-
}
|
996
|
-
|
997
|
-
if (!$('html').attr('manifest')) {
|
998
|
-
console.log('No Cache Manifest listed on the <html> tag.')
|
999
|
-
}
|
1000
|
-
|
1001
|
-
// Swap in newly download files when update is ready
|
1002
|
-
//cache.addEventListener('updateready', function(e){
|
1003
|
-
window.addEventListener('updateready', function(e){
|
1004
|
-
// Don't perform "swap" if this is the first cache
|
1005
|
-
if (cacheStatusValues[cache.status] != 'idle') {
|
1006
|
-
cache.swapCache();
|
1007
|
-
console.log('Swapped/updated the Cache Manifest.');
|
1008
|
-
}
|
1009
|
-
}
|
1010
|
-
, false);
|
1011
|
-
|
1012
|
-
// These two functions check for updates to the manifest file
|
1013
|
-
function checkForUpdates(){
|
1014
|
-
cache.update();
|
1015
|
-
}
|
1016
|
-
function autoCheckForUpdates(){
|
1017
|
-
setInterval(function(){cache.update()}, 10000);
|
1018
|
-
}
|
1019
|
-
|
1020
|
-
return {
|
1021
|
-
isOnline: isOnline,
|
1022
|
-
checkForUpdates: checkForUpdates,
|
1023
|
-
autoCheckForUpdates: autoCheckForUpdates
|
1024
|
-
}
|
1025
|
-
});
|
1026
|
-
}
|
1
|
+
/*
|
2
|
+
|
3
|
+
_/ _/_/ _/_/_/_/_/ _/
|
4
|
+
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
5
|
+
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
6
|
+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
7
|
+
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
8
|
+
_/
|
9
|
+
_/
|
10
|
+
|
11
|
+
Created by David Kaneda <http://www.davidkaneda.com>
|
12
|
+
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
13
|
+
|
14
|
+
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
15
|
+
and pinch/zoom <http://www.pinchzoom.com/>
|
16
|
+
|
17
|
+
(c) 2009 by jQTouch project members.
|
18
|
+
See LICENSE.txt for license.
|
19
|
+
|
20
|
+
$Revision: 147 $
|
21
|
+
$Date: 2010-04-19 03:45:31 +0200 (Mo, 19. Apr 2010) $
|
22
|
+
$LastChangedBy: davidcolbykaneda $
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
(function($) {
|
27
|
+
$.jQTouch = function(options) {
|
28
|
+
|
29
|
+
// Set support values
|
30
|
+
$.support.WebKitCSSMatrix = (typeof WebKitCSSMatrix == "object");
|
31
|
+
$.support.touch = (typeof Touch == "object");
|
32
|
+
$.support.WebKitAnimationEvent = (typeof WebKitTransitionEvent == "object");
|
33
|
+
|
34
|
+
// Initialize internal variables
|
35
|
+
var $body,
|
36
|
+
$head=$('head'),
|
37
|
+
hist=[],
|
38
|
+
newPageCount=0,
|
39
|
+
jQTSettings={},
|
40
|
+
hashCheckInterval,
|
41
|
+
currentPage,
|
42
|
+
orientation,
|
43
|
+
isMobileWebKit = RegExp(" Mobile/").test(navigator.userAgent),
|
44
|
+
tapReady=true,
|
45
|
+
lastAnimationTime=0,
|
46
|
+
touchSelectors=[],
|
47
|
+
publicObj={},
|
48
|
+
extensions=$.jQTouch.prototype.extensions,
|
49
|
+
defaultAnimations=['slide','flip','slideup','swap','cube','pop','dissolve','fade','back'],
|
50
|
+
animations=[],
|
51
|
+
hairextensions='';
|
52
|
+
// Get the party started
|
53
|
+
init(options);
|
54
|
+
|
55
|
+
function init(options) {
|
56
|
+
|
57
|
+
var defaults = {
|
58
|
+
addGlossToIcon: true,
|
59
|
+
backSelector: '.back, .cancel, .goback',
|
60
|
+
cacheGetRequests: true,
|
61
|
+
cubeSelector: '.cube',
|
62
|
+
dissolveSelector: '.dissolve',
|
63
|
+
fadeSelector: '.fade',
|
64
|
+
fixedViewport: true,
|
65
|
+
flipSelector: '.flip',
|
66
|
+
formSelector: 'form',
|
67
|
+
fullScreen: true,
|
68
|
+
fullScreenClass: 'fullscreen',
|
69
|
+
icon: null,
|
70
|
+
touchSelector: 'a, .touch',
|
71
|
+
popSelector: '.pop',
|
72
|
+
preloadImages: false,
|
73
|
+
slideSelector: '#jqt > * > ul li a, .slide',
|
74
|
+
slideupSelector: '.slideup',
|
75
|
+
startupScreen: null,
|
76
|
+
statusBar: 'default', // other options: black-translucent, black
|
77
|
+
submitSelector: '.submit',
|
78
|
+
swapSelector: '.swap',
|
79
|
+
useAnimations: true,
|
80
|
+
useFastTouch: true // Experimental.
|
81
|
+
};
|
82
|
+
jQTSettings = $.extend({}, defaults, options);
|
83
|
+
|
84
|
+
// Preload images
|
85
|
+
if (jQTSettings.preloadImages) {
|
86
|
+
for (var i = jQTSettings.preloadImages.length - 1; i >= 0; i--) {
|
87
|
+
(new Image()).src = jQTSettings.preloadImages[i];
|
88
|
+
};
|
89
|
+
}
|
90
|
+
// Set icon
|
91
|
+
if (jQTSettings.icon) {
|
92
|
+
var precomposed = (jQTSettings.addGlossToIcon) ? '' : '-precomposed';
|
93
|
+
hairextensions += '<link rel="apple-touch-icon' + precomposed + '" href="' + jQTSettings.icon + '" />';
|
94
|
+
}
|
95
|
+
// Set startup screen
|
96
|
+
if (jQTSettings.startupScreen) {
|
97
|
+
hairextensions += '<link rel="apple-touch-startup-image" href="' + jQTSettings.startupScreen + '" />';
|
98
|
+
}
|
99
|
+
// Set viewport
|
100
|
+
if (jQTSettings.fixedViewport) {
|
101
|
+
hairextensions += '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>';
|
102
|
+
}
|
103
|
+
// Set full-screen
|
104
|
+
if (jQTSettings.fullScreen) {
|
105
|
+
hairextensions += '<meta name="apple-mobile-web-app-capable" content="yes" />';
|
106
|
+
if (jQTSettings.statusBar) {
|
107
|
+
hairextensions += '<meta name="apple-mobile-web-app-status-bar-style" content="' + jQTSettings.statusBar + '" />';
|
108
|
+
}
|
109
|
+
}
|
110
|
+
if (hairextensions) {
|
111
|
+
$head.prepend(hairextensions);
|
112
|
+
}
|
113
|
+
|
114
|
+
// Initialize on document ready:
|
115
|
+
$(document).ready(function() {
|
116
|
+
|
117
|
+
// Add extensions
|
118
|
+
for (var i in extensions) {
|
119
|
+
var fn = extensions[i];
|
120
|
+
if ($.isFunction(fn)) {
|
121
|
+
$.extend(publicObj, fn(publicObj));
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
// Add animations
|
126
|
+
for (var i in defaultAnimations) {
|
127
|
+
var name = defaultAnimations[i];
|
128
|
+
var selector = jQTSettings[name + 'Selector'];
|
129
|
+
if (typeof(selector) == 'string') {
|
130
|
+
addAnimation({name:name, selector:selector});
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
touchSelectors.push('input');
|
135
|
+
touchSelectors.push(jQTSettings.touchSelector);
|
136
|
+
touchSelectors.push(jQTSettings.backSelector);
|
137
|
+
touchSelectors.push(jQTSettings.submitSelector);
|
138
|
+
$(touchSelectors.join(', ')).css('-webkit-touch-callout', 'none');
|
139
|
+
$(jQTSettings.backSelector).tap(liveTap);
|
140
|
+
$(jQTSettings.submitSelector).tap(submitParentForm);
|
141
|
+
|
142
|
+
$body = $('#jqt');
|
143
|
+
|
144
|
+
if (jQTSettings.fullScreenClass && window.navigator.standalone == true) {
|
145
|
+
$body.addClass(jQTSettings.fullScreenClass + ' ' + jQTSettings.statusBar);
|
146
|
+
}
|
147
|
+
|
148
|
+
// Create custom live events
|
149
|
+
$body
|
150
|
+
.bind('touchstart', handleTouch)
|
151
|
+
.bind('orientationchange', updateOrientation)
|
152
|
+
.trigger('orientationchange')
|
153
|
+
.submit(submitForm);
|
154
|
+
|
155
|
+
if (jQTSettings.useFastTouch && $.support.touch) {
|
156
|
+
$body.click(function(e) {
|
157
|
+
var $el = $(e.target);
|
158
|
+
|
159
|
+
if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA' && $el.attr('nodeName')!=='INPUT') {
|
160
|
+
$el = $el.closest('a, area');
|
161
|
+
}
|
162
|
+
|
163
|
+
if ($el.isExternalLink()) {
|
164
|
+
return true;
|
165
|
+
} else {
|
166
|
+
return false;
|
167
|
+
}
|
168
|
+
});
|
169
|
+
|
170
|
+
// This additionally gets rid of form focusses
|
171
|
+
$body.mousedown(function(e) {
|
172
|
+
var timeDiff = (new Date()).getTime() - lastAnimationTime;
|
173
|
+
if (timeDiff < 200) {
|
174
|
+
return false;
|
175
|
+
}
|
176
|
+
});
|
177
|
+
}
|
178
|
+
|
179
|
+
// Make sure exactly one child of body has "current" class
|
180
|
+
if ($('#jqt > .current').length == 0) {
|
181
|
+
currentPage = $('#jqt > *:first');
|
182
|
+
} else {
|
183
|
+
currentPage = $('#jqt > .current:first');
|
184
|
+
$('#jqt > .current').removeClass('current');
|
185
|
+
}
|
186
|
+
|
187
|
+
// Go to the top of the "current" page
|
188
|
+
$(currentPage).addClass('current');
|
189
|
+
location.hash = '#' + $(currentPage).attr('id');
|
190
|
+
addPageToHistory(currentPage);
|
191
|
+
scrollTo(0, 0);
|
192
|
+
startHashCheck();
|
193
|
+
});
|
194
|
+
}
|
195
|
+
|
196
|
+
// PUBLIC FUNCTIONS
|
197
|
+
function goBack(to) {
|
198
|
+
// Init the param
|
199
|
+
if (hist.length <= 1)
|
200
|
+
{
|
201
|
+
window.history.go(-2);
|
202
|
+
}
|
203
|
+
|
204
|
+
var numberOfPages = Math.min(parseInt(to || 1, 10), hist.length-1),
|
205
|
+
curPage = hist[0];
|
206
|
+
|
207
|
+
// Search through the history for an ID
|
208
|
+
if(isNaN(numberOfPages) && typeof(to) === "string" && to != '#' ) {
|
209
|
+
for( var i=1, length=hist.length; i < length; i++ ) {
|
210
|
+
if( '#' + hist[i].id === to ) {
|
211
|
+
numberOfPages = i;
|
212
|
+
break;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}
|
216
|
+
|
217
|
+
// If still nothing, assume one
|
218
|
+
if(isNaN(numberOfPages) || numberOfPages < 1) {
|
219
|
+
numberOfPages = 1;
|
220
|
+
};
|
221
|
+
|
222
|
+
if (hist.length > 1) {
|
223
|
+
// Remove all pages in front of the target page
|
224
|
+
hist.splice(0, numberOfPages);
|
225
|
+
animatePages(curPage.page, hist[0].page, curPage.animation, curPage.reverse === false);
|
226
|
+
} else {
|
227
|
+
location.hash = '#' + curPage.id;
|
228
|
+
}
|
229
|
+
|
230
|
+
return publicObj;
|
231
|
+
}
|
232
|
+
function goTo(toPage, animation, reverse) {
|
233
|
+
var fromPage = hist[0].page;
|
234
|
+
|
235
|
+
if (typeof(animation) === 'string') {
|
236
|
+
for (var i = animations.length - 1; i >= 0; i--) {
|
237
|
+
if (animations[i].name === animation) {
|
238
|
+
animation = animations[i];
|
239
|
+
break;
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
if (typeof(toPage) === 'string') {
|
244
|
+
nextPage = $(toPage);
|
245
|
+
if (nextPage.length < 1)
|
246
|
+
{
|
247
|
+
showPageByHref(toPage, {
|
248
|
+
'animation': animation
|
249
|
+
});
|
250
|
+
return;
|
251
|
+
}
|
252
|
+
else
|
253
|
+
{
|
254
|
+
toPage = nextPage;
|
255
|
+
}
|
256
|
+
|
257
|
+
}
|
258
|
+
if (animatePages(fromPage, toPage, animation, reverse)) {
|
259
|
+
addPageToHistory(toPage, animation, reverse);
|
260
|
+
return publicObj;
|
261
|
+
} else {
|
262
|
+
console.error('Could not animate pages.');
|
263
|
+
return false;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
function getOrientation() {
|
267
|
+
return orientation;
|
268
|
+
}
|
269
|
+
|
270
|
+
// PRIVATE FUNCTIONS
|
271
|
+
function liveTap(e){
|
272
|
+
|
273
|
+
// Grab the clicked element
|
274
|
+
var $el = $(e.target);
|
275
|
+
|
276
|
+
if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA') {
|
277
|
+
$el = $el.closest('a, area');
|
278
|
+
}
|
279
|
+
|
280
|
+
var target = $el.attr('target'),
|
281
|
+
hash = $el.attr('hash'),
|
282
|
+
animation=null;
|
283
|
+
|
284
|
+
if (tapReady == false || !$el.length) {
|
285
|
+
console.warn('Not able to tap element.');
|
286
|
+
return false;
|
287
|
+
}
|
288
|
+
|
289
|
+
if ($el.isExternalLink()) {
|
290
|
+
$el.removeClass('active');
|
291
|
+
return true;
|
292
|
+
}
|
293
|
+
|
294
|
+
// Figure out the animation to use
|
295
|
+
for (var i = animations.length - 1; i >= 0; i--) {
|
296
|
+
if ($el.is(animations[i].selector)) {
|
297
|
+
animation = animations[i];
|
298
|
+
break;
|
299
|
+
}
|
300
|
+
};
|
301
|
+
|
302
|
+
// User clicked an internal link, fullscreen mode
|
303
|
+
if (target == '_webapp') {
|
304
|
+
window.location = $el.attr('href');
|
305
|
+
}
|
306
|
+
// User clicked a back button
|
307
|
+
else if ($el.is(jQTSettings.backSelector)) {
|
308
|
+
goBack(hash);
|
309
|
+
}
|
310
|
+
// Allow tap on item with no href
|
311
|
+
else if ($el.attr('href') == '#') {
|
312
|
+
$el.unselect();
|
313
|
+
return true;
|
314
|
+
}
|
315
|
+
// Branch on internal or external href
|
316
|
+
else if (hash && hash!='#') {
|
317
|
+
$el.addClass('active');
|
318
|
+
goTo($(hash).data('referrer', $el), animation, $(this).hasClass('reverse'));
|
319
|
+
} else {
|
320
|
+
$el.addClass('loading active');
|
321
|
+
showPageByHref($el.attr('href'), {
|
322
|
+
animation: animation,
|
323
|
+
callback: function() {
|
324
|
+
$el.removeClass('loading'); setTimeout($.fn.unselect, 250, $el);
|
325
|
+
},
|
326
|
+
$referrer: $el
|
327
|
+
});
|
328
|
+
}
|
329
|
+
return false;
|
330
|
+
}
|
331
|
+
function addPageToHistory(page, animation, reverse) {
|
332
|
+
// Grab some info
|
333
|
+
var pageId = page.attr('id');
|
334
|
+
// Prepend info to page history
|
335
|
+
hist.unshift({
|
336
|
+
page: page,
|
337
|
+
animation: animation,
|
338
|
+
reverse: reverse || false,
|
339
|
+
id: pageId
|
340
|
+
});
|
341
|
+
}
|
342
|
+
function animatePages(fromPage, toPage, animation, backwards) {
|
343
|
+
// Error check for target page
|
344
|
+
if (toPage.length === 0) {
|
345
|
+
$.fn.unselect();
|
346
|
+
console.error('Target element is missing.');
|
347
|
+
return false;
|
348
|
+
}
|
349
|
+
|
350
|
+
// Error check for fromPage=toPage
|
351
|
+
if (toPage.hasClass('current')) {
|
352
|
+
$.fn.unselect();
|
353
|
+
console.error('Target element is the current page.');
|
354
|
+
return false;
|
355
|
+
}
|
356
|
+
|
357
|
+
// Collapse the keyboard
|
358
|
+
$(':focus').blur();
|
359
|
+
|
360
|
+
fromPage.css('top', -window.pageYOffset);
|
361
|
+
toPage.css('top', 0);
|
362
|
+
|
363
|
+
// Make sure we are scrolled up to hide location bar
|
364
|
+
scrollTo(0, 0);
|
365
|
+
|
366
|
+
// Define callback to run after animation completes
|
367
|
+
var callback = function animationEnd(event) {
|
368
|
+
if (animation) {
|
369
|
+
toPage.removeClass('in ' + animation.name);
|
370
|
+
fromPage.removeClass('current out ' + animation.name);
|
371
|
+
if (backwards) {
|
372
|
+
toPage.toggleClass('reverse');
|
373
|
+
fromPage.toggleClass('reverse');
|
374
|
+
}
|
375
|
+
} else {
|
376
|
+
fromPage.removeClass('current');
|
377
|
+
}
|
378
|
+
|
379
|
+
toPage.trigger('pageAnimationEnd', { direction: 'in' });
|
380
|
+
fromPage.trigger('pageAnimationEnd', { direction: 'out' });
|
381
|
+
|
382
|
+
clearInterval(hashCheckInterval);
|
383
|
+
currentPage = toPage;
|
384
|
+
location.hash = '#' + currentPage.attr('id');
|
385
|
+
startHashCheck();
|
386
|
+
|
387
|
+
var $originallink = toPage.data('referrer');
|
388
|
+
if ($originallink) {
|
389
|
+
$originallink.unselect();
|
390
|
+
}
|
391
|
+
lastAnimationTime = (new Date()).getTime();
|
392
|
+
tapReady = true;
|
393
|
+
}
|
394
|
+
|
395
|
+
fromPage.trigger('pageAnimationStart', { direction: 'out' });
|
396
|
+
toPage.trigger('pageAnimationStart', { direction: 'in' });
|
397
|
+
|
398
|
+
if ($.support.WebKitAnimationEvent && animation && jQTSettings.useAnimations) {
|
399
|
+
toPage.one('webkitAnimationEnd', callback);
|
400
|
+
tapReady = false;
|
401
|
+
if (backwards) {
|
402
|
+
toPage.toggleClass('reverse');
|
403
|
+
fromPage.toggleClass('reverse');
|
404
|
+
}
|
405
|
+
toPage.addClass(animation.name + ' in current');
|
406
|
+
fromPage.addClass(animation.name + ' out');
|
407
|
+
|
408
|
+
} else {
|
409
|
+
toPage.addClass('current');
|
410
|
+
callback();
|
411
|
+
}
|
412
|
+
|
413
|
+
return true;
|
414
|
+
}
|
415
|
+
function hashCheck() {
|
416
|
+
var curid = currentPage.attr('id');
|
417
|
+
if (location.hash != '#' + curid) {
|
418
|
+
clearInterval(hashCheckInterval);
|
419
|
+
goBack(location.hash);
|
420
|
+
}
|
421
|
+
else if (location.hash == '') {
|
422
|
+
location.hash = '#' + curid;
|
423
|
+
}
|
424
|
+
}
|
425
|
+
function startHashCheck() {
|
426
|
+
hashCheckInterval = setInterval(hashCheck, 100);
|
427
|
+
}
|
428
|
+
function insertPages(nodes, animation) {
|
429
|
+
var targetPage = null;
|
430
|
+
$(nodes).each(function(index, node) {
|
431
|
+
var $node = $(this);
|
432
|
+
if (!$node.attr('id')) {
|
433
|
+
$node.attr('id', 'page-' + (++newPageCount));
|
434
|
+
}
|
435
|
+
|
436
|
+
$body.trigger('pageInserted', {page: $node.appendTo($body)});
|
437
|
+
|
438
|
+
if ($node.hasClass('current') || !targetPage) {
|
439
|
+
targetPage = $node;
|
440
|
+
}
|
441
|
+
});
|
442
|
+
if (targetPage !== null) {
|
443
|
+
goTo(targetPage, animation);
|
444
|
+
return targetPage;
|
445
|
+
} else {
|
446
|
+
return false;
|
447
|
+
}
|
448
|
+
}
|
449
|
+
function showPageByHref(href, options) {
|
450
|
+
var defaults = {
|
451
|
+
data: null,
|
452
|
+
method: 'GET',
|
453
|
+
animation: null,
|
454
|
+
callback: null,
|
455
|
+
$referrer: null
|
456
|
+
};
|
457
|
+
|
458
|
+
var settings = $.extend({}, defaults, options);
|
459
|
+
|
460
|
+
if (href != '#') {
|
461
|
+
$.ajax({
|
462
|
+
url: href,
|
463
|
+
data: settings.data,
|
464
|
+
type: settings.method,
|
465
|
+
success: function (data, textStatus) {
|
466
|
+
var firstPage = insertPages(data, settings.animation);
|
467
|
+
if (firstPage) {
|
468
|
+
if (settings.method == 'GET' && jQTSettings.cacheGetRequests === true && settings.$referrer) {
|
469
|
+
settings.$referrer.attr('href', '#' + firstPage.attr('id'));
|
470
|
+
}
|
471
|
+
if (settings.callback) {
|
472
|
+
settings.callback(true);
|
473
|
+
}
|
474
|
+
}
|
475
|
+
},
|
476
|
+
error: function (data) {
|
477
|
+
if (settings.$referrer) {
|
478
|
+
settings.$referrer.unselect();
|
479
|
+
}
|
480
|
+
if (settings.callback) {
|
481
|
+
settings.callback(false);
|
482
|
+
}
|
483
|
+
}
|
484
|
+
});
|
485
|
+
}
|
486
|
+
else if (settings.$referrer) {
|
487
|
+
settings.$referrer.unselect();
|
488
|
+
}
|
489
|
+
}
|
490
|
+
function submitForm(e, callback) {
|
491
|
+
var $form = (typeof(e)==='string') ? $(e).eq(0) : (e.target ? $(e.target) : $(e));
|
492
|
+
|
493
|
+
if ($form.length && $form.is(jQTSettings.formSelector)) {
|
494
|
+
showPageByHref($form.attr('action'), {
|
495
|
+
data: $form.serialize(),
|
496
|
+
method: $form.attr('method') || "POST",
|
497
|
+
animation: animations[0] || null,
|
498
|
+
callback: callback
|
499
|
+
});
|
500
|
+
return false;
|
501
|
+
}
|
502
|
+
return true;
|
503
|
+
}
|
504
|
+
function submitParentForm(e) {
|
505
|
+
var $form = $(this).closest('form');
|
506
|
+
if ($form.length) {
|
507
|
+
var evt = $.Event("submit");
|
508
|
+
evt.preventDefault();
|
509
|
+
$form.trigger(evt);
|
510
|
+
return false;
|
511
|
+
}
|
512
|
+
return true;
|
513
|
+
}
|
514
|
+
function addAnimation(animation) {
|
515
|
+
if (typeof(animation.selector) == 'string' && typeof(animation.name) == 'string') {
|
516
|
+
animations.push(animation);
|
517
|
+
$(animation.selector).tap(liveTap);
|
518
|
+
touchSelectors.push(animation.selector);
|
519
|
+
}
|
520
|
+
}
|
521
|
+
function updateOrientation() {
|
522
|
+
orientation = Math.abs(window.orientation) == 90 ? 'landscape' : 'profile';
|
523
|
+
$body.removeClass('profile landscape').addClass(orientation).trigger('turn', {orientation: orientation});
|
524
|
+
// scrollTo(0, 0);
|
525
|
+
}
|
526
|
+
function handleTouch(e) {
|
527
|
+
var $el = $(e.target);
|
528
|
+
|
529
|
+
// Only handle touchSelectors
|
530
|
+
if (!$(e.target).is(touchSelectors.join(', '))) {
|
531
|
+
var $link = $(e.target).closest('a, area');
|
532
|
+
|
533
|
+
if ($link.length && $link.is(touchSelectors.join(', '))) {
|
534
|
+
$el = $link;
|
535
|
+
} else {
|
536
|
+
return;
|
537
|
+
}
|
538
|
+
}
|
539
|
+
|
540
|
+
if (e) {
|
541
|
+
var hoverTimeout = null,
|
542
|
+
startX = event.changedTouches[0].clientX,
|
543
|
+
startY = event.changedTouches[0].clientY,
|
544
|
+
startTime = (new Date).getTime(),
|
545
|
+
deltaX = 0,
|
546
|
+
deltaY = 0,
|
547
|
+
deltaT = 0;
|
548
|
+
|
549
|
+
// Let's bind these after the fact, so we can keep some internal values
|
550
|
+
$el.bind('touchmove', touchmove).bind('touchend', touchend);
|
551
|
+
|
552
|
+
hoverTimeout = setTimeout(function() {
|
553
|
+
$el.makeActive();
|
554
|
+
}, 100);
|
555
|
+
|
556
|
+
}
|
557
|
+
|
558
|
+
// Private touch functions (TODO: insert dirty joke)
|
559
|
+
function touchmove(e) {
|
560
|
+
|
561
|
+
updateChanges();
|
562
|
+
var absX = Math.abs(deltaX);
|
563
|
+
var absY = Math.abs(deltaY);
|
564
|
+
|
565
|
+
// Check for swipe
|
566
|
+
if (absX > absY && (absX > 35) && deltaT < 1000) {
|
567
|
+
$el.trigger('swipe', {direction: (deltaX < 0) ? 'left' : 'right', deltaX: deltaX, deltaY: deltaY }).unbind('touchmove',touchmove).unbind('touchend',touchend);
|
568
|
+
} else if (absY > 1) {
|
569
|
+
$el.removeClass('active');
|
570
|
+
}
|
571
|
+
|
572
|
+
clearTimeout(hoverTimeout);
|
573
|
+
}
|
574
|
+
|
575
|
+
function touchend() {
|
576
|
+
updateChanges();
|
577
|
+
|
578
|
+
if (deltaY === 0 && deltaX === 0) {
|
579
|
+
$el.makeActive();
|
580
|
+
$el.trigger('tap');
|
581
|
+
} else {
|
582
|
+
$el.removeClass('active');
|
583
|
+
}
|
584
|
+
$el.unbind('touchmove',touchmove).unbind('touchend',touchend);
|
585
|
+
clearTimeout(hoverTimeout);
|
586
|
+
}
|
587
|
+
|
588
|
+
function updateChanges() {
|
589
|
+
var first = event.changedTouches[0] || null;
|
590
|
+
deltaX = first.pageX - startX;
|
591
|
+
deltaY = first.pageY - startY;
|
592
|
+
deltaT = (new Date).getTime() - startTime;
|
593
|
+
}
|
594
|
+
|
595
|
+
} // End touch handler
|
596
|
+
|
597
|
+
// Public jQuery Fns
|
598
|
+
$.fn.unselect = function(obj) {
|
599
|
+
if (obj) {
|
600
|
+
obj.removeClass('active');
|
601
|
+
} else {
|
602
|
+
$('.active').removeClass('active');
|
603
|
+
}
|
604
|
+
}
|
605
|
+
$.fn.makeActive = function() {
|
606
|
+
return $(this).addClass('active');
|
607
|
+
}
|
608
|
+
$.fn.swipe = function(fn) {
|
609
|
+
if ($.isFunction(fn)) {
|
610
|
+
return $(this).bind('swipe', fn);
|
611
|
+
} else {
|
612
|
+
return $(this).trigger('swipe');
|
613
|
+
}
|
614
|
+
}
|
615
|
+
$.fn.tap = function(fn) {
|
616
|
+
if ($.isFunction(fn)) {
|
617
|
+
var tapEvent = (jQTSettings.useFastTouch && $.support.touch) ? 'tap' : 'click';
|
618
|
+
return $(this).live(tapEvent, fn);
|
619
|
+
} else {
|
620
|
+
return $(this).trigger('tap');
|
621
|
+
}
|
622
|
+
}
|
623
|
+
$.fn.isExternalLink = function() {
|
624
|
+
var $el = $(this);
|
625
|
+
return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('input[type="checkbox"], input[type="radio"], a[href^="http://maps.google.com:"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));
|
626
|
+
}
|
627
|
+
|
628
|
+
publicObj = {
|
629
|
+
getOrientation: getOrientation,
|
630
|
+
goBack: goBack,
|
631
|
+
goTo: goTo,
|
632
|
+
addAnimation: addAnimation,
|
633
|
+
submitForm: submitForm
|
634
|
+
}
|
635
|
+
|
636
|
+
return publicObj;
|
637
|
+
}
|
638
|
+
|
639
|
+
// Extensions directly manipulate the jQTouch object, before it's initialized.
|
640
|
+
$.jQTouch.prototype.extensions = [];
|
641
|
+
$.jQTouch.addExtension = function(extension) {
|
642
|
+
$.jQTouch.prototype.extensions.push(extension);
|
643
|
+
}
|
644
|
+
|
645
|
+
})(jQuery);
|
646
|
+
|
647
|
+
/*
|
648
|
+
|
649
|
+
_/ _/_/ _/_/_/_/_/ _/
|
650
|
+
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
651
|
+
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
652
|
+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
653
|
+
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
654
|
+
_/
|
655
|
+
_/
|
656
|
+
|
657
|
+
Created by David Kaneda <http://www.davidkaneda.com>
|
658
|
+
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
659
|
+
|
660
|
+
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
661
|
+
and pinch/zoom <http://www.pinchzoom.com/>
|
662
|
+
|
663
|
+
(c) 2009 by jQTouch project members.
|
664
|
+
See LICENSE.txt for license.
|
665
|
+
|
666
|
+
*/
|
667
|
+
|
668
|
+
(function($) {
|
669
|
+
|
670
|
+
$.fn.transition = function(css, options) {
|
671
|
+
return this.each(function(){
|
672
|
+
var $el = $(this);
|
673
|
+
var defaults = {
|
674
|
+
speed : '300ms',
|
675
|
+
callback: null,
|
676
|
+
ease: 'ease-in-out'
|
677
|
+
};
|
678
|
+
var settings = $.extend({}, defaults, options);
|
679
|
+
if(settings.speed === 0) {
|
680
|
+
$el.css(css);
|
681
|
+
window.setTimeout(settings.callback, 0);
|
682
|
+
} else {
|
683
|
+
if ($.browser.safari)
|
684
|
+
{
|
685
|
+
var s = [];
|
686
|
+
for(var i in css) {
|
687
|
+
s.push(i);
|
688
|
+
}
|
689
|
+
$el.css({
|
690
|
+
webkitTransitionProperty: s.join(", "),
|
691
|
+
webkitTransitionDuration: settings.speed,
|
692
|
+
webkitTransitionTimingFunction: settings.ease
|
693
|
+
});
|
694
|
+
if (settings.callback) {
|
695
|
+
$el.one('webkitTransitionEnd', settings.callback);
|
696
|
+
}
|
697
|
+
setTimeout(function(el){ el.css(css) }, 0, $el);
|
698
|
+
}
|
699
|
+
else
|
700
|
+
{
|
701
|
+
$el.animate(css, settings.speed, settings.callback);
|
702
|
+
}
|
703
|
+
}
|
704
|
+
});
|
705
|
+
}
|
706
|
+
})(jQuery);
|
707
|
+
|
708
|
+
/*
|
709
|
+
|
710
|
+
_/ _/_/ _/_/_/_/_/ _/
|
711
|
+
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
712
|
+
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
713
|
+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
714
|
+
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
715
|
+
_/
|
716
|
+
_/
|
717
|
+
|
718
|
+
Created by David Kaneda <http://www.davidkaneda.com>
|
719
|
+
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
720
|
+
|
721
|
+
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
722
|
+
and pinch/zoom <http://www.pinchzoom.com/>
|
723
|
+
|
724
|
+
(c) 2009 by jQTouch project members.
|
725
|
+
See LICENSE.txt for license.
|
726
|
+
|
727
|
+
*/
|
728
|
+
|
729
|
+
(function($) {
|
730
|
+
if ($.jQTouch)
|
731
|
+
{
|
732
|
+
$.jQTouch.addExtension(function AutoTitles(jQT){
|
733
|
+
|
734
|
+
var titleSelector='.toolbar h1';
|
735
|
+
|
736
|
+
$(function(){
|
737
|
+
$('#jqt').bind('pageAnimationStart', function(e, data){
|
738
|
+
if (data.direction === 'in'){
|
739
|
+
var $title = $(titleSelector, $(e.target));
|
740
|
+
var $ref = $(e.target).data('referrer');
|
741
|
+
if ($title.length && $ref){
|
742
|
+
$title.html($ref.text());
|
743
|
+
}
|
744
|
+
}
|
745
|
+
});
|
746
|
+
});
|
747
|
+
|
748
|
+
function setTitleSelector(ts){
|
749
|
+
titleSelector=ts;
|
750
|
+
}
|
751
|
+
|
752
|
+
return {
|
753
|
+
setTitleSelector: setTitleSelector
|
754
|
+
}
|
755
|
+
|
756
|
+
});
|
757
|
+
}
|
758
|
+
})(jQuery);
|
759
|
+
|
760
|
+
/*
|
761
|
+
|
762
|
+
_/ _/_/ _/_/_/_/_/ _/
|
763
|
+
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
764
|
+
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
765
|
+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
766
|
+
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
767
|
+
_/
|
768
|
+
_/
|
769
|
+
|
770
|
+
Created by David Kaneda <http://www.davidkaneda.com>
|
771
|
+
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
772
|
+
|
773
|
+
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
774
|
+
and pinch/zoom <http://www.pinchzoom.com/>
|
775
|
+
|
776
|
+
(c) 2009 by jQTouch project members.
|
777
|
+
See LICENSE.txt for license.
|
778
|
+
|
779
|
+
*/
|
780
|
+
|
781
|
+
(function($) {
|
782
|
+
if ($.jQTouch)
|
783
|
+
{
|
784
|
+
$.jQTouch.addExtension(function Floaty(jQT){
|
785
|
+
|
786
|
+
$.fn.makeFloaty = function(options){
|
787
|
+
var defaults = {
|
788
|
+
align: 'top',
|
789
|
+
spacing: 20,
|
790
|
+
time: '.3s'
|
791
|
+
}
|
792
|
+
var settings = $.extend({}, defaults, options);
|
793
|
+
settings.align = (settings.align == 'top') ? 'top' : 'bottom';
|
794
|
+
|
795
|
+
return this.each(function(){
|
796
|
+
var $el = $(this);
|
797
|
+
|
798
|
+
$el.css({
|
799
|
+
'-webkit-transition': 'top ' + settings.time + ' ease-in-out',
|
800
|
+
'display': 'block',
|
801
|
+
'min-height': '0 !important'
|
802
|
+
}).data('settings', settings);
|
803
|
+
|
804
|
+
$(document).bind('scroll', function(){
|
805
|
+
if ($el.data('floatyVisible') === true)
|
806
|
+
{
|
807
|
+
$el.scrollFloaty();
|
808
|
+
}
|
809
|
+
});
|
810
|
+
$el.scrollFloaty();
|
811
|
+
});
|
812
|
+
}
|
813
|
+
|
814
|
+
$.fn.scrollFloaty = function(){
|
815
|
+
return this.each(function(){
|
816
|
+
var $el = $(this);
|
817
|
+
var settings = $el.data('settings');
|
818
|
+
var wHeight = $('html').attr('clientHeight'); // WRONG
|
819
|
+
|
820
|
+
var newY = window.pageYOffset +
|
821
|
+
((settings.align == 'top') ?
|
822
|
+
settings.spacing : wHeight - settings.spacing - $el.get(0).offsetHeight);
|
823
|
+
|
824
|
+
$el.css('top', newY).data('floatyVisible', true);
|
825
|
+
});
|
826
|
+
}
|
827
|
+
|
828
|
+
$.fn.hideFloaty = function(){
|
829
|
+
return this.each(function(){
|
830
|
+
var $el = $(this);
|
831
|
+
var oh = $el.get(0).offsetHeight;
|
832
|
+
|
833
|
+
$el.css('top', -oh-10).data('floatyVisible', false);
|
834
|
+
});
|
835
|
+
}
|
836
|
+
|
837
|
+
$.fn.toggleFloaty = function(){
|
838
|
+
return this.each(function(){
|
839
|
+
var $el = $(this);
|
840
|
+
if ($el.data('floatyVisible') === true){
|
841
|
+
$el.hideFloaty();
|
842
|
+
}
|
843
|
+
else
|
844
|
+
{
|
845
|
+
$el.scrollFloaty();
|
846
|
+
}
|
847
|
+
});
|
848
|
+
}
|
849
|
+
});
|
850
|
+
}
|
851
|
+
})(jQuery);
|
852
|
+
|
853
|
+
/*
|
854
|
+
|
855
|
+
_/ _/_/ _/_/_/_/_/ _/
|
856
|
+
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
857
|
+
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
858
|
+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
859
|
+
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
860
|
+
_/
|
861
|
+
_/
|
862
|
+
|
863
|
+
Created by David Kaneda <http://www.davidkaneda.com>
|
864
|
+
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
865
|
+
|
866
|
+
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
867
|
+
and pinch/zoom <http://www.pinchzoom.com/>
|
868
|
+
|
869
|
+
(c) 2009 by jQTouch project members.
|
870
|
+
See LICENSE.txt for license.
|
871
|
+
|
872
|
+
*/
|
873
|
+
|
874
|
+
(function($) {
|
875
|
+
if ($.jQTouch)
|
876
|
+
{
|
877
|
+
$.jQTouch.addExtension(function Location(){
|
878
|
+
|
879
|
+
var latitude, longitude, callback;
|
880
|
+
|
881
|
+
function checkGeoLocation() {
|
882
|
+
return navigator.geolocation;
|
883
|
+
}
|
884
|
+
function updateLocation(fn) {
|
885
|
+
if (checkGeoLocation())
|
886
|
+
{
|
887
|
+
callback = fn;
|
888
|
+
navigator.geolocation.getCurrentPosition(savePosition);
|
889
|
+
return true;
|
890
|
+
} else {
|
891
|
+
console.log('Device not capable of geo-location.');
|
892
|
+
fn(false);
|
893
|
+
return false;
|
894
|
+
}
|
895
|
+
}
|
896
|
+
function savePosition(position) {
|
897
|
+
latitude = position.coords.latitude;
|
898
|
+
longitude = position.coords.longitude;
|
899
|
+
if (callback) {
|
900
|
+
callback(getLocation());
|
901
|
+
}
|
902
|
+
}
|
903
|
+
function getLocation() {
|
904
|
+
if (latitude && longitude) {
|
905
|
+
return {
|
906
|
+
latitude: latitude,
|
907
|
+
longitude: longitude
|
908
|
+
}
|
909
|
+
} else {
|
910
|
+
console.log('No location available. Try calling updateLocation() first.');
|
911
|
+
return false;
|
912
|
+
}
|
913
|
+
}
|
914
|
+
return {
|
915
|
+
updateLocation: updateLocation,
|
916
|
+
getLocation: getLocation
|
917
|
+
}
|
918
|
+
});
|
919
|
+
}
|
920
|
+
})(jQuery);
|
921
|
+
|
922
|
+
/*
|
923
|
+
|
924
|
+
_/ _/_/ _/_/_/_/_/ _/
|
925
|
+
_/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
|
926
|
+
_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
|
927
|
+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
|
928
|
+
_/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
|
929
|
+
_/
|
930
|
+
_/
|
931
|
+
|
932
|
+
Created by David Kaneda <http://www.davidkaneda.com>
|
933
|
+
Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
|
934
|
+
|
935
|
+
Special thanks to Jonathan Stark <http://jonathanstark.com/>
|
936
|
+
|
937
|
+
Lots of this code is specifically derived from Jonathan's book,
|
938
|
+
"Building iPhone Apps with HTML, CSS, and JavaScript"
|
939
|
+
|
940
|
+
(c) 2009 by jQTouch project members.
|
941
|
+
See LICENSE.txt for license.
|
942
|
+
|
943
|
+
*/
|
944
|
+
|
945
|
+
(function($) {
|
946
|
+
if ($.jQTouch)
|
947
|
+
{
|
948
|
+
$.jQTouch.addExtension(function Offline(){
|
949
|
+
|
950
|
+
// Convenience array of status values
|
951
|
+
var cacheStatusValues = [];
|
952
|
+
cacheStatusValues[0] = 'uncached';
|
953
|
+
cacheStatusValues[1] = 'idle';
|
954
|
+
cacheStatusValues[2] = 'checking';
|
955
|
+
cacheStatusValues[3] = 'downloading';
|
956
|
+
cacheStatusValues[4] = 'updateready';
|
957
|
+
cacheStatusValues[5] = 'obsolete';
|
958
|
+
|
959
|
+
// Listeners for all possible events
|
960
|
+
var cache = window.applicationCache;
|
961
|
+
//cache.addEventListener('cached', logEvent, false);
|
962
|
+
//cache.addEventListener('checking', logEvent, false);
|
963
|
+
//cache.addEventListener('downloading', logEvent, false);
|
964
|
+
//cache.addEventListener('error', logEvent, false);
|
965
|
+
//cache.addEventListener('noupdate', logEvent, false);
|
966
|
+
//cache.addEventListener('obsolete', logEvent, false);
|
967
|
+
//cache.addEventListener('progress', logEvent, false);
|
968
|
+
//cache.addEventListener('updateready', logEvent, false);
|
969
|
+
window.addEventListener('cached', logEvent, false);
|
970
|
+
window.addEventListener('checking', logEvent, false);
|
971
|
+
window.addEventListener('downloading', logEvent, false);
|
972
|
+
window.addEventListener('error', logEvent, false);
|
973
|
+
window.addEventListener('noupdate', logEvent, false);
|
974
|
+
window.addEventListener('obsolete', logEvent, false);
|
975
|
+
window.addEventListener('progress', logEvent, false);
|
976
|
+
window.addEventListener('updateready', logEvent, false);
|
977
|
+
|
978
|
+
// Log every event to the console
|
979
|
+
function logEvent(e) {
|
980
|
+
var online, status, type, message;
|
981
|
+
online = (isOnline()) ? 'yes' : 'no';
|
982
|
+
status = cacheStatusValues[cache.status];
|
983
|
+
type = e.type;
|
984
|
+
message = 'online: ' + online;
|
985
|
+
message+= ', event: ' + type;
|
986
|
+
message+= ', status: ' + status;
|
987
|
+
if (type == 'error' && navigator.onLine) {
|
988
|
+
message+= ' There was an unknown error, check your Cache Manifest.';
|
989
|
+
}
|
990
|
+
console.log(message);
|
991
|
+
}
|
992
|
+
|
993
|
+
function isOnline() {
|
994
|
+
return navigator.onLine;
|
995
|
+
}
|
996
|
+
|
997
|
+
if (!$('html').attr('manifest')) {
|
998
|
+
console.log('No Cache Manifest listed on the <html> tag.')
|
999
|
+
}
|
1000
|
+
|
1001
|
+
// Swap in newly download files when update is ready
|
1002
|
+
//cache.addEventListener('updateready', function(e){
|
1003
|
+
window.addEventListener('updateready', function(e){
|
1004
|
+
// Don't perform "swap" if this is the first cache
|
1005
|
+
if (cacheStatusValues[cache.status] != 'idle') {
|
1006
|
+
cache.swapCache();
|
1007
|
+
console.log('Swapped/updated the Cache Manifest.');
|
1008
|
+
}
|
1009
|
+
}
|
1010
|
+
, false);
|
1011
|
+
|
1012
|
+
// These two functions check for updates to the manifest file
|
1013
|
+
function checkForUpdates(){
|
1014
|
+
cache.update();
|
1015
|
+
}
|
1016
|
+
function autoCheckForUpdates(){
|
1017
|
+
setInterval(function(){cache.update()}, 10000);
|
1018
|
+
}
|
1019
|
+
|
1020
|
+
return {
|
1021
|
+
isOnline: isOnline,
|
1022
|
+
checkForUpdates: checkForUpdates,
|
1023
|
+
autoCheckForUpdates: autoCheckForUpdates
|
1024
|
+
}
|
1025
|
+
});
|
1026
|
+
}
|
1027
1027
|
})(jQuery);
|