compass-jquery-plugin 0.3.2.7 → 0.3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. data/README.md +17 -11
  2. data/VERSION.yml +2 -2
  3. data/lib/handle_js_files.rb +1 -1
  4. data/lib/jquery/emulators.rb +13 -0
  5. data/templates/dynatree/jquery.dynatree.min.js +79 -81
  6. data/templates/emulators/config/initializers/emulators.rb +0 -9
  7. data/templates/emulators/emulators/{blackberry.landscape.scss → blackberry.torch.landscape.scss} +6 -2
  8. data/templates/emulators/emulators/{blackberry.portrait.scss → blackberry.torch.portrait.scss} +6 -1
  9. data/templates/emulators/emulators/galaxy.s.landscape.png +0 -0
  10. data/templates/emulators/emulators/galaxy.s.landscape.scss +20 -0
  11. data/templates/emulators/emulators/galaxy.s.portrait.png +0 -0
  12. data/templates/emulators/emulators/galaxy.s.portrait.scss +20 -0
  13. data/templates/emulators/emulators/galaxy.s2.landscape.png +0 -0
  14. data/templates/emulators/emulators/galaxy.s2.landscape.scss +20 -0
  15. data/templates/emulators/emulators/galaxy.s2.portrait.png +0 -0
  16. data/templates/emulators/emulators/galaxy.s2.portrait.scss +20 -0
  17. data/templates/emulators/emulators/galaxy.tab.10.1.landscape.png +0 -0
  18. data/templates/emulators/emulators/galaxy.tab.10.1.landscape.scss +20 -0
  19. data/templates/emulators/emulators/galaxy.tab.10.1.portrait.png +0 -0
  20. data/templates/emulators/emulators/galaxy.tab.10.1.portrait.scss +20 -0
  21. data/templates/emulators/emulators/galaxy.tab.7.landscape.png +0 -0
  22. data/templates/emulators/emulators/galaxy.tab.7.landscape.scss +20 -0
  23. data/templates/emulators/emulators/galaxy.tab.7.portrait.png +0 -0
  24. data/templates/emulators/emulators/galaxy.tab.7.portrait.scss +20 -0
  25. data/templates/emulators/emulators/galaxy.tab.8.9.landscape.png +0 -0
  26. data/templates/emulators/emulators/galaxy.tab.8.9.landscape.scss +20 -0
  27. data/templates/emulators/emulators/galaxy.tab.8.9.portrait.png +0 -0
  28. data/templates/emulators/emulators/galaxy.tab.8.9.portrait.scss +20 -0
  29. data/templates/emulators/emulators/ipad.landscape.png +0 -0
  30. data/templates/emulators/emulators/ipad.landscape.scss +9 -4
  31. data/templates/emulators/emulators/ipad.portrait.png +0 -0
  32. data/templates/emulators/emulators/ipad.portrait.scss +9 -4
  33. data/templates/emulators/emulators/{iphone.landscape.png → iphone.3.landscape.png} +0 -0
  34. data/templates/emulators/emulators/{iphone.landscape.scss → iphone.3.landscape.scss} +7 -3
  35. data/templates/emulators/emulators/{iphone.portrait.png → iphone.3.portrait.png} +0 -0
  36. data/templates/emulators/emulators/{iphone.portrait.scss → iphone.3.portrait.scss} +7 -3
  37. data/templates/emulators/emulators/iphone.4.landscape .scss +20 -0
  38. data/templates/emulators/emulators/iphone.4.landscape.png +0 -0
  39. data/templates/emulators/emulators/iphone.4.portrait.png +0 -0
  40. data/templates/emulators/emulators/iphone.4.portrait.scss +20 -0
  41. data/templates/emulators/emulators/{palm.pre.landscape.png → palm.pre.2.landscape.png} +0 -0
  42. data/templates/emulators/emulators/{palm.landscape.scss → palm.pre.2.landscape.scss} +7 -3
  43. data/templates/emulators/emulators/{palm.pre.portrait.png → palm.pre.2.portrait.png} +0 -0
  44. data/templates/emulators/emulators/{palm.portrait.scss → palm.pre.2.portrait.scss} +7 -3
  45. data/templates/emulators/manifest.rb +34 -10
  46. data/templates/graphics/config/initializers/graphics.rb +8 -0
  47. data/templates/graphics/highcharts/dark-blue.js +170 -0
  48. data/templates/graphics/highcharts/dark-blue.min.js +4 -0
  49. data/templates/graphics/highcharts/dark-green.js +170 -0
  50. data/templates/graphics/highcharts/dark-green.min.js +4 -0
  51. data/templates/graphics/highcharts/gray.js +164 -0
  52. data/templates/graphics/highcharts/gray.min.js +4 -0
  53. data/templates/graphics/highcharts/grid.js +97 -0
  54. data/templates/graphics/highcharts/grid.min.js +3 -0
  55. data/templates/graphics/highcharts/highslide-config.js +12 -0
  56. data/templates/graphics/highcharts/highslide-config.min.js +1 -0
  57. data/templates/graphics/highcharts/highslide-full.js +3391 -0
  58. data/templates/graphics/highcharts/highslide-full.min.js +132 -0
  59. data/templates/graphics/highcharts/skies.js +89 -0
  60. data/templates/graphics/highcharts/skies.min.js +3 -0
  61. data/templates/graphics/jquery.ganttView.js +1 -1
  62. data/templates/graphics/jquery.ganttView.min.js +61 -61
  63. data/templates/graphics/jquery.highcharts.js +11342 -0
  64. data/templates/graphics/jquery.highcharts.min.js +176 -0
  65. data/templates/graphics/jquery.sparkline.min.js +35 -36
  66. data/templates/graphics/jquery/highcharts/graphics/close.png +0 -0
  67. data/templates/graphics/jquery/highcharts/graphics/closeX.png +0 -0
  68. data/templates/graphics/jquery/highcharts/graphics/controlbar-black-border.gif +0 -0
  69. data/templates/graphics/jquery/highcharts/graphics/controlbar-text-buttons.png +0 -0
  70. data/templates/graphics/jquery/highcharts/graphics/controlbar-white-small.gif +0 -0
  71. data/templates/graphics/jquery/highcharts/graphics/controlbar-white.gif +0 -0
  72. data/templates/graphics/jquery/highcharts/graphics/controlbar2.gif +0 -0
  73. data/templates/graphics/jquery/highcharts/graphics/controlbar3.gif +0 -0
  74. data/templates/graphics/jquery/highcharts/graphics/controlbar4-hover.gif +0 -0
  75. data/templates/graphics/jquery/highcharts/graphics/controlbar4.gif +0 -0
  76. data/templates/graphics/jquery/highcharts/graphics/fullexpand.gif +0 -0
  77. data/templates/graphics/jquery/highcharts/graphics/geckodimmer.png +0 -0
  78. data/templates/graphics/jquery/highcharts/graphics/icon.gif +0 -0
  79. data/templates/graphics/jquery/highcharts/graphics/loader.gif +0 -0
  80. data/templates/graphics/jquery/highcharts/graphics/loader.white.gif +0 -0
  81. data/templates/graphics/jquery/highcharts/graphics/outlines/beveled.png +0 -0
  82. data/templates/graphics/jquery/highcharts/graphics/outlines/drop-shadow.png +0 -0
  83. data/templates/graphics/jquery/highcharts/graphics/outlines/glossy-dark.png +0 -0
  84. data/templates/graphics/jquery/highcharts/graphics/outlines/outer-glow.png +0 -0
  85. data/templates/graphics/jquery/highcharts/graphics/outlines/rounded-black.png +0 -0
  86. data/templates/graphics/jquery/highcharts/graphics/outlines/rounded-white.png +0 -0
  87. data/templates/graphics/jquery/highcharts/graphics/resize.gif +0 -0
  88. data/templates/graphics/jquery/highcharts/graphics/scrollarrows.png +0 -0
  89. data/templates/graphics/jquery/highcharts/graphics/zoomin.cur +0 -0
  90. data/templates/graphics/jquery/highcharts/graphics/zoomout.cur +0 -0
  91. data/templates/graphics/jquery/highcharts/skies.jpg +0 -0
  92. data/templates/graphics/jquery/highslide.scss +763 -0
  93. data/templates/graphics/manifest.rb +43 -0
  94. data/templates/ical/config/initializers/ical.rb +1 -0
  95. data/templates/ical/jquery.ical.js +8401 -8209
  96. data/templates/ical/jquery.ical.min.js +206 -208
  97. data/templates/ical/jquery/ical.print.scss +48 -0
  98. data/templates/ical/jquery/ical.scss +372 -343
  99. data/templates/ical/manifest.rb +1 -0
  100. data/templates/jqgrid/i18n/jqgrid/locale-ar.min.js +2 -2
  101. data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +1 -1
  102. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +1 -1
  103. data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +1 -1
  104. data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +1 -1
  105. data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +1 -1
  106. data/templates/jqgrid/i18n/jqgrid/locale-da.min.js +1 -1
  107. data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +1 -1
  108. data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +2 -2
  109. data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +1 -1
  110. data/templates/jqgrid/i18n/jqgrid/locale-es.min.js +2 -2
  111. data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +1 -1
  112. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +1 -1
  113. data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +2 -2
  114. data/templates/jqgrid/i18n/jqgrid/locale-gl.min.js +2 -2
  115. data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +1 -1
  116. data/templates/jqgrid/i18n/jqgrid/locale-hu.min.js +1 -1
  117. data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +1 -1
  118. data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +2 -2
  119. data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +1 -1
  120. data/templates/jqgrid/i18n/jqgrid/locale-lt.min.js +2 -2
  121. data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +1 -1
  122. data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +1 -1
  123. data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +1 -1
  124. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +1 -1
  125. data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +1 -1
  126. data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +1 -1
  127. data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +2 -2
  128. data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +1 -1
  129. data/templates/jqgrid/i18n/jqgrid/locale-sr.min.js +1 -1
  130. data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +1 -1
  131. data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +1 -1
  132. data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +2 -2
  133. data/templates/jqgrid/jquery.jqGrid.js +162 -850
  134. data/templates/jqgrid/jquery.jqGrid.min.js +476 -497
  135. data/templates/jqgrid/jquery/jqGrid.scss +0 -19
  136. data/templates/jquery/amplify.store.js +248 -0
  137. data/templates/jquery/amplify.store.min.js +6 -0
  138. data/templates/jquery/config/initializers/jquery.rb +5 -1
  139. data/templates/jquery/history.adapter.jquery.js +37 -43
  140. data/templates/jquery/history.adapter.jquery.min.js +1 -1
  141. data/templates/jquery/history.html4.js +596 -587
  142. data/templates/jquery/history.html4.min.js +8 -8
  143. data/templates/jquery/history.js +1839 -1669
  144. data/templates/jquery/history.min.js +27 -25
  145. data/templates/jquery/i18n/jquery.ui/datepicker-af.min.js +1 -1
  146. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.min.js +1 -1
  147. data/templates/jquery/i18n/jquery.ui/datepicker-ar.min.js +1 -1
  148. data/templates/jquery/i18n/jquery.ui/datepicker-az.min.js +1 -1
  149. data/templates/jquery/i18n/jquery.ui/datepicker-bg.min.js +1 -1
  150. data/templates/jquery/i18n/jquery.ui/datepicker-bs.min.js +1 -1
  151. data/templates/jquery/i18n/jquery.ui/datepicker-ca.min.js +1 -1
  152. data/templates/jquery/i18n/jquery.ui/datepicker-cs.min.js +1 -1
  153. data/templates/jquery/i18n/jquery.ui/datepicker-da.min.js +1 -1
  154. data/templates/jquery/i18n/jquery.ui/datepicker-de.min.js +1 -1
  155. data/templates/jquery/i18n/jquery.ui/datepicker-el.min.js +1 -1
  156. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.min.js +1 -1
  157. data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.min.js +1 -1
  158. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.min.js +1 -1
  159. data/templates/jquery/i18n/jquery.ui/datepicker-eo.min.js +1 -1
  160. data/templates/jquery/i18n/jquery.ui/datepicker-es.min.js +1 -1
  161. data/templates/jquery/i18n/jquery.ui/datepicker-et.min.js +1 -1
  162. data/templates/jquery/i18n/jquery.ui/datepicker-eu.min.js +1 -1
  163. data/templates/jquery/i18n/jquery.ui/datepicker-fa.min.js +2 -2
  164. data/templates/jquery/i18n/jquery.ui/datepicker-fi.min.js +1 -1
  165. data/templates/jquery/i18n/jquery.ui/datepicker-fo.min.js +1 -1
  166. data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.min.js +1 -1
  167. data/templates/jquery/i18n/jquery.ui/datepicker-fr.min.js +1 -1
  168. data/templates/jquery/i18n/jquery.ui/datepicker-gl.min.js +1 -1
  169. data/templates/jquery/i18n/jquery.ui/datepicker-he.min.js +1 -1
  170. data/templates/jquery/i18n/jquery.ui/datepicker-hr.min.js +1 -1
  171. data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
  172. data/templates/jquery/i18n/jquery.ui/datepicker-hy.min.js +1 -1
  173. data/templates/jquery/i18n/jquery.ui/datepicker-id.min.js +1 -1
  174. data/templates/jquery/i18n/jquery.ui/datepicker-is.min.js +1 -1
  175. data/templates/jquery/i18n/jquery.ui/datepicker-it.min.js +1 -1
  176. data/templates/jquery/i18n/jquery.ui/datepicker-ja.min.js +1 -1
  177. data/templates/jquery/i18n/jquery.ui/datepicker-ko.min.js +1 -1
  178. data/templates/jquery/i18n/jquery.ui/datepicker-kz.min.js +1 -1
  179. data/templates/jquery/i18n/jquery.ui/datepicker-lt.min.js +1 -1
  180. data/templates/jquery/i18n/jquery.ui/datepicker-lv.min.js +1 -1
  181. data/templates/jquery/i18n/jquery.ui/datepicker-ml.min.js +2 -2
  182. data/templates/jquery/i18n/jquery.ui/datepicker-ms.min.js +1 -1
  183. data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
  184. data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +1 -1
  185. data/templates/jquery/i18n/jquery.ui/datepicker-pl.min.js +1 -1
  186. data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.min.js +1 -1
  187. data/templates/jquery/i18n/jquery.ui/datepicker-pt.min.js +1 -1
  188. data/templates/jquery/i18n/jquery.ui/datepicker-rm.min.js +1 -1
  189. data/templates/jquery/i18n/jquery.ui/datepicker-ro.min.js +1 -1
  190. data/templates/jquery/i18n/jquery.ui/datepicker-ru.min.js +1 -1
  191. data/templates/jquery/i18n/jquery.ui/datepicker-sk.min.js +1 -1
  192. data/templates/jquery/i18n/jquery.ui/datepicker-sl.min.js +1 -1
  193. data/templates/jquery/i18n/jquery.ui/datepicker-sq.min.js +1 -1
  194. data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.min.js +1 -1
  195. data/templates/jquery/i18n/jquery.ui/datepicker-sr.min.js +1 -1
  196. data/templates/jquery/i18n/jquery.ui/datepicker-sv.min.js +1 -1
  197. data/templates/jquery/i18n/jquery.ui/datepicker-ta.min.js +1 -1
  198. data/templates/jquery/i18n/jquery.ui/datepicker-th.min.js +1 -1
  199. data/templates/jquery/i18n/jquery.ui/datepicker-tj.min.js +1 -1
  200. data/templates/jquery/i18n/jquery.ui/datepicker-tr.min.js +1 -1
  201. data/templates/jquery/i18n/jquery.ui/datepicker-uk.min.js +1 -1
  202. data/templates/jquery/i18n/jquery.ui/datepicker-vi.min.js +1 -1
  203. data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.min.js +1 -1
  204. data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.min.js +1 -1
  205. data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.min.js +1 -1
  206. data/templates/jquery/jquery-ui.js +217 -104
  207. data/templates/jquery/jquery-ui.min.js +437 -436
  208. data/templates/jquery/jquery.bgiframe.min.js +1 -1
  209. data/templates/jquery/jquery.contextMenu.min.js +7 -7
  210. data/templates/jquery/jquery.cookie.js +60 -58
  211. data/templates/jquery/jquery.cookie.min.js +1 -1
  212. data/templates/jquery/jquery.dotimeout.min.js +2 -2
  213. data/templates/jquery/jquery.dst.min.js +4 -4
  214. data/templates/jquery/jquery.farbtastic.min.js +10 -10
  215. data/templates/jquery/jquery.form.js +15 -5
  216. data/templates/jquery/jquery.form.min.js +20 -20
  217. data/templates/jquery/jquery.haml.min.js +5 -5
  218. data/templates/jquery/jquery.hotkeys.min.js +3 -3
  219. data/templates/jquery/jquery.js +8205 -8170
  220. data/templates/jquery/jquery.layout.min.js +48 -50
  221. data/templates/jquery/jquery.min.js +166 -167
  222. data/templates/jquery/jquery.mousewheel.min.js +2 -2
  223. data/templates/jquery/jquery.offline.min.js +4 -4
  224. data/templates/jquery/jquery.pngFix.js +28 -30
  225. data/templates/jquery/jquery.pngFix.min.js +5 -5
  226. data/templates/jquery/jquery.rails.js +166 -0
  227. data/templates/jquery/jquery.rails.min.js +6 -0
  228. data/templates/jquery/jquery.replacetext.min.js +1 -1
  229. data/templates/jquery/jquery.themeswitchertool.min.js +4 -4
  230. data/templates/jquery/jquery.tmpl.js +14 -12
  231. data/templates/jquery/jquery.tmpl.min.js +12 -12
  232. data/templates/jquery/jquery.tmplPlus.js +2 -2
  233. data/templates/jquery/jquery.tmplPlus.min.js +3 -3
  234. data/templates/jquery/jquery.tokeninput.js +729 -0
  235. data/templates/jquery/jquery.tokeninput.min.js +14 -0
  236. data/templates/jquery/jquery/ui/_theme.scss +23 -16
  237. data/templates/jquery/jquery/ui/black-tie/ui-icons_4ca300_256x240.png +0 -0
  238. data/templates/jquery/jquery/ui/black-tie/ui-icons_bbbbbb_256x240.png +0 -0
  239. data/templates/jquery/jquery/ui/black-tie/ui-icons_ededed_256x240.png +0 -0
  240. data/templates/jquery/jquery/ui/black-tie/ui-icons_ffcf29_256x240.png +0 -0
  241. data/templates/jquery/jquery/ui/tokeninput.facebook.scss +95 -0
  242. data/templates/jquery/jquery/ui/tokeninput.mac.scss +164 -0
  243. data/templates/jquery/jquery/ui/tokeninput.scss +85 -0
  244. data/templates/jquery/jquery/ui/vader/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  245. data/templates/jquery/jquery/ui/vader/ui-icons_bbbbbb_256x240.png +0 -0
  246. data/templates/jquery/jquery/ui/vader/ui-icons_c98000_256x240.png +0 -0
  247. data/templates/jquery/jquery/ui/vader/ui-icons_f29a00_256x240.png +0 -0
  248. data/templates/jquery/json.min.js +6 -6
  249. data/templates/jquery/json2.js +214 -214
  250. data/templates/jquery/json2.min.js +5 -6
  251. data/templates/jquery/manifest.rb +9 -2
  252. data/templates/jstree/jquery.jstree.min.js +222 -224
  253. data/templates/mobile/config/initializers/mobile.rb +1 -1
  254. data/templates/mobile/jquery.mobile.js +887 -404
  255. data/templates/mobile/jquery.mobile.min.js +4 -4
  256. data/templates/mobile/jquery/mobile/_base.scss +50 -26
  257. data/templates/mobile/jquery/mobile/default.scss +59 -63
  258. data/templates/mobile/jquery/mobile/valencia.scss +44 -42
  259. data/templates/ribbon/jquery.ribbon.min.js +14 -14
  260. data/templates/tiny_mce/manifest.rb +4 -0
  261. data/templates/tiny_mce/tiny_mce/langs/de.js +1 -1
  262. data/templates/tiny_mce/tiny_mce/langs/en.js +1 -1
  263. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -1
  264. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/de_dlg.js +1 -1
  265. data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +1 -1
  266. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -1
  267. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -1
  268. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
  269. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -1
  270. data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
  271. data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin_src.js +1 -0
  272. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
  273. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -1
  274. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
  275. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -1
  276. data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +1 -1
  277. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
  278. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -1
  279. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -1
  280. data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +1 -1
  281. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -1
  282. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +1 -1
  283. data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin.js +1 -0
  284. data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin_src.js +1 -0
  285. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -1
  286. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -1
  287. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
  288. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -1
  289. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
  290. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -1
  291. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +1 -1
  292. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
  293. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -1
  294. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
  295. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1
  296. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -1
  297. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +1 -1
  298. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +1 -1
  299. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
  300. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1
  301. data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +1 -1
  302. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de_dlg.js +1 -1
  303. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +1 -1
  304. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -1
  305. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -1
  306. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -1
  307. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +1 -1
  308. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +1 -1
  309. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
  310. data/templates/tiny_mce/tiny_mce/utils/form_utils.js +1 -1
  311. data/templates/tiny_mce/tiny_mce/utils/validate.js +1 -1
  312. data/templates/tools/flowplayer.min.js +29 -30
  313. data/templates/tools/jquery.tools.min.js +96 -96
  314. data/templates/tools/swfobject.min.js +18 -19
  315. metadata +95 -16
  316. data/templates/jquery/jrails.js +0 -200
  317. data/templates/jquery/jrails.min.js +0 -8
