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.
Files changed (344) hide show
  1. data/VERSION.yml +1 -1
  2. data/compass-jquery-plugin.gemspec +2 -2
  3. data/gem_tasks/jrails13.rake +0 -1
  4. data/gem_tasks/jrails14.rake +1 -2
  5. data/lib/jquery.ui.rb +2 -2
  6. data/templates/dynatree/jquery.dynatree.js +2036 -2036
  7. data/templates/dynatree/jquery.dynatree.min.js +59 -59
  8. data/templates/dynatree/jquery.ui/dynatree.aero.scss +144 -144
  9. data/templates/dynatree/jquery.ui/dynatree.aqua.scss +144 -144
  10. data/templates/dynatree/jquery.ui/dynatree.crystal.scss +144 -144
  11. data/templates/dynatree/jquery.ui/dynatree.xp.scss +239 -239
  12. data/templates/dynatree/manifest.rb +127 -127
  13. data/templates/jqgrid/config/initializers/jqgrid.rb +2 -2
  14. data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +15 -15
  15. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +15 -15
  16. data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +7 -7
  17. data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +8 -8
  18. data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +8 -8
  19. data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +7 -7
  20. data/templates/jqgrid/i18n/jqgrid/locale-dk.min.js +6 -6
  21. data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +13 -13
  22. data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +6 -6
  23. data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +12 -12
  24. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +6 -6
  25. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +126 -126
  26. data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +7 -7
  27. data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +13 -13
  28. data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +7 -7
  29. data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +7 -7
  30. data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +10 -10
  31. data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +6 -6
  32. data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +6 -6
  33. data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +7 -7
  34. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +7 -7
  35. data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +7 -7
  36. data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +8 -8
  37. data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +16 -16
  38. data/templates/jqgrid/i18n/jqgrid/locale-sk.js +127 -127
  39. data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +8 -8
  40. data/templates/jqgrid/i18n/jqgrid/locale-sp.min.js +7 -7
  41. data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +7 -7
  42. data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +7 -7
  43. data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +16 -16
  44. data/templates/jqgrid/jquery.jqGrid.js +10477 -10471
  45. data/templates/jqgrid/jquery.jqGrid.min.js +430 -430
  46. data/templates/jqgrid/jquery.ui/jqGrid.scss +669 -669
  47. data/templates/jqgrid/manifest.rb +66 -66
  48. data/templates/jqtouch/jqtouch/iphone-emulator.scss +21 -21
  49. data/templates/jqtouch/jqtouch/jqt.apple.scss +584 -584
  50. data/templates/jqtouch/jqtouch/jqt.jqt.scss +528 -528
  51. data/templates/jqtouch/jqtouch/jqtouch.scss +310 -310
  52. data/templates/jqtouch/jquery.jqtouch.js +1026 -1026
  53. data/templates/jqtouch/jquery.jqtouch.min.js +26 -26
  54. data/templates/jqtouch/manifest.rb +52 -52
  55. data/templates/jrails-1.3/config/initializers/jrails.rb +28 -28
  56. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ar.js +19 -19
  57. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ar.min.js +4 -4
  58. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-bg.js +20 -20
  59. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-bg.min.js +4 -4
  60. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ca.js +18 -18
  61. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ca.min.js +2 -2
  62. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-cs.js +19 -19
  63. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-cs.min.js +2 -2
  64. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-da.js +19 -19
  65. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-da.min.js +2 -2
  66. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-de.js +19 -19
  67. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-de.min.js +2 -2
  68. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-el.js +18 -18
  69. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-el.min.js +4 -4
  70. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-eo.js +19 -19
  71. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-eo.min.js +2 -2
  72. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-es.js +18 -18
  73. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-es.min.js +2 -2
  74. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fa.js +18 -18
  75. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fa.min.js +3 -3
  76. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fi.js +19 -19
  77. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fi.min.js +2 -2
  78. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fr.js +18 -18
  79. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-fr.min.js +2 -2
  80. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-he.js +19 -19
  81. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-he.min.js +3 -3
  82. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hr.js +18 -18
  83. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hr.min.js +2 -2
  84. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hu.js +19 -19
  85. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hu.min.js +2 -2
  86. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hy.js +18 -18
  87. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-hy.min.js +4 -4
  88. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-id.js +18 -18
  89. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-id.min.js +2 -2
  90. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-is.js +18 -18
  91. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-is.min.js +2 -2
  92. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-it.js +19 -19
  93. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-it.min.js +2 -2
  94. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ja.js +19 -19
  95. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ja.min.js +2 -2
  96. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ko.js +18 -18
  97. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ko.min.js +2 -2
  98. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lt.js +18 -18
  99. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lt.min.js +2 -2
  100. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lv.js +18 -18
  101. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-lv.min.js +2 -2
  102. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ms.js +18 -18
  103. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ms.min.js +2 -2
  104. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-nl.js +18 -18
  105. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-nl.min.js +2 -2
  106. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-no.js +19 -19
  107. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-no.min.js +2 -2
  108. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pl.js +19 -19
  109. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pl.min.js +2 -2
  110. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pt-BR.js +18 -18
  111. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-pt-BR.min.js +2 -2
  112. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ro.js +22 -22
  113. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ro.min.js +2 -2
  114. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ru.js +18 -18
  115. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-ru.min.js +4 -4
  116. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sk.js +19 -19
  117. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sk.min.js +2 -2
  118. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sl.js +20 -20
  119. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sl.min.js +2 -2
  120. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sq.js +19 -19
  121. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sq.min.js +2 -2
  122. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr-SR.js +19 -19
  123. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr-SR.min.js +2 -2
  124. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr.js +19 -19
  125. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sr.min.js +3 -3
  126. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sv.js +19 -19
  127. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-sv.min.js +2 -2
  128. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-th.js +18 -18
  129. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-th.min.js +4 -4
  130. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-tr.js +18 -18
  131. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-tr.min.js +2 -2
  132. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-uk.js +24 -24
  133. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-uk.min.js +4 -4
  134. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-CN.js +19 -19
  135. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-CN.min.js +2 -2
  136. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-TW.js +19 -19
  137. data/templates/jrails-1.3/i18n/jquery.ui/datepicker-zh-TW.min.js +2 -2
  138. data/templates/jrails-1.3/jquery-1.3.2.js +7637 -7637
  139. data/templates/jrails-1.3/jquery-1.3.2.min.js +178 -178
  140. data/templates/jrails-1.3/jquery-ui-1.7.2.js +18316 -18316
  141. data/templates/jrails-1.3/jquery-ui-1.7.2.min.js +688 -688
  142. data/templates/jrails-1.3/jquery.contextMenu.js +210 -210
  143. data/templates/jrails-1.3/jquery.contextMenu.min.js +8 -8
  144. data/templates/jrails-1.3/jquery.haml.js +293 -293
  145. data/templates/jrails-1.3/jquery.haml.min.js +5 -5
  146. data/templates/jrails-1.3/jquery.pngFix.js +10 -10
  147. data/templates/jrails-1.3/jquery.pngFix.min.js +2 -2
  148. data/templates/jrails-1.3/jquery.themeswitchertool.js +190 -190
  149. data/templates/jrails-1.3/jquery.themeswitchertool.min.js +8 -8
  150. data/templates/jrails-1.3/jquery.ui/_theme.scss +1281 -1281
  151. data/templates/jrails-1.3/jquery.ui/base.scss +85 -85
  152. data/templates/jrails-1.3/jquery.ui/black-tie.scss +85 -85
  153. data/templates/jrails-1.3/jquery.ui/blitzer.scss +85 -85
  154. data/templates/jrails-1.3/jquery.ui/contextMenu.scss +49 -49
  155. data/templates/jrails-1.3/jquery.ui/cupertino.scss +85 -85
  156. data/templates/jrails-1.3/jquery.ui/dark-hive.scss +85 -85
  157. data/templates/jrails-1.3/jquery.ui/dot-luv.scss +85 -85
  158. data/templates/jrails-1.3/jquery.ui/eggplant.scss +85 -85
  159. data/templates/jrails-1.3/jquery.ui/excite-bike.scss +85 -85
  160. data/templates/jrails-1.3/jquery.ui/flick.scss +85 -85
  161. data/templates/jrails-1.3/jquery.ui/hot-sneaks.scss +85 -85
  162. data/templates/jrails-1.3/jquery.ui/humanity.scss +85 -85
  163. data/templates/jrails-1.3/jquery.ui/le-frog.scss +85 -85
  164. data/templates/jrails-1.3/jquery.ui/mint-choc.scss +85 -85
  165. data/templates/jrails-1.3/jquery.ui/overcast.scss +85 -85
  166. data/templates/jrails-1.3/jquery.ui/pepper-grinder.scss +85 -85
  167. data/templates/jrails-1.3/jquery.ui/redmond.scss +85 -85
  168. data/templates/jrails-1.3/jquery.ui/smoothness.scss +85 -85
  169. data/templates/jrails-1.3/jquery.ui/south-street.scss +85 -85
  170. data/templates/jrails-1.3/jquery.ui/sunny.scss +85 -85
  171. data/templates/jrails-1.3/jquery.ui/swanky-purse.scss +85 -85
  172. data/templates/jrails-1.3/jquery.ui/trontastic.scss +85 -85
  173. data/templates/jrails-1.3/jquery.ui/ui-darkness.scss +85 -85
  174. data/templates/jrails-1.3/jquery.ui/ui-lightness.scss +85 -85
  175. data/templates/jrails-1.3/jquery.ui/vader.scss +85 -85
  176. data/templates/jrails-1.3/jrails.js +197 -197
  177. data/templates/jrails-1.3/jrails.min.js +8 -8
  178. data/templates/jrails-1.3/manifest.rb +496 -496
  179. data/templates/jrails-1.4/config/initializers/jrails.rb +30 -30
  180. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-af.js +23 -23
  181. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-af.min.js +2 -2
  182. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ar.js +23 -23
  183. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ar.min.js +4 -4
  184. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-az.js +22 -22
  185. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-az.min.js +2 -2
  186. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bg.js +24 -24
  187. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bg.min.js +4 -4
  188. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bs.js +22 -22
  189. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-bs.min.js +2 -2
  190. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ca.js +22 -22
  191. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ca.min.js +2 -2
  192. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-cs.js +23 -23
  193. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-cs.min.js +2 -2
  194. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-da.js +23 -23
  195. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-da.min.js +2 -2
  196. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-de.js +23 -23
  197. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-de.min.js +2 -2
  198. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-el.js +22 -22
  199. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-el.min.js +4 -4
  200. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-en-GB.js +23 -23
  201. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-en-GB.min.js +2 -2
  202. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eo.js +23 -23
  203. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eo.min.js +2 -2
  204. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-es.js +22 -22
  205. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-es.min.js +2 -2
  206. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-et.js +22 -22
  207. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-et.min.js +2 -2
  208. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eu.js +22 -22
  209. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-eu.min.js +2 -2
  210. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fa.js +22 -22
  211. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fa.min.js +3 -3
  212. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fi.js +23 -23
  213. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fi.min.js +2 -2
  214. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fo.js +23 -23
  215. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fo.min.js +2 -2
  216. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr-CH.js +22 -22
  217. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr-CH.min.js +2 -2
  218. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr.js +22 -22
  219. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr.min.js +2 -2
  220. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-he.js +23 -23
  221. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-he.min.js +3 -3
  222. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hr.js +22 -22
  223. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hr.min.js +2 -2
  224. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hu.js +23 -23
  225. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hu.min.js +2 -2
  226. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hy.js +22 -22
  227. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-hy.min.js +4 -4
  228. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-id.js +22 -22
  229. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-id.min.js +2 -2
  230. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-is.js +22 -22
  231. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-is.min.js +2 -2
  232. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-it.js +23 -23
  233. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-it.min.js +2 -2
  234. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ja.js +22 -22
  235. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ja.min.js +2 -2
  236. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ko.js +22 -22
  237. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ko.min.js +2 -2
  238. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lt.js +22 -22
  239. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lt.min.js +2 -2
  240. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lv.js +22 -22
  241. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-lv.min.js +2 -2
  242. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ms.js +22 -22
  243. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ms.min.js +2 -2
  244. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-nl.js +22 -22
  245. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-nl.min.js +2 -2
  246. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-no.js +23 -23
  247. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-no.min.js +2 -2
  248. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pl.js +23 -23
  249. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pl.min.js +2 -2
  250. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pt-BR.js +22 -22
  251. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pt-BR.min.js +2 -2
  252. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ro.js +26 -26
  253. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ro.min.js +2 -2
  254. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ru.js +22 -22
  255. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ru.min.js +4 -4
  256. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sk.js +23 -23
  257. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sk.min.js +2 -2
  258. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sl.js +24 -24
  259. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sl.min.js +2 -2
  260. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sq.js +23 -23
  261. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sq.min.js +2 -2
  262. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr-SR.js +23 -23
  263. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr-SR.min.js +2 -2
  264. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr.js +23 -23
  265. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sr.min.js +4 -4
  266. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sv.js +23 -23
  267. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-sv.min.js +2 -2
  268. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ta.js +23 -23
  269. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-ta.min.js +4 -4
  270. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-th.js +22 -22
  271. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-th.min.js +4 -4
  272. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-tr.js +22 -22
  273. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-tr.min.js +2 -2
  274. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-uk.js +22 -22
  275. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-uk.min.js +4 -4
  276. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-vi.js +23 -23
  277. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-vi.min.js +2 -2
  278. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-CN.js +23 -23
  279. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-CN.min.js +2 -2
  280. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-HK.js +23 -23
  281. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-HK.min.js +2 -2
  282. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-TW.js +23 -23
  283. data/templates/jrails-1.4/i18n/jquery.ui/datepicker-zh-TW.min.js +2 -2
  284. data/templates/jrails-1.4/jquery-1.4.2.js +9501 -9501
  285. data/templates/jrails-1.4/jquery-1.4.2.min.js +210 -210
  286. data/templates/jrails-1.4/jquery-ui-1.8.js +21904 -21904
  287. data/templates/jrails-1.4/jquery-ui-1.8.min.js +766 -766
  288. data/templates/jrails-1.4/jquery.bgiframe.js +9 -9
  289. data/templates/jrails-1.4/jquery.bgiframe.min.js +2 -2
  290. data/templates/jrails-1.4/jquery.compat-1.3.js +291 -291
  291. data/templates/jrails-1.4/jquery.compat-1.3.min.js +6 -6
  292. data/templates/jrails-1.4/jquery.contextMenu.js +210 -210
  293. data/templates/jrails-1.4/jquery.contextMenu.min.js +8 -8
  294. data/templates/jrails-1.4/jquery.haml.js +293 -293
  295. data/templates/jrails-1.4/jquery.haml.min.js +5 -5
  296. data/templates/jrails-1.4/jquery.metadata.js +121 -121
  297. data/templates/jrails-1.4/jquery.metadata.min.js +2 -2
  298. data/templates/jrails-1.4/jquery.pngFix.js +10 -10
  299. data/templates/jrails-1.4/jquery.pngFix.min.js +2 -2
  300. data/templates/jrails-1.4/jquery.themeswitchertool.js +190 -190
  301. data/templates/jrails-1.4/jquery.themeswitchertool.min.js +8 -8
  302. data/templates/jrails-1.4/jquery.ui/_theme.scss +1433 -1433
  303. data/templates/jrails-1.4/jquery.ui/base.scss +90 -90
  304. data/templates/jrails-1.4/jquery.ui/black-tie.scss +90 -90
  305. data/templates/jrails-1.4/jquery.ui/blitzer.scss +90 -90
  306. data/templates/jrails-1.4/jquery.ui/contextMenu.scss +49 -49
  307. data/templates/jrails-1.4/jquery.ui/cupertino.scss +90 -90
  308. data/templates/jrails-1.4/jquery.ui/dark-hive.scss +90 -90
  309. data/templates/jrails-1.4/jquery.ui/dot-luv.scss +90 -90
  310. data/templates/jrails-1.4/jquery.ui/eggplant.scss +90 -90
  311. data/templates/jrails-1.4/jquery.ui/excite-bike.scss +90 -90
  312. data/templates/jrails-1.4/jquery.ui/flick.scss +90 -90
  313. data/templates/jrails-1.4/jquery.ui/hot-sneaks.scss +90 -90
  314. data/templates/jrails-1.4/jquery.ui/humanity.scss +90 -90
  315. data/templates/jrails-1.4/jquery.ui/le-frog.scss +90 -90
  316. data/templates/jrails-1.4/jquery.ui/mint-choc.scss +90 -90
  317. data/templates/jrails-1.4/jquery.ui/overcast.scss +90 -90
  318. data/templates/jrails-1.4/jquery.ui/pepper-grinder.scss +90 -90
  319. data/templates/jrails-1.4/jquery.ui/redmond.scss +90 -90
  320. data/templates/jrails-1.4/jquery.ui/smoothness.scss +90 -90
  321. data/templates/jrails-1.4/jquery.ui/south-street.scss +90 -90
  322. data/templates/jrails-1.4/jquery.ui/start.scss +90 -90
  323. data/templates/jrails-1.4/jquery.ui/sunny.scss +90 -90
  324. data/templates/jrails-1.4/jquery.ui/swanky-purse.scss +90 -90
  325. data/templates/jrails-1.4/jquery.ui/trontastic.scss +90 -90
  326. data/templates/jrails-1.4/jquery.ui/ui-darkness.scss +90 -90
  327. data/templates/jrails-1.4/jquery.ui/ui-lightness.scss +90 -90
  328. data/templates/jrails-1.4/jquery.ui/vader.scss +90 -90
  329. data/templates/jrails-1.4/jrails.js +197 -197
  330. data/templates/jrails-1.4/jrails.min.js +8 -8
  331. data/templates/jrails-1.4/manifest.rb +568 -568
  332. data/templates/ribbon/config/initializers/ribbon.rb +3 -3
  333. data/templates/ribbon/jquery.ribbon.js +225 -225
  334. data/templates/ribbon/jquery.ribbon.min.js +14 -14
  335. data/templates/ribbon/jquery.ui/ribbon.simple.scss +271 -271
  336. data/templates/ribbon/jquery.ui/ribbon.windows7.scss +454 -454
  337. data/templates/ribbon/manifest.rb +52 -52
  338. data/templates/secret_sauce/app/views/ui/_ui_grid_for_without_block.js.haml +144 -144
  339. data/templates/secret_sauce/config/initializers/secret_sauce.rb +6 -6
  340. data/templates/secret_sauce/jquery.ui/secret_sauce.scss +33 -33
  341. data/templates/secret_sauce/manifest.rb +10 -10
  342. data/templates/secret_sauce/secret_sauce.js +11 -11
  343. data/templates/secret_sauce/secret_sauce.min.js +1 -1
  344. 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);