compass-jquery-plugin 0.3.0.beta.26 → 0.3.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (415) hide show
  1. data/README.textile +1 -52
  2. data/VERSION.yml +1 -1
  3. data/compass-jquery-plugin.gemspec +6 -407
  4. data/gem_tasks/jrails.rake +84 -85
  5. data/gem_tasks/rubygems.rake +9 -1
  6. data/templates/jqtouch/config/initializers/jqtouch.rb +1 -1
  7. data/templates/jrails/config/initializers/jrails.rb +3 -3
  8. data/templates/jrails/{jquery-ui-1.8.6.js → jquery-ui.js} +0 -0
  9. data/templates/jrails/{jquery-ui-1.8.6.min.js → jquery-ui.min.js} +0 -0
  10. data/templates/jrails/{jquery-1.4.4.js → jquery.js} +360 -284
  11. data/templates/jrails/jquery.min.js +151 -0
  12. data/templates/jrails/manifest.rb +4 -4
  13. metadata +9 -410
  14. data/gem_tasks/jqgrid.rake +0 -119
  15. data/gem_tasks/mobile.rake +0 -144
  16. data/gem_tasks/secret_sauce.rake +0 -64
  17. data/lib/jquery/gridify/assertions.rb +0 -37
  18. data/lib/jquery/gridify/grid.rb +0 -147
  19. data/lib/jquery/gridify/grid_column.rb +0 -134
  20. data/lib/jquery/gridify/grid_finder.rb +0 -223
  21. data/lib/jquery/gridify/grid_options.rb +0 -279
  22. data/lib/jquery/gridify/grid_view.rb +0 -435
  23. data/lib/jquery/gridify.rb +0 -42
  24. data/lib/jquery/jqgrid/jqgrid.rb +0 -438
  25. data/lib/jquery/jqgrid.rb +0 -5
  26. data/lib/jquery/mobile.rb +0 -3
  27. data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +0 -14
  28. data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +0 -18
  29. data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +0 -6
  30. data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +0 -118
  31. data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +0 -226
  32. data/lib/jquery/secret_sauce/model/find_for_grid.rb +0 -42
  33. data/lib/jquery/secret_sauce.rb +0 -9
  34. data/templates/jqgrid/config/initializers/jqgrid.rb +0 -4
  35. data/templates/jqgrid/config/locales/jquery/jqgrid/de.yml +0 -7
  36. data/templates/jqgrid/config/locales/jquery/jqgrid/en.yml +0 -7
  37. data/templates/jqgrid/i18n/jqgrid/locale-bg.js +0 -132
  38. data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +0 -6
  39. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +0 -132
  40. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +0 -6
  41. data/templates/jqgrid/i18n/jqgrid/locale-cat.js +0 -128
  42. data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +0 -6
  43. data/templates/jqgrid/i18n/jqgrid/locale-cn.js +0 -132
  44. data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +0 -5
  45. data/templates/jqgrid/i18n/jqgrid/locale-cs.js +0 -128
  46. data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +0 -6
  47. data/templates/jqgrid/i18n/jqgrid/locale-da.js +0 -128
  48. data/templates/jqgrid/i18n/jqgrid/locale-da.min.js +0 -6
  49. data/templates/jqgrid/i18n/jqgrid/locale-de.js +0 -133
  50. data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +0 -7
  51. data/templates/jqgrid/i18n/jqgrid/locale-el.js +0 -126
  52. data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +0 -7
  53. data/templates/jqgrid/i18n/jqgrid/locale-en.js +0 -128
  54. data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +0 -6
  55. data/templates/jqgrid/i18n/jqgrid/locale-es.js +0 -128
  56. data/templates/jqgrid/i18n/jqgrid/locale-es.min.js +0 -7
  57. data/templates/jqgrid/i18n/jqgrid/locale-fa.js +0 -125
  58. data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +0 -6
  59. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +0 -130
  60. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +0 -6
  61. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +0 -126
  62. data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +0 -7
  63. data/templates/jqgrid/i18n/jqgrid/locale-gl.js +0 -126
  64. data/templates/jqgrid/i18n/jqgrid/locale-gl.min.js +0 -7
  65. data/templates/jqgrid/i18n/jqgrid/locale-he.js +0 -127
  66. data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +0 -6
  67. data/templates/jqgrid/i18n/jqgrid/locale-hu.js +0 -129
  68. data/templates/jqgrid/i18n/jqgrid/locale-hu.min.js +0 -6
  69. data/templates/jqgrid/i18n/jqgrid/locale-is.js +0 -126
  70. data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +0 -6
  71. data/templates/jqgrid/i18n/jqgrid/locale-it.js +0 -1
  72. data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +0 -7
  73. data/templates/jqgrid/i18n/jqgrid/locale-ja.js +0 -155
  74. data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +0 -5
  75. data/templates/jqgrid/i18n/jqgrid/locale-nl.js +0 -149
  76. data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +0 -6
  77. data/templates/jqgrid/i18n/jqgrid/locale-no.js +0 -1
  78. data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +0 -6
  79. data/templates/jqgrid/i18n/jqgrid/locale-pl.js +0 -127
  80. data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +0 -6
  81. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +0 -127
  82. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +0 -6
  83. data/templates/jqgrid/i18n/jqgrid/locale-pt.js +0 -125
  84. data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +0 -6
  85. data/templates/jqgrid/i18n/jqgrid/locale-ro.js +0 -139
  86. data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +0 -7
  87. data/templates/jqgrid/i18n/jqgrid/locale-ru.js +0 -127
  88. data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +0 -7
  89. data/templates/jqgrid/i18n/jqgrid/locale-sk.js +0 -127
  90. data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +0 -6
  91. data/templates/jqgrid/i18n/jqgrid/locale-sv.js +0 -127
  92. data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +0 -6
  93. data/templates/jqgrid/i18n/jqgrid/locale-tr.js +0 -126
  94. data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +0 -6
  95. data/templates/jqgrid/i18n/jqgrid/locale-ua.js +0 -127
  96. data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +0 -7
  97. data/templates/jqgrid/jquery/jqGrid.scss +0 -692
  98. data/templates/jqgrid/jquery.jqGrid.js +0 -11576
  99. data/templates/jqgrid/jquery.jqGrid.min.js +0 -472
  100. data/templates/jqgrid/manifest.rb +0 -70
  101. data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +0 -13
  102. data/templates/jrails/jquery-1.4.4.min.js +0 -152
  103. data/templates/mobile/config/initializers/mobile.rb +0 -6
  104. data/templates/mobile/glyphish/Read me first - license.txt +0 -14
  105. data/templates/mobile/glyphish/icons/01-refresh.png +0 -0
  106. data/templates/mobile/glyphish/icons/02-redo.png +0 -0
  107. data/templates/mobile/glyphish/icons/03-loopback.png +0 -0
  108. data/templates/mobile/glyphish/icons/04-squiggle.png +0 -0
  109. data/templates/mobile/glyphish/icons/05-shuffle.png +0 -0
  110. data/templates/mobile/glyphish/icons/06-magnifying-glass.png +0 -0
  111. data/templates/mobile/glyphish/icons/07-map-marker.png +0 -0
  112. data/templates/mobile/glyphish/icons/08-chat.png +0 -0
  113. data/templates/mobile/glyphish/icons/09-chat2.png +0 -0
  114. data/templates/mobile/glyphish/icons/10-medical.png +0 -0
  115. data/templates/mobile/glyphish/icons/100-coffee.png +0 -0
  116. data/templates/mobile/glyphish/icons/101-gameplan.png +0 -0
  117. data/templates/mobile/glyphish/icons/102-walk.png +0 -0
  118. data/templates/mobile/glyphish/icons/103-map.png +0 -0
  119. data/templates/mobile/glyphish/icons/104-index-cards.png +0 -0
  120. data/templates/mobile/glyphish/icons/105-piano.png +0 -0
  121. data/templates/mobile/glyphish/icons/106-sliders.png +0 -0
  122. data/templates/mobile/glyphish/icons/107-widescreen.png +0 -0
  123. data/templates/mobile/glyphish/icons/108-badge.png +0 -0
  124. data/templates/mobile/glyphish/icons/109-chicken.png +0 -0
  125. data/templates/mobile/glyphish/icons/11-clock.png +0 -0
  126. data/templates/mobile/glyphish/icons/110-bug.png +0 -0
  127. data/templates/mobile/glyphish/icons/111-user.png +0 -0
  128. data/templates/mobile/glyphish/icons/112-group.png +0 -0
  129. data/templates/mobile/glyphish/icons/113-navigation.png +0 -0
  130. data/templates/mobile/glyphish/icons/114-balloon.png +0 -0
  131. data/templates/mobile/glyphish/icons/115-bow-and-arrow.png +0 -0
  132. data/templates/mobile/glyphish/icons/116-controller.png +0 -0
  133. data/templates/mobile/glyphish/icons/117-todo.png +0 -0
  134. data/templates/mobile/glyphish/icons/118-coathanger.png +0 -0
  135. data/templates/mobile/glyphish/icons/119-piggybank.png +0 -0
  136. data/templates/mobile/glyphish/icons/12-eye.png +0 -0
  137. data/templates/mobile/glyphish/icons/120-headphones.png +0 -0
  138. data/templates/mobile/glyphish/icons/121-lanscape.png +0 -0
  139. data/templates/mobile/glyphish/icons/122-stats.png +0 -0
  140. data/templates/mobile/glyphish/icons/123-id-card.png +0 -0
  141. data/templates/mobile/glyphish/icons/124-bullhorn.png +0 -0
  142. data/templates/mobile/glyphish/icons/125-food.png +0 -0
  143. data/templates/mobile/glyphish/icons/126-moon.png +0 -0
  144. data/templates/mobile/glyphish/icons/127-sock.png +0 -0
  145. data/templates/mobile/glyphish/icons/128-bone.png +0 -0
  146. data/templates/mobile/glyphish/icons/129-golf.png +0 -0
  147. data/templates/mobile/glyphish/icons/13-target.png +0 -0
  148. data/templates/mobile/glyphish/icons/130-dice.png +0 -0
  149. data/templates/mobile/glyphish/icons/14-tag.png +0 -0
  150. data/templates/mobile/glyphish/icons/15-tags.png +0 -0
  151. data/templates/mobile/glyphish/icons/16-line-chart.png +0 -0
  152. data/templates/mobile/glyphish/icons/17-bar-chart.png +0 -0
  153. data/templates/mobile/glyphish/icons/18-envelope.png +0 -0
  154. data/templates/mobile/glyphish/icons/19-gear.png +0 -0
  155. data/templates/mobile/glyphish/icons/20-gear2.png +0 -0
  156. data/templates/mobile/glyphish/icons/21-skull.png +0 -0
  157. data/templates/mobile/glyphish/icons/22-skull-n-crossbones.png +0 -0
  158. data/templates/mobile/glyphish/icons/23-bird.png +0 -0
  159. data/templates/mobile/glyphish/icons/24-gift.png +0 -0
  160. data/templates/mobile/glyphish/icons/25-weather.png +0 -0
  161. data/templates/mobile/glyphish/icons/26-bandaid.png +0 -0
  162. data/templates/mobile/glyphish/icons/27-planet.png +0 -0
  163. data/templates/mobile/glyphish/icons/28-star.png +0 -0
  164. data/templates/mobile/glyphish/icons/29-heart.png +0 -0
  165. data/templates/mobile/glyphish/icons/30-key.png +0 -0
  166. data/templates/mobile/glyphish/icons/31-ipod.png +0 -0
  167. data/templates/mobile/glyphish/icons/32-iphone.png +0 -0
  168. data/templates/mobile/glyphish/icons/33-cabinet.png +0 -0
  169. data/templates/mobile/glyphish/icons/34-coffee.png +0 -0
  170. data/templates/mobile/glyphish/icons/35-shopping-bag.png +0 -0
  171. data/templates/mobile/glyphish/icons/36-toolbox.png +0 -0
  172. data/templates/mobile/glyphish/icons/37-suitcase.png +0 -0
  173. data/templates/mobile/glyphish/icons/38-airplane.png +0 -0
  174. data/templates/mobile/glyphish/icons/39-spraycan.png +0 -0
  175. data/templates/mobile/glyphish/icons/40-inbox.png +0 -0
  176. data/templates/mobile/glyphish/icons/41-picture-frame.png +0 -0
  177. data/templates/mobile/glyphish/icons/42-photos.png +0 -0
  178. data/templates/mobile/glyphish/icons/43-film-roll.png +0 -0
  179. data/templates/mobile/glyphish/icons/44-shoebox.png +0 -0
  180. data/templates/mobile/glyphish/icons/45-movie1.png +0 -0
  181. data/templates/mobile/glyphish/icons/46-movie2.png +0 -0
  182. data/templates/mobile/glyphish/icons/47-fuel.png +0 -0
  183. data/templates/mobile/glyphish/icons/48-fork-and-knife.png +0 -0
  184. data/templates/mobile/glyphish/icons/49-battery.png +0 -0
  185. data/templates/mobile/glyphish/icons/50-beaker.png +0 -0
  186. data/templates/mobile/glyphish/icons/51-outlet.png +0 -0
  187. data/templates/mobile/glyphish/icons/52-pinetree.png +0 -0
  188. data/templates/mobile/glyphish/icons/53-house.png +0 -0
  189. data/templates/mobile/glyphish/icons/54-lock.png +0 -0
  190. data/templates/mobile/glyphish/icons/55-network.png +0 -0
  191. data/templates/mobile/glyphish/icons/56-cloud.png +0 -0
  192. data/templates/mobile/glyphish/icons/57-download.png +0 -0
  193. data/templates/mobile/glyphish/icons/58-bookmark.png +0 -0
  194. data/templates/mobile/glyphish/icons/59-flag.png +0 -0
  195. data/templates/mobile/glyphish/icons/60-signpost.png +0 -0
  196. data/templates/mobile/glyphish/icons/61-brightness.png +0 -0
  197. data/templates/mobile/glyphish/icons/62-contrast.png +0 -0
  198. data/templates/mobile/glyphish/icons/63-runner.png +0 -0
  199. data/templates/mobile/glyphish/icons/64-zap.png +0 -0
  200. data/templates/mobile/glyphish/icons/65-note.png +0 -0
  201. data/templates/mobile/glyphish/icons/66-microphone.png +0 -0
  202. data/templates/mobile/glyphish/icons/67-tshirt.png +0 -0
  203. data/templates/mobile/glyphish/icons/68-paperclip.png +0 -0
  204. data/templates/mobile/glyphish/icons/69-display.png +0 -0
  205. data/templates/mobile/glyphish/icons/70-tv.png +0 -0
  206. data/templates/mobile/glyphish/icons/71-compass.png +0 -0
  207. data/templates/mobile/glyphish/icons/72-pin.png +0 -0
  208. data/templates/mobile/glyphish/icons/73-radar.png +0 -0
  209. data/templates/mobile/glyphish/icons/74-location.png +0 -0
  210. data/templates/mobile/glyphish/icons/75-phone.png +0 -0
  211. data/templates/mobile/glyphish/icons/76-baby.png +0 -0
  212. data/templates/mobile/glyphish/icons/77-ekg.png +0 -0
  213. data/templates/mobile/glyphish/icons/78-stopwatch.png +0 -0
  214. data/templates/mobile/glyphish/icons/79-medical-bag.png +0 -0
  215. data/templates/mobile/glyphish/icons/80-shopping-cart.png +0 -0
  216. data/templates/mobile/glyphish/icons/81-dashboard.png +0 -0
  217. data/templates/mobile/glyphish/icons/82-dogpaw.png +0 -0
  218. data/templates/mobile/glyphish/icons/83-calendar.png +0 -0
  219. data/templates/mobile/glyphish/icons/84-lightbulb.png +0 -0
  220. data/templates/mobile/glyphish/icons/85-trophy.png +0 -0
  221. data/templates/mobile/glyphish/icons/86-camera.png +0 -0
  222. data/templates/mobile/glyphish/icons/87-wineglass.png +0 -0
  223. data/templates/mobile/glyphish/icons/88-beermug.png +0 -0
  224. data/templates/mobile/glyphish/icons/89-dumbbell.png +0 -0
  225. data/templates/mobile/glyphish/icons/90-lifebuoy.png +0 -0
  226. data/templates/mobile/glyphish/icons/91-beaker2.png +0 -0
  227. data/templates/mobile/glyphish/icons/92-testtube.png +0 -0
  228. data/templates/mobile/glyphish/icons/93-thermometer.png +0 -0
  229. data/templates/mobile/glyphish/icons/94-pill.png +0 -0
  230. data/templates/mobile/glyphish/icons/95-equalizer.png +0 -0
  231. data/templates/mobile/glyphish/icons/96-book.png +0 -0
  232. data/templates/mobile/glyphish/icons/97-puzzle.png +0 -0
  233. data/templates/mobile/glyphish/icons/98-palette.png +0 -0
  234. data/templates/mobile/glyphish/icons/99-umbrella.png +0 -0
  235. data/templates/mobile/glyphish/mini-icons/01-refresh.png +0 -0
  236. data/templates/mobile/glyphish/mini-icons/02-redo.png +0 -0
  237. data/templates/mobile/glyphish/mini-icons/03-loopback.png +0 -0
  238. data/templates/mobile/glyphish/mini-icons/04-squiggle.png +0 -0
  239. data/templates/mobile/glyphish/mini-icons/05-shuffle.png +0 -0
  240. data/templates/mobile/glyphish/mini-icons/06-magnifying-glass.png +0 -0
  241. data/templates/mobile/glyphish/mini-icons/07-map-marker.png +0 -0
  242. data/templates/mobile/glyphish/mini-icons/08-chat.png +0 -0
  243. data/templates/mobile/glyphish/mini-icons/09-chat2.png +0 -0
  244. data/templates/mobile/glyphish/mini-icons/10-medical.png +0 -0
  245. data/templates/mobile/glyphish/mini-icons/100-coffee.png +0 -0
  246. data/templates/mobile/glyphish/mini-icons/101-gameplan.png +0 -0
  247. data/templates/mobile/glyphish/mini-icons/102-walk.png +0 -0
  248. data/templates/mobile/glyphish/mini-icons/103-map.png +0 -0
  249. data/templates/mobile/glyphish/mini-icons/104-index-cards.png +0 -0
  250. data/templates/mobile/glyphish/mini-icons/105-piano.png +0 -0
  251. data/templates/mobile/glyphish/mini-icons/106-sliders.png +0 -0
  252. data/templates/mobile/glyphish/mini-icons/107-widescreen.png +0 -0
  253. data/templates/mobile/glyphish/mini-icons/108-badge.png +0 -0
  254. data/templates/mobile/glyphish/mini-icons/109-chicken.png +0 -0
  255. data/templates/mobile/glyphish/mini-icons/11-clock.png +0 -0
  256. data/templates/mobile/glyphish/mini-icons/110-bug.png +0 -0
  257. data/templates/mobile/glyphish/mini-icons/111-user.png +0 -0
  258. data/templates/mobile/glyphish/mini-icons/112-group.png +0 -0
  259. data/templates/mobile/glyphish/mini-icons/113-navigation.png +0 -0
  260. data/templates/mobile/glyphish/mini-icons/114-balloon.png +0 -0
  261. data/templates/mobile/glyphish/mini-icons/115-bow-and-arrow.png +0 -0
  262. data/templates/mobile/glyphish/mini-icons/116-controller.png +0 -0
  263. data/templates/mobile/glyphish/mini-icons/117-todo.png +0 -0
  264. data/templates/mobile/glyphish/mini-icons/118-coathanger.png +0 -0
  265. data/templates/mobile/glyphish/mini-icons/119-piggybank.png +0 -0
  266. data/templates/mobile/glyphish/mini-icons/12-eye.png +0 -0
  267. data/templates/mobile/glyphish/mini-icons/120-headphones.png +0 -0
  268. data/templates/mobile/glyphish/mini-icons/121-lanscape.png +0 -0
  269. data/templates/mobile/glyphish/mini-icons/122-stats.png +0 -0
  270. data/templates/mobile/glyphish/mini-icons/123-id-card.png +0 -0
  271. data/templates/mobile/glyphish/mini-icons/124-bullhorn.png +0 -0
  272. data/templates/mobile/glyphish/mini-icons/125-food.png +0 -0
  273. data/templates/mobile/glyphish/mini-icons/126-moon.png +0 -0
  274. data/templates/mobile/glyphish/mini-icons/127-sock.png +0 -0
  275. data/templates/mobile/glyphish/mini-icons/128-bone.png +0 -0
  276. data/templates/mobile/glyphish/mini-icons/129-golf.png +0 -0
  277. data/templates/mobile/glyphish/mini-icons/13-target.png +0 -0
  278. data/templates/mobile/glyphish/mini-icons/130-dice.png +0 -0
  279. data/templates/mobile/glyphish/mini-icons/14-tag.png +0 -0
  280. data/templates/mobile/glyphish/mini-icons/15-tags.png +0 -0
  281. data/templates/mobile/glyphish/mini-icons/16-line-chart.png +0 -0
  282. data/templates/mobile/glyphish/mini-icons/17-bar-chart.png +0 -0
  283. data/templates/mobile/glyphish/mini-icons/18-envelope.png +0 -0
  284. data/templates/mobile/glyphish/mini-icons/19-gear.png +0 -0
  285. data/templates/mobile/glyphish/mini-icons/20-gear2.png +0 -0
  286. data/templates/mobile/glyphish/mini-icons/21-skull.png +0 -0
  287. data/templates/mobile/glyphish/mini-icons/22-skull-n-crossbones.png +0 -0
  288. data/templates/mobile/glyphish/mini-icons/23-bird.png +0 -0
  289. data/templates/mobile/glyphish/mini-icons/24-gift.png +0 -0
  290. data/templates/mobile/glyphish/mini-icons/25-weather.png +0 -0
  291. data/templates/mobile/glyphish/mini-icons/26-bandaid.png +0 -0
  292. data/templates/mobile/glyphish/mini-icons/27-planet.png +0 -0
  293. data/templates/mobile/glyphish/mini-icons/28-star.png +0 -0
  294. data/templates/mobile/glyphish/mini-icons/29-heart.png +0 -0
  295. data/templates/mobile/glyphish/mini-icons/30-key.png +0 -0
  296. data/templates/mobile/glyphish/mini-icons/31-ipod.png +0 -0
  297. data/templates/mobile/glyphish/mini-icons/32-iphone.png +0 -0
  298. data/templates/mobile/glyphish/mini-icons/33-cabinet.png +0 -0
  299. data/templates/mobile/glyphish/mini-icons/34-coffee.png +0 -0
  300. data/templates/mobile/glyphish/mini-icons/35-shopping-bag.png +0 -0
  301. data/templates/mobile/glyphish/mini-icons/36-toolbox.png +0 -0
  302. data/templates/mobile/glyphish/mini-icons/37-suitcase.png +0 -0
  303. data/templates/mobile/glyphish/mini-icons/38-airplane.png +0 -0
  304. data/templates/mobile/glyphish/mini-icons/39-spraycan.png +0 -0
  305. data/templates/mobile/glyphish/mini-icons/40-inbox.png +0 -0
  306. data/templates/mobile/glyphish/mini-icons/41-picture-frame.png +0 -0
  307. data/templates/mobile/glyphish/mini-icons/42-photos.png +0 -0
  308. data/templates/mobile/glyphish/mini-icons/43-film-roll.png +0 -0
  309. data/templates/mobile/glyphish/mini-icons/44-shoebox.png +0 -0
  310. data/templates/mobile/glyphish/mini-icons/45-movie1.png +0 -0
  311. data/templates/mobile/glyphish/mini-icons/46-movie2.png +0 -0
  312. data/templates/mobile/glyphish/mini-icons/47-fuel.png +0 -0
  313. data/templates/mobile/glyphish/mini-icons/48-fork-and-knife.png +0 -0
  314. data/templates/mobile/glyphish/mini-icons/49-battery.png +0 -0
  315. data/templates/mobile/glyphish/mini-icons/50-beaker.png +0 -0
  316. data/templates/mobile/glyphish/mini-icons/51-outlet.png +0 -0
  317. data/templates/mobile/glyphish/mini-icons/52-pinetree.png +0 -0
  318. data/templates/mobile/glyphish/mini-icons/53-house.png +0 -0
  319. data/templates/mobile/glyphish/mini-icons/54-lock.png +0 -0
  320. data/templates/mobile/glyphish/mini-icons/55-network.png +0 -0
  321. data/templates/mobile/glyphish/mini-icons/56-cloud.png +0 -0
  322. data/templates/mobile/glyphish/mini-icons/57-download.png +0 -0
  323. data/templates/mobile/glyphish/mini-icons/58-bookmark.png +0 -0
  324. data/templates/mobile/glyphish/mini-icons/59-flag.png +0 -0
  325. data/templates/mobile/glyphish/mini-icons/60-signpost.png +0 -0
  326. data/templates/mobile/glyphish/mini-icons/61-brightness.png +0 -0
  327. data/templates/mobile/glyphish/mini-icons/62-contrast.png +0 -0
  328. data/templates/mobile/glyphish/mini-icons/63-runner.png +0 -0
  329. data/templates/mobile/glyphish/mini-icons/64-zap.png +0 -0
  330. data/templates/mobile/glyphish/mini-icons/65-note.png +0 -0
  331. data/templates/mobile/glyphish/mini-icons/66-microphone.png +0 -0
  332. data/templates/mobile/glyphish/mini-icons/67-tshirt.png +0 -0
  333. data/templates/mobile/glyphish/mini-icons/68-paperclip.png +0 -0
  334. data/templates/mobile/glyphish/mini-icons/69-display.png +0 -0
  335. data/templates/mobile/glyphish/mini-icons/70-tv.png +0 -0
  336. data/templates/mobile/glyphish/mini-icons/71-compass.png +0 -0
  337. data/templates/mobile/glyphish/mini-icons/72-pin.png +0 -0
  338. data/templates/mobile/glyphish/mini-icons/73-radar.png +0 -0
  339. data/templates/mobile/glyphish/mini-icons/74-location.png +0 -0
  340. data/templates/mobile/glyphish/mini-icons/75-phone.png +0 -0
  341. data/templates/mobile/glyphish/mini-icons/76-baby.png +0 -0
  342. data/templates/mobile/glyphish/mini-icons/77-ekg.png +0 -0
  343. data/templates/mobile/glyphish/mini-icons/78-stopwatch.png +0 -0
  344. data/templates/mobile/glyphish/mini-icons/79-medical-bag.png +0 -0
  345. data/templates/mobile/glyphish/mini-icons/80-shopping-cart.png +0 -0
  346. data/templates/mobile/glyphish/mini-icons/81-dashboard.png +0 -0
  347. data/templates/mobile/glyphish/mini-icons/82-dogpaw.png +0 -0
  348. data/templates/mobile/glyphish/mini-icons/83-calendar.png +0 -0
  349. data/templates/mobile/glyphish/mini-icons/84-lightbulb.png +0 -0
  350. data/templates/mobile/glyphish/mini-icons/85-trophy.png +0 -0
  351. data/templates/mobile/glyphish/mini-icons/86-camera.png +0 -0
  352. data/templates/mobile/glyphish/mini-icons/87-wineglass.png +0 -0
  353. data/templates/mobile/glyphish/mini-icons/88-beermug.png +0 -0
  354. data/templates/mobile/glyphish/mini-icons/89-dumbbell.png +0 -0
  355. data/templates/mobile/glyphish/mini-icons/90-lifebuoy.png +0 -0
  356. data/templates/mobile/glyphish/mini-icons/91-beaker2.png +0 -0
  357. data/templates/mobile/glyphish/mini-icons/92-testtube.png +0 -0
  358. data/templates/mobile/glyphish/mini-icons/93-thermometer.png +0 -0
  359. data/templates/mobile/glyphish/mini-icons/94-pill.png +0 -0
  360. data/templates/mobile/glyphish/mini-icons/95-equalizer.png +0 -0
  361. data/templates/mobile/glyphish/mini-icons/96-book.png +0 -0
  362. data/templates/mobile/glyphish/mini-icons/97-puzzle.png +0 -0
  363. data/templates/mobile/glyphish/mini-icons/98-palette.png +0 -0
  364. data/templates/mobile/glyphish/mini-icons/99-umbrella.png +0 -0
  365. data/templates/mobile/jquery/mobile/_base.scss +0 -1325
  366. data/templates/mobile/jquery/mobile/default/ajax-loader.png +0 -0
  367. data/templates/mobile/jquery/mobile/default/form-check-off.png +0 -0
  368. data/templates/mobile/jquery/mobile/default/form-check-on.png +0 -0
  369. data/templates/mobile/jquery/mobile/default/form-radio-off.png +0 -0
  370. data/templates/mobile/jquery/mobile/default/form-radio-on.png +0 -0
  371. data/templates/mobile/jquery/mobile/default/icon-arrow-white-down.png +0 -0
  372. data/templates/mobile/jquery/mobile/default/icon-arrow-white-left.png +0 -0
  373. data/templates/mobile/jquery/mobile/default/icon-arrow-white-right.png +0 -0
  374. data/templates/mobile/jquery/mobile/default/icon-arrow-white-up.png +0 -0
  375. data/templates/mobile/jquery/mobile/default/icon-delete.png +0 -0
  376. data/templates/mobile/jquery/mobile/default/icon-minus-white.png +0 -0
  377. data/templates/mobile/jquery/mobile/default/icon-plus-white.png +0 -0
  378. data/templates/mobile/jquery/mobile/default/icon-search-black.png +0 -0
  379. data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
  380. data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
  381. data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
  382. data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
  383. data/templates/mobile/jquery/mobile/default.scss +0 -742
  384. data/templates/mobile/jquery/mobile/valencia/ajax-loader.png +0 -0
  385. data/templates/mobile/jquery/mobile/valencia/form-check-off.png +0 -0
  386. data/templates/mobile/jquery/mobile/valencia/form-check-on.png +0 -0
  387. data/templates/mobile/jquery/mobile/valencia/form-radio-off.png +0 -0
  388. data/templates/mobile/jquery/mobile/valencia/form-radio-on.png +0 -0
  389. data/templates/mobile/jquery/mobile/valencia/icon-arrow-white-down.png +0 -0
  390. data/templates/mobile/jquery/mobile/valencia/icon-arrow-white-left.png +0 -0
  391. data/templates/mobile/jquery/mobile/valencia/icon-arrow-white-right.png +0 -0
  392. data/templates/mobile/jquery/mobile/valencia/icon-arrow-white-up.png +0 -0
  393. data/templates/mobile/jquery/mobile/valencia/icon-delete.png +0 -0
  394. data/templates/mobile/jquery/mobile/valencia/icon-minus-white.png +0 -0
  395. data/templates/mobile/jquery/mobile/valencia/icon-plus-white.png +0 -0
  396. data/templates/mobile/jquery/mobile/valencia/icon-search-black.png +0 -0
  397. data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
  398. data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
  399. data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
  400. data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
  401. data/templates/mobile/jquery/mobile/valencia/texture_05.png +0 -0
  402. data/templates/mobile/jquery/mobile/valencia/texture_075.png +0 -0
  403. data/templates/mobile/jquery/mobile/valencia.scss +0 -804
  404. data/templates/mobile/jquery.mobile.js +0 -3390
  405. data/templates/mobile/jquery.mobile.min.js +0 -28
  406. data/templates/mobile/lib/tasks/jquery.mobile.rake +0 -106
  407. data/templates/mobile/manifest.rb +0 -307
  408. data/templates/secret_sauce/app/views/shared/_ui_form_error_messages.html.haml +0 -6
  409. data/templates/secret_sauce/app/views/shared/_ui_grid_for_without_block.js.haml +0 -144
  410. data/templates/secret_sauce/app/views/shared/_ui_static_dialog.html.haml +0 -6
  411. data/templates/secret_sauce/config/initializers/secret_sauce.rb +0 -8
  412. data/templates/secret_sauce/jquery/secret_sauce.scss +0 -33
  413. data/templates/secret_sauce/manifest.rb +0 -10
  414. data/templates/secret_sauce/secret_sauce.js +0 -12
  415. data/templates/secret_sauce/secret_sauce.min.js +0 -1