@@ -3,4 +3,4 @@ require 'jquery/mobile'
3
3
  ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :mobile_default => ['compiled/jquery/mobile/default.css']
4
4
  ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :mobile_valencia => ['compiled/jquery/mobile/valencia.css']
5
5
 
6
- ActionView::Helpers::AssetTagHelper.register_javascript_expansion :mobile => ['jquery.min', 'jquery.mobile.min']
6
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :mobile => ['jquery.mobile.min']
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jQuery UI Widget @VERSION
3
3
  *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
4
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
6
6
  * http://jquery.org/license
7
7
  *
@@ -96,19 +96,15 @@
96
96
 
97
97
  if (isMethodCall) {
98
98
  this.each(function() {
99
- var instance = $.data(this, name),
100
- methodValue = instance && $.isFunction(instance[options]) ?
101
- instance[ options ].apply(instance, args) :
102
- instance;
103
- // TODO: add this back in 1.9 and use $.error() (see #5972)
104
- // if ( !instance ) {
105
- // throw "cannot call methods on " + name + " prior to initialization; " +
106
- // "attempted to call method '" + options + "'";
107
- // }
108
- // if ( !$.isFunction( instance[options] ) ) {
109
- // throw "no such method '" + options + "' for " + name + " widget instance";
110
- // }
111
- // var methodValue = instance[ options ].apply( instance, args );
99
+ var instance = $.data(this, name);
100
+ if (!instance) {
101
+ throw "cannot call methods on " + name + " prior to initialization; " +
102
+ "attempted to call method '" + options + "'";
103
+ }
104
+ if (!$.isFunction(instance[options])) {
105
+ throw "no such method '" + options + "' for " + name + " widget instance";
106
+ }
107
+ var methodValue = instance[ options ].apply(instance, args);
112
108
  if (methodValue !== instance && methodValue !== undefined) {
113
109
  returnValue = methodValue;
114
110
  return false;
@@ -162,7 +158,11 @@
162
158
  this._init();
163
159
  },
164
160
  _getCreateOptions: function() {
165
- return $.metadata && $.metadata.get(this.element[0])[ this.widgetName ];
161
+ var options = {};
162
+ if ($.metadata) {
163
+ options = $.metadata.get(element)[ this.widgetName ];
164
+ }
165
+ return options;
166
166
  },
167
167
  _create: function() {
168
168
  },
@@ -436,7 +436,7 @@
436
436
  var fakeBody = $("<body>").prependTo("html"),
437
437
  fbCSS = fakeBody[0].style,
438
438
  vendors = ['webkit','moz','o'],
439
- webos = window.palmGetResource || window.PalmServiceBridge, //only used to rule out scrollTop
439
+ webos = "palmGetResource" in window, //only used to rule out scrollTop
440
440
  bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB
441
441
 
442
442
  //thx Modernizr
@@ -494,7 +494,8 @@
494
494
  cssPseudoElement: !!propExists('content'),
495
495
  boxShadow: !!propExists('boxShadow') && !bb,
496
496
  scrollTop: ("pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[0]) && !webos,
497
- dynamicBaseTag: baseTagTest()
497
+ dynamicBaseTag: baseTagTest(),
498
+ eventCapture: ("addEventListener" in document) // This is a weak test. We may want to beef this up later.
498
499
  });
499
500
 
500
501
  fakeBody.remove();
@@ -506,6 +507,442 @@
506
507
 
507
508
  })(jQuery);
508
509
 
510
+ /*
511
+ * jQuery Mobile Framework : "mouse" plugin
512
+ * Copyright (c) jQuery Project
513
+ * Dual licensed under the MIT or GPL Version 2 licenses.
514
+ * http://jquery.org/license
515
+ */
516
+
517
+ // This plugin is an experiment for abstracting away the touch and mouse
518
+ // events so that developers don't have to worry about which method of input
519
+ // the device their document is loaded on supports.
520
+ //
521
+ // The idea here is to allow the developer to register listeners for the
522
+ // basic mouse events, such as mousedown, mousemove, mouseup, and click,
523
+ // and the plugin will take care of registering the correct listeners
524
+ // behind the scenes to invoke the listener at the fastest possible time
525
+ // for that device, while still retaining the order of event firing in
526
+ // the traditional mouse environment, should multiple handlers be registered
527
+ // on the same element for different events.
528
+ //
529
+ // The current version exposes the following virtual events to jQuery bind methods:
530
+ // "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
531
+
532
+ (function($, window, document, undefined) {
533
+
534
+ var dataPropertyName = "virtualMouseBindings",
535
+ touchTargetPropertyName = "virtualTouchID",
536
+ virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),
537
+ touchEventProps = "clientX clientY pageX pageY screenX screenY".split(" "),
538
+ activeDocHandlers = {},
539
+ resetTimerID = 0,
540
+ startX = 0,
541
+ startY = 0,
542
+ didScroll = false,
543
+ clickBlockList = [],
544
+ blockMouseTriggers = false,
545
+ blockTouchTriggers = false,
546
+ eventCaptureSupported = $.support.eventCapture,
547
+ $document = $(document),
548
+ nextTouchID = 1,
549
+ lastTouchID = 0;
550
+
551
+ $.vmouse = {
552
+ moveDistanceThreshold: 10,
553
+ clickDistanceThreshold: 10,
554
+ resetTimerDuration: 1500
555
+ };
556
+
557
+ function getNativeEvent(event) {
558
+ while (event && typeof event.originalEvent !== "undefined") {
559
+ event = event.originalEvent;
560
+ }
561
+ return event;
562
+ }
563
+
564
+ function createVirtualEvent(event, eventType) {
565
+ var t = event.type;
566
+ event = $.Event(event);
567
+ event.type = eventType;
568
+
569
+ var oe = event.originalEvent;
570
+ var props = $.event.props;
571
+
572
+ // copy original event properties over to the new event
573
+ // this would happen if we could call $.event.fix instead of $.Event
574
+ // but we don't have a way to force an event to be fixed multiple times
575
+ if (oe) {
576
+ for (var i = props.length, prop; i;) {
577
+ prop = props[ --i ];
578
+ event[prop] = oe[prop];
579
+ }
580
+ }
581
+
582
+ if (t.search(/^touch/) !== -1) {
583
+ var ne = getNativeEvent(oe),
584
+ t = ne.touches,
585
+ ct = ne.changedTouches,
586
+ touch = (t && t.length) ? t[0] : ((ct && ct.length) ? ct[0] : undefined);
587
+ if (touch) {
588
+ for (var i = 0, len = touchEventProps.length; i < len; i++) {
589
+ var prop = touchEventProps[i];
590
+ event[prop] = touch[prop];
591
+ }
592
+ }
593
+ }
594
+
595
+ return event;
596
+ }
597
+
598
+ function getVirtualBindingFlags(element) {
599
+ var flags = {};
600
+ while (element) {
601
+ var b = $.data(element, dataPropertyName);
602
+ for (var k in b) {
603
+ if (b[k]) {
604
+ flags[k] = flags.hasVirtualBinding = true;
605
+ }
606
+ }
607
+ element = element.parentNode;
608
+ }
609
+ return flags;
610
+ }
611
+
612
+ function getClosestElementWithVirtualBinding(element, eventType) {
613
+ while (element) {
614
+ var b = $.data(element, dataPropertyName);
615
+ if (b && (!eventType || b[eventType])) {
616
+ return element;
617
+ }
618
+ element = element.parentNode;
619
+ }
620
+ return null;
621
+ }
622
+
623
+ function enableTouchBindings() {
624
+ blockTouchTriggers = false;
625
+ }
626
+
627
+ function disableTouchBindings() {
628
+ blockTouchTriggers = true;
629
+ }
630
+
631
+ function enableMouseBindings() {
632
+ lastTouchID = 0;
633
+ clickBlockList.length = 0;
634
+ blockMouseTriggers = false;
635
+
636
+ // When mouse bindings are enabled, our
637
+ // touch bindings are disabled.
638
+ disableTouchBindings();
639
+ }
640
+
641
+ function disableMouseBindings() {
642
+ // When mouse bindings are disabled, our
643
+ // touch bindings are enabled.
644
+ enableTouchBindings();
645
+ }
646
+
647
+ function startResetTimer() {
648
+ clearResetTimer();
649
+ resetTimerID = setTimeout(function() {
650
+ resetTimerID = 0;
651
+ enableMouseBindings();
652
+ }, $.vmouse.resetTimerDuration);
653
+ }
654
+
655
+ function clearResetTimer() {
656
+ if (resetTimerID) {
657
+ clearTimeout(resetTimerID);
658
+ resetTimerID = 0;
659
+ }
660
+ }
661
+
662
+ function triggerVirtualEvent(eventType, event, flags) {
663
+ var defaultPrevented = false;
664
+
665
+ if ((flags && flags[eventType]) || (!flags && getClosestElementWithVirtualBinding(event.target, eventType))) {
666
+ var ve = createVirtualEvent(event, eventType);
667
+ $(event.target).trigger(ve);
668
+ defaultPrevented = ve.isDefaultPrevented();
669
+ }
670
+
671
+ return defaultPrevented;
672
+ }
673
+
674
+ function mouseEventCallback(event) {
675
+ var touchID = $.data(event.target, touchTargetPropertyName);
676
+ if (!blockMouseTriggers && (!lastTouchID || lastTouchID !== touchID)) {
677
+ triggerVirtualEvent("v" + event.type, event);
678
+ }
679
+ }
680
+
681
+ function handleTouchStart(event) {
682
+ var touches = getNativeEvent(event).touches;
683
+ if (touches && touches.length === 1) {
684
+ var target = event.target,
685
+ flags = getVirtualBindingFlags(target);
686
+
687
+ if (flags.hasVirtualBinding) {
688
+ lastTouchID = nextTouchID++;
689
+ $.data(target, touchTargetPropertyName, lastTouchID);
690
+
691
+ clearResetTimer();
692
+
693
+ disableMouseBindings();
694
+ didScroll = false;
695
+
696
+ var t = getNativeEvent(event).touches[0];
697
+ startX = t.pageX;
698
+ startY = t.pageY;
699
+
700
+ triggerVirtualEvent("vmouseover", event, flags);
701
+ triggerVirtualEvent("vmousedown", event, flags);
702
+ }
703
+ }
704
+ }
705
+
706
+ function handleScroll(event) {
707
+ if (blockTouchTriggers) {
708
+ return;
709
+ }
710
+
711
+ if (!didScroll) {
712
+ triggerVirtualEvent("vmousecancel", event, getVirtualBindingFlags(event.target));
713
+ }
714
+
715
+ didScroll = true;
716
+ startResetTimer();
717
+ }
718
+
719
+ function handleTouchMove(event) {
720
+ if (blockTouchTriggers) {
721
+ return;
722
+ }
723
+
724
+ var t = getNativeEvent(event).touches[0];
725
+
726
+ var didCancel = didScroll,
727
+ moveThreshold = $.vmouse.moveDistanceThreshold;
728
+ didScroll = didScroll
729
+ || (Math.abs(t.pageX - startX) > moveThreshold || Math.abs(t.pageY - startY) > moveThreshold);
730
+
731
+ var flags = getVirtualBindingFlags(event.target);
732
+ if (didScroll && !didCancel) {
733
+ triggerVirtualEvent("vmousecancel", event, flags);
734
+ }
735
+ triggerVirtualEvent("vmousemove", event, flags);
736
+ startResetTimer();
737
+ }
738
+
739
+ function handleTouchEnd(event) {
740
+ if (blockTouchTriggers) {
741
+ return;
742
+ }
743
+
744
+ disableTouchBindings();
745
+
746
+ var flags = getVirtualBindingFlags(event.target);
747
+ triggerVirtualEvent("vmouseup", event, flags);
748
+ if (!didScroll) {
749
+ if (triggerVirtualEvent("vclick", event, flags)) {
750
+ // The target of the mouse events that follow the touchend
751
+ // event don't necessarily match the target used during the
752
+ // touch. This means we need to rely on coordinates for blocking
753
+ // any click that is generated.
754
+ var t = getNativeEvent(event).changedTouches[0];
755
+ clickBlockList.push({ touchID: lastTouchID, x: t.clientX, y: t.clientY });
756
+
757
+ // Prevent any mouse events that follow from triggering
758
+ // virtual event notifications.
759
+ blockMouseTriggers = true;
760
+ }
761
+ }
762
+ triggerVirtualEvent("vmouseout", event, flags);
763
+ didScroll = false;
764
+
765
+ startResetTimer();
766
+ }
767
+
768
+ function hasVirtualBindings(ele) {
769
+ var bindings = $.data(ele, dataPropertyName), k;
770
+ if (bindings) {
771
+ for (k in bindings) {
772
+ if (bindings[k]) {
773
+ return true;
774
+ }
775
+ }
776
+ }
777
+ return false;
778
+ }
779
+
780
+ function dummyMouseHandler() {
781
+ }
782
+
783
+ function getSpecialEventObject(eventType) {
784
+ var realType = eventType.substr(1);
785
+ return {
786
+ setup: function(data, namespace) {
787
+ // If this is the first virtual mouse binding for this element,
788
+ // add a bindings object to its data.
789
+
790
+ if (!hasVirtualBindings(this)) {
791
+ $.data(this, dataPropertyName, {});
792
+ }
793
+
794
+ // If setup is called, we know it is the first binding for this
795
+ // eventType, so initialize the count for the eventType to zero.
796
+
797
+ var bindings = $.data(this, dataPropertyName);
798
+ bindings[eventType] = true;
799
+
800
+ // If this is the first virtual mouse event for this type,
801
+ // register a global handler on the document.
802
+
803
+ activeDocHandlers[eventType] = (activeDocHandlers[eventType] || 0) + 1;
804
+ if (activeDocHandlers[eventType] === 1) {
805
+ $document.bind(realType, mouseEventCallback);
806
+ }
807
+
808
+ // Some browsers, like Opera Mini, won't dispatch mouse/click events
809
+ // for elements unless they actually have handlers registered on them.
810
+ // To get around this, we register dummy handlers on the elements.
811
+
812
+ $(this).bind(realType, dummyMouseHandler);
813
+
814
+ // For now, if event capture is not supported, we rely on mouse handlers.
815
+ if (eventCaptureSupported) {
816
+ // If this is the first virtual mouse binding for the document,
817
+ // register our touchstart handler on the document.
818
+
819
+ activeDocHandlers["touchstart"] = (activeDocHandlers["touchstart"] || 0) + 1;
820
+ if (activeDocHandlers["touchstart"] === 1) {
821
+ $document.bind("touchstart", handleTouchStart)
822
+
823
+ .bind("touchend", handleTouchEnd)
824
+
825
+ // On touch platforms, touching the screen and then dragging your finger
826
+ // causes the window content to scroll after some distance threshold is
827
+ // exceeded. On these platforms, a scroll prevents a click event from being
828
+ // dispatched, and on some platforms, even the touchend is suppressed. To
829
+ // mimic the suppression of the click event, we need to watch for a scroll
830
+ // event. Unfortunately, some platforms like iOS don't dispatch scroll
831
+ // events until *AFTER* the user lifts their finger (touchend). This means
832
+ // we need to watch both scroll and touchmove events to figure out whether
833
+ // or not a scroll happenens before the touchend event is fired.
834
+
835
+ .bind("touchmove", handleTouchMove)
836
+ .bind("scroll", handleScroll);
837
+ }
838
+ }
839
+ },
840
+
841
+ teardown: function(data, namespace) {
842
+ // If this is the last virtual binding for this eventType,
843
+ // remove its global handler from the document.
844
+
845
+ --activeDocHandlers[eventType];
846
+ if (!activeDocHandlers[eventType]) {
847
+ $document.unbind(realType, mouseEventCallback);
848
+ }
849
+
850
+ if (eventCaptureSupported) {
851
+ // If this is the last virtual mouse binding in existence,
852
+ // remove our document touchstart listener.
853
+
854
+ --activeDocHandlers["touchstart"];
855
+ if (!activeDocHandlers["touchstart"]) {
856
+ $document.unbind("touchstart", handleTouchStart)
857
+ .unbind("touchmove", handleTouchMove)
858
+ .unbind("touchend", handleTouchEnd)
859
+ .unbind("scroll", handleScroll);
860
+ }
861
+ }
862
+
863
+ var $this = $(this),
864
+ bindings = $.data(this, dataPropertyName);
865
+ bindings[eventType] = false;
866
+
867
+ // Unregister the dummy event handler.
868
+
869
+ $this.unbind(realType, dummyMouseHandler);
870
+
871
+ // If this is the last virtual mouse binding on the
872
+ // element, remove the binding data from the element.
873
+
874
+ if (!hasVirtualBindings(this)) {
875
+ $this.removeData(dataPropertyName);
876
+ }
877
+ }
878
+ };
879
+ }
880
+
881
+ // Expose our custom events to the jQuery bind/unbind mechanism.
882
+
883
+ for (var i = 0; i < virtualEventNames.length; i++) {
884
+ $.event.special[virtualEventNames[i]] = getSpecialEventObject(virtualEventNames[i]);
885
+ }
886
+
887
+ // Add a capture click handler to block clicks.
888
+ // Note that we require event capture support for this so if the device
889
+ // doesn't support it, we punt for now and rely solely on mouse events.
890
+ if (eventCaptureSupported) {
891
+ document.addEventListener("click", function(e) {
892
+ var cnt = clickBlockList.length;
893
+ var target = e.target;
894
+ if (cnt) {
895
+ var x = e.clientX,
896
+ y = e.clientY,
897
+ threshold = $.vmouse.clickDistanceThreshold;
898
+
899
+ // The idea here is to run through the clickBlockList to see if
900
+ // the current click event is in the proximity of one of our
901
+ // vclick events that had preventDefault() called on it. If we find
902
+ // one, then we block the click.
903
+ //
904
+ // Why do we have to rely on proximity?
905
+ //
906
+ // Because the target of the touch event that triggered the vclick
907
+ // can be different from the target of the click event synthesized
908
+ // by the browser. The target of a mouse/click event that is syntehsized
909
+ // from a touch event seems to be implementation specific. For example,
910
+ // some browsers will fire mouse/click events for a link that is near
911
+ // a touch event, even though the target of the touchstart/touchend event
912
+ // says the user touched outside the link. Also, it seems that with most
913
+ // browsers, the target of the mouse/click event is not calculated until the
914
+ // time it is dispatched, so if you replace an element that you touched
915
+ // with another element, the target of the mouse/click will be the new
916
+ // element underneath that point.
917
+ //
918
+ // Aside from proximity, we also check to see if the target and any
919
+ // of its ancestors were the ones that blocked a click. This is necessary
920
+ // because of the strange mouse/click target calculation done in the
921
+ // Android 2.1 browser, where if you click on an element, and there is a
922
+ // mouse/click handler on one of its ancestors, the target will be the
923
+ // innermost child of the touched element, even if that child is no where
924
+ // near the point of touch.
925
+
926
+ var ele = target;
927
+ while (ele) {
928
+ for (var i = 0; i < cnt; i++) {
929
+ var o = clickBlockList[i],
930
+ touchID = 0;
931
+ if ((ele === target && Math.abs(o.x - x) < threshold && Math.abs(o.y - y) < threshold) || $.data(ele, touchTargetPropertyName) === o.touchID) {
932
+ // XXX: We may want to consider removing matches from the block list
933
+ // instead of waiting for the reset timer to fire.
934
+ e.preventDefault();
935
+ e.stopPropagation();
936
+ return;
937
+ }
938
+ }
939
+ ele = ele.parentNode;
940
+ }
941
+ }
942
+ }, true);
943
+ }
944
+ })(jQuery, window, document);
945
+
509
946
  /*
510
947
  * jQuery Mobile Framework : events
511
948
  * Copyright (c) jQuery Project
@@ -528,6 +965,13 @@
528
965
  touchStopEvent = supportTouch ? "touchend" : "mouseup",
529
966
  touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
530
967
 
968
+ function triggerCustomEvent(obj, eventType, event) {
969
+ var originalType = event.type;
970
+ event.type = eventType;
971
+ $.event.handle.call(obj, event);
972
+ event.type = originalType;
973
+ }
974
+
531
975
  // also handles scrollstop
532
976
  $.event.special.scrollstart = {
533
977
  enabled: true,
@@ -540,10 +984,7 @@
540
984
 
541
985
  function trigger(event, state) {
542
986
  scrolling = state;
543
- var originalType = event.type;
544
- event.type = scrolling ? "scrollstart" : "scrollstop";
545
- $.event.handle.call(thisObject, event);
546
- event.type = originalType;
987
+ triggerCustomEvent(thisObject, scrolling ? "scrollstart" : "scrollstop", event);
547
988
  }
548
989
 
549
990
  // iPhone triggers scroll after a small delay; use touchmove instead
@@ -571,71 +1012,40 @@
571
1012
  $this = $(thisObject);
572
1013
 
573
1014
  $this
574
- .bind("mousedown touchstart", function(event) {
575
- if (event.which && event.which !== 1 ||
576
- //check if event fired once already by a device that fires both mousedown and touchstart (while supporting both events)
577
- $this.jqmData("prevEvent") && $this.jqmData("prevEvent") !== event.type) {
1015
+ .bind("vmousedown", function(event) {
1016
+ if (event.which && event.which !== 1) {
578
1017
  return false;
579
1018
  }
580
1019
 
581
- //save event type so only this type is let through for a temp duration,
582
- //allowing quick repetitive taps but not duplicative events
583
- $this.jqmData("prevEvent", event.type);
584
- setTimeout(function() {
585
- $this.removeData("prevEvent");
586
- }, 800);
587
-
588
- var moved = false,
589
- touching = true,
1020
+ var touching = true,
590
1021
  origTarget = event.target,
591
1022
  origEvent = event.originalEvent,
592
- origPos = event.type == "touchstart" ? [origEvent.touches[0].pageX, origEvent.touches[0].pageY] : [ event.pageX, event.pageY ],
593
- originalType,
594
1023
  timer;
595
1024
 
596
-
597
- function moveHandler(event) {
598
- if (event.type == "scroll") {
599
- moved = true;
600
- return;
601
- }
602
- var newPageXY = event.type == "touchmove" ? event.originalEvent.touches[0] : event;
603
- if ((Math.abs(origPos[0] - newPageXY.pageX) > 10) ||
604
- (Math.abs(origPos[1] - newPageXY.pageY) > 10)) {
605
- moved = true;
606
- }
1025
+ function clearTapHandlers() {
1026
+ touching = false;
1027
+ clearTimeout(timer);
1028
+ $this.unbind("vclick", clickHandler).unbind("vmousecancel", clearTapHandlers);
607
1029
  }
608
1030
 
609
- timer = setTimeout(function() {
610
- if (touching && !moved) {
611
- originalType = event.type;
612
- event.type = "taphold";
613
- $.event.handle.call(thisObject, event);
614
- event.type = originalType;
615
- }
616
- }, 750);
617
-
618
- //scroll now cancels tap
619
- $(window).one("scroll", moveHandler);
620
-
621
- $this
622
- .bind("mousemove touchmove", moveHandler)
623
- .one("mouseup touchend", function(event) {
624
- $this.unbind("mousemove touchmove", moveHandler);
625
- $(window).unbind("scroll", moveHandler);
626
- clearTimeout(timer);
627
- touching = false;
1031
+ function clickHandler(event) {
1032
+ clearTapHandlers();
628
1033
 
629
1034
  /* ONLY trigger a 'tap' event if the start target is
630
1035
  * the same as the stop target.
631
1036
  */