@@ -1,3390 +0,0 @@
1
- /*!
2
- * jQuery UI Widget @VERSION
3
- *
4
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI/Widget
9
- */
10
- (function( $, undefined ) {
11
-
12
- // jQuery 1.4+
13
- if ( $.cleanData ) {
14
- var _cleanData = $.cleanData;
15
- $.cleanData = function( elems ) {
16
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
17
- $( elem ).triggerHandler( "remove" );
18
- }
19
- _cleanData( elems );
20
- };
21
- } else {
22
- var _remove = $.fn.remove;
23
- $.fn.remove = function( selector, keepData ) {
24
- return this.each(function() {
25
- if ( !keepData ) {
26
- if ( !selector || $.filter( selector, [ this ] ).length ) {
27
- $( "*", this ).add( [ this ] ).each(function() {
28
- $( this ).triggerHandler( "remove" );
29
- });
30
- }
31
- }
32
- return _remove.call( $(this), selector, keepData );
33
- });
34
- };
35
- }
36
-
37
- $.widget = function( name, base, prototype ) {
38
- var namespace = name.split( "." )[ 0 ],
39
- fullName;
40
- name = name.split( "." )[ 1 ];
41
- fullName = namespace + "-" + name;
42
-
43
- if ( !prototype ) {
44
- prototype = base;
45
- base = $.Widget;
46
- }
47
-
48
- // create selector for plugin
49
- $.expr[ ":" ][ fullName ] = function( elem ) {
50
- return !!$.data( elem, name );
51
- };
52
-
53
- $[ namespace ] = $[ namespace ] || {};
54
- $[ namespace ][ name ] = function( options, element ) {
55
- // allow instantiation without initializing for simple inheritance
56
- if ( arguments.length ) {
57
- this._createWidget( options, element );
58
- }
59
- };
60
-
61
- var basePrototype = new base();
62
- // we need to make the options hash a property directly on the new instance
63
- // otherwise we'll modify the options hash on the prototype that we're
64
- // inheriting from
65
- // $.each( basePrototype, function( key, val ) {
66
- // if ( $.isPlainObject(val) ) {
67
- // basePrototype[ key ] = $.extend( {}, val );
68
- // }
69
- // });
70
- basePrototype.options = $.extend( true, {}, basePrototype.options );
71
- $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
72
- namespace: namespace,
73
- widgetName: name,
74
- widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
75
- widgetBaseClass: fullName
76
- }, prototype );
77
-
78
- $.widget.bridge( name, $[ namespace ][ name ] );
79
- };
80
-
81
- $.widget.bridge = function( name, object ) {
82
- $.fn[ name ] = function( options ) {
83
- var isMethodCall = typeof options === "string",
84
- args = Array.prototype.slice.call( arguments, 1 ),
85
- returnValue = this;
86
-
87
- // allow multiple hashes to be passed on init
88
- options = !isMethodCall && args.length ?
89
- $.extend.apply( null, [ true, options ].concat(args) ) :
90
- options;
91
-
92
- // prevent calls to internal methods
93
- if ( isMethodCall && options.charAt( 0 ) === "_" ) {
94
- return returnValue;
95
- }
96
-
97
- if ( isMethodCall ) {
98
- this.each(function() {
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 );
108
- if ( methodValue !== instance && methodValue !== undefined ) {
109
- returnValue = methodValue;
110
- return false;
111
- }
112
- });
113
- } else {
114
- this.each(function() {
115
- var instance = $.data( this, name );
116
- if ( instance ) {
117
- instance.option( options || {} )._init();
118
- } else {
119
- $.data( this, name, new object( options, this ) );
120
- }
121
- });
122
- }
123
-
124
- return returnValue;
125
- };
126
- };
127
-
128
- $.Widget = function( options, element ) {
129
- // allow instantiation without initializing for simple inheritance
130
- if ( arguments.length ) {
131
- this._createWidget( options, element );
132
- }
133
- };
134
-
135
- $.Widget.prototype = {
136
- widgetName: "widget",
137
- widgetEventPrefix: "",
138
- options: {
139
- disabled: false
140
- },
141
- _createWidget: function( options, element ) {
142
- // $.widget.bridge stores the plugin instance, but we do it anyway
143
- // so that it's stored even before the _create function runs
144
- $.data( element, this.widgetName, this );
145
- this.element = $( element );
146
- this.options = $.extend( true, {},
147
- this.options,
148
- this._getCreateOptions(),
149
- options );
150
-
151
- var self = this;
152
- this.element.bind( "remove." + this.widgetName, function() {
153
- self.destroy();
154
- });
155
-
156
- this._create();
157
- this._trigger( "create" );
158
- this._init();
159
- },
160
- _getCreateOptions: function() {
161
- var options = {};
162
- if ( $.metadata ) {
163
- options = $.metadata.get( element )[ this.widgetName ];
164
- }
165
- return options;
166
- },
167
- _create: function() {},
168
- _init: function() {},
169
-
170
- destroy: function() {
171
- this.element
172
- .unbind( "." + this.widgetName )
173
- .removeData( this.widgetName );
174
- this.widget()
175
- .unbind( "." + this.widgetName )
176
- .removeAttr( "aria-disabled" )
177
- .removeClass(
178
- this.widgetBaseClass + "-disabled " +
179
- "ui-state-disabled" );
180
- },
181
-
182
- widget: function() {
183
- return this.element;
184
- },
185
-
186
- option: function( key, value ) {
187
- var options = key;
188
-
189
- if ( arguments.length === 0 ) {
190
- // don't return a reference to the internal hash
191
- return $.extend( {}, this.options );
192
- }
193
-
194
- if (typeof key === "string" ) {
195
- if ( value === undefined ) {
196
- return this.options[ key ];
197
- }
198
- options = {};
199
- options[ key ] = value;
200
- }
201
-
202
- this._setOptions( options );
203
-
204
- return this;
205
- },
206
- _setOptions: function( options ) {
207
- var self = this;
208
- $.each( options, function( key, value ) {
209
- self._setOption( key, value );
210
- });
211
-
212
- return this;
213
- },
214
- _setOption: function( key, value ) {
215
- this.options[ key ] = value;
216
-
217
- if ( key === "disabled" ) {
218
- this.widget()
219
- [ value ? "addClass" : "removeClass"](
220
- this.widgetBaseClass + "-disabled" + " " +
221
- "ui-state-disabled" )
222
- .attr( "aria-disabled", value );
223
- }
224
-
225
- return this;
226
- },
227
-
228
- enable: function() {
229
- return this._setOption( "disabled", false );
230
- },
231
- disable: function() {
232
- return this._setOption( "disabled", true );
233
- },
234
-
235
- _trigger: function( type, event, data ) {
236
- var callback = this.options[ type ];
237
-
238
- event = $.Event( event );
239
- event.type = ( type === this.widgetEventPrefix ?
240
- type :
241
- this.widgetEventPrefix + type ).toLowerCase();
242
- data = data || {};
243
-
244
- // copy original event properties over to the new event
245
- // this would happen if we could call $.event.fix instead of $.Event
246
- // but we don't have a way to force an event to be fixed multiple times
247
- if ( event.originalEvent ) {
248
- for ( var i = $.event.props.length, prop; i; ) {
249
- prop = $.event.props[ --i ];
250
- event[ prop ] = event.originalEvent[ prop ];
251
- }
252
- }
253
-
254
- this.element.trigger( event, data );
255
-
256
- return !( $.isFunction(callback) &&
257
- callback.call( this.element[0], event, data ) === false ||
258
- event.isDefaultPrevented() );
259
- }
260
- };
261
-
262
- })( jQuery );
263
-
264
-
265
- (function( $ ) {
266
-
267
- $.widget( "mobile.widget", {
268
- _getCreateOptions: function() {
269
- var elem = this.element,
270
- options = {};
271
- $.each( this.options, function( option ) {
272
- var value = elem.data( option.replace( /[A-Z]/g, function( c ) {
273
- return "-" + c.toLowerCase();
274
- } ) );
275
- if ( value !== undefined ) {
276
- options[ option ] = value;
277
- }
278
- });
279
- return options;
280
- }
281
- });
282
-
283
- })( jQuery );
284
-
285
-
286
- (function( $ ) {
287
-
288
- // test whether a CSS media type or query applies
289
- $.media = (function() {
290
- // TODO: use window.matchMedia once at least one UA implements it
291
- var cache = {},
292
- $html = $( "html" ),
293
- testDiv = $( "<div id='jquery-mediatest'>" ),
294
- fakeBody = $( "<body>" ).append( testDiv );
295
-
296
- return function( query ) {
297
- if ( !( query in cache ) ) {
298
- var styleBlock = $( "<style type='text/css'>" +
299
- "@media " + query + "{#jquery-mediatest{position:absolute;}}" +
300
- "</style>" );
301
- $html.prepend( fakeBody ).prepend( styleBlock );
302
- cache[ query ] = testDiv.css( "position" ) === "absolute";
303
- fakeBody.add( styleBlock ).remove();
304
- }
305
- return cache[ query ];
306
- };
307
- })();
308
-
309
- var fakeBody = $( "<body>" ).prependTo( "html" ),
310
- fbCSS = fakeBody[0].style,
311
- vendors = ['webkit','moz','o'],
312
- webos = window.palmGetResource || window.PalmServiceBridge, //only used to rule out scrollTop
313
- bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB
314
-
315
- //thx Modernizr
316
- function propExists( prop ){
317
- var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
318
- props = (prop + ' ' + vendors.join(uc_prop + ' ') + uc_prop).split(' ');
319
- for(var v in props){
320
- if( fbCSS[ v ] !== undefined ){
321
- return true;
322
- }
323
- }
324
- };
325
-
326
- //test for dynamic-updating base tag support (allows us to avoid href,src attr rewriting)
327
- function baseTagTest(){
328
- var fauxBase = location.protocol + '//' + location.host + location.pathname + "ui-dir/",
329
- base = $("<base>", {"href": fauxBase}).appendTo("head"),
330
- link = $( "<a href='testurl'></a>" ).prependTo( fakeBody ),
331
- rebase = link[0].href;
332
- base.remove();
333
- return rebase.indexOf(fauxBase) === 0;
334
- };
335
-
336
- $.extend( $.support, {
337
- orientation: "orientation" in window,
338
- touch: "ontouchend" in document,
339
- cssTransitions: "WebKitTransitionEvent" in window,
340
- pushState: !!history.pushState,
341
- mediaquery: $.media('only all'),
342
- cssPseudoElement: !!propExists('content'),
343
- boxShadow: !!propExists('boxShadow') && !bb,
344
- scrollTop: ("pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[0]) && !webos,
345
- dynamicBaseTag: baseTagTest()
346
- });
347
-
348
- fakeBody.remove();
349
-
350
- //for ruling out shadows via css
351
- if( !$.support.boxShadow ){ $('html').addClass('ui-mobile-nosupport-boxshadow'); }
352
-
353
- })( jQuery );
354
-
355
- (function( $ ) {
356
-
357
- // add new event shortcuts
358
- $.each( "touchstart touchmove touchend orientationchange tap taphold swipe swipeleft swiperight scrollstart scrollstop".split( " " ), function( i, name ) {
359
- $.fn[ name ] = function( fn ) {
360
- return fn ? this.bind( name, fn ) : this.trigger( name );
361
- };
362
- $.attrFn[ name ] = true;
363
- });
364
-
365
- var supportTouch = $.support.touch,
366
- scrollEvent = "touchmove scroll",
367
- touchStartEvent = supportTouch ? "touchstart" : "mousedown",
368
- touchStopEvent = supportTouch ? "touchend" : "mouseup",
369
- touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
370
-
371
- // also handles scrollstop
372
- $.event.special.scrollstart = {
373
- enabled: true,
374
-
375
- setup: function() {
376
- var thisObject = this,
377
- $this = $( thisObject ),
378
- scrolling,
379
- timer;
380
-
381
- function trigger( event, state ) {
382
- scrolling = state;
383
- var originalType = event.type;
384
- event.type = scrolling ? "scrollstart" : "scrollstop";
385
- $.event.handle.call( thisObject, event );
386
- event.type = originalType;
387
- }
388
-
389
- // iPhone triggers scroll after a small delay; use touchmove instead
390
- $this.bind( scrollEvent, function( event ) {
391
- if ( !$.event.special.scrollstart.enabled ) {
392
- return;
393
- }
394
-
395
- if ( !scrolling ) {
396
- trigger( event, true );
397
- }
398
-
399
- clearTimeout( timer );
400
- timer = setTimeout(function() {
401
- trigger( event, false );
402
- }, 50 );
403
- });
404
- }
405
- };
406
-
407
- // also handles taphold
408
- $.event.special.tap = {
409
- setup: function() {
410
- var thisObject = this,
411
- $this = $( thisObject );
412
-
413
- $this
414
- .bind( touchStartEvent, function( event ) {
415
- if ( event.which && event.which !== 1 ) {
416
- return;
417
- }
418
-
419
- var moved = false,
420
- touching = true,
421
- origPos = [ event.pageX, event.pageY ],
422
- originalType,
423
- timer;
424
-
425
- function moveHandler() {
426
- if ((Math.abs(origPos[0] - event.pageX) > 10) ||
427
- (Math.abs(origPos[1] - event.pageY) > 10)) {
428
- moved = true;
429
- }
430
- }
431
-
432
- timer = setTimeout(function() {
433
- if ( touching && !moved ) {
434
- originalType = event.type;
435
- event.type = "taphold";
436
- $.event.handle.call( thisObject, event );
437
- event.type = originalType;
438
- }
439
- }, 750 );
440
-
441
- $this
442
- .one( touchMoveEvent, moveHandler)
443
- .one( touchStopEvent, function( event ) {
444
- $this.unbind( touchMoveEvent, moveHandler );
445
- clearTimeout( timer );
446
- touching = false;
447
-
448
- if ( !moved ) {
449
- originalType = event.type;
450
- event.type = "tap";
451
- $.event.handle.call( thisObject, event );
452
- event.type = originalType;
453
- }
454
- });
455
- });
456
- }
457
- };
458
-
459
- // also handles swipeleft, swiperight
460
- $.event.special.swipe = {
461
- setup: function() {
462
- var thisObject = this,
463
- $this = $( thisObject );
464
-
465
- $this
466
- .bind( touchStartEvent, function( event ) {
467
- var data = event.originalEvent.touches ?
468
- event.originalEvent.touches[ 0 ] :
469
- event,
470
- start = {
471
- time: (new Date).getTime(),
472
- coords: [ data.pageX, data.pageY ],
473
- origin: $( event.target )
474
- },
475
- stop;
476
-
477
- function moveHandler( event ) {
478
- if ( !start ) {
479
- return;
480
- }
481
-
482
- var data = event.originalEvent.touches ?
483
- event.originalEvent.touches[ 0 ] :
484
- event;
485
- stop = {
486
- time: (new Date).getTime(),
487
- coords: [ data.pageX, data.pageY ]
488
- };
489
-
490
- // prevent scrolling
491
- if ( Math.abs( start.coords[0] - stop.coords[0] ) > 10 ) {
492
- event.preventDefault();
493
- }
494
- }
495
-
496
- $this
497
- .bind( touchMoveEvent, moveHandler )
498
- .one( touchStopEvent, function( event ) {
499
- $this.unbind( touchMoveEvent, moveHandler );
500
- if ( start && stop ) {
501
- if ( stop.time - start.time < 1000 &&
502
- Math.abs( start.coords[0] - stop.coords[0]) > 30 &&
503
- Math.abs( start.coords[1] - stop.coords[1]) < 75 ) {
504
- start.origin
505
- .trigger( "swipe" )
506
- .trigger( start.coords[0] > stop.coords[0] ? "swipeleft" : "swiperight" );
507
- }
508
- }
509
- start = stop = undefined;
510
- });
511
- });
512
- }
513
- };
514
-
515
- (function(jQuery){
516
- // "Cowboy" Ben Alman
517
-
518
- var win = jQuery(window),
519
- special_event,
520
- get_orientation,
521
- last_orientation;
522
-
523
- jQuery.event.special.orientationchange = special_event = {
524
- setup: function(){
525
- // If the event is supported natively, return false so that jQuery
526
- // will bind to the event using DOM methods.
527
- if ( jQuery.support.orientation ) { return false; }
528
-
529
- // Get the current orientation to avoid initial double-triggering.
530
- last_orientation = get_orientation();
531
-
532
- // Because the orientationchange event doesn't exist, simulate the
533
- // event by testing window dimensions on resize.
534
- win.bind( "resize", handler );
535
- },
536
- teardown: function(){
537
- // If the event is not supported natively, return false so that
538
- // jQuery will unbind the event using DOM methods.
539
- if ( jQuery.support.orientation ) { return false; }
540
-
541
- // Because the orientationchange event doesn't exist, unbind the
542
- // resize event handler.
543
- win.unbind( "resize", handler );
544
- },
545
- add: function( handleObj ) {
546
- // Save a reference to the bound event handler.
547
- var old_handler = handleObj.handler;
548
-
549
- handleObj.handler = function( event ) {
550
- // Modify event object, adding the .orientation property.
551
- event.orientation = get_orientation();
552
-
553
- // Call the originally-bound event handler and return its result.
554
- return old_handler.apply( this, arguments );
555
- };
556
- }
557
- };
558
-
559
- // If the event is not supported natively, this handler will be bound to
560
- // the window resize event to simulate the orientationchange event.
561
- function handler() {
562
- // Get the current orientation.
563
- var orientation = get_orientation();
564
-
565
- if ( orientation !== last_orientation ) {
566
- // The orientation has changed, so trigger the orientationchange event.
567
- last_orientation = orientation;
568
- win.trigger( "orientationchange" );
569
- }
570
- };
571
-
572
- // Get the current page orientation. This method is exposed publicly, should it
573
- // be needed, as jQuery.event.special.orientationchange.orientation()
574
- special_event.orientation = get_orientation = function() {
575
- var elem = document.documentElement;
576
- return elem && elem.clientWidth / elem.clientHeight < 1.1 ? "portrait" : "landscape";
577
- };
578
-
579
- })(jQuery);
580
-
581
- $.each({
582
- scrollstop: "scrollstart",
583
- taphold: "tap",
584
- swipeleft: "swipe",
585
- swiperight: "swipe"
586
- }, function( event, sourceEvent ) {
587
- $.event.special[ event ] = {
588
- setup: function() {
589
- $( this ).bind( sourceEvent, $.noop );
590
- }
591
- };
592
- });
593
-
594
- })( jQuery );
595
-
596
-
597
- /*!
598
- * jQuery hashchange event - v1.3 - 7/21/2010
599
- * http://benalman.com/projects/jquery-hashchange-plugin/
600
- *
601
- * Copyright (c) 2010 "Cowboy" Ben Alman
602
- * Dual licensed under the MIT and GPL licenses.
603
- * http://benalman.com/about/license/
604
- */
605
-
606
- // Script: jQuery hashchange event
607
- //
608
- // *Version: 1.3, Last updated: 7/21/2010*
609
- //
610
- // Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
611
- // GitHub - http://github.com/cowboy/jquery-hashchange/
612
- // Source - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.js
613
- // (Minified) - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.min.js (0.8kb gzipped)
614
- //
615
- // About: License
616
- //
617
- // Copyright (c) 2010 "Cowboy" Ben Alman,
618
- // Dual licensed under the MIT and GPL licenses.
619
- // http://benalman.com/about/license/
620
- //
621
- // About: Examples
622
- //
623
- // These working examples, complete with fully commented code, illustrate a few
624
- // ways in which this plugin can be used.
625
- //
626
- // hashchange event - http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/
627
- // document.domain - http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/
628
- //
629
- // About: Support and Testing
630
- //
631
- // Information about what version or versions of jQuery this plugin has been
632
- // tested with, what browsers it has been tested in, and where the unit tests
633
- // reside (so you can test it yourself).
634
- //
635
- // jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2
636
- // Browsers Tested - Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5,
637
- // Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.
638
- // Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/
639
- //
640
- // About: Known issues
641
- //
642
- // While this jQuery hashchange event implementation is quite stable and
643
- // robust, there are a few unfortunate browser bugs surrounding expected
644
- // hashchange event-based behaviors, independent of any JavaScript
645
- // window.onhashchange abstraction. See the following examples for more
646
- // information:
647
- //
648
- // Chrome: Back Button - http://benalman.com/code/projects/jquery-hashchange/examples/bug-chrome-back-button/
649
- // Firefox: Remote XMLHttpRequest - http://benalman.com/code/projects/jquery-hashchange/examples/bug-firefox-remote-xhr/
650
- // WebKit: Back Button in an Iframe - http://benalman.com/code/projects/jquery-hashchange/examples/bug-webkit-hash-iframe/
651
- // Safari: Back Button from a different domain - http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/
652
- //
653
- // Also note that should a browser natively support the window.onhashchange
654
- // event, but not report that it does, the fallback polling loop will be used.
655
- //
656
- // About: Release History
657
- //
658
- // 1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more
659
- // "removable" for mobile-only development. Added IE6/7 document.title
660
- // support. Attempted to make Iframe as hidden as possible by using
661
- // techniques from http://www.paciellogroup.com/blog/?p=604. Added
662
- // support for the "shortcut" format $(window).hashchange( fn ) and
663
- // $(window).hashchange() like jQuery provides for built-in events.
664
- // Renamed jQuery.hashchangeDelay to <jQuery.fn.hashchange.delay> and
665
- // lowered its default value to 50. Added <jQuery.fn.hashchange.domain>
666
- // and <jQuery.fn.hashchange.src> properties plus document-domain.html
667
- // file to address access denied issues when setting document.domain in
668
- // IE6/7.
669
- // 1.2 - (2/11/2010) Fixed a bug where coming back to a page using this plugin
670
- // from a page on another domain would cause an error in Safari 4. Also,
671
- // IE6/7 Iframe is now inserted after the body (this actually works),
672
- // which prevents the page from scrolling when the event is first bound.
673
- // Event can also now be bound before DOM ready, but it won't be usable
674
- // before then in IE6/7.
675
- // 1.1 - (1/21/2010) Incorporated document.documentMode test to fix IE8 bug
676
- // where browser version is incorrectly reported as 8.0, despite
677
- // inclusion of the X-UA-Compatible IE=EmulateIE7 meta tag.
678
- // 1.0 - (1/9/2010) Initial Release. Broke out the jQuery BBQ event.special
679
- // window.onhashchange functionality into a separate plugin for users
680
- // who want just the basic event & back button support, without all the
681
- // extra awesomeness that BBQ provides. This plugin will be included as
682
- // part of jQuery BBQ, but also be available separately.
683
-
684
- (function($,window,undefined){
685
- '$:nomunge'; // Used by YUI compressor.
686
-
687
- // Reused string.
688
- var str_hashchange = 'hashchange',
689
-
690
- // Method / object references.
691
- doc = document,
692
- fake_onhashchange,
693
- special = $.event.special,
694
-
695
- // Does the browser support window.onhashchange? Note that IE8 running in
696
- // IE7 compatibility mode reports true for 'onhashchange' in window, even
697
- // though the event isn't supported, so also test document.documentMode.
698
- doc_mode = doc.documentMode,
699
- supports_onhashchange = 'on' + str_hashchange in window && ( doc_mode === undefined || doc_mode > 7 );
700
-
701
- // Get location.hash (or what you'd expect location.hash to be) sans any
702
- // leading #. Thanks for making this necessary, Firefox!
703
- function get_fragment( url ) {
704
- url = url || location.href;
705
- return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );
706
- };
707
-
708
- // Method: jQuery.fn.hashchange
709
- //
710
- // Bind a handler to the window.onhashchange event or trigger all bound
711
- // window.onhashchange event handlers. This behavior is consistent with
712
- // jQuery's built-in event handlers.
713
- //
714
- // Usage:
715
- //
716
- // > jQuery(window).hashchange( [ handler ] );
717
- //
718
- // Arguments:
719
- //
720
- // handler - (Function) Optional handler to be bound to the hashchange
721
- // event. This is a "shortcut" for the more verbose form:
722
- // jQuery(window).bind( 'hashchange', handler ). If handler is omitted,
723
- // all bound window.onhashchange event handlers will be triggered. This
724
- // is a shortcut for the more verbose
725
- // jQuery(window).trigger( 'hashchange' ). These forms are described in
726
- // the <hashchange event> section.
727
- //
728
- // Returns:
729
- //
730
- // (jQuery) The initial jQuery collection of elements.
731
-
732
- // Allow the "shortcut" format $(elem).hashchange( fn ) for binding and
733
- // $(elem).hashchange() for triggering, like jQuery does for built-in events.
734
- $.fn[ str_hashchange ] = function( fn ) {
735
- return fn ? this.bind( str_hashchange, fn ) : this.trigger( str_hashchange );
736
- };
737
-
738
- // Property: jQuery.fn.hashchange.delay
739
- //
740
- // The numeric interval (in milliseconds) at which the <hashchange event>
741
- // polling loop executes. Defaults to 50.
742
-
743
- // Property: jQuery.fn.hashchange.domain
744
- //
745
- // If you're setting document.domain in your JavaScript, and you want hash
746
- // history to work in IE6/7, not only must this property be set, but you must
747
- // also set document.domain BEFORE jQuery is loaded into the page. This
748
- // property is only applicable if you are supporting IE6/7 (or IE8 operating
749
- // in "IE7 compatibility" mode).
750
- //
751
- // In addition, the <jQuery.fn.hashchange.src> property must be set to the
752
- // path of the included "document-domain.html" file, which can be renamed or
753
- // modified if necessary (note that the document.domain specified must be the
754
- // same in both your main JavaScript as well as in this file).
755
- //
756
- // Usage:
757
- //
758
- // jQuery.fn.hashchange.domain = document.domain;
759
-
760
- // Property: jQuery.fn.hashchange.src
761
- //
762
- // If, for some reason, you need to specify an Iframe src file (for example,
763
- // when setting document.domain as in <jQuery.fn.hashchange.domain>), you can
764
- // do so using this property. Note that when using this property, history
765
- // won't be recorded in IE6/7 until the Iframe src file loads. This property
766
- // is only applicable if you are supporting IE6/7 (or IE8 operating in "IE7
767
- // compatibility" mode).
768
- //
769
- // Usage:
770
- //
771
- // jQuery.fn.hashchange.src = 'path/to/file.html';
772
-
773
- $.fn[ str_hashchange ].delay = 50;
774
- /*
775
- $.fn[ str_hashchange ].domain = null;
776
- $.fn[ str_hashchange ].src = null;
777
- */
778
-
779
- // Event: hashchange event
780
- //
781
- // Fired when location.hash changes. In browsers that support it, the native
782
- // HTML5 window.onhashchange event is used, otherwise a polling loop is
783
- // initialized, running every <jQuery.fn.hashchange.delay> milliseconds to
784
- // see if the hash has changed. In IE6/7 (and IE8 operating in "IE7
785
- // compatibility" mode), a hidden Iframe is created to allow the back button
786
- // and hash-based history to work.
787
- //
788
- // Usage as described in <jQuery.fn.hashchange>:
789
- //
790
- // > // Bind an event handler.
791
- // > jQuery(window).hashchange( function(e) {
792
- // > var hash = location.hash;
793
- // > ...
794
- // > });
795
- // >
796
- // > // Manually trigger the event handler.
797
- // > jQuery(window).hashchange();
798
- //
799
- // A more verbose usage that allows for event namespacing:
800
- //
801
- // > // Bind an event handler.
802
- // > jQuery(window).bind( 'hashchange', function(e) {
803
- // > var hash = location.hash;
804
- // > ...
805
- // > });
806
- // >
807
- // > // Manually trigger the event handler.
808
- // > jQuery(window).trigger( 'hashchange' );
809
- //
810
- // Additional Notes:
811
- //
812
- // * The polling loop and Iframe are not created until at least one handler
813
- // is actually bound to the 'hashchange' event.
814
- // * If you need the bound handler(s) to execute immediately, in cases where
815
- // a location.hash exists on page load, via bookmark or page refresh for
816
- // example, use jQuery(window).hashchange() or the more verbose
817
- // jQuery(window).trigger( 'hashchange' ).
818
- // * The event can be bound before DOM ready, but since it won't be usable
819
- // before then in IE6/7 (due to the necessary Iframe), recommended usage is
820
- // to bind it inside a DOM ready handler.
821
-
822
- // Override existing $.event.special.hashchange methods (allowing this plugin
823
- // to be defined after jQuery BBQ in BBQ's source code).
824
- special[ str_hashchange ] = $.extend( special[ str_hashchange ], {
825
-
826
- // Called only when the first 'hashchange' event is bound to window.
827
- setup: function() {
828
- // If window.onhashchange is supported natively, there's nothing to do..
829
- if ( supports_onhashchange ) { return false; }
830
-
831
- // Otherwise, we need to create our own. And we don't want to call this
832
- // until the user binds to the event, just in case they never do, since it
833
- // will create a polling loop and possibly even a hidden Iframe.
834
- $( fake_onhashchange.start );
835
- },
836
-
837
- // Called only when the last 'hashchange' event is unbound from window.
838
- teardown: function() {
839
- // If window.onhashchange is supported natively, there's nothing to do..
840
- if ( supports_onhashchange ) { return false; }
841
-
842
- // Otherwise, we need to stop ours (if possible).
843
- $( fake_onhashchange.stop );
844
- }
845
-
846
- });
847
-
848
- // fake_onhashchange does all the work of triggering the window.onhashchange
849
- // event for browsers that don't natively support it, including creating a
850
- // polling loop to watch for hash changes and in IE 6/7 creating a hidden
851
- // Iframe to enable back and forward.
852
- fake_onhashchange = (function(){
853
- var self = {},
854
- timeout_id,
855
-
856
- // Remember the initial hash so it doesn't get triggered immediately.
857
- last_hash = get_fragment(),
858
-
859
- fn_retval = function(val){ return val; },
860
- history_set = fn_retval,
861
- history_get = fn_retval;
862
-
863
- // Start the polling loop.
864
- self.start = function() {
865
- timeout_id || poll();
866
- };
867
-
868
- // Stop the polling loop.
869
- self.stop = function() {
870
- timeout_id && clearTimeout( timeout_id );
871
- timeout_id = undefined;
872
- };
873
-
874
- // This polling loop checks every $.fn.hashchange.delay milliseconds to see
875
- // if location.hash has changed, and triggers the 'hashchange' event on
876
- // window when necessary.
877
- function poll() {
878
- var hash = get_fragment(),
879
- history_hash = history_get( last_hash );
880
-
881
- if ( hash !== last_hash ) {
882
- history_set( last_hash = hash, history_hash );
883
-
884
- $(window).trigger( str_hashchange );
885
-
886
- } else if ( history_hash !== last_hash ) {
887
- location.href = location.href.replace( /#.*/, '' ) + history_hash;
888
- }
889
-
890
- timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );
891
- };
892
-
893
- // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
894
- // vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
895
- // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
896
- $.browser.msie && !supports_onhashchange && (function(){
897
- // Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
898
- // when running in "IE7 compatibility" mode.
899
-
900
- var iframe,
901
- iframe_src;
902
-
903
- // When the event is bound and polling starts in IE 6/7, create a hidden
904
- // Iframe for history handling.
905
- self.start = function(){
906
- if ( !iframe ) {
907
- iframe_src = $.fn[ str_hashchange ].src;
908
- iframe_src = iframe_src && iframe_src + get_fragment();
909
-
910
- // Create hidden Iframe. Attempt to make Iframe as hidden as possible
911
- // by using techniques from http://www.paciellogroup.com/blog/?p=604.
912
- iframe = $('<iframe tabindex="-1" title="empty"/>').hide()
913
-
914
- // When Iframe has completely loaded, initialize the history and
915
- // start polling.
916
- .one( 'load', function(){
917
- iframe_src || history_set( get_fragment() );
918
- poll();
919
- })
920
-
921
- // Load Iframe src if specified, otherwise nothing.
922
- .attr( 'src', iframe_src || 'javascript:0' )
923
-
924
- // Append Iframe after the end of the body to prevent unnecessary
925
- // initial page scrolling (yes, this works).
926
- .insertAfter( 'body' )[0].contentWindow;
927
-
928
- // Whenever `document.title` changes, update the Iframe's title to
929
- // prettify the back/next history menu entries. Since IE sometimes
930
- // errors with "Unspecified error" the very first time this is set
931
- // (yes, very useful) wrap this with a try/catch block.
932
- doc.onpropertychange = function(){
933
- try {
934
- if ( event.propertyName === 'title' ) {
935
- iframe.document.title = doc.title;
936
- }
937
- } catch(e) {}
938
- };
939
-
940
- }
941
- };
942
-
943
- // Override the "stop" method since an IE6/7 Iframe was created. Even
944
- // if there are no longer any bound event handlers, the polling loop
945
- // is still necessary for back/next to work at all!
946
- self.stop = fn_retval;
947
-
948
- // Get history by looking at the hidden Iframe's location.hash.
949
- history_get = function() {
950
- return get_fragment( iframe.location.href );
951
- };
952
-
953
- // Set a new history item by opening and then closing the Iframe
954
- // document, *then* setting its location.hash. If document.domain has
955
- // been set, update that as well.
956
- history_set = function( hash, history_hash ) {
957
- var iframe_doc = iframe.document,
958
- domain = $.fn[ str_hashchange ].domain;
959
-
960
- if ( hash !== history_hash ) {
961
- // Update Iframe with any initial `document.title` that might be set.
962
- iframe_doc.title = doc.title;
963
-
964
- // Opening the Iframe's document after it has been closed is what
965
- // actually adds a history entry.
966
- iframe_doc.open();
967
-
968
- // Set document.domain for the Iframe document as well, if necessary.
969
- domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' );
970
-
971
- iframe_doc.close();
972
-
973
- // Update the Iframe's hash, for great justice.
974
- iframe.location.hash = hash;
975
- }
976
- };
977
-
978
- })();
979
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
980
- // ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^
981
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
982
-
983
- return self;
984
- })();
985
-
986
- })(jQuery,this);
987
-
988
-
989
- (function ( jQuery ) {
990
-
991
- jQuery.widget( "mobile.page", jQuery.mobile.widget, {
992
- options: {
993
- backBtnText: "Back",
994
- addBackBtn: true,
995
- degradeInputs: {
996
- color: true,
997
- date: true,
998
- datetime: true,
999
- "datetime-local": true,
1000
- email: true,
1001
- month: true,
1002
- number: true,
1003
- range: true,
1004
- search: true,
1005
- tel: true,
1006
- time: true,
1007
- url: true,
1008
- week: true
1009
- }
1010
- },
1011
-
1012
- _create: function() {
1013
- var $elem = this.element,
1014
- o = this.options;
1015
-
1016
- if ( this._trigger( "beforeCreate" ) === false ) {
1017
- return;
1018
- }
1019
-
1020
- //some of the form elements currently rely on the presence of ui-page and ui-content
1021
- // classes so we'll handle page and content roles outside of the main role processing
1022
- // loop below.
1023
- $elem.find( "[data-role='page'], [data-role='content']" ).andSelf().each(function() {
1024
- jQuery(this).addClass( "ui-" + jQuery(this).data( "role" ) );
1025
- });
1026
-
1027
- $elem.find( "[data-role='nojs']" ).addClass( "ui-nojs" );
1028
-
1029
- this._enchanceControls();
1030
-
1031
- // pre-find data els
1032
- var $dataEls = $elem.find( "[data-role]" ).andSelf().each(function() {
1033
- var $this = jQuery( this ),
1034
- role = $this.data( "role" ),
1035
- theme = $this.data( "theme" );
1036
-
1037
- //apply theming and markup modifications to page,header,content,footer
1038
- if ( role === "header" || role === "footer" ) {
1039
- $this.addClass( "ui-bar-" + (theme || $this.parent('[data-role=page]').data( "theme" ) || "a") );
1040
-
1041
- // add ARIA role
1042
- $this.attr( "role", role === "header" ? "banner" : "contentinfo" );
1043
-
1044
- //right,left buttons
1045
- var $headeranchors = $this.children( "a" ),
1046
- leftbtn = $headeranchors.hasClass( "ui-btn-left" ),
1047
- rightbtn = $headeranchors.hasClass( "ui-btn-right" );
1048
-
1049
- if ( !leftbtn ) {
1050
- leftbtn = $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
1051
- }
1052
-
1053
- if ( !rightbtn ) {
1054
- rightbtn = $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
1055
- }
1056
-
1057
- // auto-add back btn on pages beyond first view
1058
- if ( o.addBackBtn && role === "header" &&
1059
- (jQuery.mobile.urlStack.length > 1 || jQuery(".ui-page").length > 1) &&
1060
- !leftbtn && !$this.data( "noBackBtn" ) ) {
1061
-
1062
- jQuery( "<a href='#' class='ui-btn-left' data-icon='arrow-l'>"+ o.backBtnText +"</a>" )
1063
- .click(function() {
1064
- history.back();
1065
- return false;
1066
- })
1067
- .prependTo( $this );
1068
- }
1069
-
1070
- //page title
1071
- $this.children( "h1, h2, h3, h4, h5, h6" )
1072
- .addClass( "ui-title" )
1073
- //regardless of h element number in src, it becomes h1 for the enhanced page
1074
- .attr({ "tabindex": "0", "role": "heading", "aria-level": "1" });
1075
-
1076
- } else if ( role === "content" ) {
1077
- if ( theme ) {
1078
- $this.addClass( "ui-body-" + theme );
1079
- }
1080
-
1081
- // add ARIA role
1082
- $this.attr( "role", "main" );
1083
-
1084
- } else if ( role === "page" ) {
1085
- $this.addClass( "ui-body-" + (theme || "c") );
1086
- }
1087
-
1088
- switch(role) {
1089
- case "header":
1090
- case "footer":
1091
- case "page":
1092
- case "content":
1093
- $this.addClass( "ui-" + role );
1094
- break;
1095
- case "collapsible":
1096
- case "fieldcontain":
1097
- case "navbar":
1098
- case "listview":
1099
- case "dialog":
1100
- $this[ role ]();
1101
- break;
1102
- }
1103
- });
1104
-
1105
- //links in bars, or those with data-role become buttons
1106
- $elem.find( "[data-role='button'], .ui-bar a, .ui-header a, .ui-footer a" )
1107
- .not( ".ui-btn" )
1108
- .buttonMarkup();
1109
-
1110
- $elem
1111
- .find("[data-role='controlgroup']")
1112
- .controlgroup();
1113
-
1114
- //links within content areas
1115
- $elem.find( "a:not(.ui-btn):not(.ui-link-inherit)" )
1116
- .addClass( "ui-link" );
1117
-
1118
- //fix toolbars
1119
- $elem.fixHeaderFooter();
1120
- },
1121
-
1122
- _enchanceControls: function() {
1123
- var o = this.options;
1124
- // degrade inputs to avoid poorly implemented native functionality
1125
- this.element.find( "input" ).each(function() {
1126
- var type = this.getAttribute( "type" );
1127
- if ( o.degradeInputs[ type ] ) {
1128
- jQuery( this ).replaceWith(
1129
- jQuery( "<div>" ).html( jQuery(this).clone() ).html()
1130
- .replace( /type="([a-zA-Z]+)"/, "data-type='$1'" ) );
1131
- }
1132
- });
1133
-
1134
- // enchance form controls
1135
- this.element
1136
- .find( "[type='radio'], [type='checkbox']" )
1137
- .checkboxradio();
1138
-
1139
- this.element
1140
- .find( "button, [type='button'], [type='submit'], [type='reset'], [type='image']" )
1141
- .not( ".ui-nojs" )
1142
- .button();
1143
-
1144
- this.element
1145
- .find( "input, textarea" )
1146
- .not( "[type='radio'], [type='checkbox'], button, [type='button'], [type='submit'], [type='reset'], [type='image']" )
1147
- .textinput();
1148
-
1149
- this.element
1150
- .find( "input, select" )
1151
- .filter( "[data-role='slider'], [data-type='range']" )
1152
- .slider();
1153
-
1154
- this.element
1155
- .find( "select:not([data-role='slider'])" )
1156
- .customSelect();
1157
- }
1158
- });
1159
-
1160
- })( jQuery );
1161
-
1162
-
1163
- /*
1164
- * jQuery Mobile Framework : prototype for "fixHeaderFooter" plugin - on-demand positioning for headers,footers
1165
- * Copyright (c) jQuery Project
1166
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1167
- * Note: Code is in draft form and is subject to change
1168
- */
1169
- (function($){
1170
- $.fn.fixHeaderFooter = function(options){
1171
- if( !$.support.scrollTop ){ return $(this); }
1172
- return $(this).each(function(){
1173
- if( $(this).data('fullscreen') ){ $(this).addClass('ui-page-fullscreen'); }
1174
- $(this).find('.ui-header[data-position="fixed"]').addClass('ui-header-fixed ui-fixed-inline fade'); //should be slidedown
1175
- $(this).find('.ui-footer[data-position="fixed"]').addClass('ui-footer-fixed ui-fixed-inline fade'); //should be slideup
1176
- });
1177
- };
1178
-
1179
- //single controller for all showing,hiding,toggling
1180
- $.fixedToolbars = (function(){
1181
- if( !$.support.scrollTop ){ return; }
1182
- var currentstate = 'inline',
1183
- delayTimer,
1184
- ignoreTargets = 'a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed',
1185
- toolbarSelector = '.ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last',
1186
- stickyFooter, //for storing quick references to duplicate footers
1187
- supportTouch = $.support.touch,
1188
- touchStartEvent = supportTouch ? "touchstart" : "mousedown",
1189
- touchStopEvent = supportTouch ? "touchend" : "mouseup",
1190
- stateBefore = null,
1191
- scrollTriggered = false;
1192
-
1193
- $(function() {
1194
- $(document)
1195
- .bind(touchStartEvent,function(event){
1196
- if( $(event.target).closest(ignoreTargets).length ){ return; }
1197
- stateBefore = currentstate;
1198
- $.fixedToolbars.hide(true);
1199
- })
1200
- .bind('scrollstart',function(event){
1201
- if( $(event.target).closest(ignoreTargets).length ){ return; } //because it could be a touchmove...
1202
- scrollTriggered = true;
1203
- if(stateBefore == null){ stateBefore = currentstate; }
1204
- $.fixedToolbars.hide(true);
1205
- })
1206
- .bind(touchStopEvent,function(event){
1207
- if( $(event.target).closest(ignoreTargets).length ){ return; }
1208
- if( !scrollTriggered ){
1209
- $.fixedToolbars.toggle(stateBefore);
1210
- stateBefore = null;
1211
- }
1212
- })
1213
- .bind('scrollstop',function(event){
1214
- if( $(event.target).closest(ignoreTargets).length ){ return; }
1215
- scrollTriggered = false;
1216
- $.fixedToolbars.toggle( stateBefore == 'overlay' ? 'inline' : 'overlay' );
1217
- stateBefore = null;
1218
- });
1219
-
1220
- //function to return another footer already in the dom with the same data-id
1221
- function findStickyFooter(el){
1222
- var thisFooter = el.find('[data-role="footer"]');
1223
- return jQuery( '.ui-footer[data-id="'+ thisFooter.data('id') +'"]:not(.ui-footer-duplicate)' ).not(thisFooter);
1224
- }
1225
-
1226
- //before page is shown, check for duplicate footer
1227
- $('.ui-page').live('pagebeforeshow', function(event, ui){
1228
- stickyFooter = findStickyFooter( $(event.target) );
1229
- if( stickyFooter.length ){
1230
- //if the existing footer is the first of its kind, create a placeholder before stealing it
1231
- if( stickyFooter.parents('.ui-page:eq(0)').find('.ui-footer[data-id="'+ stickyFooter.data('id') +'"]').length == 1 ){
1232
- stickyFooter.before( stickyFooter.clone().addClass('ui-footer-duplicate') );
1233
- }
1234
- $(event.target).find('[data-role="footer"]').addClass('ui-footer-duplicate');
1235
- stickyFooter.appendTo($.pageContainer).css('top',0);
1236
- setTop(stickyFooter);
1237
- }
1238
- });
1239
-
1240
- //after page is shown, append footer to new page
1241
- $('.ui-page').live('pageshow', function(event, ui){
1242
- if( stickyFooter && stickyFooter.length ){
1243
- stickyFooter.appendTo(event.target).css('top',0);
1244
- }
1245
- $.fixedToolbars.show(true);
1246
- });
1247
-
1248
- });
1249
-
1250
- function setTop(el){
1251
- var fromTop = $(window).scrollTop(),
1252
- thisTop = el.offset().top,
1253
- thisCSStop = el.css('top') == 'auto' ? 0 : parseFloat(el.css('top')),
1254
- screenHeight = window.innerHeight,
1255
- thisHeight = el.outerHeight(),
1256
- useRelative = el.parents('.ui-page:not(.ui-page-fullscreen)').length,
1257
- relval;
1258
- if( el.is('.ui-header-fixed') ){
1259
- relval = fromTop - thisTop + thisCSStop;
1260
- if( relval < thisTop){ relval = 0; }
1261
- return el.css('top', ( useRelative ) ? relval : fromTop);
1262
- }
1263
- else{
1264
- relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
1265
- if( relval > thisTop ){ relval = 0; }
1266
- return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight );
1267
- }
1268
- }
1269
-
1270
- //exposed methods
1271
- return {
1272
- show: function(immediately){
1273
- currentstate = 'overlay';
1274
- var $ap = $.activePage ? $.activePage : $(".ui-page-active");
1275
- return $ap.children( toolbarSelector ).each(function(){
1276
- var el = $(this),
1277
- fromTop = $(window).scrollTop(),
1278
- thisTop = el.offset().top,
1279
- screenHeight = window.innerHeight,
1280
- thisHeight = el.outerHeight(),
1281
- alreadyVisible = (el.is('.ui-header-fixed') && fromTop <= thisTop + thisHeight) || (el.is('.ui-footer-fixed') && thisTop <= fromTop + screenHeight);
1282
-
1283
- //add state class
1284
- el.addClass('ui-fixed-overlay').removeClass('ui-fixed-inline');
1285
-
1286
- if( !alreadyVisible && !immediately ){
1287
- el.addClass('in').animationComplete(function(){
1288
- el.removeClass('in');
1289
- });
1290
- }
1291
- setTop(el);
1292
- });
1293
- },
1294
- hide: function(immediately){
1295
- currentstate = 'inline';
1296
- var $ap = $.activePage ? $.activePage : $(".ui-page-active");
1297
- return $ap.children( toolbarSelector ).each(function(){
1298
- var el = $(this);
1299
-
1300
- //add state class
1301
- el.addClass('ui-fixed-inline').removeClass('ui-fixed-overlay');
1302
-
1303
- if(immediately){
1304
- el.css('top',0);
1305
- }
1306
- else{
1307
- if( el.css('top') !== 'auto' && parseFloat(el.css('top')) !== 0 ){
1308
- var classes = 'out reverse';
1309
- el.addClass(classes).animationComplete(function(){
1310
- el.removeClass(classes);
1311
- el.css('top',0);
1312
- });
1313
- }
1314
- }
1315
- });
1316
- },
1317
- hideAfterDelay: function(){
1318
- delayTimer = setTimeout(function(){
1319
- $.fixedToolbars.hide();
1320
- }, 3000);
1321
- },
1322
- toggle: function(from){
1323
- if(from){ currentstate = from; }
1324
- return (currentstate == 'overlay') ? $.fixedToolbars.hide() : $.fixedToolbars.show();
1325
- }
1326
- };
1327
- })();
1328
-
1329
- })(jQuery);
1330
-
1331
- /*
1332
- * jQuery Mobile Framework : "customCheckboxRadio" plugin (based on code from Filament Group,Inc)
1333
- * Copyright (c) jQuery Project
1334
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1335
- * Note: Code is in draft form and is subject to change
1336
- */
1337
- (function ( $ ) {
1338
- $.widget( "mobile.checkboxradio", $.mobile.widget, {
1339
- options: {
1340
- theme: undefined,
1341
- icon: undefined
1342
- },
1343
- _create: function(){
1344
- var input = this.element,
1345
- label = jQuery("label[for='" + input.attr( "id" ) + "']"),
1346
- inputtype = input.attr( "type" ),
1347
- checkedicon = "ui-icon-" + inputtype + "-on",
1348
- uncheckedicon = "ui-icon-" + inputtype + "-off";
1349
-
1350
- if ( inputtype != "checkbox" && inputtype != "radio" ) { return; }
1351
-
1352
- label
1353
- .buttonMarkup({
1354
- iconpos: this.options.icon,
1355
- theme: this.options.theme,
1356
- icon: this.options.icon ? uncheckedicon : ( this.element.parents( "[data-type='horizontal']" ).length ? undefined : uncheckedicon ),
1357
- shadow: false
1358
- });
1359
-
1360
- // wrap the input + label in a div
1361
- input
1362
- .add( label )
1363
- .wrapAll( "<div class='ui-" + inputtype +"'></div>" );
1364
-
1365
- label.bind({
1366
- mouseover: function() {
1367
- if( $(this).parent().is('.ui-disabled') ){ return false; }
1368
- },
1369
-
1370
- mousedown: function() {
1371
- if( $(this).parent().is('.ui-disabled') ){ return false; }
1372
- label.data( "state", input.attr( "checked" ) );
1373
- },
1374
-
1375
- click: function() {
1376
- setTimeout(function() {
1377
- if ( input.attr( "checked" ) === label.data( "state" ) ) {
1378
- input.trigger( "click" );
1379
- }
1380
- }, 1);
1381
- }
1382
- });
1383
-
1384
- input
1385
- .bind({
1386
-
1387
- click: function() {
1388
- jQuery( "input[name='" + input.attr( "name" ) + "'][type='" + inputtype + "']" ).checkboxradio( "refresh" );
1389
- },
1390
-
1391
- focus: function() {
1392
- label.addClass( "ui-focus" );
1393
- },
1394
-
1395
- blur: function() {
1396
- label.removeClass( "ui-focus" );
1397
- }
1398
- });
1399
-
1400
- this.refresh();
1401
-
1402
- },
1403
-
1404
- refresh: function( ){
1405
- var input = this.element,
1406
- label = jQuery("label[for='" + input.attr( "id" ) + "']"),
1407
- inputtype = input.attr( "type" ),
1408
- icon = label.find( ".ui-icon" ),
1409
- checkedicon = "ui-icon-" + inputtype + "-on",
1410
- uncheckedicon = "ui-icon-" + inputtype + "-off";
1411
-
1412
- if ( input[0].checked ) {
1413
- label.addClass( "ui-btn-active" );
1414
- icon.addClass( checkedicon );
1415
- icon.removeClass( uncheckedicon );
1416
-
1417
- } else {
1418
- label.removeClass( "ui-btn-active" );
1419
- icon.removeClass( checkedicon );
1420
- icon.addClass( uncheckedicon );
1421
- }
1422
-
1423
- if( input.is( ":disabled" ) ){
1424
- this.disable();
1425
- }
1426
- else {
1427
- this.enable();
1428
- }
1429
- },
1430
-
1431
- disable: function(){
1432
- this.element.attr("disabled",true).parent().addClass("ui-disabled");
1433
- },
1434
-
1435
- enable: function(){
1436
- this.element.attr("disabled",false).parent().removeClass("ui-disabled");
1437
- }
1438
- });
1439
- })( jQuery );
1440
-
1441
-
1442
- /*
1443
- * jQuery Mobile Framework : "textinput" plugin for text inputs, textareas (based on code from Filament Group,Inc)
1444
- * Copyright (c) jQuery Project
1445
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1446
- * Note: Code is in draft form and is subject to change
1447
- */
1448
- (function ( $ ) {
1449
- $.widget( "mobile.textinput", $.mobile.widget, {
1450
- options: {
1451
- theme: undefined
1452
- },
1453
- _create: function(){
1454
- var input = this.element,
1455
- o = this.options,
1456
- theme = o.theme,
1457
- themeclass;
1458
-
1459
- if ( !theme ) {
1460
- var themedParent = this.element.closest("[class*='ui-bar-'],[class*='ui-body-']");
1461
- theme = themedParent.length ?
1462
- /ui-(bar|body)-([a-z])/.exec( themedParent.attr("class") )[2] :
1463
- "c";
1464
- }
1465
-
1466
- themeclass = " ui-body-" + theme;
1467
-
1468
- $('label[for='+input.attr('id')+']').addClass('ui-input-text');
1469
-
1470
- input.addClass('ui-input-text ui-body-'+ o.theme);
1471
-
1472
- var focusedEl = input;
1473
-
1474
- //"search" input widget
1475
- if( input.is('[type="search"],[data-type="search"]') ){
1476
- focusedEl = input.wrap('<div class="ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-search'+ themeclass +'"></div>').parent();
1477
- var clearbtn = $('<a href="#" class="ui-input-clear" title="clear text">clear text</a>')
1478
- .click(function(){
1479
- input.val('').focus();
1480
- input.trigger('change');
1481
- clearbtn.addClass('ui-input-clear-hidden');
1482
- return false;
1483
- })
1484
- .appendTo(focusedEl)
1485
- .buttonMarkup({icon: 'delete', iconpos: 'notext', corners:true, shadow:true});
1486
-
1487
- function toggleClear(){
1488
- if(input.val() == ''){
1489
- clearbtn.addClass('ui-input-clear-hidden');
1490
- }
1491
- else{
1492
- clearbtn.removeClass('ui-input-clear-hidden');
1493
- }
1494
- }
1495
-
1496
- toggleClear();
1497
- input.keyup(toggleClear);
1498
- }
1499
- else{
1500
- input.addClass('ui-corner-all ui-shadow-inset' + themeclass);
1501
- }
1502
-
1503
- input
1504
- .focus(function(){
1505
- focusedEl.addClass('ui-focus');
1506
- })
1507
- .blur(function(){
1508
- focusedEl.removeClass('ui-focus');
1509
- });
1510
-
1511
- //autogrow
1512
- if ( input.is('textarea') ) {
1513
- var extraLineHeight = 15,
1514
- keyupTimeoutBuffer = 100,
1515
- keyup = function() {
1516
- var scrollHeight = input[0].scrollHeight,
1517
- clientHeight = input[0].clientHeight;
1518
- if ( clientHeight < scrollHeight ) {
1519
- input.css({ height: (scrollHeight + extraLineHeight) });
1520
- }
1521
- },
1522
- keyupTimeout;
1523
- input.keyup(function() {
1524
- clearTimeout( keyupTimeout );
1525
- keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
1526
- });
1527
- }
1528
- },
1529
-
1530
- disable: function(){
1531
- ( this.element.attr("disabled",true).is('[type="search"],[data-type="search"]') ? this.element.parent() : this.element ).addClass("ui-disabled");
1532
- },
1533
-
1534
- enable: function(){
1535
- ( this.element.attr("disabled", false).is('[type="search"],[data-type="search"]') ? this.element.parent() : this.element ).removeClass("ui-disabled");
1536
- }
1537
- });
1538
- })( jQuery );
1539
-
1540
-
1541
- /*
1542
- * jQuery Mobile Framework : "customSelect" plugin (based on code from Filament Group,Inc)
1543
- * Copyright (c) jQuery Project
1544
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1545
- * Note: Code is in draft form and is subject to change
1546
- */
1547
- (function($){
1548
- $.fn.customSelect = function(options){
1549
- return $(this).each(function(){
1550
- var select = $(this)
1551
- .attr( "tabindex", "-1" )
1552
- .wrap( "<div class='ui-select'>" ),
1553
- selectID = select.attr( "id" ),
1554
- label = $( "label[for="+ selectID +"]" )
1555
- .addClass( "ui-select" ),
1556
-
1557
- //extendable options
1558
- o = $.extend({
1559
- chooseText: label.text(),
1560
- theme: select.data("theme")
1561
- }, options),
1562
-
1563
- buttonId = selectID + "-button",
1564
- menuId = selectID + "-menu",
1565
- thisPage = select.closest( ".ui-page" ),
1566
- menuType,
1567
- currScroll,
1568
- button = $( "<a>", {
1569
- "href": "#",
1570
- "role": "button",
1571
- "id": buttonId,
1572
- "aria-haspopup": "true",
1573
- "aria-owns": menuId
1574
- })
1575
- .text( $( this.options.item(this.selectedIndex) ).text() )
1576
- .insertBefore( select )
1577
- .buttonMarkup({
1578
- iconpos: 'right',
1579
- icon: 'arrow-d',
1580
- theme: o.theme
1581
- }),
1582
- menuPage = $( "<div data-role='dialog' data-theme='a'>" +
1583
- "<div data-role='header' data-theme='b'>" +
1584
- "<div class='ui-title'>" + o.chooseText + "</div>"+
1585
- "</div>"+
1586
- "<div data-role='content'></div>"+
1587
- "</div>" )
1588
- .appendTo( $.pageContainer )
1589
- .page(),
1590
- menuPageContent = menuPage.find( ".ui-content" ),
1591
- screen = $( "<div>", {
1592
- "class": "ui-listbox-screen ui-overlay ui-screen-hidden fade"
1593
- })
1594
- .appendTo( thisPage ),
1595
- listbox = $( "<div>", { "class": "ui-listbox ui-listbox-hidden ui-body-a ui-overlay-shadow ui-corner-all pop"} )
1596
- .insertAfter(screen),
1597
- list = $( "<ul>", {
1598
- "class": "ui-listbox-list",
1599
- "id": menuId,
1600
- "role": "listbox",
1601
- "aria-labelledby": buttonId
1602
- })
1603
- .appendTo( listbox );
1604
-
1605
- //populate menu
1606
- select.find( "option" ).each(function( i ){
1607
- var selected = (select[0].selectedIndex == i),
1608
- anchor = $("<a>", {
1609
- "aria-selected": selected,
1610
- "role": "option",
1611
- "href": "#"
1612
- })
1613
- .text( $(this).text() );
1614
-
1615
- $( "<li>", {
1616
- "class": selected ? "ui-btn-active" : '',
1617
- "data-icon": "checkbox-on"
1618
- })
1619
- .append( anchor )
1620
- .appendTo( list );
1621
- });
1622
-
1623
- //now populated, create listview
1624
- list.listview();
1625
-
1626
-
1627
-
1628
- function showmenu(){
1629
- var menuHeight = list.outerHeight();
1630
- currScroll = [ $(window).scrollLeft(), $(window).scrollTop() ];
1631
-
1632
- if( menuHeight > window.innerHeight - 80 || !$.support.scrollTop ){
1633
- menuType = "page";
1634
- menuPageContent.append( list );
1635
- $.changePage(menuPage, undefined);
1636
- }
1637
- else {
1638
- menuType = "overlay";
1639
-
1640
- screen
1641
- .height( $(document).height() )
1642
- .removeClass('ui-screen-hidden');
1643
-
1644
- listbox
1645
- .append( list )
1646
- .removeClass( "ui-listbox-hidden" )
1647
- .css({
1648
- top: $(window).scrollTop() + (window.innerHeight/2),
1649
- "margin-top": -menuHeight/2,
1650
- left: window.innerWidth/2,
1651
- "margin-left": -1* listbox.outerWidth() / 2
1652
- })
1653
- .addClass("in");
1654
- }
1655
- };
1656
-
1657
- function hidemenu(){
1658
- if(menuType == "page"){
1659
- $.changePage([menuPage,thisPage], undefined, true);
1660
- }
1661
- else{
1662
- screen.addClass( "ui-screen-hidden" );
1663
- listbox.addClass( "ui-listbox-hidden" ).removeAttr( "style" ).removeClass("in");
1664
- }
1665
- };
1666
-
1667
- //page show/hide events
1668
- menuPage
1669
- .bind("pageshow", function(){
1670
- list.find( ".ui-btn-active" ).focus();
1671
- return false;
1672
- })
1673
- .bind("pagehide", function(){
1674
- window.scrollTo(currScroll[0], currScroll[1]);
1675
- select.focus();
1676
- listbox.append( list ).removeAttr('style');
1677
- return false;
1678
- });
1679
-
1680
-
1681
- //select properties,events
1682
- select
1683
- .change(function(){
1684
- var $el = select.get(0);
1685
- button.find( ".ui-btn-text" ).text( $($el.options.item($el.selectedIndex)).text() );
1686
- })
1687
- .focus(function(){
1688
- $(this).blur();
1689
- button.focus();
1690
- });
1691
-
1692
- //button events
1693
- button.mousedown(function(event){
1694
- showmenu();
1695
- return false;
1696
- });
1697
-
1698
- //apply click events for items
1699
- list
1700
- .find("li")
1701
- .mousedown(function(){
1702
- //deselect active
1703
- list.find( "li" )
1704
- .removeClass( "ui-btn-active" )
1705
- .children(0)
1706
- .attr( "aria-selected", "false");
1707
-
1708
- //select this one
1709
- $(this)
1710
- .addClass( "ui-btn-active" )
1711
- .find( "a" )
1712
- .attr( "aria-selected", "true");
1713
-
1714
- //update select
1715
- var newIndex = list.find( "li" ).index( this ),
1716
- prevIndex = select[0].selectedIndex;
1717
-
1718
- select[0].selectedIndex = newIndex;
1719
-
1720
- //trigger change event
1721
- if(newIndex !== prevIndex){
1722
- select.trigger( "change" );
1723
- }
1724
-
1725
- //hide custom select
1726
- hidemenu();
1727
- return false;
1728
- });
1729
-
1730
- //hide on outside click
1731
- screen.click(function(){
1732
- hidemenu();
1733
- return false;
1734
- });
1735
- });
1736
- };
1737
-
1738
- })(jQuery);
1739
-
1740
-
1741
-
1742
- /*
1743
- * jQuery Mobile Framework : sample plugin for making button-like links
1744
- * Copyright (c) jQuery Project
1745
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1746
- * Note: Code is in draft form and is subject to change
1747
- */
1748
- (function( jQuery ) {
1749
-
1750
- jQuery.fn.buttonMarkup = function( options ){
1751
- return this.each( function() {
1752
- var el = jQuery( this ),
1753
- o = jQuery.extend( {}, jQuery.fn.buttonMarkup.defaults, el.data(), options),
1754
-
1755
- // Classes Defined
1756
- buttonClass,
1757
- innerClass = "ui-btn-inner",
1758
- iconClass;
1759
-
1760
- if ( attachEvents ) {
1761
- attachEvents();
1762
- }
1763
-
1764
- // if not, try to find closest theme container
1765
- if ( !o.theme ) {
1766
- var themedParent = el.closest("[class*='ui-bar-'],[class*='ui-body-']");
1767
- o.theme = themedParent.length ?
1768
- /ui-(bar|body)-([a-z])/.exec( themedParent.attr("class") )[2] :
1769
- "c";
1770
- }
1771
-
1772
- buttonClass = "ui-btn ui-btn-up-" + o.theme;
1773
-
1774
- if ( o.inline ) {
1775
- buttonClass += " ui-btn-inline";
1776
- }
1777
-
1778
- if ( o.icon ) {
1779
- o.icon = "ui-icon-" + o.icon;
1780
- o.iconpos = o.iconpos || "left";
1781
-
1782
- iconClass = "ui-icon " + o.icon;
1783
-
1784
- if ( o.shadow ) {
1785
- iconClass += " ui-icon-shadow"
1786
- }
1787
- }
1788
-
1789
- if ( o.iconpos ) {
1790
- buttonClass += " ui-btn-icon-" + o.iconpos;
1791
-
1792
- if ( o.iconpos == "notext" && !el.attr("title") ) {
1793
- el.attr( "title", el.text() );
1794
- }
1795
- }
1796
-
1797
- if ( o.corners ) {
1798
- buttonClass += " ui-btn-corner-all";
1799
- innerClass += " ui-btn-corner-all";
1800
- }
1801
-
1802
- if ( o.shadow ) {
1803
- buttonClass += " ui-shadow";
1804
- }
1805
-
1806
- el
1807
- .attr( "data-theme", o.theme )
1808
- .addClass( buttonClass );
1809
-
1810
- var wrap = ("<D class='" + innerClass + "'><D class='ui-btn-text'></D>" +
1811
- ( o.icon ? "<span class='" + iconClass + "'></span>" : "" ) +
1812
- "</D>").replace(/D/g, o.wrapperEls);
1813
-
1814
- el.wrapInner( wrap );
1815
- });
1816
- };
1817
-
1818
- jQuery.fn.buttonMarkup.defaults = {
1819
- corners: true,
1820
- shadow: true,
1821
- iconshadow: true,
1822
- wrapperEls: "span"
1823
- };
1824
-
1825
- var attachEvents = function() {
1826
- jQuery(".ui-btn").live({
1827
- mousedown: function() {
1828
- var theme = jQuery(this).attr( "data-theme" );
1829
- jQuery(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
1830
- },
1831
- mouseup: function() {
1832
- var theme = jQuery(this).attr( "data-theme" );
1833
- jQuery(this).removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
1834
- },
1835
- "mouseover focus": function() {
1836
- var theme = jQuery(this).attr( "data-theme" );
1837
- jQuery(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
1838
- },
1839
- "mouseout blur": function() {
1840
- var theme = jQuery(this).attr( "data-theme" );
1841
- jQuery(this).removeClass( "ui-btn-hover-" + theme ).addClass( "ui-btn-up-" + theme );
1842
- }
1843
- });
1844
-
1845
- attachEvents = null;
1846
- };
1847
-
1848
- })(jQuery);
1849
-
1850
-
1851
- /*
1852
- * jQuery Mobile Framework : sample plugin for making button links that proxy to native input/buttons
1853
- * Copyright (c) jQuery Project
1854
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1855
- * Note: Code is in draft form and is subject to change
1856
- */
1857
- (function ( $ ) {
1858
- $.widget( "mobile.button", $.mobile.widget, {
1859
- options: {},
1860
- _create: function(){
1861
- var $el = this.element,
1862
- type = $el.attr('type');
1863
- $el
1864
- .addClass('ui-btn-hidden')
1865
- .attr('tabindex','-1');
1866
-
1867
- //add ARIA role
1868
- $( "<a>", {
1869
- "href": "#",
1870
- "role": "button",
1871
- "aria-label": $el.attr( "type" )
1872
- } )
1873
- .text( $el.text() || $el.val() )
1874
- .insertBefore( $el )
1875
- .click(function(){
1876
- if( type == "submit" ){
1877
- $(this).closest('form').submit();
1878
- }
1879
- else{
1880
- $el.click();
1881
- }
1882
-
1883
- return false;
1884
- })
1885
- .buttonMarkup({
1886
- theme: $el.data("theme"),
1887
- icon: $el.data("icon"),
1888
- iconpos: $el.data("iconpos"),
1889
- inline: $el.data("inline"),
1890
- corners: $el.data("corners"),
1891
- shadow: $el.data("shadow"),
1892
- iconshadow: $el.data("icon-shadow")
1893
- });
1894
- }
1895
- });
1896
- })( jQuery );
1897
-
1898
- /*
1899
- * jQuery Mobile Framework : "slider" plugin (based on code from Filament Group,Inc)
1900
- * Copyright (c) jQuery Project
1901
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
1902
- * Note: Code is in draft form and is subject to change
1903
- */
1904
- (function($){
1905
- $.fn.slider = function(options){
1906
- return this.each(function(){
1907
- var control = $(this),
1908
- themedParent = control.parents('[class*=ui-bar-],[class*=ui-body-]').eq(0),
1909
-
1910
- o = $.extend({
1911
- trackTheme: (themedParent.length ? themedParent.attr('class').match(/ui-(bar|body)-([a-z])/)[2] : 'c'),
1912
- theme: control.data("theme") || (themedParent.length ? themedParent.attr('class').match(/ui-(bar|body)-([a-z])/)[2] : 'c')
1913
- },options),
1914
-
1915
- cType = control[0].nodeName.toLowerCase(),
1916
- selectClass = (cType == 'select') ? 'ui-slider-switch' : '',
1917
- controlID = control.attr('id'),
1918
- labelID = controlID + '-label',
1919
- label = $('[for='+ controlID +']').attr('id',labelID),
1920
- val = (cType == 'input') ? control.val() : control[0].selectedIndex,
1921
- min = (cType == 'input') ? parseFloat(control.attr('min')) : 0,
1922
- max = (cType == 'input') ? parseFloat(control.attr('max')) : control.find('option').length-1,
1923
- percent = val / (max - min) * 100,
1924
- snappedPercent = percent,
1925
- slider = $('<div class="ui-slider '+ selectClass +' ui-btn-down-'+o.trackTheme+' ui-btn-corner-all" role="application"></div>'),
1926
- handle = $('<a href="#" class="ui-slider-handle"></a>')
1927
- .appendTo(slider)
1928
- .buttonMarkup({corners: true, theme: o.theme, shadow: true})
1929
- .attr({
1930
- 'role': 'slider',
1931
- 'aria-valuemin': min,
1932
- 'aria-valuemax': max,
1933
- 'aria-valuenow': val,
1934
- 'aria-valuetext': val,
1935
- 'title': val,
1936
- 'aria-labelledby': labelID
1937
- }),
1938
- dragging = false;
1939
-
1940
- if(cType == 'select'){
1941
- slider.wrapInner('<div class="ui-slider-inneroffset"></div>');
1942
- var options = control.find('option');
1943
-
1944
- control.find('option').each(function(i){
1945
- var side = (i==0) ?'b':'a',
1946
- corners = (i==0) ? 'right' :'left',
1947
- theme = (i==0) ? ' ui-btn-down-' + o.trackTheme :' ui-btn-active';
1948
- $('<div class="ui-slider-labelbg ui-slider-labelbg-'+ side + theme +' ui-btn-corner-'+ corners+'"></div>').prependTo(slider);
1949
- $('<span class="ui-slider-label ui-slider-label-'+ side + theme +' ui-btn-corner-'+ corners+'" role="img">'+$(this).text()+'</span>').prependTo(handle);
1950
- });
1951
-
1952
- }
1953
-
1954
- function updateControl(val){
1955
- if(cType == 'input'){
1956
- control.val(val);
1957
- }
1958
- else {
1959
- control[0].selectedIndex = val;
1960
- }
1961
- control.trigger("change");
1962
- }
1963
-
1964
- function slideUpdate(event, val){
1965
- if (val){
1966
- percent = parseFloat(val) / (max - min) * 100;
1967
- } else {
1968
- var data = event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event,
1969
- // a slight tolerance helped get to the ends of the slider
1970
- tol = 4;
1971
- if( !dragging
1972
- || data.pageX < slider.offset().left - tol
1973
- || data.pageX > slider.offset().left + slider.width() + tol ){
1974
- return;
1975
- }
1976
- percent = Math.round(((data.pageX - slider.offset().left) / slider.width() ) * 100);
1977
- }
1978
- if( percent < 0 ) { percent = 0; }
1979
- if( percent > 100 ) { percent = 100; }
1980
- var newval = Math.round( (percent/100) * max );
1981
- if( newval < min ) { newval = min; }
1982
- if( newval > max ) { newval = max; }
1983
- //flip the stack of the bg colors
1984
- if(percent > 60 && cType == 'select'){
1985
-
1986
- }
1987
- snappedPercent = Math.round( newval / max * 100 );
1988
- handle.css('left', percent + '%');
1989
- handle.attr({
1990
- 'aria-valuenow': (cType == 'input') ? newval : control.find('option').eq(newval).attr('value'),
1991
- 'aria-valuetext': (cType == 'input') ? newval : control.find('option').eq(newval).text(),
1992
- 'title': newval
1993
- });
1994
- updateSwitchClass(newval);
1995
- updateControl(newval);
1996
- }
1997
-
1998
- function updateSwitchClass(val){
1999
- if(cType == 'input'){return;}
2000
- if(val == 0){ slider.addClass('ui-slider-switch-a').removeClass('ui-slider-switch-b'); }
2001
- else { slider.addClass('ui-slider-switch-b').removeClass('ui-slider-switch-a'); }
2002
- }
2003
-
2004
- updateSwitchClass(val);
2005
-
2006
- function updateSnap(){
2007
- if(cType == 'select'){
2008
- handle
2009
- .addClass('ui-slider-handle-snapping')
2010
- .css('left', snappedPercent + '%')
2011
- .animationComplete(function(){
2012
- handle.removeClass('ui-slider-handle-snapping');
2013
- });
2014
- }
2015
- }
2016
-
2017
- label.addClass('ui-slider');
2018
-
2019
- control
2020
- .addClass((cType == 'input') ? 'ui-slider-input' : 'ui-slider-switch')
2021
- .keyup(function(e){
2022
- slideUpdate(e, $(this).val() );
2023
- });
2024
-
2025
- slider
2026
- .bind($.support.touch ? "touchstart" : "mousedown", function(event){
2027
- dragging = true;
2028
- if((cType == 'select')){
2029
- val = control[0].selectedIndex;
2030
- }
2031
- slideUpdate(event);
2032
- return false;
2033
- })
2034
- .bind($.support.touch ? "touchmove" : "mousemove", function(event){
2035
- slideUpdate(event);
2036
- return false;
2037
- })
2038
- .bind($.support.touch ? "touchend" : "mouseup", function(event){
2039
- dragging = false;
2040
- if(cType == 'select'){
2041
- if(val == control[0].selectedIndex){
2042
- val = val == 0 ? 1 : 0;
2043
- //tap occurred, but value didn't change. flip it!
2044
- slideUpdate(event,val);
2045
- }
2046
- updateSnap();
2047
- }
2048
- return false;
2049
- })
2050
- .insertAfter(control);
2051
-
2052
- handle
2053
- .css('left', percent + '%')
2054
- .bind('click', function(e){ return false; });
2055
- });
2056
- };
2057
- })(jQuery);
2058
-
2059
-
2060
-
2061
- /*
2062
- * jQuery Mobile Framework : "collapsible" plugin (based on code from Filament Group,Inc)
2063
- * Copyright (c) jQuery Project
2064
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2065
- * Note: Code is in draft form and is subject to change
2066
- */
2067
- (function ( $ ) {
2068
- $.widget( "mobile.collapsible", $.mobile.widget, {
2069
- options: {
2070
- expandCueText: ' click to expand contents',
2071
- collapseCueText: ' click to collapse contents',
2072
- collapsed: false,
2073
- heading: '>:header,>legend',
2074
- theme: undefined,
2075
- iconTheme: 'd'
2076
- },
2077
- _create: function(){
2078
-
2079
- var $el = this.element,
2080
- o = this.options,
2081
- collapsibleContain = $el.addClass('ui-collapsible-contain'),
2082
- collapsibleHeading = $el.find(o.heading).eq(0),
2083
- collapsibleContent = collapsibleContain.wrapInner('<div class="ui-collapsible-content"></div>').find('.ui-collapsible-content'),
2084
- collapsibleParent = $el.closest('[data-role="collapsible-set"]').addClass('ui-collapsible-set');
2085
-
2086
- //replace collapsibleHeading if it's a legend
2087
- if(collapsibleHeading.is('legend')){
2088
- collapsibleHeading = $('<div role="heading">'+ collapsibleHeading.html() +'</div>').insertBefore(collapsibleHeading);
2089
- collapsibleHeading.next().remove();
2090
- }
2091
-
2092
- //drop heading in before content
2093
- collapsibleHeading.insertBefore(collapsibleContent);
2094
-
2095
- //modify markup & attributes
2096
- collapsibleHeading.addClass('ui-collapsible-heading')
2097
- .append('<span class="ui-collapsible-heading-status"></span>')
2098
- .wrapInner('<a href="#" class="ui-collapsible-heading-toggle"></a>')
2099
- .find('a:eq(0)')
2100
- .buttonMarkup({
2101
- shadow: !!!collapsibleParent.length,
2102
- corners:false,
2103
- iconPos: 'left',
2104
- icon: 'plus',
2105
- theme: o.theme
2106
- })
2107
- .find('.ui-icon')
2108
- .removeAttr('class')
2109
- .buttonMarkup({
2110
- shadow: true,
2111
- corners:true,
2112
- iconPos: 'notext',
2113
- icon: 'plus',
2114
- theme: o.iconTheme
2115
- });
2116
-
2117
- if( !collapsibleParent.length ){
2118
- collapsibleHeading
2119
- .find('a:eq(0)')
2120
- .addClass('ui-corner-all')
2121
- .find('.ui-btn-inner')
2122
- .addClass('ui-corner-all');
2123
- }
2124
- else {
2125
- if( collapsibleContain.data('collapsible-last') ){
2126
- collapsibleHeading
2127
- .find('a:eq(0), .ui-btn-inner')
2128
- .addClass('ui-corner-bottom');
2129
- }
2130
- }
2131
-
2132
-
2133
- //events
2134
- collapsibleContain
2135
- .bind('collapse', function(event){
2136
- if( !event.isDefaultPrevented() ){
2137
- event.preventDefault();
2138
- collapsibleHeading
2139
- .addClass('ui-collapsible-heading-collapsed')
2140
- .find('.ui-collapsible-heading-status').text(o.expandCueText);
2141
-
2142
- collapsibleHeading.find('.ui-icon').removeClass('ui-icon-minus').addClass('ui-icon-plus');
2143
- collapsibleContent.addClass('ui-collapsible-content-collapsed').attr('aria-hidden',true);
2144
-
2145
- if( collapsibleContain.data('collapsible-last') ){
2146
- collapsibleHeading
2147
- .find('a:eq(0), .ui-btn-inner')
2148
- .addClass('ui-corner-bottom');
2149
- }
2150
- }
2151
-
2152
- })
2153
- .bind('expand', function(event){
2154
- if( !event.isDefaultPrevented() ){
2155
- event.preventDefault();
2156
- collapsibleHeading
2157
- .removeClass('ui-collapsible-heading-collapsed')
2158
- .find('.ui-collapsible-heading-status').text(o.collapseCueText);
2159
-
2160
- collapsibleHeading.find('.ui-icon').removeClass('ui-icon-plus').addClass('ui-icon-minus');
2161
- collapsibleContent.removeClass('ui-collapsible-content-collapsed').attr('aria-hidden',false);
2162
-
2163
- if( collapsibleContain.data('collapsible-last') ){
2164
- collapsibleHeading
2165
- .find('a:eq(0), .ui-btn-inner')
2166
- .removeClass('ui-corner-bottom');
2167
- }
2168
-
2169
- }
2170
- })
2171
- .trigger(o.collapsed ? 'collapse' : 'expand');
2172
-
2173
-
2174
- //close others in a set
2175
- if( collapsibleParent.length && !collapsibleParent.data("collapsiblebound") ){
2176
- collapsibleParent
2177
- .data("collapsiblebound", true)
2178
- .bind("expand", function( event ){
2179
- $(this).find( ".ui-collapsible-contain" )
2180
- .not( $(event.target).closest( ".ui-collapsible-contain" ) )
2181
- .not( "> .ui-collapsible-contain .ui-collapsible-contain" )
2182
- .trigger( "collapse" );
2183
- })
2184
- var set = collapsibleParent.find('[data-role=collapsible]')
2185
-
2186
- set.first()
2187
- .find('a:eq(0)')
2188
- .addClass('ui-corner-top')
2189
- .find('.ui-btn-inner')
2190
- .addClass('ui-corner-top');
2191
-
2192
- set.last().data('collapsible-last', true)
2193
- }
2194
-
2195
- collapsibleHeading.click(function(){
2196
- if( collapsibleHeading.is('.ui-collapsible-heading-collapsed') ){
2197
- collapsibleContain.trigger('expand');
2198
- }
2199
- else {
2200
- collapsibleContain.trigger('collapse');
2201
- }
2202
- return false;
2203
- });
2204
-
2205
- }
2206
- });
2207
- })( jQuery );
2208
-
2209
- /*
2210
- * jQuery Mobile Framework : prototype for "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
2211
- * Copyright (c) jQuery Project
2212
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2213
- * Note: Code is in draft form and is subject to change
2214
- */
2215
- (function($){
2216
- $.fn.controlgroup = function(options){
2217
-
2218
- return $(this).each(function(){
2219
- var o = $.extend({
2220
- direction: $( this ).data( "type" ) || "vertical",
2221
- shadow: false
2222
- },options);
2223
- var groupheading = $(this).find('>legend'),
2224
- flCorners = o.direction == 'horizontal' ? ['ui-corner-left', 'ui-corner-right'] : ['ui-corner-top', 'ui-corner-bottom'],
2225
- type = $(this).find('input:eq(0)').attr('type');
2226
-
2227
- //replace legend with more stylable replacement div
2228
- if( groupheading.length ){
2229
- $(this).wrapInner('<div class="ui-controlgroup-controls"></div>');
2230
- $('<div role="heading" class="ui-controlgroup-label">'+ groupheading.html() +'</div>').insertBefore( $(this).children(0) );
2231
- groupheading.remove();
2232
- }
2233
-
2234
- $(this).addClass('ui-corner-all ui-controlgroup ui-controlgroup-'+o.direction);
2235
-
2236
- function flipClasses(els){
2237
- els
2238
- .removeClass('ui-btn-corner-all ui-shadow')
2239
- .eq(0).addClass(flCorners[0])
2240
- .end()
2241
- .filter(':last').addClass(flCorners[1]).addClass('ui-controlgroup-last');
2242
- }
2243
- flipClasses($(this).find('.ui-btn'));
2244
- flipClasses($(this).find('.ui-btn-inner'));
2245
- if(o.shadow){
2246
- $(this).addClass('ui-shadow');
2247
- }
2248
- });
2249
- };
2250
- })(jQuery);
2251
-
2252
- /*
2253
- * jQuery Mobile Framework : prototype for "fieldcontain" plugin - simple class additions to make form row separators
2254
- * Copyright (c) jQuery Project
2255
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2256
- * Note: Code is in draft form and is subject to change
2257
- */
2258
- (function($){
2259
- $.fn.fieldcontain = function(options){
2260
- var o = $.extend({
2261
- theme: 'c'
2262
- },options);
2263
- return $(this).addClass('ui-field-contain ui-body ui-br');
2264
- };
2265
- })(jQuery);
2266
-
2267
- /*
2268
- * jQuery Mobile Framework : listview plugin
2269
- * Copyright (c) jQuery Project
2270
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2271
- * Note: Code is in draft form and is subject to change
2272
- */
2273
- (function( jQuery ) {
2274
-
2275
- jQuery.widget( "mobile.listview", jQuery.mobile.widget, {
2276
- options: {
2277
- theme: "c",
2278
- countTheme: "c",
2279
- headerTheme: "b",
2280
- dividerTheme: "b",
2281
- splitIcon: "arrow-r",
2282
- splitTheme: "b",
2283
- inset: false
2284
- },
2285
-
2286
- _create: function() {
2287
- var $list = this.element,
2288
- o = this.options;
2289
-
2290
- // create listview markup
2291
- $list
2292
- .addClass( "ui-listview" )
2293
- .attr( "role", "listbox" )
2294
-
2295
- if ( o.inset ) {
2296
- $list.addClass( "ui-listview-inset ui-corner-all ui-shadow" );
2297
- }
2298
-
2299
- $list.delegate( ".ui-li", "focusin", function() {
2300
- jQuery( this ).attr( "tabindex", "0" );
2301
- });
2302
-
2303
- this._itemApply( $list, $list );
2304
-
2305
- this.refresh( true );
2306
-
2307
- //keyboard events for menu items
2308
- $list.keydown(function( e ) {
2309
- var target = jQuery( e.target ),
2310
- li = target.closest( "li" );
2311
-
2312
- // switch logic based on which key was pressed
2313
- switch ( e.keyCode ) {
2314
- // up or left arrow keys
2315
- case 38:
2316
- var prev = li.prev();
2317
-
2318
- // if there's a previous option, focus it
2319
- if ( prev.length ) {
2320
- target
2321
- .blur()
2322
- .attr( "tabindex", "-1" );
2323
-
2324
- prev.find( "a" ).first().focus();
2325
- }
2326
-
2327
- return false;
2328
- break;
2329
-
2330
- // down or right arrow keys
2331
- case 40:
2332
- var next = li.next();
2333
-
2334
- // if there's a next option, focus it
2335
- if ( next.length ) {
2336
- target
2337
- .blur()
2338
- .attr( "tabindex", "-1" );
2339
-
2340
- next.find( "a" ).first().focus();
2341
- }
2342
-
2343
- return false;
2344
- break;
2345
-
2346
- case 39:
2347
- var a = li.find( "a.ui-li-link-alt" );
2348
-
2349
- if ( a.length ) {
2350
- target.blur();
2351
- a.first().focus();
2352
- }
2353
-
2354
- return false;
2355
- break;
2356
-
2357
- case 37:
2358
- var a = li.find( "a.ui-link-inherit" );
2359
-
2360
- if ( a.length ) {
2361
- target.blur();
2362
- a.first().focus();
2363
- }
2364
-
2365
- return false;
2366
- break;
2367
-
2368
- // if enter or space is pressed, trigger click
2369
- case 13:
2370
- case 32:
2371
- target.trigger( "click" );
2372
-
2373
- return false;
2374
- break;
2375
- }
2376
- });
2377
-
2378
- // tapping the whole LI triggers click on the first link
2379
- $list.delegate( "li", "click", function(event) {
2380
- if ( !jQuery( event.target ).closest( "a" ).length ) {
2381
- jQuery( this ).find( "a" ).first().trigger( "click" );
2382
- return false;
2383
- }
2384
- });
2385
- },
2386
-
2387
- _itemApply: function( $list, item ) {
2388
- // TODO class has to be defined in markup
2389
- item.find( ".ui-li-count" )
2390
- .addClass( "ui-btn-up-" + ($list.data( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
2391
-
2392
- item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" );
2393
-
2394
- item.find( "p, ul, dl" ).addClass( "ui-li-desc" );
2395
-
2396
- item.find( "img" ).addClass( "ui-li-thumb" ).each(function() {
2397
- jQuery( this ).closest( "li" )
2398
- .addClass( jQuery(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
2399
- });
2400
-
2401
- var aside = item.find( ".ui-li-aside" );
2402
-
2403
- if ( aside.length ) {
2404
- aside.each(function(i, el) {
2405
- $(el).prependTo( $(el).parent() ); //shift aside to front for css float
2406
- });
2407
- }
2408
-
2409
- if ( jQuery.support.cssPseudoElement || !jQuery.nodeName( item[0], "ol" ) ) {
2410
- return;
2411
- }
2412
- },
2413
-
2414
- refresh: function( create ) {
2415
- this._createSubPages();
2416
-
2417
- var o = this.options,
2418
- $list = this.element,
2419
- self = this,
2420
- dividertheme = $list.data( "dividertheme" ) || o.dividerTheme,
2421
- li = $list.children( "li" ),
2422
- counter = jQuery.support.cssPseudoElement || !jQuery.nodeName( $list[0], "ol" ) ? 0 : 1;
2423
-
2424
- if ( counter ) {
2425
- $list.find( ".ui-li-dec" ).remove();
2426
- }
2427
-
2428
- li.attr({ "role": "option", "tabindex": "-1" });
2429
-
2430
- li.first().attr( "tabindex", "0" );
2431
-
2432
- li.each(function( pos ) {
2433
- var item = jQuery( this ),
2434
- itemClass = "ui-li";
2435
-
2436
- // If we're creating the element, we update it regardless
2437
- if ( !create && item.hasClass( "ui-li" ) ) {
2438
- return;
2439
- }
2440
-
2441
- var a = item.find( "a" );
2442
-
2443
- if ( a.length ) {
2444
- item
2445
- .buttonMarkup({
2446
- wrapperEls: "div",
2447
- shadow: false,
2448
- corners: false,
2449
- iconpos: "right",
2450
- icon: a.length > 1 ? false : item.data("icon") || "arrow-r",
2451
- theme: o.theme
2452
- });
2453
-
2454
- a.first().addClass( "ui-link-inherit" );
2455
-
2456
- if ( a.length > 1 ) {
2457
- itemClass += " ui-li-has-alt";
2458
-
2459
- var last = a.last(),
2460
- splittheme = $list.data( "splittheme" ) || last.data( "theme" ) || o.splitTheme;
2461
-
2462
- last
2463
- .attr( "title", last.text() )
2464
- .addClass( "ui-li-link-alt" )
2465
- .empty()
2466
- .buttonMarkup({
2467
- shadow: false,
2468
- corners: false,
2469
- theme: o.theme,
2470
- icon: false,
2471
- iconpos: false
2472
- })
2473
- .find( ".ui-btn-inner" )
2474
- .append( jQuery( "<span>" ).buttonMarkup({
2475
- shadow: true,
2476
- corners: true,
2477
- theme: splittheme,
2478
- iconpos: "notext",
2479
- icon: $list.data( "spliticon" ) || last.data( "icon" ) || o.splitIcon
2480
- } ) );
2481
- }
2482
-
2483
- } else if ( item.data( "role" ) === "list-divider" ) {
2484
- itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
2485
- item.attr( "role", "heading" );
2486
-
2487
- //reset counter when a divider heading is encountered
2488
- if ( counter ) {
2489
- counter = 1;
2490
- }
2491
-
2492
- } else {
2493
- itemClass += " ui-li-static ui-btn-up-" + o.theme;
2494
- }
2495
-
2496
- if ( pos === 0 ) {
2497
- if ( o.inset ) {
2498
- itemClass += " ui-corner-top";
2499
-
2500
- item
2501
- .add( item.find( ".ui-btn-inner" ) )
2502
- .find( ".ui-li-link-alt" )
2503
- .addClass( "ui-corner-tr" )
2504
- .end()
2505
- .find( ".ui-li-thumb" )
2506
- .addClass( "ui-corner-tl" );
2507
- }
2508
-
2509
- } else if ( pos === li.length - 1 ) {
2510
-
2511
- if ( o.inset ) {
2512
- itemClass += " ui-corner-bottom";
2513
-
2514
- item
2515
- .add( item.find( ".ui-btn-inner" ) )
2516
- .find( ".ui-li-link-alt" )
2517
- .addClass( "ui-corner-br" )
2518
- .end()
2519
- .find( ".ui-li-thumb" )
2520
- .addClass( "ui-corner-bl" );
2521
- }
2522
- }
2523
-
2524
- if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
2525
- item
2526
- .find( ".ui-link-inherit" ).first()
2527
- .addClass( "ui-li-jsnumbering" )
2528
- .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
2529
- }
2530
-
2531
- item.addClass( itemClass );
2532
-
2533
- if ( !create ) {
2534
- self._itemApply( $list, item );
2535
- }
2536
- });
2537
- },
2538
-
2539
- _createSubPages: function() {
2540
- var parentList = this.element,
2541
- parentPage = parentList.closest( ".ui-page" ),
2542
- parentId = parentPage.attr( "id" ),
2543
- o = this.options,
2544
- persistentFooterID = parentPage.find( "[data-role='footer']" ).data( "id" );
2545
-
2546
- jQuery( parentList.find( "ul, ol" ).toArray().reverse() ).each(function( i ) {
2547
- var list = jQuery( this ),
2548
- parent = list.parent(),
2549
- title = parent.contents()[ 0 ].nodeValue.split("\n")[0],
2550
- id = parentId + "&" + $.mobile.subPageUrlKey + "=" + $.mobile.idStringEscape(title + " " + i),
2551
- theme = list.data( "theme" ) || o.theme,
2552
- countTheme = list.data( "counttheme" ) || parentList.data( "counttheme" ) || o.countTheme,
2553
- newPage = list.wrap( "<div data-role='page'><div data-role='content'></div></div>" )
2554
- .parent()
2555
- .before( "<div data-role='header' data-theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
2556
- .after( persistentFooterID ? $( "<div>", { "data-role": "footer", "data-id": persistentFooterID, "class": "ui-footer-duplicate" } ) : "" )
2557
- .parent()
2558
- .attr({
2559
- id: id,
2560
- "data-theme": theme,
2561
- "data-count-theme": countTheme
2562
- })
2563
- .appendTo( jQuery.pageContainer );
2564
-
2565
-
2566
-
2567
- newPage.page();
2568
-
2569
- parent.html( "<a href='#" + id + "'>" + title + "</a>" );
2570
- }).listview();
2571
- }
2572
- });
2573
-
2574
- })( jQuery );
2575
-
2576
-
2577
- (function( $ ) {
2578
-
2579
- $.mobile.listview.prototype.options.filter = false;
2580
-
2581
- $( "[data-role='listview']" ).live( "listviewcreate", function() {
2582
- var list = $( this ),
2583
- listview = list.data( "listview" );
2584
- if ( !listview.options.filter ) {
2585
- return;
2586
- }
2587
-
2588
- var wrapper = $( "<form>", { "class": "ui-listview-filter ui-bar-c", "role": "search" } ),
2589
-
2590
- search = $( "<input>", {
2591
- placeholder: "Filter results...",
2592
- "data-type": "search"
2593
- })
2594
- .bind( "keyup change", function() {
2595
- var val = this.value.toLowerCase();;
2596
- list.children().show();
2597
- if ( val ) {
2598
- list.children().filter(function() {
2599
- return $( this ).text().toLowerCase().indexOf( val ) === -1;
2600
- }).hide();
2601
- }
2602
-
2603
- //listview._numberItems();
2604
- })
2605
- .appendTo( wrapper )
2606
- .customTextInput();
2607
-
2608
- wrapper.insertBefore( list );
2609
- });
2610
-
2611
- })( jQuery );
2612
-
2613
-
2614
- /*
2615
- * jQuery Mobile Framework : prototype for "dialog" plugin.
2616
- * Copyright (c) jQuery Project
2617
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2618
- * Note: Code is in draft form and is subject to change
2619
- */
2620
- (function ( $ ) {
2621
- $.widget( "mobile.dialog", $.mobile.widget, {
2622
- options: {},
2623
- _create: function(){
2624
- var self = this,
2625
- $el = self.element,
2626
- $closeBtn = $('<a href="#" data-icon="delete" data-iconpos="notext">Close</a>');
2627
-
2628
- $el.delegate("a, submit", "click submit", function(e){
2629
- if( e.type == "click" && ( $(e.target).closest('[data-back]') || $(e.target).closest($closeBtn) ) ){
2630
- self.close();
2631
- return false;
2632
- }
2633
- //otherwise, assume we're headed somewhere new. set activepage to dialog so the transition will work
2634
- $.activePage = this.element;
2635
- });
2636
-
2637
- this.element
2638
- .bind("pageshow",function(){
2639
- return false;
2640
- })
2641
- //add ARIA role
2642
- .attr("role","dialog")
2643
- .addClass('ui-page ui-dialog ui-body-a')
2644
- .find('[data-role=header]')
2645
- .addClass('ui-corner-top ui-overlay-shadow')
2646
- .prepend( $closeBtn )
2647
- .end()
2648
- .find('.ui-content,[data-role=footer]')
2649
- .last()
2650
- .addClass('ui-corner-bottom ui-overlay-shadow');
2651
-
2652
- },
2653
- close: function(){
2654
- $.changePage([this.element, $.activePage], undefined, true );
2655
- }
2656
- });
2657
- })( jQuery );
2658
-
2659
- /*
2660
- * jQuery Mobile Framework : prototype for "navbar" plugin
2661
- * Copyright (c) jQuery Project
2662
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2663
- * Note: Code is in draft form and is subject to change
2664
- */
2665
- (function ( $ ) {
2666
- $.widget( "mobile.navbar", $.mobile.widget, {
2667
- options: {
2668
- iconpos: 'top'
2669
- },
2670
- _create: function(){
2671
- var $navbar = this.element,
2672
- $navbtns = $navbar.find("a"),
2673
- iconpos = $navbtns.filter('icon').length ? this.options.iconpos : undefined;
2674
-
2675
- $navbar
2676
- .addClass('ui-navbar')
2677
- .attr("role","navigation")
2678
- .find("ul")
2679
- .grid({grid: $navbtns.length > 2 ? "b" : "a"});
2680
-
2681
- if( !iconpos ){
2682
- $navbar.addClass("ui-navbar-noicons");
2683
- }
2684
-
2685
- $navbtns
2686
- .buttonMarkup({
2687
- corners: false,
2688
- shadow: false,
2689
- iconpos: iconpos
2690
- });
2691
-
2692
- $navbar.delegate("a", "click",function(event){
2693
- $navbtns.removeClass("ui-btn-active");
2694
- });
2695
- }
2696
- });
2697
- })( jQuery );
2698
-
2699
- /*
2700
- * jQuery Mobile Framework : plugin for creating grids
2701
- * Copyright (c) jQuery Project
2702
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
2703
- * Note: Code is in draft form and is subject to change
2704
- */
2705
- (function($){
2706
- $.fn.grid = function(options){
2707
- return $(this).each(function(){
2708
- var o = $.extend({
2709
- grid: 'a'
2710
- },options);
2711
-
2712
- $(this).addClass('ui-grid-' + o.grid);
2713
-
2714
- var $kids = $(this).children();
2715
- iterator = o.grid == 'a' ? 2 : 3;
2716
-
2717
- $kids.filter(':nth-child(' + iterator + 'n+1)').addClass('ui-block-a');
2718
- $kids.filter(':nth-child(' + iterator + 'n+2)').addClass('ui-block-b');
2719
-
2720
- if(iterator == 3){
2721
- $kids.filter(':nth-child(3n+3)').addClass('ui-block-c');
2722
- }
2723
- });
2724
- };
2725
- })(jQuery);
2726
-
2727
-
2728
-
2729
- /*!
2730
- * jQuery Mobile
2731
- * http://jquerymobile.com/
2732
- *
2733
- * Copyright 2010, jQuery Project
2734
- * Dual licensed under the MIT or GPL Version 2 licenses.
2735
- * http://jquery.org/license
2736
- */
2737
-
2738
- (function( $, window, undefined ) {
2739
-
2740
- //jQuery.mobile obj extendable options
2741
- jQuery.mobile = jQuery.extend({
2742
-
2743
- //define the url parameter used for referencing widget-generated sub-pages.
2744
- //Translates to to example.html&ui-page=subpageIdentifier
2745
- //hash segment before &ui-page= is used to make Ajax request
2746
- subPageUrlKey: 'ui-page',
2747
-
2748
- //anchor links that match these selectors will be untrackable in history
2749
- //(no change in URL, not bookmarkable)
2750
- nonHistorySelectors: '[data-rel=dialog]',
2751
-
2752
- //class assigned to page currently in view, and during transitions
2753
- activePageClass: 'ui-page-active',
2754
-
2755
- //class used for "active" button state, from CSS framework
2756
- activeBtnClass: 'ui-btn-active',
2757
-
2758
- //available CSS transitions
2759
- transitions: ['slide', 'slideup', 'slidedown', 'pop', 'flip', 'fade'],
2760
-
2761
- //set default transition
2762
- defaultTransition: 'slide',
2763
-
2764
- //show loading message during Ajax requests
2765
- //if false, message will not appear, but loading classes will still be toggled on html el
2766
- loadingMessage: "loading",
2767
-
2768
- //configure meta viewport tag's content attr:
2769
- metaViewportContent: "width=device-width, minimum-scale=1, maximum-scale=1",
2770
-
2771
- //additional markup to prepend to head
2772
- headExtras: undefined,
2773
-
2774
- //support conditions that must be met in order to proceed
2775
- gradeA: function(){
2776
- return jQuery.support.mediaquery;
2777
- }
2778
-
2779
- }, jQuery.mobile );
2780
-
2781
- //if device support condition(s) aren't met, leave things as they are -> a basic, usable experience,
2782
- //otherwise, proceed with the enhancements
2783
- if ( !jQuery.mobile.gradeA() ) {
2784
- return;
2785
- }
2786
-
2787
- //define vars for interal use
2788
- var $window = jQuery(window),
2789
- $html = jQuery('html'),
2790
- $head = jQuery('head'),
2791
-
2792
- //to be populated at DOM ready
2793
- $body,
2794
-
2795
- //loading div which appears during Ajax requests
2796
- //will not appear if $.mobile.loadingMessage is false
2797
- $loader = $.mobile.loadingMessage ?
2798
- jQuery('<div class="ui-loader ui-body-a ui-corner-all">'+
2799
- '<span class="ui-icon ui-icon-loading spin"></span>'+
2800
- '<h1>'+ $.mobile.loadingMessage +'</h1>'+
2801
- '</div>')
2802
- : undefined,
2803
-
2804
- //define meta viewport tag, if content is defined
2805
- $metaViewport = $.mobile.metaViewportContent ? $("<meta>", { name: "viewport", content: $.mobile.metaViewportContent}) : undefined,
2806
-
2807
- //define baseUrl for use in relative url management
2808
- baseUrl = getPathDir( location.protocol + '//' + location.host + location.pathname ),
2809
-
2810
- //define base element, for use in routing asset urls that are referenced in Ajax-requested markup
2811
- $base = $.support.dynamicBaseTag ? $("<base>", { href: baseUrl }) : undefined,
2812
-
2813
- //will be defined as first page element in DOM
2814
- $startPage,
2815
-
2816
- //will be defined as $startPage.parent(), which is usually the body element
2817
- //will receive ui-mobile-viewport class
2818
- $pageContainer,
2819
-
2820
- //will be defined when a link is clicked and given an active class
2821
- activeClickedLink = null,
2822
-
2823
- //array of pages that are visited during a single page load
2824
- //length will grow as pages are visited, and shrink as "back" link/button is clicked
2825
- //each item has a url (string matches ID), and transition (saved for reuse when "back" link/button is clicked)
2826
- urlStack = [ {
2827
- url: location.hash.replace( /^#/, "" ),
2828
- transition: undefined
2829
- } ],
2830
-
2831
- //define first selector to receive focus when a page is shown
2832
- focusable = "[tabindex],a,button:visible,select:visible,input",
2833
-
2834
- //contains role for next page, if defined on clicked link via data-rel
2835
- nextPageRole = null,
2836
-
2837
- //enable/disable hashchange event listener
2838
- //toggled internally when location.hash is updated to match the url of a successful page load
2839
- hashListener = true,
2840
-
2841
- //media-query-like width breakpoints, which are translated to classes on the html element
2842
- resolutionBreakpoints = [320,480,768,1024];
2843
-
2844
-
2845
- //prepend head markup additions
2846
- $head.prepend( $.mobile.headExtras || {}, $metaViewport || {}, $base || {} );
2847
-
2848
- // TODO: don't expose (temporary during code reorg)
2849
- $.mobile.urlStack = urlStack;
2850
-
2851
- //consistent string escaping for urls and IDs
2852
- function idStringEscape(str){
2853
- return str.replace(/[^a-zA-Z0-9]/g, '-');
2854
- }
2855
-
2856
- $.mobile.idStringEscape = idStringEscape;
2857
-
2858
- // hide address bar
2859
- function hideBrowserChrome() {
2860
- // prevent scrollstart and scrollstop events
2861
- jQuery.event.special.scrollstart.enabled = false;
2862
- setTimeout(function() {
2863
- window.scrollTo( 0, 0 );
2864
- },0);
2865
- setTimeout(function() {
2866
- jQuery.event.special.scrollstart.enabled = true;
2867
- }, 150 );
2868
- }
2869
-
2870
- function getPathDir( path ){
2871
- var newPath = path.replace(/#/,'').split('/');
2872
- newPath.pop();
2873
- return newPath.join('/') + (newPath.length ? '/' : '');
2874
- }
2875
-
2876
- function getBaseURL( nonHashPath ){
2877
- return getPathDir( nonHashPath || location.hash );
2878
- }
2879
-
2880
- var setBaseURL = !$.support.dynamicBaseTag ? $.noop : function( nonHashPath ){
2881
- //set base url for new page assets
2882
- $base.attr('href', baseUrl + getBaseURL( nonHashPath ));
2883
- }
2884
-
2885
- var resetBaseURL = !$.support.dynamicBaseTag ? $.noop : function(){
2886
- $base.attr('href', baseUrl);
2887
- }
2888
-
2889
- //set base href to pathname
2890
- resetBaseURL();
2891
-
2892
- //for form submission
2893
- $('form').live('submit', function(){
2894
- var type = $(this).attr("method"),
2895
- url = $(this).attr( "action" ).replace( location.protocol + "//" + location.host, "");
2896
-
2897
- //external submits use regular HTTP
2898
- if( /^(:?\w+:)/.test( url ) ){
2899
- return;
2900
- }
2901
-
2902
- //if it's a relative href, prefix href with base url
2903
- if( url.indexOf('/') && url.indexOf('#') !== 0 ){
2904
- url = getBaseURL() + url;
2905
- }
2906
-
2907
- $.changePage({
2908
- url: url,
2909
- type: type,
2910
- data: $(this).serialize()
2911
- },
2912
- undefined,
2913
- undefined,
2914
- true
2915
- );
2916
- return false;
2917
- });
2918
-
2919
- //click routing - direct to HTTP or Ajax, accordingly
2920
- jQuery( "a" ).live( "click", function(event) {
2921
- var $this = $(this),
2922
- //get href, remove same-domain protocol and host
2923
- href = $this.attr( "href" ).replace( location.protocol + "//" + location.host, ""),
2924
- //if it still starts with a protocol, it's external, or could be :mailto, etc
2925
- external = /^(:?\w+:)/.test( href ) || $this.is( "[target],[rel=external]" );
2926
-
2927
- if( href === '#' ){
2928
- //for links created purely for interaction - ignore
2929
- return false;
2930
- }
2931
-
2932
- activeClickedLink = $this.closest( ".ui-btn" ).addClass( $.mobile.activeBtnClass );
2933
-
2934
- if( external ){
2935
- //deliberately redirect, in case click was triggered
2936
- location.href = href;
2937
- }
2938
- else {
2939
- //use ajax
2940
- var transition = $this.data( "transition" ),
2941
- back = $this.data( "back" ),
2942
- changeHashOnSuccess = !$this.is( $.mobile.nonHistorySelectors );
2943
-
2944
- nextPageRole = $this.attr( "data-rel" );
2945
-
2946
- //if it's a relative href, prefix href with base url
2947
- if( href.indexOf('/') && href.indexOf('#') !== 0 ){
2948
- href = getBaseURL() + href;
2949
- }
2950
-
2951
- href.replace(/^#/,'');
2952
-
2953
- changePage(href, transition, back, changeHashOnSuccess);
2954
- }
2955
- event.preventDefault();
2956
- });
2957
-
2958
- // turn on/off page loading message.
2959
- function pageLoading( done ) {
2960
- if ( done ) {
2961
- $html.removeClass( "ui-loading" );
2962
- } else {
2963
-
2964
- if( $.mobile.loadingMessage ){
2965
- $loader.appendTo($pageContainer).css({top: $(window).scrollTop() + 75});
2966
- }
2967
- $html.addClass( "ui-loading" );
2968
- }
2969
- };
2970
-
2971
- //for directing focus to the page title, or otherwise first focusable element
2972
- function reFocus(page){
2973
- var pageTitle = page.find( ".ui-title:eq(0)" );
2974
- if( pageTitle.length ){
2975
- pageTitle.focus();
2976
- }
2977
- else{
2978
- page.find( focusable ).eq(0).focus();
2979
- }
2980
- }
2981
-
2982
- //function for setting role of next page
2983
- function setPageRole( newPage ) {
2984
- if ( nextPageRole ) {
2985
- newPage.attr( "data-role", nextPageRole );
2986
- nextPageRole = undefined;
2987
- }
2988
- }
2989
-
2990
- //wrap page and transfer data-attrs if it has an ID
2991
- function wrapNewPage( newPage ){
2992
- var copyAttrs = ['data-role', 'data-theme', 'data-fullscreen'], //TODO: more page-level attrs?
2993
- wrapper = newPage.wrap( "<div>" ).parent();
2994
-
2995
- $.each(copyAttrs,function(i){
2996
- if( newPage.attr( copyAttrs[ i ] ) ){
2997
- wrapper.attr( copyAttrs[ i ], newPage.attr( copyAttrs[ i ] ) );
2998
- newPage.removeAttr( copyAttrs[ i ] );
2999
- }
3000
- });
3001
- return wrapper;
3002
- }
3003
-
3004
- //remove active classes after page transition or error
3005
- function removeActiveLinkClass(forceRemoval){
3006
- if( !!activeClickedLink && (!activeClickedLink.closest( '.ui-page-active' ).length || forceRemoval )){
3007
- activeClickedLink.removeClass( $.mobile.activeBtnClass );
3008
- }
3009
- activeClickedLink = null;
3010
- }
3011
-
3012
-
3013
- //for getting or creating a new page
3014
- function changePage( to, transition, back, changeHash){
3015
-
3016
- //from is always the currently viewed page
3017
- var toIsArray = $.type(to) === "array",
3018
- from = toIsArray ? to[0] : $.activePage,
3019
- to = toIsArray ? to[1] : to,
3020
- url = fileUrl = $.type(to) === "string" ? to.replace( /^#/, "" ) : null,
3021
- data = undefined,
3022
- type = 'get',
3023
- isFormRequest = false,
3024
- duplicateCachedPage = null,
3025
- back = (back !== undefined) ? back : ( urlStack.length > 1 && urlStack[ urlStack.length - 2 ].url === url ),
3026
- transition = (transition !== undefined) ? transition : $.mobile.defaultTransition;
3027
-
3028
- if( $.type(to) === "object" && to.url ){
3029
- url = to.url,
3030
- data = to.data,
3031
- type = to.type,
3032
- isFormRequest = true;
3033
- //make get requests bookmarkable
3034
- if( data && type == 'get' ){
3035
- url += "?" + data;
3036
- data = undefined;
3037
- }
3038
- }
3039
-
3040
- //reset base to pathname for new request
3041
- resetBaseURL();
3042
-
3043
- // if the new href is the same as the previous one
3044
- if ( back ) {
3045
- transition = urlStack.pop().transition;
3046
- } else {
3047
- urlStack.push({ url: url, transition: transition });
3048
- }
3049
-
3050
- //function for transitioning between two existing pages
3051
- function transitionPages() {
3052
-
3053
- //kill the keyboard
3054
- jQuery( document.activeElement ).blur();
3055
-
3056
- //trigger before show/hide events
3057
- from.data("page")._trigger("beforehide", {nextPage: to});
3058
- to.data("page")._trigger("beforeshow", {prevPage: from});
3059
-
3060
- function loadComplete(){
3061
- pageLoading( true );
3062
- //trigger show/hide events, allow preventing focus change through return false
3063
- if( from.data("page")._trigger("hide", null, {nextPage: to}) !== false && to.data("page")._trigger("show", null, {prevPage: from}) !== false ){
3064
- $.activePage = to;
3065
- }
3066
- reFocus( to );
3067
- if( changeHash && url ){
3068
- hashListener = false;
3069
- location.hash = url;
3070
- }
3071
- removeActiveLinkClass();
3072
-
3073
- //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden
3074
- if( duplicateCachedPage != null ){
3075
- duplicateCachedPage.remove();
3076
- }
3077
- }
3078
-
3079
- if(transition){
3080
- $pageContainer.addClass('ui-mobile-viewport-transitioning');
3081
- // animate in / out
3082
- from.addClass( transition + " out " + ( back ? "reverse" : "" ) );
3083
- to.addClass( $.mobile.activePageClass + " " + transition +
3084
- " in " + ( back ? "reverse" : "" ) );
3085
-
3086
- // callback - remove classes, etc
3087
- to.animationComplete(function() {
3088
- from.add( to ).removeClass(" out in reverse " + $.mobile.transitions.join(' ') );
3089
- from.removeClass( $.mobile.activePageClass );
3090
- loadComplete();
3091
- $pageContainer.removeClass('ui-mobile-viewport-transitioning');
3092
- });
3093
- }
3094
- else{
3095
- from.removeClass( $.mobile.activePageClass );
3096
- to.addClass( $.mobile.activePageClass );
3097
- loadComplete();
3098
- }
3099
- };
3100
-
3101
- //shared page enhancements
3102
- function enhancePage(){
3103
- setPageRole( to );
3104
- to.page();
3105
- }
3106
-
3107
- //get the actual file in a jq-mobile nested url
3108
- function getFileURL( url ){
3109
- return url.match( '&' + jQuery.mobile.subPageUrlKey ) ? url.split( '&' + jQuery.mobile.subPageUrlKey )[0] : url;
3110
- }
3111
-
3112
- //if url is a string
3113
- if( url ){
3114
- to = jQuery( "[id='" + url + "']" ),
3115
- fileUrl = getFileURL(url);
3116
- }
3117
- else{ //find base url of element, if avail
3118
- var toID = to.attr('id'),
3119
- toIDfileurl = getFileURL(toID);
3120
-
3121
- if(toID != toIDfileurl){
3122
- fileUrl = toIDfileurl;
3123
- }
3124
- }
3125
-
3126
- // find the "to" page, either locally existing in the dom or by creating it through ajax
3127
- if ( to.length && !isFormRequest ) {
3128
- if( fileUrl ){
3129
- setBaseURL(fileUrl);
3130
- }
3131
- enhancePage();
3132
- transitionPages();
3133
- } else {
3134
-
3135
- //if to exists in DOM, save a reference to it in duplicateCachedPage for removal after page change
3136
- if( to.length ){
3137
- duplicateCachedPage = to;
3138
- }
3139
-
3140
- pageLoading();
3141
-
3142
- $.ajax({
3143
- url: fileUrl,
3144
- type: type,
3145
- data: data,
3146
- success: function( html ) {
3147
- setBaseURL(fileUrl);
3148
- var all = jQuery("<div></div>");
3149
- //workaround to allow scripts to execute when included in page divs
3150
- all.get(0).innerHTML = html;
3151
- to = all.find('[data-role="page"]');
3152
-
3153
- //rewrite src and href attrs to use a base url
3154
- if( !$.support.dynamicBaseTag ){
3155
- var baseUrl = getBaseURL(fileUrl);
3156
- to.find('[src],link[href]').each(function(){
3157
- var thisAttr = $(this).is('[href]') ? 'href' : 'src',
3158
- thisUrl = $(this).attr(thisAttr);
3159
-
3160
- //if full path exists and is same, chop it - helps IE out
3161
- thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' );
3162
-
3163
- if( !/^(\w+:|#|\/)/.test(thisUrl) ){
3164
- $(this).attr(thisAttr, baseUrl + thisUrl);
3165
- }
3166
- });
3167
- }
3168
-
3169
- //preserve ID on a retrieved page
3170
- if ( to.attr('id') ) {
3171
- to = wrapNewPage( to );
3172
- }
3173
-
3174
- to
3175
- .attr( "id", fileUrl )
3176
- .appendTo( $pageContainer );
3177
-
3178
- enhancePage();
3179
- transitionPages();
3180
- },
3181
- error: function() {
3182
- pageLoading( true );
3183
- removeActiveLinkClass(true);
3184
- jQuery("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>")
3185
- .css({ "display": "block", "opacity": 0.96, "top": $(window).scrollTop() + 100 })
3186
- .appendTo( $pageContainer )
3187
- .delay( 800 )
3188
- .fadeOut( 400, function(){
3189
- $(this).remove();
3190
- });
3191
- }
3192
- });
3193
- }
3194
-
3195
- };
3196
-
3197
-
3198
- jQuery(function() {
3199
-
3200
- $body = jQuery( "body" );
3201
- pageLoading();
3202
-
3203
- // needs to be bound at domready (for IE6)
3204
- // find or load content, make it active
3205
- $window.bind( "hashchange", function(e, triggered) {
3206
- if( !hashListener ){
3207
- hashListener = true;
3208
- return;
3209
- }
3210
- var to = location.hash,
3211
- transition = triggered ? false : undefined;
3212
-
3213
- // either we've backed up to the root page url
3214
- // or it's the first page load with no hash present
3215
- //there's a hash and it wasn't manually triggered
3216
- // > probably a new page, "back" will be figured out by changePage
3217
- if ( to ){
3218
- changePage( to, transition);
3219
- }
3220
- //there's no hash, the active page is not the start page, and it's not manually triggered hashchange
3221
- // > probably backed out to the first page visited
3222
- else if( $.activePage.length && !$startPage.is( $.activePage ) && !triggered ) {
3223
- changePage( $startPage, transition, true );
3224
- }
3225
- else{
3226
- $startPage.trigger("pagebeforeshow", {prevPage: $('')});
3227
- $startPage.addClass( $.mobile.activePageClass );
3228
- pageLoading( true );
3229
-
3230
- if( $startPage.trigger("pageshow", {prevPage: $('')}) !== false ){
3231
- reFocus($startPage);
3232
- }
3233
- }
3234
-
3235
- });
3236
- });
3237
-
3238
- //add mobile, loading classes to doc
3239
- $html.addClass('ui-mobile');
3240
-
3241
- //add orientation class on flip/resize.
3242
- $window.bind( "orientationchange.htmlclass", function( event ) {
3243
- $html.removeClass( "portrait landscape" ).addClass( event.orientation );
3244
- });
3245
-
3246
- //add breakpoint classes for faux media-q support
3247
- function detectResolutionBreakpoints(){
3248
- var currWidth = $window.width(),
3249
- minPrefix = "min-width-",
3250
- maxPrefix = "max-width-",
3251
- minBreakpoints = [],
3252
- maxBreakpoints = [],
3253
- unit = "px",
3254
- breakpointClasses;
3255
-
3256
- $html.removeClass( minPrefix + resolutionBreakpoints.join(unit + " " + minPrefix) + unit + " " +
3257
- maxPrefix + resolutionBreakpoints.join( unit + " " + maxPrefix) + unit );
3258
-
3259
- $.each(resolutionBreakpoints,function( i ){
3260
- if( currWidth >= resolutionBreakpoints[ i ] ){
3261
- minBreakpoints.push( minPrefix + resolutionBreakpoints[ i ] + unit );
3262
- }
3263
- if( currWidth <= resolutionBreakpoints[ i ] ){
3264
- maxBreakpoints.push( maxPrefix + resolutionBreakpoints[ i ] + unit );
3265
- }
3266
- });
3267
-
3268
- if( minBreakpoints.length ){ breakpointClasses = minBreakpoints.join(" "); }
3269
- if( maxBreakpoints.length ){ breakpointClasses += " " + maxBreakpoints.join(" "); }
3270
-
3271
- $html.addClass( breakpointClasses );
3272
- };
3273
-
3274
- //add breakpoints now and on oc/resize events
3275
- $window.bind( "orientationchange resize", detectResolutionBreakpoints);
3276
- detectResolutionBreakpoints();
3277
-
3278
- //common breakpoints, overrideable, changeable
3279
- $.mobile.addResolutionBreakpoints = function( newbps ){
3280
- if( $.type( newbps ) === "array" ){
3281
- resolutionBreakpoints = resolutionBreakpoints.concat( newbps );
3282
- }
3283
- else {
3284
- resolutionBreakpoints.push( newbps );
3285
- }
3286
- detectResolutionBreakpoints();
3287
- }
3288
-
3289
- //animation complete callback
3290
- //TODO - update support test and create special event for transitions
3291
- //check out transitionEnd (opera per Paul's request)
3292
- jQuery.fn.animationComplete = function(callback){
3293
- if(jQuery.support.cssTransitions){
3294
- return jQuery(this).one('webkitAnimationEnd', callback);
3295
- }
3296
- else{
3297
- callback();
3298
- }
3299
- };
3300
-
3301
- jQuery.extend({
3302
- pageLoading: pageLoading,
3303
- changePage: changePage,
3304
- hideBrowserChrome: hideBrowserChrome
3305
- });
3306
-
3307
- //dom-ready
3308
- jQuery(function(){
3309
- var $pages = jQuery("[data-role='page']");
3310
- //set up active page
3311
- $startPage = $.activePage = $pages.first();
3312
-
3313
- //set page container
3314
- $pageContainer = $startPage.parent().addClass('ui-mobile-viewport');
3315
-
3316
- jQuery.extend({
3317
- pageContainer: $pageContainer
3318
- });
3319
-
3320
- //initialize all pages present
3321
- $pages.page();
3322
-
3323
- //trigger a new hashchange, hash or not
3324
- $window.trigger( "hashchange", [ true ] );
3325
-
3326
- //update orientation
3327
- $window.trigger( "orientationchange.htmlclass" );
3328
- });
3329
-
3330
- $window
3331
- .load(hideBrowserChrome)
3332
- .unload(removeActiveLinkClass);
3333
-
3334
- })( jQuery, this );
3335
-
3336
-
3337
- //quick & dirty theme switcher, written to potentially work as a bookmarklet
3338
- (function($){
3339
- $.themeswitcher = function(){
3340
- var
3341
- themesDir = '/stylesheets/compiled/jquery/mobile/',
3342
- //themesDir = 'http://jquerymobile.com/test/themes/',
3343
- themes = ['default','valencia'],
3344
- currentPage = $.activePage,
3345
- menuPage =
3346
- $( '<div data-role=\'dialog\' data-theme=\'a\'>' +
3347
- '<div data-role=\'header\' data-theme=\'b\'>' +
3348
- '<div class=\'ui-title\'>Switch Theme:</div>'+
3349
- '</div>'+
3350
- '<div data-role=\'content\' data-theme=\'c\'><ul data-role=\'listview\' data-inset=\'true\'></ul></div>'+
3351
- '</div>'
3352
- ).appendTo( $.pageContainer ),
3353
- menu = menuPage.find('ul');
3354
-
3355
- //menu items
3356
- $.each(themes, function( i ){
3357
- $('<li><a href=\'#\'>' + themes[ i ].charAt(0).toUpperCase() + themes[ i ].substr(1) + '</a></li>')
3358
- .click(function(){
3359
- addTheme( themes[i] );
3360
- done();
3361
- return false;
3362
- })
3363
- .appendTo(menu);
3364
- });
3365
-
3366
- //remover, adder
3367
- function addTheme(theme){
3368
- $('head').append( '<link rel=\'stylesheet\' href=\''+ themesDir + theme +'.css\' />' );
3369
- }
3370
-
3371
- //finished with this
3372
- function done(){
3373
- $.changePage([menuPage, currentPage], 'pop', true);
3374
- menuPage.bind('pagehide',function(){
3375
- menuPage.remove();
3376
- });
3377
- return false;
3378
- }
3379
-
3380
- //destroy
3381
- menuPage.find('.ui-btn-left').click(done);
3382
-
3383
- //create page, listview
3384
- menuPage.page();
3385
-
3386
- //change page now
3387
- $.changePage([currentPage, menuPage], 'pop', false);
3388
- };
3389
- })(jQuery);
3390
-