632
- if (!moved && ( origTarget == event.target )) {
633
- originalType = event.type;
634
- event.type = "tap";
635
- $.event.handle.call(thisObject, event);
636
- event.type = originalType;
1037
+ if (origTarget == event.target) {
1038
+ triggerCustomEvent(thisObject, "tap", event);
637
1039
  }
638
- });
1040
+ }
1041
+
1042
+ $this.bind("vmousecancel", clearTapHandlers).bind("vclick", clickHandler);
1043
+
1044
+ timer = setTimeout(function() {
1045
+ if (touching) {
1046
+ triggerCustomEvent(thisObject, "taphold", event);
1047
+ }
1048
+ }, 750);
639
1049
  });
640
1050
  }
641
1051
  };
@@ -687,6 +1097,7 @@
687
1097
  Math.abs(start.coords[1] - stop.coords[1]) < 75) {
688
1098
  start.origin
689
1099
  .trigger("swipe")
1100
+
690
1101
  .trigger(start.coords[0] > stop.coords[0] ? "swipeleft" : "swiperight");
691
1102
  }
692
1103
  }
@@ -1199,6 +1610,7 @@
1199
1610
  options: {
1200
1611
  backBtnText: "Back",
1201
1612
  addBackBtn: true,
1613
+ backBtnTheme: null,
1202
1614
  degradeInputs: {
1203
1615
  color: false,
1204
1616
  date: false,
@@ -1268,7 +1680,12 @@
1268
1680
  $elem.jqmData("url") !== $.mobile.path.stripHash(location.hash) &&
1269
1681
  !leftbtn && $this.jqmData("backbtn") !== false) {
1270
1682
 
1271
- $("<a href='#' class='ui-btn-left' data-" + $.mobile.ns + "rel='back' data-" + $.mobile.ns + "icon='arrow-l'>" + o.backBtnText + "</a>").prependTo($this);
1683
+ var backBtn = $("<a href='#' class='ui-btn-left' data-" + $.mobile.ns + "rel='back' data-" + $.mobile.ns + "icon='arrow-l'>" + o.backBtnText + "</a>").prependTo($this);
1684
+
1685
+ //if theme is provided, override default inheritance
1686
+ if (o.backBtnTheme) {
1687
+ backBtn.attr("data-" + $.mobile.ns + "theme", o.backBtnTheme);
1688
+ }
1272
1689
  }
1273
1690
 
1274
1691
  //page title
@@ -1448,6 +1865,9 @@
1448
1865
  //if false, message will not appear, but loading classes will still be toggled on html el
1449
1866
  loadingMessage: "loading",
1450
1867
 
1868
+ //error response message - appears when an Ajax page request fails
1869
+ pageLoadErrorMessage: "Error Loading Page",
1870
+
1451
1871
  //configure meta viewport tag's content attr:
1452
1872
  //note: this feature is deprecated in A4 in favor of adding
1453
1873
  //the meta viewport element directly in the markup
@@ -1598,17 +2018,38 @@
1598
2018
  path.origin = path.get(location.protocol + '//' + location.host + location.pathname);
1599
2019
  },
1600
2020
 
1601
- //prefix a relative url with the current path
2021
+ // prefix a relative url with the current path
2022
+ // TODO force old relative deeplinks into new absolute path
1602
2023
  makeAbsolute: function(url) {
1603
- return path.get() + url;
2024
+ var isHashPath = path.isPath(location.hash);
2025
+
2026
+ if (path.isQuery(url)) {
2027
+ // if the path is a list of query params and the hash is a path
2028
+ // append the query params to the hash (without params or dialog keys).
2029
+ // otherwise use the pathname and append the query params
2030
+ return ( isHashPath ? path.cleanHash(location.hash) : location.pathname ) + url;
2031
+ }
2032
+
2033
+ // If the hash is a path, even if its not absolute, use it to prepend to the url
2034
+ // otherwise use the path with the trailing segement removed
2035
+ return ( isHashPath ? path.get() : path.get(location.pathname) ) + url;
2036
+ },
2037
+
2038
+ // test if a given url (string) is a path
2039
+ // NOTE might be exceptionally naive
2040
+ isPath: function(url) {
2041
+ return /\//.test(url);
2042
+ },
2043
+
2044
+ isQuery: function(url) {
2045
+ return /^\?/.test(url);
1604
2046
  },
1605
2047
 
1606
2048
  //return a url path with the window's location protocol/hostname/pathname removed
1607
2049
  clean: function(url) {
1608
- // Replace the protocol, host, and pathname only once at the beginning of the url to avoid
2050
+ // Replace the protocol host only once at the beginning of the url to avoid
1609
2051
  // problems when it's included as a part of a param
1610
- // Also, since all urls are absolute in IE, we need to remove the pathname as well.
1611
- var leadingUrlRootRegex = new RegExp("^" + location.protocol + "//" + location.host + location.pathname);
2052
+ var leadingUrlRootRegex = new RegExp("^" + location.protocol + "//" + location.host);
1612
2053
  return url.replace(leadingUrlRootRegex, "");
1613
2054
  },
1614
2055
 
@@ -1617,6 +2058,11 @@
1617
2058
  return url.replace(/^#/, "");
1618
2059
  },
1619
2060
 
2061
+ //remove the preceding hash, any query params, and dialog notations
2062
+ cleanHash: function(hash) {
2063
+ return path.stripHash(hash.replace(/\?.*$/, "").replace(dialogHashKey, ""));
2064
+ },
2065
+
1620
2066
  //check whether a url is referencing the same domain, or an external domain or different protocol
1621
2067
  //could be mailto, etc
1622
2068
  isExternal: function(url) {
@@ -1663,13 +2109,13 @@
1663
2109
  },
1664
2110
 
1665
2111
  // addNew is used whenever a new page is added
1666
- addNew: function(url, transition) {
2112
+ addNew: function(url, transition, title, storedTo) {
1667
2113
  //if there's forward history, wipe it
1668
2114
  if (urlHistory.getNext()) {
1669
2115
  urlHistory.clearForward();
1670
2116
  }
1671
2117
 
1672
- urlHistory.stack.push({url : url, transition: transition });
2118
+ urlHistory.stack.push({url : url, transition: transition, title: title, page: storedTo });
1673
2119
 
1674
2120
  urlHistory.activeIndex = urlHistory.stack.length - 1;
1675
2121
  },
@@ -1786,12 +2232,20 @@
1786
2232
 
1787
2233
  //direct focus to the page title, or otherwise first focusable element
1788
2234
  function reFocus(page) {
1789
- var pageTitle = page.find(".ui-title:eq(0)");
1790
- if (pageTitle.length) {
1791
- pageTitle.focus();
2235
+ var lastClicked = page.jqmData("lastClicked");
2236
+
2237
+ if (lastClicked && lastClicked.length) {
2238
+ lastClicked.focus();
1792
2239
  }
1793
2240
  else {
1794
- page.find(focusable).eq(0).focus();
2241
+ var pageTitle = page.find(".ui-title:eq(0)");
2242
+
2243
+ if (pageTitle.length) {
2244
+ pageTitle.focus();
2245
+ }
2246
+ else {
2247
+ page.find(focusable).eq(0).focus();
2248
+ }
1795
2249
  }
1796
2250
  }
1797
2251
 
@@ -1841,8 +2295,9 @@
1841
2295
  // changepage function
1842
2296
  $.mobile.changePage = function(to, transition, reverse, changeHash, fromHashChange) {
1843
2297
  //from is always the currently viewed page
1844
- var toIsArray = $.type(to) === "array",
1845
- toIsObject = $.type(to) === "object",
2298
+ var toType = $.type(to),
2299
+ toIsArray = toType === "array",
2300
+ toIsObject = toType === "object",
1846
2301
  from = toIsArray ? to[0] : $.mobile.activePage;
1847
2302
 
1848
2303
  to = toIsArray ? to[1] : to;
@@ -1853,15 +2308,18 @@
1853
2308
  type = 'get',
1854
2309
  isFormRequest = false,
1855
2310
  duplicateCachedPage = null,
1856
- currPage = urlHistory.getActive(),
2311
+ active = urlHistory.getActive(),
1857
2312
  back = false,
1858
- forward = false;
2313
+ forward = false,
2314
+ pageTitle = document.title;
1859
2315
 
1860
2316
 
1861
2317
  // If we are trying to transition to the same page that we are currently on ignore the request.
1862
2318
  // an illegal same page request is defined by the current page being the same as the url, as long as there's history
1863
2319
  // and to is not an array or object (those are allowed to be "same")
1864
- if (currPage && urlHistory.stack.length > 1 && currPage.url === url && !toIsArray && !toIsObject) {
2320
+ if (urlHistory.stack.length > 0
2321
+ && active.page.jqmData("url") === url
2322
+ && !toIsArray && !toIsObject) {
1865
2323
  return;
1866
2324
  }
1867
2325
  else if (isPageTransitioning) {
@@ -1879,7 +2337,7 @@
1879
2337
  isBack: function() {
1880
2338
  forward = !(back = true);
1881
2339
  reverse = true;
1882
- transition = transition || currPage.transition;
2340
+ transition = transition || active.transition;
1883
2341
  },
1884
2342
  isForward: function() {
1885
2343
  forward = !(back = false);
@@ -1912,7 +2370,7 @@
1912
2370
  }
1913
2371
 
1914
2372
  //kill the keyboard
1915
- $(window.document.activeElement).add("input:focus, textarea:focus, select:focus").blur();
2373
+ $(window.document.activeElement || "").add("input:focus, textarea:focus, select:focus").blur();
1916
2374
 
1917
2375
  function defaultTransition() {
1918
2376
  if (transition === undefined) {
@@ -1943,13 +2401,15 @@
1943
2401
 
1944
2402
  if (from) {
1945
2403
  //set as data for returning to that spot
1946
- from.jqmData("lastScroll", currScroll);
2404
+ from
2405
+ .jqmData("lastScroll", currScroll)
2406
+ .jqmData("lastClicked", $activeClickedLink);
1947
2407
  //trigger before show/hide events
1948
2408
  from.data("page")._trigger("beforehide", null, { nextPage: to });
1949
2409
  }
1950
2410
  to.data("page")._trigger("beforeshow", null, { prevPage: from || $("") });
1951
2411
 
1952
- function loadComplete() {
2412
+ function pageChangeComplete() {
1953
2413
 
1954
2414
  if (changeHash !== false && url) {
1955
2415
  //disable hash listening temporarily
@@ -1958,11 +2418,20 @@
1958
2418
  path.set(url);
1959
2419
  }
1960
2420
 
2421
+ //if title element wasn't found, try the page div data attr too
2422
+ var newPageTitle = to.jqmData("title") || to.find(".ui-header .ui-title").text();
2423
+ if (!!newPageTitle && pageTitle == document.title) {
2424
+ pageTitle = newPageTitle;
2425
+ }
2426
+
1961
2427
  //add page to history stack if it's not back or forward
1962
2428
  if (!back && !forward) {
1963
- urlHistory.addNew(url, transition);
2429
+ urlHistory.addNew(url, transition, pageTitle, to);
1964
2430
  }
1965
2431
 
2432
+ //set page title
2433
+ document.title = urlHistory.getActive().title;
2434
+
1966
2435
  removeActiveLinkClass();
1967
2436
 
1968
2437
  //jump to top or prev scroll, sometimes on iOS the page has not rendered yet. I could only get by this with a setTimeout, but would like to avoid that.
@@ -2004,9 +2473,10 @@
2004
2473
  pageContainerClasses = [];
2005
2474
  }
2006
2475
 
2476
+ //clear page loader
2477
+ $.mobile.pageLoading(true);
2007
2478
 
2008
2479
  if (transition && (transition !== 'none')) {
2009
- $.mobile.pageLoading(true);
2010
2480
  if ($.inArray(transition, perspectiveTransitions) >= 0) {
2011
2481
  addContainerClass('ui-mobile-viewport-perspective');
2012
2482
  }
@@ -2025,17 +2495,16 @@
2025
2495
  if (from) {
2026
2496
  from.removeClass($.mobile.activePageClass);
2027
2497
  }
2028
- loadComplete();
2498
+ pageChangeComplete();
2029
2499
  removeContainerClasses();
2030
2500
  });
2031
2501
  }
2032
2502
  else {
2033
- $.mobile.pageLoading(true);
2034
2503
  if (from) {
2035
2504
  from.removeClass($.mobile.activePageClass);
2036
2505
  }
2037
2506
  to.addClass($.mobile.activePageClass);
2038
- loadComplete();
2507
+ pageChangeComplete();
2039
2508
  }
2040
2509
  }
2041
2510
 
@@ -2092,15 +2561,21 @@
2092
2561
  url: fileUrl,
2093
2562
  type: type,
2094
2563
  data: data,
2564
+ dataType: "html",
2095
2565
  success: function(html) {
2096
2566
  //pre-parse html to check for a data-url,
2097
2567
  //use it as the new fileUrl, base path, etc
2098
2568
  var all = $("<div></div>"),
2099
2569
  redirectLoc,
2570
+
2571
+ //page title regexp
2572
+ newPageTitle = html.match(/<title[^>]*>([^<]*)/) && RegExp.$1,
2573
+
2100
2574
  // TODO handle dialogs again
2101
2575
  pageElemRegex = new RegExp(".*(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>).*"),
2102
2576
  dataUrlRegex = new RegExp("\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?");
2103
2577
 
2578
+
2104
2579
  // data-url must be provided for the base tag so resource requests can be directed to the
2105
2580
  // correct url. loading into a temprorary element makes these requests immediately
2106
2581
  if (pageElemRegex.test(html) && RegExp.$1 && dataUrlRegex.test(RegExp.$1) && RegExp.$1) {
@@ -2123,15 +2598,21 @@
2123
2598
  all.get(0).innerHTML = html;
2124
2599
  to = all.find(":jqmData(role='page'), :jqmData(role='dialog')").first();
2125
2600
 
2601
+ //finally, if it's defined now, set the page title for storage in urlHistory
2602
+ if (newPageTitle) {
2603
+ pageTitle = newPageTitle;
2604
+ }
2605
+
2126
2606
  //rewrite src and href attrs to use a base url
2127
2607
  if (!$.support.dynamicBaseTag) {
2128
2608
  var newPath = path.get(fileUrl);
2129
- to.find('[src],link[href]').each(function() {
2609
+ to.find("[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]").each(function() {
2130
2610
  var thisAttr = $(this).is('[href]') ? 'href' : 'src',
2131
2611
  thisUrl = $(this).attr(thisAttr);
2132
2612
 
2613
+
2133
2614
  //if full path exists and is same, chop it - helps IE out
2134
- thisUrl.replace(location.protocol + '//' + location.host + location.pathname, '');
2615
+ thisUrl = thisUrl.replace(location.protocol + '//' + location.host + location.pathname, '');
2135
2616
 
2136
2617
  if (!/^(\w+:|#|\/)/.test(thisUrl)) {
2137
2618
  $(this).attr(thisAttr, newPath + thisUrl);
@@ -2150,19 +2631,29 @@
2150
2631
  }, 0);
2151
2632
  },
2152
2633
  error: function() {
2634
+
2635
+ //remove loading message
2153
2636
  $.mobile.pageLoading(true);
2637
+
2638
+ //clear out the active button state
2154
2639
  removeActiveLinkClass(true);
2640
+
2641
+ //set base back to current path
2155
2642
  if (base) {
2156
2643
  base.set(path.get());
2157
2644
  }
2158
- $("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>")
2645
+
2646
+ //release transition lock so navigation is free again
2647
+ releasePageTransitionLock();
2648
+
2649
+ //show error message
2650
+ $("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>" + $.mobile.pageLoadErrorMessage + "</h1></div>")
2159
2651
  .css({ "display": "block", "opacity": 0.96, "top": $(window).scrollTop() + 100 })
2160
2652
  .appendTo($.mobile.pageContainer)
2161
2653
  .delay(800)
2162
2654
  .fadeOut(400, function() {
2163
2655
  $(this).remove();
2164
2656
  });
2165
- releasePageTransitionLock();
2166
2657
  }
2167
2658
  });
2168
2659
  }
@@ -2207,14 +2698,36 @@
2207
2698
  event.preventDefault();
2208
2699
  });
2209
2700
 
2701
+ function findClosestLink(ele) {
2702
+ while (ele) {
2703
+ if (ele.nodeName.toLowerCase() == "a") {
2704
+ break;
2705
+ }
2706
+ ele = ele.parentNode;
2707
+ }
2708
+ return ele;
2709
+ }
2710
+
2711
+ //add active state on vclick
2712
+ $(document).bind("vclick", function(event) {
2713
+ var link = findClosestLink(event.target);
2714
+ if (link) {
2715
+ $(link).closest(".ui-btn").not(".ui-disabled").addClass($.mobile.activeBtnClass);
2716
+ }
2717
+ });
2718
+
2210
2719
 
2211
2720
  //click routing - direct to HTTP or Ajax, accordingly
2212
- $("a").live("click", function(event) {
2721
+ $(document).bind("click", function(event) {
2722
+ var link = findClosestLink(event.target);
2723
+ if (!link) {
2724
+ return;
2725
+ }
2213
2726
 
2214
- var $this = $(this),
2727
+ var $link = $(link),
2215
2728
 
2216
2729
  //get href, if defined, otherwise fall to null #
2217
- href = $this.attr("href") || "#",
2730
+ href = $link.attr("href") || "#",
2218
2731
 
2219
2732
  //cache a check for whether the link had a protocol
2220
2733
  //if this is true and the link was same domain, we won't want
@@ -2226,7 +2739,7 @@
2226
2739
  url = path.clean(href),
2227
2740
 
2228
2741
  //rel set to external
2229
- isRelExternal = $this.is("[rel='external']"),
2742
+ isRelExternal = $link.is("[rel='external']"),
2230
2743
 
2231
2744
  //rel set to external
2232
2745
  isEmbeddedPage = path.isEmbeddedPage(url),
@@ -2245,13 +2758,13 @@
2245
2758
  isExternal = (path.isExternal(url) && !isCrossDomainPageLoad) || (isRelExternal && !isEmbeddedPage),
2246
2759
 
2247
2760
  //if target attr is specified we mimic _blank... for now
2248
- hasTarget = $this.is("[target]"),
2761
+ hasTarget = $link.is("[target]"),
2249
2762
 
2250
2763
  //if data-ajax attr is set to false, use the default behavior of a link
2251
- hasAjaxDisabled = $this.is(":jqmData(ajax='false')");
2764
+ hasAjaxDisabled = $link.is(":jqmData(ajax='false')");
2252
2765
 
2253
2766
  //if there's a data-rel=back attr, go back in history
2254
- if ($this.is(":jqmData(rel='back')")) {
2767
+ if ($link.is(":jqmData(rel='back')")) {
2255
2768
  window.history.back();
2256
2769
  return false;
2257
2770
  }
@@ -2264,7 +2777,7 @@
2264
2777
  return;
2265
2778
  }
2266
2779
 
2267
- $activeClickedLink = $this.closest(".ui-btn").addClass($.mobile.activeBtnClass);
2780
+ $activeClickedLink = $link.closest(".ui-btn");
2268
2781
 
2269
2782
  if (isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled ||
2270
2783
  // TODO: deprecated - remove at 1.0
@@ -2277,30 +2790,28 @@
2277
2790
  //use default click handling
2278
2791
  return;
2279
2792
  }
2280
- else {
2281
- //use ajax
2282
- var transition = $this.jqmData("transition"),
2283
- direction = $this.jqmData("direction"),
2284
- reverse = (direction && direction === "reverse") ||
2285
- // deprecated - remove by 1.0
2286
- $this.jqmData("back");
2287
2793
 
2288
- //this may need to be more specific as we use data-rel more
2289
- nextPageRole = $this.attr("data-" + $.mobile.ns + "rel");
2794
+ //use ajax
2795
+ var transition = $link.jqmData("transition"),
2796
+ direction = $link.jqmData("direction"),
2797
+ reverse = (direction && direction === "reverse") ||
2798
+ // deprecated - remove by 1.0
2799
+ $link.jqmData("back");
2290
2800
 
2291
- //if it's a relative href, prefix href with base url
2292
- if (path.isRelative(url) && !hadProtocol) {
2293
- url = path.makeAbsolute(url);
2294
- }
2295
-
2296
- url = path.stripHash(url);
2801
+ //this may need to be more specific as we use data-rel more
2802
+ nextPageRole = $link.attr("data-" + $.mobile.ns + "rel");
2297
2803
 
2298
- $.mobile.changePage(url, transition, reverse);
2804
+ //if it's a relative href, prefix href with base url
2805
+ if (path.isRelative(url) && !hadProtocol) {
2806
+ url = path.makeAbsolute(url);
2299
2807
  }
2808
+
2809
+ url = path.stripHash(url);
2810
+
2811
+ $.mobile.changePage(url, transition, reverse);
2300
2812
  event.preventDefault();
2301
2813
  });
2302
2814
 
2303
-
2304
2815
  //hashchange event handler
2305
2816
  $window.bind("hashchange", function(e, triggered) {
2306
2817
  //find first page via hash
@@ -2317,24 +2828,35 @@
2317
2828
  return;
2318
2829
  }
2319
2830
 
2320
- // special case for dialogs requires heading back or forward until we find a non dialog page
2831
+ // special case for dialogs
2321
2832
  if (urlHistory.stack.length > 1 &&
2322
- to.indexOf(dialogHashKey) > -1 &&
2323
- !$.mobile.activePage.is(".ui-dialog")) {
2324
-
2325
- //determine if we're heading forward or backward and continue accordingly past
2326
- //the current dialog
2327
- urlHistory.directHashChange({
2328
- currentUrl: to,
2329
- isBack: function() {
2330
- window.history.back();
2331
- },
2332
- isForward: function() {
2333
- window.history.forward();
2334
- }
2335
- });
2833
+ to.indexOf(dialogHashKey) > -1) {
2834
+
2835
+ // If current active page is not a dialog skip the dialog and continue
2836
+ // in the same direction
2837
+ if (!$.mobile.activePage.is(".ui-dialog")) {
2838
+ //determine if we're heading forward or backward and continue accordingly past
2839
+ //the current dialog
2840
+ urlHistory.directHashChange({
2841
+ currentUrl: to,
2842
+ isBack: function() {
2843
+ window.history.back();
2844
+ },
2845
+ isForward: function() {
2846
+ window.history.forward();
2847
+ }
2848
+ });
2336
2849
 
2337
- return;
2850
+ // prevent changepage
2851
+ return;
2852
+ } else {
2853
+ var setTo = function() {
2854
+ to = $.mobile.urlHistory.getActive().page;
2855
+ };
2856
+ // if the current active page is a dialog and we're navigating
2857
+ // to a dialog use the dialog objected saved in the stack
2858
+ urlHistory.directHashChange({ currentUrl: to, isBack: setTo, isForward: setTo });
2859
+ }
2338
2860
  }
2339
2861
 
2340
2862
  //if to is defined, load it
@@ -2346,6 +2868,7 @@
2346
2868
  $.mobile.changePage($.mobile.firstPage, transition, true, false, true);
2347
2869
  }
2348
2870
  });
2871
+
2349
2872
  })(jQuery);
2350
2873
 
2351
2874
 
@@ -2410,15 +2933,12 @@
2410
2933
 
2411
2934
  $(function() {
2412
2935
  $(document)
2413
- .bind(touchStartEvent, function(event) {
2936
+ .bind("vmousedown", function(event) {
2414
2937
  if (touchToggleEnabled) {
2415
- if ($(event.target).closest(ignoreTargets).length) {
2416
- return;
2417
- }
2418
2938
  stateBefore = currentstate;
2419
2939
  }
2420
2940
  })
2421
- .bind(touchStopEvent, function(event) {
2941
+ .bind("vclick", function(event) {
2422
2942
  if (touchToggleEnabled) {
2423
2943
  if ($(event.target).closest(ignoreTargets).length) {
2424
2944
  return;
@@ -2430,9 +2950,6 @@
2430
2950
  }
2431
2951
  })
2432
2952
  .bind('scrollstart', function(event) {
2433
- if ($(event.target).closest(ignoreTargets).length) {
2434
- return;
2435
- } //because it could be a touchmove...
2436
2953
  scrollTriggered = true;
2437
2954
  if (stateBefore == null) {
2438
2955
  stateBefore = currentstate;
@@ -2470,30 +2987,30 @@
2470
2987
  //before page is shown, check for duplicate footer
2471
2988
  $('.ui-page').live('pagebeforeshow', function(event, ui) {
2472
2989
  var page = $(event.target),
2473
- footer = page.find(":jqmData(role='footer'):not(.ui-sticky-footer)"),
2474
- id = footer.jqmData('id');
2475
- stickyFooter = null;
2476
- if (id) {
2477
- stickyFooter = $(".ui-footer:jqmData(id='" + id + "').ui-sticky-footer");
2478
- if (stickyFooter.length == 0) {
2479
- // No sticky footer exists for this data-id. We'll use this
2480
- // footer as the sticky footer for the group and then create
2481
- // a placeholder footer for the page.
2482
- stickyFooter = footer;
2483
- footer = stickyFooter.clone(); // footer placeholder
2484
- stickyFooter.addClass('ui-sticky-footer').before(footer);
2485
- }
2486
- footer.addClass('ui-footer-duplicate');
2487
- stickyFooter.appendTo($.mobile.pageContainer).css('top', 0);
2488
- setTop(stickyFooter);
2990
+ footer = page.find(":jqmData(role='footer')"),
2991
+ id = footer.data('id'),
2992
+ prevPage = ui.prevPage,
2993
+ prevFooter = prevPage && prevPage.find(":jqmData(role='footer')"),
2994
+ prevFooterMatches = prevFooter.length && prevFooter.jqmData("id") === id;
2995
+
2996
+ if (id && prevFooterMatches) {
2997
+ stickyFooter = footer;
2998
+ setTop(stickyFooter.removeClass("fade in out").appendTo($.mobile.pageContainer));
2489
2999
  }
2490
3000
  });
2491
3001
 
2492
3002
  //after page is shown, append footer to new page
2493
3003
  $('.ui-page').live('pageshow', function(event, ui) {
3004
+ var $this = $(this);
3005
+
2494
3006
  if (stickyFooter && stickyFooter.length) {
2495
- stickyFooter.appendTo(event.target).css('top', 0);
3007
+
3008
+ setTimeout(function() {
3009
+ setTop(stickyFooter.appendTo($this).addClass("fade"));
3010
+ stickyFooter = null;
3011
+ }, 500);
2496
3012
  }
3013
+
2497
3014
  $.fixedToolbars.show(true, this);
2498
3015
  });
2499
3016
 
@@ -2681,57 +3198,33 @@
2681
3198
  .wrapAll("<div class='ui-" + inputtype + "'></div>");
2682
3199
 
2683
3200
  label.bind({
2684
- mouseover: function() {
3201
+ vmouseover: function() {
2685
3202
  if ($(this).parent().is('.ui-disabled')) {
2686
3203
  return false;
2687
3204
  }
2688
3205
  },
2689
3206
 
2690
- "touchmove": function(event) {
2691
- var oe = event.originalEvent.touches[0];
2692
- if (label.jqmData("movestart")) {
2693
- if (Math.abs(label.jqmData("movestart")[0] - oe.pageX) > 10 ||
2694
- Math.abs(label.jqmData("movestart")[1] - oe.pageY) > 10) {
2695
- label.jqmData("moved", true);
2696
- }
2697
- }
2698
- else {
2699
- label.jqmData("movestart", [ parseFloat(oe.pageX), parseFloat(oe.pageY) ]);
2700
- }
2701
- },
2702
-
2703
- "touchend mouseup": function(event) {
3207
+ vclick: function(event) {
2704
3208
  if (input.is(":disabled")) {
2705
3209
  event.preventDefault();
2706
3210
  return;
2707
3211
  }
2708
3212
 
2709
- label.removeData("movestart");
2710
- if (label.jqmData("etype") && label.jqmData("etype") !== event.type || label.jqmData("moved")) {
2711
- label.removeData("etype").removeData("moved");
2712
- if (label.jqmData("moved")) {
2713
- label.removeData("moved");
2714
- }
2715
- return false;
2716
- }
2717
- label.jqmData("etype", event.type);
2718
3213
  self._cacheVals();
2719
3214
  input.attr("checked", inputtype === "radio" && true || !input.is(":checked"));
2720
3215
  self._updateAll();
2721
- event.preventDefault();
2722
- },
2723
-
2724
- click: false
3216
+ return false;
3217
+ }
2725
3218
 
2726
3219
  });
2727
3220
 
2728
3221
  input
2729
3222
  .bind({
2730
- mousedown: function() {
3223
+ vmousedown: function() {
2731
3224
  this._cacheVals();
2732
3225
  },
2733
3226
 
2734
- click: function() {
3227
+ vclick: function() {
2735
3228
  self._updateAll();
2736
3229
  },
2737
3230
 
@@ -2761,9 +3254,10 @@
2761
3254
  },
2762
3255
 
2763
3256
  _updateAll: function() {
3257
+ var self = this;
3258
+
2764
3259
  this._getInputSet().each(function() {
2765
- var dVal = $(this).jqmData("cacheVal");
2766
- if (dVal && dVal !== $(this).is(":checked") || this.inputtype === "checkbox") {
3260
+ if ($(this).is(":checked") || self.inputtype === "checkbox") {
2767
3261
  $(this).trigger("change");
2768
3262
  }
2769
3263
  })
@@ -3083,20 +3577,20 @@
3083
3577
 
3084
3578
  select
3085
3579
  .appendTo(button)
3086
- .bind("touchstart mousedown", function(e) {
3580
+ .bind("vmousedown", function(e) {
3087
3581
  //add active class to button
3088
3582
  button.addClass($.mobile.activeBtnClass);
3089
3583
  })
3090
- .bind("focus mouseover", function() {
3091
- button.trigger("mouseover");
3584
+ .bind("focus vmouseover", function() {
3585
+ button.trigger("vmouseover");
3092
3586
  })
3093
- .bind("touchmove", function() {
3587
+ .bind("vmousemove", function() {
3094
3588
  //remove active class on scroll/touchmove
3095
3589
  button.removeClass($.mobile.activeBtnClass);
3096
3590
  })
3097
- .bind("change blur mouseout", function() {
3591
+ .bind("change blur vmouseout", function() {
3098
3592
  button
3099
- .trigger("mouseout")
3593
+ .trigger("vmouseout")
3100
3594
  .removeClass($.mobile.activeBtnClass);
3101
3595
  });
3102
3596
 
@@ -3115,43 +3609,28 @@
3115
3609
 
3116
3610
  //button events
3117
3611
  button
3118
- .bind("touchstart", function(event) {
3119
- //set startTouches to cached copy of
3120
- $(this).jqmData("startTouches", $.extend({}, event.originalEvent.touches[ 0 ]));
3121
- })
3122
- .bind($.support.touch ? "touchend" : "mouseup", function(event) {
3123
- //if it's a scroll, don't open
3124
- if ($(this).jqmData("moved")) {
3125
- $(this).removeData("moved");
3126
- } else {
3612
+ .bind("vclick keydown", function(event) {
3613
+ if (event.type == "vclick" ||
3614
+ event.keyCode && ( event.keyCode === $.mobile.keyCode.ENTER || event.keyCode === $.mobile.keyCode.SPACE )) {
3127
3615
  self.open();
3128
- }
3129
- event.preventDefault();
3130
- })
3131
- .bind("touchmove", function(event) {
3132
- //if touch moved enough, set data moved and don't open menu
3133
- var thisTouches = event.originalEvent.touches[ 0 ],
3134
- startTouches = $(this).jqmData("startTouches"),
3135
- deltaX = Math.abs(thisTouches.pageX - startTouches.pageX),
3136
- deltaY = Math.abs(thisTouches.pageY - startTouches.pageY);
3137
-
3138
- if (deltaX > 10 || deltaY > 10) {
3139
- $(this).jqmData("moved", true);
3616
+ event.preventDefault();
3140
3617
  }
3141
3618
  });
3142
3619
 
3143
-
3144
3620
  //events for list items
3145
- list.delegate("li:not(.ui-disabled, .ui-li-divider)", "click", function(event) {
3146
- // clicking on the list item fires click on the link in listview.js.
3147
- // to prevent this handler from firing twice if the link isn't clicked on,
3148
- // short circuit unless the target is the link
3149
- if (!$(event.target).is("a")) {
3150
- return;
3151
- }
3621
+ list
3622
+ .attr("role", "listbox")
3623
+ .delegate(".ui-li>a", "focusin", function() {
3624
+ $(this).attr("tabindex", "0");
3625
+ })
3626
+ .delegate(".ui-li>a", "focusout", function() {
3627
+ $(this).attr("tabindex", "-1");
3628
+ })
3629
+ .delegate("li:not(.ui-disabled, .ui-li-divider)", "vclick", function(event) {
3152
3630
 
3153
3631
  // index of option tag to be selected
3154
- var newIndex = list.find("li:not(.ui-li-divider)").index(this),
3632
+ var oldIndex = select[0].selectedIndex,
3633
+ newIndex = list.find("li:not(.ui-li-divider)").index(this),
3155
3634
  option = self.optionElems.eq(newIndex)[0];
3156
3635
 
3157
3636
  // toggle selected status on the tag for multi selects
@@ -3165,8 +3644,10 @@
3165
3644
  .toggleClass('ui-icon-checkbox-off', !option.selected);
3166
3645
  }
3167
3646
 
3168
- // trigger change
3169
- select.trigger("change");
3647
+ // trigger change if value changed
3648
+ if (oldIndex !== newIndex) {
3649
+ select.trigger("change");
3650
+ }
3170
3651
 
3171
3652
  //hide custom select for single selects only
3172
3653
  if (!isMultiple) {
@@ -3174,12 +3655,68 @@
3174
3655
  }
3175
3656
 
3176
3657
  event.preventDefault();
3658
+ })
3659
+ //keyboard events for menu items
3660
+ .keydown(function(e) {
3661
+ var target = $(e.target),
3662
+ li = target.closest("li");
3663
+
3664
+ // switch logic based on which key was pressed
3665
+ switch (e.keyCode) {
3666
+ // up or left arrow keys
3667
+ case 38:
3668
+ var prev = li.prev();
3669
+
3670
+ // if there's a previous option, focus it
3671
+ if (prev.length) {
3672
+ target
3673
+ .blur()
3674
+ .attr("tabindex", "-1");
3675
+
3676
+ prev.find("a").first().focus();
3677
+ }
3678
+
3679
+ return false;
3680
+ break;
3681
+
3682
+ // down or right arrow keys
3683
+ case 40:
3684
+ var next = li.next();
3685
+
3686
+ // if there's a next option, focus it
3687
+ if (next.length) {
3688
+ target
3689
+ .blur()
3690
+ .attr("tabindex", "-1");
3691
+
3692
+ next.find("a").first().focus();
3693
+ }
3694
+
3695
+ return false;
3696
+ break;
3697
+
3698
+ // if enter or space is pressed, trigger click
3699
+ case 13:
3700
+ case 32:
3701
+ target.trigger("vclick");
3702
+
3703
+ return false;
3704
+ break;
3705
+ }
3177
3706
  });
3178
3707
 
3179
- //events on "screen" overlay + close button
3180
- screen.click(function(event) {
3708
+ //events on "screen" overlay
3709
+ screen.bind("vclick", function(event) {
3181
3710
  self.close();
3182
3711
  });
3712
+
3713
+ //close button on small overlays
3714
+ self.headerClose.click(function() {
3715
+ if (self.menuType == "overlay") {
3716
+ self.close();
3717
+ return false;
3718
+ }
3719
+ })
3183
3720
  }
3184
3721
  },
3185
3722
 
@@ -3232,6 +3769,10 @@
3232
3769
 
3233
3770
  self.list.html(lis.join(" "));
3234
3771
 
3772
+ self.list.find("li")
3773
+ .attr({ "role": "option", "tabindex": "-1" })
3774
+ .first().attr("tabindex", "0");
3775
+
3235
3776
  // hide header close link for single selects
3236
3777
  if (!this.isMultiple) {
3237
3778
  this.headerClose.hide();
@@ -3317,8 +3858,7 @@
3317
3858
  scrollTop = $(window).scrollTop(),
3318
3859
  btnOffset = self.button.offset().top,
3319
3860
  screenHeight = window.innerHeight,
3320
- screenWidth = window.innerWidth,
3321
- dialogUsed = self.list.parents('.ui-dialog').length;
3861
+ screenWidth = window.innerWidth;
3322
3862
 
3323
3863
  //add active class to button
3324
3864
  self.button.addClass($.mobile.activeBtnClass);
@@ -3332,9 +3872,7 @@
3332
3872
  self.list.find(".ui-btn-active").focus();
3333
3873
  }
3334
3874
 
3335
- // NOTE addresses issue with firefox outerHeight when the parent dialog
3336
- // is display: none. Upstream?
3337
- if (dialogUsed || menuHeight > screenHeight - 80 || !$.support.scrollTop) {
3875
+ if (menuHeight > screenHeight - 80 || !$.support.scrollTop) {
3338
3876
 
3339
3877
  //for webos (set lastscroll using button offset)
3340
3878
  if (scrollTop == 0 && btnOffset > screenHeight) {
@@ -3538,23 +4076,50 @@
3538
4076
  wrapperEls: "span"
3539
4077
  };
3540
4078
 
4079
+ function closestEnabledButton(element) {
4080
+ while (element) {
4081
+ var $ele = $(element);
4082
+ if ($ele.hasClass("ui-btn") && !ele.hasClass("ui-disabled")) {
4083
+ break;
4084
+ }
4085
+ element = element.parentNode;
4086
+ }
4087
+ return element;
4088
+ }
4089
+
3541
4090
  var attachEvents = function() {
3542
- $(".ui-btn:not(.ui-disabled)").live({
3543
- "touchstart mousedown": function() {
3544
- var theme = $(this).attr("data-" + $.mobile.ns + "theme");
3545
- $(this).removeClass("ui-btn-up-" + theme).addClass("ui-btn-down-" + theme);
4091
+ $(document).bind({
4092
+ "vmousedown": function() {
4093
+ var btn = closestEnabledButton(this);
4094
+ if (btn) {
4095
+ var $btn = $(btn),
4096
+ theme = $btn.attr("data-" + $.mobile.ns + "theme");
4097
+ $btn.removeClass("ui-btn-up-" + theme).addClass("ui-btn-down-" + theme);
4098
+ }
3546
4099
  },
3547
- "touchmove touchend mouseup": function() {
3548
- var theme = $(this).attr("data-" + $.mobile.ns + "theme");
3549
- $(this).removeClass("ui-btn-down-" + theme).addClass("ui-btn-up-" + theme);
4100
+ "vmousecancel vmouseup": function() {
4101
+ var btn = closestEnabledButton(this);
4102
+ if (btn) {
4103
+ var $btn = $(btn),
4104
+ theme = $btn.attr("data-" + $.mobile.ns + "theme");
4105
+ $btn.removeClass("ui-btn-down-" + theme).addClass("ui-btn-up-" + theme);
4106
+ }
3550
4107
  },
3551
- "mouseover focus": function() {
3552
- var theme = $(this).attr("data-" + $.mobile.ns + "theme");
3553
- $(this).removeClass("ui-btn-up-" + theme).addClass("ui-btn-hover-" + theme);
4108
+ "vmouseover focus": function() {
4109
+ var btn = closestEnabledButton(this);
4110
+ if (btn) {
4111
+ var $btn = $(btn),
4112
+ theme = $btn.attr("data-" + $.mobile.ns + "theme");
4113
+ $btn.removeClass("ui-btn-up-" + theme).addClass("ui-btn-hover-" + theme);
4114
+ }
3554
4115
  },
3555
- "mouseout blur": function() {
3556
- var theme = $(this).attr("data-" + $.mobile.ns + "theme");
3557
- $(this).removeClass("ui-btn-hover-" + theme).addClass("ui-btn-up-" + theme);
4116
+ "vmouseout blur": function() {
4117
+ var btn = closestEnabledButton(this);
4118
+ if (btn) {
4119
+ var $btn = $(btn),
4120
+ theme = $btn.attr("data-" + $.mobile.ns + "theme");
4121
+ $btn.removeClass("ui-btn-hover-" + theme).addClass("ui-btn-up-" + theme);
4122
+ }
3558
4123
  }
3559
4124
  });
3560
4125
 
@@ -3603,7 +4168,7 @@
3603
4168
  //add hidden input during submit
3604
4169
  var type = $el.attr('type');
3605
4170
  if (type !== 'button' && type !== 'reset') {
3606
- $el.click(function() {
4171
+ $el.bind("vclick", function() {
3607
4172
  var $buttonPlaceholder = $("<input>",
3608
4173
  {type: "hidden", name: $el.attr("name"), value: $el.attr("value")})
3609
4174
  .insertBefore($el);
@@ -3729,7 +4294,7 @@
3729
4294
  });
3730
4295
 
3731
4296
  // prevent screen drag when slider activated
3732
- $(document).bind("touchmove mousemove", function(event) {
4297
+ $(document).bind("vmousemove", function(event) {
3733
4298
  if (self.dragging) {
3734
4299
  self.refresh(event);
3735
4300
  return false;
@@ -3737,7 +4302,7 @@
3737
4302
  });
3738
4303
 
3739
4304
  slider
3740
- .bind("touchstart mousedown", function(event) {
4305
+ .bind("vmousedown", function(event) {
3741
4306
  self.dragging = true;
3742
4307
  if (cType === "select") {
3743
4308
  self.beforeStart = control[0].selectedIndex;
@@ -3748,7 +4313,7 @@
3748
4313
 
3749
4314
  slider
3750
4315
  .add(document)
3751
- .bind("touchend mouseup", function() {
4316
+ .bind("vmouseup", function() {
3752
4317
  if (self.dragging) {
3753
4318
  self.dragging = false;
3754
4319
  if (cType === "select") {
@@ -3773,9 +4338,10 @@
3773
4338
 
3774
4339
  // NOTE force focus on handle
3775
4340
  this.handle
3776
- .bind("touchstart mousedown", function() {
4341
+ .bind("vmousedown", function() {
3777
4342
  $(this).focus();
3778
- });
4343
+ })
4344
+ .bind("vclick", false);
3779
4345
 
3780
4346
  this.handle
3781
4347
  .bind("keydown", function(event) {
@@ -3845,7 +4411,7 @@
3845
4411
  max = (cType === "input") ? parseFloat(control.attr("max")) : control.find("option").length - 1;
3846
4412
 
3847
4413
  if (typeof val === "object") {
3848
- var data = val.originalEvent.touches ? val.originalEvent.touches[ 0 ] : val,
4414
+ var data = val,
3849
4415
  // a slight tolerance helped get to the ends of the slider
3850
4416
  tol = 8;
3851
4417
  if (!this.dragging
@@ -3925,6 +4491,7 @@
3925
4491
  this.slider.addClass("ui-disabled").attr("aria-disabled", true);
3926
4492
  return this._setOption("disabled", true);
3927
4493
  }
4494
+
3928
4495
  });
3929
4496
  })(jQuery);
3930
4497
 
@@ -4053,6 +4620,7 @@
4053
4620
  .not("> .ui-collapsible-contain .ui-collapsible-contain")
4054
4621
  .trigger("collapse");
4055
4622
  });
4623
+
4056
4624
  var set = collapsibleParent.find(":jqmData(role=collapsible)")
4057
4625
 
4058
4626
  set.first()
@@ -4065,18 +4633,15 @@
4065
4633
  }
4066
4634
 
4067
4635
  collapsibleHeading
4068
- .bind({
4069
- "tap": function() {
4070
- if (collapsibleHeading.is('.ui-collapsible-heading-collapsed')) {
4071
- collapsibleContain.trigger('expand');
4072
- }
4073
- else {
4074
- collapsibleContain.trigger('collapse');
4075
- }
4076
- return false;
4077
- },
4078
- "click": false
4079
- });
4636
+ .bind("vclick", function(e) {
4637
+ if (collapsibleHeading.is('.ui-collapsible-heading-collapsed')) {
4638
+ collapsibleContain.trigger('expand');
4639
+ }
4640
+ else {
4641
+ collapsibleContain.trigger('collapse');
4642
+ }
4643
+ return false;
4644
+ });
4080
4645
  }
4081
4646
  });
4082
4647
  })(jQuery);
@@ -4162,92 +4727,13 @@
4162
4727
 
4163
4728
  // create listview markup
4164
4729
  $list
4165
- .addClass("ui-listview")
4166
- .attr("role", "listbox")
4730
+ .addClass("ui-listview");
4167
4731
 
4168
4732
  if (o.inset) {
4169
4733
  $list.addClass("ui-listview-inset ui-corner-all ui-shadow");
4170
4734
  }
4171
4735
 
4172
- $list.delegate(".ui-li", "focusin", function() {
4173
- $(this).attr("tabindex", "0");
4174
- });
4175
-
4176
- this._itemApply($list, $list);
4177
-
4178
- this.refresh(true);
4179
-
4180
- //keyboard events for menu items
4181
- $list.keydown(function(e) {
4182
- var target = $(e.target),
4183
- li = target.closest("li");
4184
-
4185
- // switch logic based on which key was pressed
4186
- switch (e.keyCode) {
4187
- // up or left arrow keys
4188
- case 38:
4189
- var prev = li.prev();
4190
-
4191
- // if there's a previous option, focus it
4192
- if (prev.length) {
4193
- target
4194
- .blur()
4195
- .attr("tabindex", "-1");
4196
-
4197
- prev.find("a").first().focus();
4198
- }
4199
-
4200
- return false;
4201
- break;
4202
-
4203
- // down or right arrow keys
4204
- case 40:
4205
- var next = li.next();
4206
-
4207
- // if there's a next option, focus it
4208
- if (next.length) {
4209
- target
4210
- .blur()
4211
- .attr("tabindex", "-1");
4212
-
4213
- next.find("a").first().focus();
4214
- }
4215
-
4216
- return false;
4217
- break;
4218
-
4219
- case 39:
4220
- var a = li.find("a.ui-li-link-alt");
4221
-
4222
- if (a.length) {
4223
- target.blur();
4224
- a.first().focus();
4225
- }
4226
-
4227
- return false;
4228
- break;
4229
-
4230
- case 37:
4231
- var a = li.find("a.ui-link-inherit");
4232
-
4233
- if (a.length) {
4234
- target.blur();
4235
- a.first().focus();
4236
- }
4237
-
4238
- return false;
4239
- break;
4240
-
4241
- // if enter or space is pressed, trigger click
4242
- case 13:
4243
- case 32:
4244
- target.trigger("click");
4245
-
4246
- return false;
4247
- break;
4248
- }
4249
- });
4250
-
4736
+ this.refresh();
4251
4737
  },
4252
4738
 
4253
4739
  _itemApply: function($list, item) {
@@ -4259,22 +4745,14 @@
4259
4745
 
4260
4746
  item.find("p, dl").addClass("ui-li-desc");
4261
4747
 
4262
- $list.find("li").find(">img:eq(0), >a:first>img:eq(0)").addClass("ui-li-thumb").each(function() {
4263
- $(this).closest("li")
4264
- .addClass($(this).is(".ui-li-icon") ? "ui-li-has-icon" : "ui-li-has-thumb");
4748
+ item.find("img:first-child:eq(0)").addClass("ui-li-thumb").each(function() {
4749
+ item.addClass($(this).is(".ui-li-icon") ? "ui-li-has-icon" : "ui-li-has-thumb");
4265
4750
  });
4266
4751
 
4267
- var aside = item.find(".ui-li-aside");
4268
-
4269
- if (aside.length) {
4270
- aside.each(function(i, el) {
4271
- $(el).prependTo($(el).parent()); //shift aside to front for css float
4272
- });
4273
- }
4274
-
4275
- if ($.support.cssPseudoElement || !$.nodeName(item[0], "ol")) {
4276
- return;
4277
- }
4752
+ item.find(".ui-li-aside").each(function() {
4753
+ var $this = $(this);
4754
+ $this.prependTo($this.parent()); //shift aside to front for css float
4755
+ });
4278
4756
  },
4279
4757
 
4280
4758
  _removeCorners: function(li) {
@@ -4290,6 +4768,8 @@
4290
4768
  $list = this.element,
4291
4769
  self = this,
4292
4770
  dividertheme = $list.jqmData("dividertheme") || o.dividerTheme,
4771
+ listsplittheme = $list.jqmData("splittheme"),
4772
+ listspliticon = $list.jqmData("spliticon"),
4293
4773
  li = $list.children("li"),
4294
4774
  counter = $.support.cssPseudoElement || !$.nodeName($list[0], "ol") ? 0 : 1;
4295
4775
 
@@ -4297,23 +4777,19 @@
4297
4777
  $list.find(".ui-li-dec").remove();
4298
4778
  }
4299
4779
 
4300
- li.attr({ "role": "option", "tabindex": "-1" });
4301
-
4302
- li.first().attr("tabindex", "0");
4303
-
4304
-
4305
- li.each(function(pos) {
4306
- var item = $(this),
4780
+ var numli = li.length;
4781
+ for (var pos = 0; pos < numli; pos++) {
4782
+ var item = li.eq(pos),
4307
4783
  itemClass = "ui-li";
4308
4784
 
4309
4785
  // If we're creating the element, we update it regardless
4310
4786
  if (!create && item.hasClass("ui-li")) {
4311
- return;
4787
+ continue;
4312
4788
  }
4313
4789
 
4314
4790
  var itemTheme = item.jqmData("theme") || o.theme;
4315
4791
 
4316
- var a = item.find("a");
4792
+ var a = item.children("a");
4317
4793
 
4318
4794
  if (a.length) {
4319
4795
  var icon = item.jqmData("icon");
@@ -4334,7 +4810,7 @@
4334
4810
  itemClass += " ui-li-has-alt";
4335
4811
 
4336
4812
  var last = a.last(),
4337
- splittheme = $list.jqmData("splittheme") || last.jqmData("theme") || o.splitTheme;
4813
+ splittheme = listsplittheme || last.jqmData("theme") || o.splitTheme;
4338
4814
 
4339
4815
  last
4340
4816
  .appendTo(item)
@@ -4354,7 +4830,7 @@
4354
4830
  corners: true,
4355
4831
  theme: splittheme,
4356
4832
  iconpos: "notext",
4357
- icon: $list.jqmData("spliticon") || last.jqmData("icon") || o.splitIcon
4833
+ icon: listspliticon || last.jqmData("icon") || o.splitIcon
4358
4834
  }));
4359
4835
  }
4360
4836
 
@@ -4368,7 +4844,7 @@
4368
4844
  }
4369
4845
 
4370
4846
  } else {
4371
- itemClass += " ui-li-static ui-btn-up-" + itemTheme;
4847
+ itemClass += " ui-li-static ui-body-" + itemTheme;
4372
4848
  }
4373
4849
 
4374
4850
 
@@ -4407,8 +4883,10 @@
4407
4883
 
4408
4884
 
4409
4885
  if (counter && itemClass.indexOf("ui-li-divider") < 0) {
4410
- item
4411
- .find(".ui-link-inherit").first()
4886
+
4887
+ var countParent = item.is(".ui-li-static:first") ? item : item.find(".ui-link-inherit");
4888
+
4889
+ countParent
4412
4890
  .addClass("ui-li-jsnumbering")
4413
4891
  .prepend("<span class='ui-li-dec'>" + (counter++) + ". </span>");
4414
4892
  }
@@ -4418,7 +4896,7 @@
4418
4896
  if (!create) {
4419
4897
  self._itemApply($list, item);
4420
4898
  }
4421
- });
4899
+ }
4422
4900
  },
4423
4901
 
4424
4902
  //create a string for ID/subpage url creation
@@ -4431,31 +4909,32 @@
4431
4909
  parentPage = parentList.closest(".ui-page"),
4432
4910
  parentId = parentPage.jqmData("url"),
4433
4911
  o = this.options,
4912
+ dns = "data-" + $.mobile.ns,
4434
4913
  self = this,
4435
4914
  persistentFooterID = parentPage.find(":jqmData(role='footer')").jqmData("id");
4436
4915
 
4437
- $(parentList.find("ul, ol").toArray().reverse()).each(
4916
+ $(parentList.find("li>ul, li>ol").toArray().reverse()).each(
4438
4917
  function(i) {
4439
4918
  var list = $(this),
4440
4919
  parent = list.parent(),
4441
- title = $.trim(parent.contents()[ 0 ].nodeValue) || parent.find('a:first').text(),
4920
+ nodeEls = $(list.prevAll().toArray().reverse()),
4921
+ nodeEls = nodeEls.length ? nodeEls : $("<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>"),
4922
+ title = nodeEls.first().text(),//url limits to first 30 chars of text
4442
4923
  id = parentId + "&" + $.mobile.subPageUrlKey + "=" + self._idStringEscape(title + " " + i),
4443
4924
  theme = list.jqmData("theme") || o.theme,
4444
4925
  countTheme = list.jqmData("counttheme") || parentList.jqmData("counttheme") || o.countTheme,
4445
- newPage = list.wrap("<div data-" + $.mobile.ns + "role='page'><div data-" + $.mobile.ns + "role='content'></div></div>")
4926
+ newPage = list.detach()
4927
+ .wrap("<div " + dns + "role='page'" + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>")
4446
4928
  .parent()
4447
- .before("<div data-" + $.mobile.ns + "role='header' data-" + $.mobile.ns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>")
4448
- .after(persistentFooterID ? $("<div data-" + $.mobile.ns + "role='footer' data-" + $.mobile.ns + "id='" + persistentFooterID + "'>") : "")
4929
+ .before("<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>")
4930
+ .after(persistentFooterID ? $("<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>") : "")
4449
4931
  .parent()
4450
- .attr("data-" + $.mobile.ns + "url", id)
4451
- .attr("data-" + $.mobile.ns + "theme", theme)
4452
- .attr("data-" + $.mobile.ns + "count-theme", countTheme)
4453
4932
  .appendTo($.mobile.pageContainer);
4454
4933
 
4455
4934
  newPage.page();
4456
4935
  var anchor = parent.find('a:first');
4457
4936
  if (!anchor.length) {
4458
- anchor = $("<a></a>").html(title).prependTo(parent.empty());
4937
+ anchor = $("<a></a>").html(nodeEls || title).prependTo(parent.empty());
4459
4938
  }
4460
4939
  anchor.attr('href', '#' + id);
4461
4940
  }).listview();
@@ -4474,6 +4953,7 @@
4474
4953
  (function($, undefined) {
4475
4954
 
4476
4955
  $.mobile.listview.prototype.options.filter = false;
4956
+ $.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
4477
4957
 
4478
4958
  $(":jqmData(role='listview')").live("listviewcreate", function() {
4479
4959
  var list = $(this),
@@ -4486,7 +4966,7 @@
4486
4966
  var wrapper = $("<form>", { "class": "ui-listview-filter ui-bar-c", "role": "search" }),
4487
4967
 
4488
4968
  search = $("<input>", {
4489
- placeholder: "Filter results..."
4969
+ placeholder: listview.options.filterPlaceholder
4490
4970
  })
4491
4971
  .attr("data-" + $.mobile.ns + "type", "search")
4492
4972
  .bind("keyup change", function() {
@@ -4537,7 +5017,9 @@
4537
5017
  */
4538
5018
  (function($, undefined) {
4539
5019
  $.widget("mobile.dialog", $.mobile.widget, {
4540
- options: {},
5020
+ options: {
5021
+ closeBtnText: "Close"
5022
+ },
4541
5023
  _create: function() {
4542
5024
  var self = this,
4543
5025
  $el = self.element;
@@ -4549,7 +5031,7 @@
4549
5031
  .addClass('ui-page ui-dialog ui-body-a')
4550
5032
  .find(":jqmData(role=header)")
4551
5033
  .addClass('ui-corner-top ui-overlay-shadow')
4552
- .prepend("<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "rel='back' data-" + $.mobile.ns + "iconpos='notext'>Close</a>")
5034
+ .prepend("<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "rel='back' data-" + $.mobile.ns + "iconpos='notext'>" + this.options.closeBtnText + "</a>")
4553
5035
  .end()
4554
5036
  .find('.ui-content:not([class*="ui-body-"])')
4555
5037
  .addClass('ui-body-c')
@@ -4564,9 +5046,9 @@
4564
5046
  - if the click was on the close button, or the link has a data-rel="back" it'll go back in history naturally
4565
5047
  */
4566
5048
  this.element
4567
- .bind("click submit", function(e) {
5049
+ .bind("vclick submit", function(e) {
4568
5050
  var $targetel;
4569
- if (e.type == "click") {
5051
+ if (e.type == "vclick") {
4570
5052
  $targetel = $(e.target).closest("a");
4571
5053
  }
4572
5054
  else {
@@ -4623,14 +5105,15 @@
4623
5105
  iconpos: iconpos
4624
5106
  });
4625
5107
 
4626
- $navbar.delegate("a", "click", function(event) {
4627
- $navbtns.removeClass("ui-btn-active");
4628
- $(this).addClass("ui-btn-active");
5108
+ $navbar.delegate("a", "vclick", function(event) {
5109
+ $navbtns.not(".ui-state-persist").removeClass($.mobile.activeBtnClass);
5110
+ $(this).addClass($.mobile.activeBtnClass);
4629
5111
  });
4630
5112
  }
4631
5113
  });
4632
5114
  })(jQuery);
4633
5115
 
5116
+
4634
5117
  /*
4635
5118
  * jQuery Mobile Framework : plugin for creating CSS grids
4636
5119
  * Copyright (c) jQuery Project