compass-jquery-plugin 0.3.2.7 → 0.3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. data/README.md +17 -11
  2. data/VERSION.yml +2 -2
  3. data/lib/handle_js_files.rb +1 -1
  4. data/lib/jquery/emulators.rb +13 -0
  5. data/templates/dynatree/jquery.dynatree.min.js +79 -81
  6. data/templates/emulators/config/initializers/emulators.rb +0 -9
  7. data/templates/emulators/emulators/{blackberry.landscape.scss → blackberry.torch.landscape.scss} +6 -2
  8. data/templates/emulators/emulators/{blackberry.portrait.scss → blackberry.torch.portrait.scss} +6 -1
  9. data/templates/emulators/emulators/galaxy.s.landscape.png +0 -0
  10. data/templates/emulators/emulators/galaxy.s.landscape.scss +20 -0
  11. data/templates/emulators/emulators/galaxy.s.portrait.png +0 -0
  12. data/templates/emulators/emulators/galaxy.s.portrait.scss +20 -0
  13. data/templates/emulators/emulators/galaxy.s2.landscape.png +0 -0
  14. data/templates/emulators/emulators/galaxy.s2.landscape.scss +20 -0
  15. data/templates/emulators/emulators/galaxy.s2.portrait.png +0 -0
  16. data/templates/emulators/emulators/galaxy.s2.portrait.scss +20 -0
  17. data/templates/emulators/emulators/galaxy.tab.10.1.landscape.png +0 -0
  18. data/templates/emulators/emulators/galaxy.tab.10.1.landscape.scss +20 -0
  19. data/templates/emulators/emulators/galaxy.tab.10.1.portrait.png +0 -0
  20. data/templates/emulators/emulators/galaxy.tab.10.1.portrait.scss +20 -0
  21. data/templates/emulators/emulators/galaxy.tab.7.landscape.png +0 -0
  22. data/templates/emulators/emulators/galaxy.tab.7.landscape.scss +20 -0
  23. data/templates/emulators/emulators/galaxy.tab.7.portrait.png +0 -0
  24. data/templates/emulators/emulators/galaxy.tab.7.portrait.scss +20 -0
  25. data/templates/emulators/emulators/galaxy.tab.8.9.landscape.png +0 -0
  26. data/templates/emulators/emulators/galaxy.tab.8.9.landscape.scss +20 -0
  27. data/templates/emulators/emulators/galaxy.tab.8.9.portrait.png +0 -0
  28. data/templates/emulators/emulators/galaxy.tab.8.9.portrait.scss +20 -0
  29. data/templates/emulators/emulators/ipad.landscape.png +0 -0
  30. data/templates/emulators/emulators/ipad.landscape.scss +9 -4
  31. data/templates/emulators/emulators/ipad.portrait.png +0 -0
  32. data/templates/emulators/emulators/ipad.portrait.scss +9 -4
  33. data/templates/emulators/emulators/{iphone.landscape.png → iphone.3.landscape.png} +0 -0
  34. data/templates/emulators/emulators/{iphone.landscape.scss → iphone.3.landscape.scss} +7 -3
  35. data/templates/emulators/emulators/{iphone.portrait.png → iphone.3.portrait.png} +0 -0
  36. data/templates/emulators/emulators/{iphone.portrait.scss → iphone.3.portrait.scss} +7 -3
  37. data/templates/emulators/emulators/iphone.4.landscape .scss +20 -0
  38. data/templates/emulators/emulators/iphone.4.landscape.png +0 -0
  39. data/templates/emulators/emulators/iphone.4.portrait.png +0 -0
  40. data/templates/emulators/emulators/iphone.4.portrait.scss +20 -0
  41. data/templates/emulators/emulators/{palm.pre.landscape.png → palm.pre.2.landscape.png} +0 -0
  42. data/templates/emulators/emulators/{palm.landscape.scss → palm.pre.2.landscape.scss} +7 -3
  43. data/templates/emulators/emulators/{palm.pre.portrait.png → palm.pre.2.portrait.png} +0 -0
  44. data/templates/emulators/emulators/{palm.portrait.scss → palm.pre.2.portrait.scss} +7 -3
  45. data/templates/emulators/manifest.rb +34 -10
  46. data/templates/graphics/config/initializers/graphics.rb +8 -0
  47. data/templates/graphics/highcharts/dark-blue.js +170 -0
  48. data/templates/graphics/highcharts/dark-blue.min.js +4 -0
  49. data/templates/graphics/highcharts/dark-green.js +170 -0
  50. data/templates/graphics/highcharts/dark-green.min.js +4 -0
  51. data/templates/graphics/highcharts/gray.js +164 -0
  52. data/templates/graphics/highcharts/gray.min.js +4 -0
  53. data/templates/graphics/highcharts/grid.js +97 -0
  54. data/templates/graphics/highcharts/grid.min.js +3 -0
  55. data/templates/graphics/highcharts/highslide-config.js +12 -0
  56. data/templates/graphics/highcharts/highslide-config.min.js +1 -0
  57. data/templates/graphics/highcharts/highslide-full.js +3391 -0
  58. data/templates/graphics/highcharts/highslide-full.min.js +132 -0
  59. data/templates/graphics/highcharts/skies.js +89 -0
  60. data/templates/graphics/highcharts/skies.min.js +3 -0
  61. data/templates/graphics/jquery.ganttView.js +1 -1
  62. data/templates/graphics/jquery.ganttView.min.js +61 -61
  63. data/templates/graphics/jquery.highcharts.js +11342 -0
  64. data/templates/graphics/jquery.highcharts.min.js +176 -0
  65. data/templates/graphics/jquery.sparkline.min.js +35 -36
  66. data/templates/graphics/jquery/highcharts/graphics/close.png +0 -0
  67. data/templates/graphics/jquery/highcharts/graphics/closeX.png +0 -0
  68. data/templates/graphics/jquery/highcharts/graphics/controlbar-black-border.gif +0 -0
  69. data/templates/graphics/jquery/highcharts/graphics/controlbar-text-buttons.png +0 -0
  70. data/templates/graphics/jquery/highcharts/graphics/controlbar-white-small.gif +0 -0
  71. data/templates/graphics/jquery/highcharts/graphics/controlbar-white.gif +0 -0
  72. data/templates/graphics/jquery/highcharts/graphics/controlbar2.gif +0 -0
  73. data/templates/graphics/jquery/highcharts/graphics/controlbar3.gif +0 -0
  74. data/templates/graphics/jquery/highcharts/graphics/controlbar4-hover.gif +0 -0
  75. data/templates/graphics/jquery/highcharts/graphics/controlbar4.gif +0 -0
  76. data/templates/graphics/jquery/highcharts/graphics/fullexpand.gif +0 -0
  77. data/templates/graphics/jquery/highcharts/graphics/geckodimmer.png +0 -0
  78. data/templates/graphics/jquery/highcharts/graphics/icon.gif +0 -0
  79. data/templates/graphics/jquery/highcharts/graphics/loader.gif +0 -0
  80. data/templates/graphics/jquery/highcharts/graphics/loader.white.gif +0 -0
  81. data/templates/graphics/jquery/highcharts/graphics/outlines/beveled.png +0 -0
  82. data/templates/graphics/jquery/highcharts/graphics/outlines/drop-shadow.png +0 -0
  83. data/templates/graphics/jquery/highcharts/graphics/outlines/glossy-dark.png +0 -0
  84. data/templates/graphics/jquery/highcharts/graphics/outlines/outer-glow.png +0 -0
  85. data/templates/graphics/jquery/highcharts/graphics/outlines/rounded-black.png +0 -0
  86. data/templates/graphics/jquery/highcharts/graphics/outlines/rounded-white.png +0 -0
  87. data/templates/graphics/jquery/highcharts/graphics/resize.gif +0 -0
  88. data/templates/graphics/jquery/highcharts/graphics/scrollarrows.png +0 -0
  89. data/templates/graphics/jquery/highcharts/graphics/zoomin.cur +0 -0
  90. data/templates/graphics/jquery/highcharts/graphics/zoomout.cur +0 -0
  91. data/templates/graphics/jquery/highcharts/skies.jpg +0 -0
  92. data/templates/graphics/jquery/highslide.scss +763 -0
  93. data/templates/graphics/manifest.rb +43 -0
  94. data/templates/ical/config/initializers/ical.rb +1 -0
  95. data/templates/ical/jquery.ical.js +8401 -8209
  96. data/templates/ical/jquery.ical.min.js +206 -208
  97. data/templates/ical/jquery/ical.print.scss +48 -0
  98. data/templates/ical/jquery/ical.scss +372 -343
  99. data/templates/ical/manifest.rb +1 -0
  100. data/templates/jqgrid/i18n/jqgrid/locale-ar.min.js +2 -2
  101. data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +1 -1
  102. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +1 -1
  103. data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +1 -1
  104. data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +1 -1
  105. data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +1 -1
  106. data/templates/jqgrid/i18n/jqgrid/locale-da.min.js +1 -1
  107. data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +1 -1
  108. data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +2 -2
  109. data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +1 -1
  110. data/templates/jqgrid/i18n/jqgrid/locale-es.min.js +2 -2
  111. data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +1 -1
  112. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +1 -1
  113. data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +2 -2
  114. data/templates/jqgrid/i18n/jqgrid/locale-gl.min.js +2 -2
  115. data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +1 -1
  116. data/templates/jqgrid/i18n/jqgrid/locale-hu.min.js +1 -1
  117. data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +1 -1
  118. data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +2 -2
  119. data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +1 -1
  120. data/templates/jqgrid/i18n/jqgrid/locale-lt.min.js +2 -2
  121. data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +1 -1
  122. data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +1 -1
  123. data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +1 -1
  124. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +1 -1
  125. data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +1 -1
  126. data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +1 -1
  127. data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +2 -2
  128. data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +1 -1
  129. data/templates/jqgrid/i18n/jqgrid/locale-sr.min.js +1 -1
  130. data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +1 -1
  131. data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +1 -1
  132. data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +2 -2
  133. data/templates/jqgrid/jquery.jqGrid.js +162 -850
  134. data/templates/jqgrid/jquery.jqGrid.min.js +476 -497
  135. data/templates/jqgrid/jquery/jqGrid.scss +0 -19
  136. data/templates/jquery/amplify.store.js +248 -0
  137. data/templates/jquery/amplify.store.min.js +6 -0
  138. data/templates/jquery/config/initializers/jquery.rb +5 -1
  139. data/templates/jquery/history.adapter.jquery.js +37 -43
  140. data/templates/jquery/history.adapter.jquery.min.js +1 -1
  141. data/templates/jquery/history.html4.js +596 -587
  142. data/templates/jquery/history.html4.min.js +8 -8
  143. data/templates/jquery/history.js +1839 -1669
  144. data/templates/jquery/history.min.js +27 -25
  145. data/templates/jquery/i18n/jquery.ui/datepicker-af.min.js +1 -1
  146. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.min.js +1 -1
  147. data/templates/jquery/i18n/jquery.ui/datepicker-ar.min.js +1 -1
  148. data/templates/jquery/i18n/jquery.ui/datepicker-az.min.js +1 -1
  149. data/templates/jquery/i18n/jquery.ui/datepicker-bg.min.js +1 -1
  150. data/templates/jquery/i18n/jquery.ui/datepicker-bs.min.js +1 -1
  151. data/templates/jquery/i18n/jquery.ui/datepicker-ca.min.js +1 -1
  152. data/templates/jquery/i18n/jquery.ui/datepicker-cs.min.js +1 -1
  153. data/templates/jquery/i18n/jquery.ui/datepicker-da.min.js +1 -1
  154. data/templates/jquery/i18n/jquery.ui/datepicker-de.min.js +1 -1
  155. data/templates/jquery/i18n/jquery.ui/datepicker-el.min.js +1 -1
  156. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.min.js +1 -1
  157. data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.min.js +1 -1
  158. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.min.js +1 -1
  159. data/templates/jquery/i18n/jquery.ui/datepicker-eo.min.js +1 -1
  160. data/templates/jquery/i18n/jquery.ui/datepicker-es.min.js +1 -1
  161. data/templates/jquery/i18n/jquery.ui/datepicker-et.min.js +1 -1
  162. data/templates/jquery/i18n/jquery.ui/datepicker-eu.min.js +1 -1
  163. data/templates/jquery/i18n/jquery.ui/datepicker-fa.min.js +2 -2
  164. data/templates/jquery/i18n/jquery.ui/datepicker-fi.min.js +1 -1
  165. data/templates/jquery/i18n/jquery.ui/datepicker-fo.min.js +1 -1
  166. data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.min.js +1 -1
  167. data/templates/jquery/i18n/jquery.ui/datepicker-fr.min.js +1 -1
  168. data/templates/jquery/i18n/jquery.ui/datepicker-gl.min.js +1 -1
  169. data/templates/jquery/i18n/jquery.ui/datepicker-he.min.js +1 -1
  170. data/templates/jquery/i18n/jquery.ui/datepicker-hr.min.js +1 -1
  171. data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
  172. data/templates/jquery/i18n/jquery.ui/datepicker-hy.min.js +1 -1
  173. data/templates/jquery/i18n/jquery.ui/datepicker-id.min.js +1 -1
  174. data/templates/jquery/i18n/jquery.ui/datepicker-is.min.js +1 -1
  175. data/templates/jquery/i18n/jquery.ui/datepicker-it.min.js +1 -1
  176. data/templates/jquery/i18n/jquery.ui/datepicker-ja.min.js +1 -1
  177. data/templates/jquery/i18n/jquery.ui/datepicker-ko.min.js +1 -1
  178. data/templates/jquery/i18n/jquery.ui/datepicker-kz.min.js +1 -1
  179. data/templates/jquery/i18n/jquery.ui/datepicker-lt.min.js +1 -1
  180. data/templates/jquery/i18n/jquery.ui/datepicker-lv.min.js +1 -1
  181. data/templates/jquery/i18n/jquery.ui/datepicker-ml.min.js +2 -2
  182. data/templates/jquery/i18n/jquery.ui/datepicker-ms.min.js +1 -1
  183. data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
  184. data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +1 -1
  185. data/templates/jquery/i18n/jquery.ui/datepicker-pl.min.js +1 -1
  186. data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.min.js +1 -1
  187. data/templates/jquery/i18n/jquery.ui/datepicker-pt.min.js +1 -1
  188. data/templates/jquery/i18n/jquery.ui/datepicker-rm.min.js +1 -1
  189. data/templates/jquery/i18n/jquery.ui/datepicker-ro.min.js +1 -1
  190. data/templates/jquery/i18n/jquery.ui/datepicker-ru.min.js +1 -1
  191. data/templates/jquery/i18n/jquery.ui/datepicker-sk.min.js +1 -1
  192. data/templates/jquery/i18n/jquery.ui/datepicker-sl.min.js +1 -1
  193. data/templates/jquery/i18n/jquery.ui/datepicker-sq.min.js +1 -1
  194. data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.min.js +1 -1
  195. data/templates/jquery/i18n/jquery.ui/datepicker-sr.min.js +1 -1
  196. data/templates/jquery/i18n/jquery.ui/datepicker-sv.min.js +1 -1
  197. data/templates/jquery/i18n/jquery.ui/datepicker-ta.min.js +1 -1
  198. data/templates/jquery/i18n/jquery.ui/datepicker-th.min.js +1 -1
  199. data/templates/jquery/i18n/jquery.ui/datepicker-tj.min.js +1 -1
  200. data/templates/jquery/i18n/jquery.ui/datepicker-tr.min.js +1 -1
  201. data/templates/jquery/i18n/jquery.ui/datepicker-uk.min.js +1 -1
  202. data/templates/jquery/i18n/jquery.ui/datepicker-vi.min.js +1 -1
  203. data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.min.js +1 -1
  204. data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.min.js +1 -1
  205. data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.min.js +1 -1
  206. data/templates/jquery/jquery-ui.js +217 -104
  207. data/templates/jquery/jquery-ui.min.js +437 -436
  208. data/templates/jquery/jquery.bgiframe.min.js +1 -1
  209. data/templates/jquery/jquery.contextMenu.min.js +7 -7
  210. data/templates/jquery/jquery.cookie.js +60 -58
  211. data/templates/jquery/jquery.cookie.min.js +1 -1
  212. data/templates/jquery/jquery.dotimeout.min.js +2 -2
  213. data/templates/jquery/jquery.dst.min.js +4 -4
  214. data/templates/jquery/jquery.farbtastic.min.js +10 -10
  215. data/templates/jquery/jquery.form.js +15 -5
  216. data/templates/jquery/jquery.form.min.js +20 -20
  217. data/templates/jquery/jquery.haml.min.js +5 -5
  218. data/templates/jquery/jquery.hotkeys.min.js +3 -3
  219. data/templates/jquery/jquery.js +8205 -8170
  220. data/templates/jquery/jquery.layout.min.js +48 -50
  221. data/templates/jquery/jquery.min.js +166 -167
  222. data/templates/jquery/jquery.mousewheel.min.js +2 -2
  223. data/templates/jquery/jquery.offline.min.js +4 -4
  224. data/templates/jquery/jquery.pngFix.js +28 -30
  225. data/templates/jquery/jquery.pngFix.min.js +5 -5
  226. data/templates/jquery/jquery.rails.js +166 -0
  227. data/templates/jquery/jquery.rails.min.js +6 -0
  228. data/templates/jquery/jquery.replacetext.min.js +1 -1
  229. data/templates/jquery/jquery.themeswitchertool.min.js +4 -4
  230. data/templates/jquery/jquery.tmpl.js +14 -12
  231. data/templates/jquery/jquery.tmpl.min.js +12 -12
  232. data/templates/jquery/jquery.tmplPlus.js +2 -2
  233. data/templates/jquery/jquery.tmplPlus.min.js +3 -3
  234. data/templates/jquery/jquery.tokeninput.js +729 -0
  235. data/templates/jquery/jquery.tokeninput.min.js +14 -0
  236. data/templates/jquery/jquery/ui/_theme.scss +23 -16
  237. data/templates/jquery/jquery/ui/black-tie/ui-icons_4ca300_256x240.png +0 -0
  238. data/templates/jquery/jquery/ui/black-tie/ui-icons_bbbbbb_256x240.png +0 -0
  239. data/templates/jquery/jquery/ui/black-tie/ui-icons_ededed_256x240.png +0 -0
  240. data/templates/jquery/jquery/ui/black-tie/ui-icons_ffcf29_256x240.png +0 -0
  241. data/templates/jquery/jquery/ui/tokeninput.facebook.scss +95 -0
  242. data/templates/jquery/jquery/ui/tokeninput.mac.scss +164 -0
  243. data/templates/jquery/jquery/ui/tokeninput.scss +85 -0
  244. data/templates/jquery/jquery/ui/vader/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  245. data/templates/jquery/jquery/ui/vader/ui-icons_bbbbbb_256x240.png +0 -0
  246. data/templates/jquery/jquery/ui/vader/ui-icons_c98000_256x240.png +0 -0
  247. data/templates/jquery/jquery/ui/vader/ui-icons_f29a00_256x240.png +0 -0
  248. data/templates/jquery/json.min.js +6 -6
  249. data/templates/jquery/json2.js +214 -214
  250. data/templates/jquery/json2.min.js +5 -6
  251. data/templates/jquery/manifest.rb +9 -2
  252. data/templates/jstree/jquery.jstree.min.js +222 -224
  253. data/templates/mobile/config/initializers/mobile.rb +1 -1
  254. data/templates/mobile/jquery.mobile.js +887 -404
  255. data/templates/mobile/jquery.mobile.min.js +4 -4
  256. data/templates/mobile/jquery/mobile/_base.scss +50 -26
  257. data/templates/mobile/jquery/mobile/default.scss +59 -63
  258. data/templates/mobile/jquery/mobile/valencia.scss +44 -42
  259. data/templates/ribbon/jquery.ribbon.min.js +14 -14
  260. data/templates/tiny_mce/manifest.rb +4 -0
  261. data/templates/tiny_mce/tiny_mce/langs/de.js +1 -1
  262. data/templates/tiny_mce/tiny_mce/langs/en.js +1 -1
  263. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -1
  264. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/de_dlg.js +1 -1
  265. data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +1 -1
  266. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -1
  267. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -1
  268. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
  269. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -1
  270. data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
  271. data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin_src.js +1 -0
  272. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
  273. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -1
  274. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
  275. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -1
  276. data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +1 -1
  277. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
  278. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -1
  279. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -1
  280. data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +1 -1
  281. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -1
  282. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +1 -1
  283. data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin.js +1 -0
  284. data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin_src.js +1 -0
  285. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -1
  286. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -1
  287. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
  288. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -1
  289. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
  290. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -1
  291. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +1 -1
  292. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
  293. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -1
  294. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
  295. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1
  296. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -1
  297. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +1 -1
  298. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +1 -1
  299. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
  300. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1
  301. data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +1 -1
  302. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de_dlg.js +1 -1
  303. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +1 -1
  304. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -1
  305. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -1
  306. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -1
  307. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +1 -1
  308. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +1 -1
  309. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
  310. data/templates/tiny_mce/tiny_mce/utils/form_utils.js +1 -1
  311. data/templates/tiny_mce/tiny_mce/utils/validate.js +1 -1
  312. data/templates/tools/flowplayer.min.js +29 -30
  313. data/templates/tools/jquery.tools.min.js +96 -96
  314. data/templates/tools/swfobject.min.js +18 -19
  315. metadata +95 -16
  316. data/templates/jquery/jrails.js +0 -200
  317. data/templates/jquery/jrails.min.js +0 -8
@@ -574,25 +574,6 @@ tr.ui-search-toolbar {
574
574
  text-overflow: ellipsis;
575
575
  -moz-binding: url('ellipsis-xbl.xml#ellipsis'); } }
576
576
 
577
- .ui-searchFilter {
578
- display: none;
579
- position: absolute;
580
- z-index: 770;
581
- overflow: visible;
582
- table {
583
- position: relative;
584
- margin: 0em;
585
- width: auto;
586
- td {
587
- margin: 0em;
588
- padding: 1px;
589
- input, select {
590
- margin: 0.1em; } } }
591
- .ui-state-default {
592
- cursor: pointer; }
593
- .divider hr {
594
- margin: 1px; } }
595
-
596
577
  /* Multiselect
597
578
  ----------------------------------*/
598
579
 
@@ -0,0 +1,248 @@
1
+ /*!
2
+ * Amplify Store - Persistent Client-Side Storage @VERSION
3
+ *
4
+ * Copyright 2011 appendTo LLC. (http://appendto.com/team)
5
+ * Dual licensed under the MIT or GPL licenses.
6
+ * http://appendto.com/open-source-licenses
7
+ *
8
+ * http://amplifyjs.com
9
+ */
10
+ (function(amplify, undefined) {
11
+
12
+ // MooTools Compatibility
13
+ JSON.stringify = JSON.stringify || JSON.encode;
14
+ JSON.parse = JSON.parse || JSON.decode;
15
+
16
+ var store = amplify.store = function(key, value, options, type) {
17
+ var type = store.type;
18
+ if (options && options.type && options.type in store.types) {
19
+ type = options.type;
20
+ }
21
+ return store.types[ type ](key, value, options || {});
22
+ };
23
+
24
+ store.types = {};
25
+ store.type = null;
26
+ store.addType = function(type, storage) {
27
+ if (!store.type) {
28
+ store.type = type;
29
+ }
30
+
31
+ store.types[ type ] = storage;
32
+ store[ type ] = function(key, value, options) {
33
+ options = options || {};
34
+ options.type = type;
35
+ return store(key, value, options);
36
+ };
37
+ }
38
+ store.error = function() {
39
+ return "amplify.store quota exceeded";
40
+ };
41
+
42
+ function createSimpleStorage(storageType, storage) {
43
+ var values = storage.__amplify__ ? JSON.parse(storage.__amplify__) : {};
44
+ store.addType(storageType, function(key, value, options) {
45
+ var ret = value,
46
+ now = (new Date()).getTime(),
47
+ storedValue,
48
+ parsed;
49
+
50
+ if (!key) {
51
+ ret = {};
52
+ for (key in values) {
53
+ storedValue = storage[ key ];
54
+ parsed = storedValue ? JSON.parse(storedValue) : { expires: -1 };
55
+ if (parsed.expires && parsed.expires <= now) {
56
+ delete storage[ key ];
57
+ delete values[ key ];
58
+ } else {
59
+ ret[ key.replace(/^__amplify__/, "") ] = parsed.data;
60
+ }
61
+ }
62
+ storage.__amplify__ = JSON.stringify(values);
63
+ return ret;
64
+ }
65
+
66
+ // protect against overwriting built-in properties
67
+ key = "__amplify__" + key;
68
+
69
+ if (value === undefined) {
70
+ if (values[ key ]) {
71
+ storedValue = storage[ key ];
72
+ parsed = storedValue ? JSON.parse(storedValue) : { expires: -1 };
73
+ if (parsed.expires && parsed.expires <= now) {
74
+ delete storage[ key ];
75
+ delete values[ key ];
76
+ } else {
77
+ return parsed.data;
78
+ }
79
+ }
80
+ } else {
81
+ if (value === null) {
82
+ delete storage[ key ];
83
+ delete values[ key ];
84
+ } else {
85
+ parsed = JSON.stringify({
86
+ data: value,
87
+ expires: options.expires ? now + options.expires : null
88
+ });
89
+ try {
90
+ storage[ key ] = parsed;
91
+ values[ key ] = true;
92
+ // quota exceeded
93
+ } catch(error) {
94
+ // expire old data and try again
95
+ store[ storageType ]();
96
+ try {
97
+ storage[ key ] = parsed;
98
+ values[ key ] = true;
99
+ } catch(error) {
100
+ throw store.error();
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ storage.__amplify__ = JSON.stringify(values);
107
+ return ret;
108
+ });
109
+ }
110
+
111
+ // localStorage + sessionStorage
112
+ // IE 8+, Firefox 3.5+, Safari 4+, Chrome 4+, Opera 10.5+, iPhone 2+, Android 2+
113
+ for (var webStorageType in { localStorage: 1, sessionStorage: 1 }) {
114
+ // try/catch for file protocol in Firefox
115
+ try {
116
+ if (window[ webStorageType ].getItem) {
117
+ createSimpleStorage(webStorageType, window[ webStorageType ]);
118
+ }
119
+ } catch(e) {
120
+ }
121
+ }
122
+
123
+ // globalStorage
124
+ // non-standard: Firefox 2+
125
+ // https://developer.mozilla.org/en/dom/storage#globalStorage
126
+ if (window.globalStorage) {
127
+ createSimpleStorage("globalStorage",
128
+ window.globalStorage[ window.location.hostname ]);
129
+ // Firefox 2.0 and 3.0 have sessionStorage and globalStorage
130
+ // make sure we defualt to globalStorage
131
+ // but don't default to globalStorage in 3.5+ which also has localStorage
132
+ if (store.type === "sessionStorage") {
133
+ store.type = "globalStorage";
134
+ }
135
+ }
136
+
137
+ // userData
138
+ // non-standard: IE 5+
139
+ // http://msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx
140
+ (function() {
141
+ // append to html instead of body so we can do this from the head
142
+ var div = document.createElement("div"),
143
+ attrKey = "amplify",
144
+ attrs;
145
+ div.style.display = "none";
146
+ document.getElementsByTagName("head")[ 0 ].appendChild(div);
147
+ if (div.addBehavior) {
148
+ div.addBehavior("#default#userdata");
149
+ div.load(attrKey);
150
+ attrs = div.getAttribute(attrKey) ? JSON.parse(div.getAttribute(attrKey)) : {};
151
+
152
+ store.addType("userData", function(key, value, options) {
153
+ var ret = value,
154
+ now = (new Date()).getTime(),
155
+ attr,
156
+ parsed,
157
+ prevValue;
158
+
159
+ if (!key) {
160
+ ret = {};
161
+ for (key in attrs) {
162
+ attr = div.getAttribute(key);
163
+ parsed = attr ? JSON.parse(attr) : { expires: -1 };
164
+ if (parsed.expires && parsed.expires <= now) {
165
+ div.removeAttribute(key);
166
+ delete attrs[ key ];
167
+ } else {
168
+ ret[ key ] = parsed.data;
169
+ }
170
+ }
171
+ div.setAttribute(attrKey, JSON.stringify(attrs));
172
+ div.save(attrKey);
173
+ return ret;
174
+ }
175
+
176
+ // convert invalid characters to dashes
177
+ // http://www.w3.org/TR/REC-xml/#NT-Name
178
+ // simplified to assume the starting character is valid
179
+ // also removed colon as it is invalid in HTML attribute names
180
+ key = key.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g, "-");
181
+
182
+ if (value === undefined) {
183
+ if (key in attrs) {
184
+ attr = div.getAttribute(key);
185
+ parsed = attr ? JSON.parse(attr) : { expires: -1 };
186
+ if (parsed.expires && parsed.expires <= now) {
187
+ div.removeAttribute(key);
188
+ delete attrs[ key ];
189
+ } else {
190
+ return parsed.data;
191
+ }
192
+ }
193
+ } else {
194
+ if (value === null) {
195
+ div.removeAttribute(key);
196
+ delete attrs[ key ];
197
+ } else {
198
+ // we need to get the previous value in case we need to rollback
199
+ prevValue = div.getAttribute(key);
200
+ parsed = JSON.stringify({
201
+ data: value,
202
+ expires: (options.expires ? (now + options.expires) : null)
203
+ });
204
+ div.setAttribute(key, parsed);
205
+ attrs[ key ] = true;
206
+ }
207
+ }
208
+
209
+ div.setAttribute(attrKey, JSON.stringify(attrs));
210
+ try {
211
+ div.save(attrKey);
212
+ // quota exceeded
213
+ } catch (error) {
214
+ // roll the value back to the previous value
215
+ if (prevValue === null) {
216
+ div.removeAttribute(key);
217
+ delete attrs[ key ];
218
+ } else {
219
+ div.setAttribute(key, prevValue);
220
+ }
221
+
222
+ // expire old data and try again
223
+ store.userData();
224
+ try {
225
+ div.setAttribute(key, parsed);
226
+ attrs[ key ] = true;
227
+ div.save(attrKey);
228
+ } catch (error) {
229
+ // roll the value back to the previous value
230
+ if (prevValue === null) {
231
+ div.removeAttribute(key);
232
+ delete attrs[ key ];
233
+ } else {
234
+ div.setAttribute(key, prevValue);
235
+ }
236
+ throw store.error();
237
+ }
238
+ }
239
+ return ret;
240
+ });
241
+ }
242
+ }() );
243
+
244
+ // in-memory storage
245
+ // fallback for all browsers to enable the API even if we can't persist data
246
+ createSimpleStorage("memory", {});
247
+
248
+ }(this.amplify = this.amplify || {}) );
@@ -0,0 +1,6 @@
1
+ (function(n,m){function k(b,c){var a=c.__amplify__?JSON.parse(c.__amplify__):{};f.addType(b,function(d,e,i){var h=e,g=(new Date).getTime();if(!d){h={};for(d in a)e=(e=c[d])?JSON.parse(e):{expires:-1},e.expires&&e.expires<=g?(delete c[d],delete a[d]):h[d.replace(/^__amplify__/,"")]=e.data;c.__amplify__=JSON.stringify(a);return h}d="__amplify__"+d;if(e===m){if(a[d])if(e=(e=c[d])?JSON.parse(e):{expires:-1},e.expires&&e.expires<=g)delete c[d],delete a[d];else return e.data}else if(e===null)delete c[d],
2
+ delete a[d];else{e=JSON.stringify({data:e,expires:i.expires?g+i.expires:null});try{c[d]=e,a[d]=!0}catch(j){f[b]();try{c[d]=e,a[d]=!0}catch(k){throw f.error();}}}c.__amplify__=JSON.stringify(a);return h})}JSON.stringify=JSON.stringify||JSON.encode;JSON.parse=JSON.parse||JSON.decode;var f=n.store=function(b,c,a,d){d=f.type;if(a&&a.type&&a.type in f.types)d=a.type;return f.types[d](b,c,a||{})};f.types={};f.type=null;f.addType=function(b,c){if(!f.type)f.type=b;f.types[b]=c;f[b]=function(a,d,c){c=c||{};
3
+ c.type=b;return f(a,d,c)}};f.error=function(){return"amplify.store quota exceeded"};for(var l in{localStorage:1,sessionStorage:1})try{window[l].getItem&&k(l,window[l])}catch(o){}if(window.globalStorage&&(k("globalStorage",window.globalStorage[window.location.hostname]),f.type==="sessionStorage"))f.type="globalStorage";(function(){var b=document.createElement("div"),c;b.style.display="none";document.getElementsByTagName("head")[0].appendChild(b);b.addBehavior&&(b.addBehavior("#default#userdata"),b.load("amplify"),
4
+ c=b.getAttribute("amplify")?JSON.parse(b.getAttribute("amplify")):{},f.addType("userData",function(a,d,e){var i=d,h=(new Date).getTime(),g,j;if(!a){i={};for(a in c)g=(d=b.getAttribute(a))?JSON.parse(d):{expires:-1},g.expires&&g.expires<=h?(b.removeAttribute(a),delete c[a]):i[a]=g.data;b.setAttribute("amplify",JSON.stringify(c));b.save("amplify");return i}a=a.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,"-");if(d===m){if(a in c)if(g=
5
+ (d=b.getAttribute(a))?JSON.parse(d):{expires:-1},g.expires&&g.expires<=h)b.removeAttribute(a),delete c[a];else return g.data}else d===null?(b.removeAttribute(a),delete c[a]):(j=b.getAttribute(a),g=JSON.stringify({data:d,expires:e.expires?h+e.expires:null}),b.setAttribute(a,g),c[a]=!0);b.setAttribute("amplify",JSON.stringify(c));try{b.save("amplify")}catch(k){j===null?(b.removeAttribute(a),delete c[a]):b.setAttribute(a,j);f.userData();try{b.setAttribute(a,g),c[a]=!0,b.save("amplify")}catch(l){throw j===
6
+ null?(b.removeAttribute(a),delete c[a]):b.setAttribute(a,j),f.error();}}return i}))})();k("memory",{})})(this.amplify=this.amplify||{});
@@ -19,7 +19,7 @@ ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery'
19
19
 
20
20
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => ['jquery.min']
21
21
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery_ui => ['jquery.min', 'jquery.cookie.min', 'jquery.form.min', 'jquery.layout.min', 'jquery-ui.min', 'jquery.flashMessages.min']
22
- ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jrails => ['jrails.min']
22
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jrails => ['jquery.rails.min']
23
23
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jhaml => ['jquery.haml.min']
24
24
  ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :contextMenu => ['compiled/jquery/ui/contextMenu.css']
25
25
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :contextMenu => ['jquery.contextMenu.min']
@@ -38,6 +38,10 @@ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :pngFix => ['j
38
38
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :replaceText => ['jquery.replaceText.min']
39
39
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :themeSwitcher => ['jquery.themeswitchertool.min']
40
40
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :tmpl => ['jquery.tmpl.min', 'jquery.tmplPlus.min']
41
+ ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :tokeninput => ['compiled/jquery/ui/tokeninput.css']
42
+ ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :tokeninput_facebook => ['compiled/jquery/ui/tokeninput.facebook.css']
43
+ ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :tokeninput_mac => ['compiled/jquery/ui/tokeninput.mac.css']
44
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :tokeninput => ['jquery.tokeninput.min']
41
45
 
42
46
  require 'jquery/jquery'
43
47
  require 'handle_attributes'
@@ -6,53 +6,47 @@
6
6
  */
7
7
 
8
8
  // Closure
9
- (function(window,undefined){
10
- // Localise Globals
11
- var
12
- History = window.History = window.History||{},
13
- jQuery = window.jQuery;
9
+ (function(window, undefined) {
10
+ // Localise Globals
11
+ var
12
+ History = window.History = window.History || {},
13
+ jQuery = window.jQuery;
14
14
 
15
- // Check Existence
16
- if ( typeof History.Adapter !== 'undefined' ) {
17
- throw new Error('History.js Adapter has already been loaded...');
18
- }
15
+ // Check Existence
16
+ if (typeof History.Adapter !== 'undefined') {
17
+ throw new Error('History.js Adapter has already been loaded...');
18
+ }
19
19
 
20
- // Add the Adapter
21
- History.Adapter = {
22
- /**
23
- * History.Adapter.bind(el,event,callback)
24
- * @param {Element|Selector} el
25
- * @param {String} event - custom and standard events
26
- * @param {Function} callback
27
- * @return
28
- */
29
- bind: function(el,event,callback){
30
- jQuery(el).bind(event,callback);
31
- },
20
+ // Add the Adapter
21
+ History.Adapter = {
22
+ // History.Adapter.bind(el,event,callback)
23
+ // @param {Element|Selector} el
24
+ // @param {String} event - custom and standard events
25
+ // @param {Function} callback
26
+ // @return
27
+ bind: function(el, event, callback) {
28
+ jQuery(el).bind(event, callback);
29
+ },
32
30
 
33
- /**
34
- * History.Adapter.trigger(el,event)
35
- * @param {Element|Selector} el
36
- * @param {String} event - custom and standard events
37
- * @return
38
- */
39
- trigger: function(el,event){
40
- jQuery(el).trigger(event);
41
- },
31
+ // History.Adapter.trigger(el,event)
32
+ // @param {Element|Selector} el
33
+ // @param {String} event - custom and standard events
34
+ // @return
35
+ trigger: function(el, event) {
36
+ jQuery(el).trigger(event);
37
+ },
42
38
 
43
- /**
44
- * History.Adapter.trigger(el,event,data)
45
- * @param {Function} callback
46
- * @return
47
- */
48
- onDomLoad: function(callback) {
49
- jQuery(callback);
50
- }
51
- };
39
+ // History.Adapter.trigger(el,event,data)
40
+ // @param {Function} callback
41
+ // @return
42
+ onDomLoad: function(callback) {
43
+ jQuery(callback);
44
+ }
45
+ };
52
46
 
53
- // Try and Initialise History
54
- if ( typeof History.init !== 'undefined' ) {
55
- History.init();
56
- }
47
+ // Try and Initialise History
48
+ if (typeof History.init !== 'undefined') {
49
+ History.init();
50
+ }
57
51
 
58
52
  })(window);
@@ -1,4 +1,4 @@
1
1
  /*
2
2
  New BSD License <http://creativecommons.org/licenses/BSD/>
3
3
  */
4
- (function(c){var b=c.History=c.History||{},d=c.jQuery;if(typeof b.Adapter!=="undefined")throw Error("History.js Adapter has already been loaded...");b.Adapter={bind:function(a,e,f){d(a).bind(e,f)},trigger:function(a,e){d(a).trigger(e)},onDomLoad:function(a){d(a)}};typeof b.init!=="undefined"&&b.init()})(window);
4
+ (function(b){var a=b.History=b.History||{},c=b.jQuery;if(typeof a.Adapter!=="undefined")throw Error("History.js Adapter has already been loaded...");a.Adapter={bind:function(d,a,b){c(d).bind(a,b)},trigger:function(a,b){c(a).trigger(b)},onDomLoad:function(a){c(a)}};typeof a.init!=="undefined"&&a.init()})(window);
@@ -6,592 +6,601 @@
6
6
  * @license New BSD License <http://creativecommons.org/licenses/BSD/>
7
7
  */
8
8
 
9
- (function(window,undefined){
10
- "use strict";
11
-
12
- // --------------------------------------------------------------------------
13
- // Initialise
14
-
15
- // Localise Globals
16
- var
17
- document = window.document, // Make sure we are using the correct document
18
- History = window.History = window.History||{}; // Public History Object
19
-
20
- // Check Existence
21
- if ( typeof History.initHtml4 !== 'undefined' ) {
22
- throw new Error('History.js HTML4 Support has already been loaded...');
23
- }
24
-
25
- // --------------------------------------------------------------------------
26
- // Initialise HTML4 Support
27
-
28
- // Initialise HTML4 Support
29
- History.initHtml4 = function(){
30
- // Initialise
31
- if ( typeof History.initHtml4.initialized !== 'undefined' ) {
32
- // Already Loaded
33
- return false;
34
- }
35
- else {
36
- History.initHtml4.initialized = true;
37
- }
38
-
39
- // ----------------------------------------------------------------------
40
- // Hash Storage
41
-
42
- /**
43
- * History.savedHashes
44
- * Store the hashes in an array
45
- */
46
- History.savedHashes = [];
47
-
48
- /**
49
- * History.isLastHash(newHash)
50
- * Checks if the hash is the last hash
51
- * @param {string} newHash
52
- * @return {boolean} true
53
- */
54
- History.isLastHash = function(newHash){
55
- // Prepare
56
- var oldHash = History.getHashByIndex();
57
-
58
- // Check
59
- var isLast = newHash === oldHash;
60
-
61
- // Return isLast
62
- return isLast;
63
- };
64
-
65
- /**
66
- * History.saveHash(newHash)
67
- * Push a Hash
68
- * @param {string} newHash
69
- * @return {boolean} true
70
- */
71
- History.saveHash = function(newHash){
72
- // Check Hash
73
- if ( History.isLastHash(newHash) ) {
74
- return false;
75
- }
76
-
77
- // Push the Hash
78
- History.savedHashes.push(newHash);
79
-
80
- // Return true
81
- return true;
82
- };
83
-
84
- /**
85
- * History.getHashByIndex()
86
- * Gets a hash by the index
87
- * @param {integer} index
88
- * @return {string}
89
- */
90
- History.getHashByIndex = function(index){
91
- // Prepare
92
- var hash = null;
93
-
94
- // Handle
95
- if ( typeof index === 'undefined' ) {
96
- // Get the last inserted
97
- hash = History.savedHashes[History.savedHashes.length-1];
98
- }
99
- else if ( index < 0 ) {
100
- // Get from the end
101
- hash = History.savedHashes[History.savedHashes.length+index];
102
- }
103
- else {
104
- // Get from the beginning
105
- hash = History.savedHashes[index];
106
- }
107
-
108
- // Return hash
109
- return hash;
110
- };
111
-
112
- // ----------------------------------------------------------------------
113
- // Discarded States
114
-
115
- /**
116
- * History.discardedHashes
117
- * A hashed array of discarded hashes
118
- */
119
- History.discardedHashes = {};
120
-
121
- /**
122
- * History.discardedStates
123
- * A hashed array of discarded states
124
- */
125
- History.discardedStates = {};
126
-
127
- /**
128
- * History.discardState(State)
129
- * Discards the state by ignoring it through History
130
- * @param {object} State
131
- * @return {true}
132
- */
133
- History.discardState = function(discardedState,forwardState,backState){
134
- //History.debug('History.discardState', arguments);
135
- // Prepare
136
- var discardedStateHash = History.getHashByState(discardedState);
137
-
138
- // Create Discard Object
139
- var discardObject = {
140
- 'discardedState': discardedState,
141
- 'backState': backState,
142
- 'forwardState': forwardState
143
- };
144
-
145
- // Add to DiscardedStates
146
- History.discardedStates[discardedStateHash] = discardObject;
147
-
148
- // Return true
149
- return true;
150
- };
151
-
152
- /**
153
- * History.discardHash(hash)
154
- * Discards the hash by ignoring it through History
155
- * @param {string} hash
156
- * @return {true}
157
- */
158
- History.discardHash = function(discardedHash,forwardState,backState){
159
- //History.debug('History.discardState', arguments);
160
- // Create Discard Object
161
- var discardObject = {
162
- 'discardedHash': discardedHash,
163
- 'backState': backState,
164
- 'forwardState': forwardState
165
- };
166
-
167
- // Add to discardedHash
168
- History.discardedHashes[discardedHash] = discardObject;
169
-
170
- // Return true
171
- return true;
172
- };
173
-
174
- /**
175
- * History.discardState(State)
176
- * Checks to see if the state is discarded
177
- * @param {object} State
178
- * @return {bool}
179
- */
180
- History.discardedState = function(State){
181
- // Prepare
182
- var StateHash = History.getHashByState(State);
183
-
184
- // Check
185
- var discarded = History.discardedStates[StateHash]||false;
186
-
187
- // Return true
188
- return discarded;
189
- };
190
-
191
- /**
192
- * History.discardedHash(hash)
193
- * Checks to see if the state is discarded
194
- * @param {string} State
195
- * @return {bool}
196
- */
197
- History.discardedHash = function(hash){
198
- // Check
199
- var discarded = History.discardedHashes[hash]||false;
200
-
201
- // Return true
202
- return discarded;
203
- };
204
-
205
- /**
206
- * History.recycleState(State)
207
- * Allows a discarded state to be used again
208
- * @param {object} data
209
- * @param {string} title
210
- * @param {string} url
211
- * @return {true}
212
- */
213
- History.recycleState = function(State){
214
- //History.debug('History.recycleState', arguments);
215
- // Prepare
216
- var StateHash = History.getHashByState(State);
217
-
218
- // Remove from DiscardedStates
219
- if ( History.discardedState(State) ) {
220
- delete History.discardedStates[StateHash];
221
- }
222
-
223
- // Return true
224
- return true;
225
- };
226
-
227
- // ----------------------------------------------------------------------
228
- // HTML4 HashChange Support
229
-
230
- if ( History.emulated.hashChange ) {
231
- /*
232
- * We must emulate the HTML4 HashChange Support by manually checking for hash changes
233
- */
234
-
235
- /**
236
- * History.hashChangeInit()
237
- * Init the HashChange Emulation
238
- */
239
- History.hashChangeInit = function(){
240
- // Define our Checker Function
241
- History.checkerFunction = null;
242
-
243
- // Define some variables that will help in our checker function
244
- var
245
- lastDocumentHash = '';
246
-
247
- // Handle depending on the browser
248
- if ( History.isInternetExplorer() ) {
249
- // IE6 and IE7
250
- // We need to use an iframe to emulate the back and forward buttons
251
-
252
- // Create iFrame
253
- var
254
- iframeId = 'historyjs-iframe',
255
- iframe = document.createElement('iframe');
256
-
257
- // Adjust iFarme
258
- iframe.setAttribute('id', iframeId);
259
- iframe.style.display = 'none';
260
-
261
- // Append iFrame
262
- document.body.appendChild(iframe);
263
-
264
- // Create initial history entry
265
- iframe.contentWindow.document.open();
266
- iframe.contentWindow.document.close();
267
-
268
- // Define some variables that will help in our checker function
269
- var
270
- lastIframeHash = '',
271
- checkerRunning = false;
272
-
273
- // Define the checker function
274
- History.checkerFunction = function(){
275
- // Check Running
276
- if ( checkerRunning ) {
277
- return false;
278
- }
279
-
280
- // Update Running
281
- checkerRunning = true;
282
-
283
- // Fetch
284
- var
285
- documentHash = History.getHash()||'',
286
- iframeHash = History.unescapeHash(iframe.contentWindow.document.location.hash)||'';
287
-
288
- // The Document Hash has changed (application caused)
289
- if ( documentHash !== lastDocumentHash ) {
290
- // Equalise
291
- lastDocumentHash = documentHash;
292
-
293
- // Create a history entry in the iframe
294
- if ( iframeHash !== documentHash ) {
295
- //History.debug('hashchange.checker: iframe hash change', 'documentHash (new):', documentHash, 'iframeHash (old):', iframeHash);
296
-
297
- // Equalise
298
- lastIframeHash = iframeHash = documentHash;
299
-
300
- // Create History Entry
301
- iframe.contentWindow.document.open();
302
- iframe.contentWindow.document.close();
303
-
304
- // Update the iframe's hash
305
- iframe.contentWindow.document.location.hash = History.escapeHash(documentHash);
306
- }
307
-
308
- // Trigger Hashchange Event
309
- History.Adapter.trigger(window,'hashchange');
310
- }
311
-
312
- // The iFrame Hash has changed (back button caused)
313
- else if ( iframeHash !== lastIframeHash ) {
314
- //History.debug('hashchange.checker: iframe hash out of sync', 'iframeHash (new):', iframeHash, 'documentHash (old):', documentHash);
315
-
316
- // Equalise
317
- lastIframeHash = iframeHash;
318
-
319
- // Update the Hash
320
- History.setHash(iframeHash,false);
321
- }
322
-
323
- // Reset Running
324
- checkerRunning = false;
325
-
326
- // Return true
327
- return true;
328
- };
329
- }
330
- else {
331
- // We are not IE
332
- // Firefox 1 or 2, Opera
333
-
334
- // Define the checker function
335
- History.checkerFunction = function(){
336
- // Prepare
337
- var documentHash = History.getHash();
338
-
339
- // The Document Hash has changed (application caused)
340
- if ( documentHash !== lastDocumentHash ) {
341
- // Equalise
342
- lastDocumentHash = documentHash;
343
-
344
- // Trigger Hashchange Event
345
- History.Adapter.trigger(window,'hashchange');
346
- }
347
-
348
- // Return true
349
- return true;
350
- };
351
- }
352
-
353
- // Apply the checker function
354
- setInterval(History.checkerFunction, History.options.hashChangeInterval);
355
-
356
- // Done
357
- return true;
358
- }; // History.hashChangeInit
359
-
360
- // Bind hashChangeInit
361
- History.Adapter.onDomLoad(History.hashChangeInit);
362
-
363
- } // History.emulated.hashChange
364
-
365
-
366
- // ----------------------------------------------------------------------
367
- // HTML5 State Support
368
-
369
- if ( History.emulated.pushState ) {
370
- /*
371
- * We must emulate the HTML5 State Management by using HTML4 HashChange
372
- */
373
-
374
- /**
375
- * History.onHashChange(event)
376
- * Trigger HTML5's window.onpopstate via HTML4 HashChange Support
377
- */
378
- History.onHashChange = function(event){
379
- //History.debug('History.onHashChange', arguments);
380
-
381
- // Prepare
382
- var
383
- currentUrl = ((event && event.newURL) || document.location.href),
384
- currentHash = History.getHashByUrl(currentUrl),
385
- currentState = null,
386
- currentStateHash = null,
387
- currentStateHashExits = null;
388
-
389
- // Check if we are the same state
390
- if ( History.isLastHash(currentHash) ) {
391
- // There has been no change (just the page's hash has finally propagated)
392
- //History.debug('History.onHashChange: no change');
393
- History.busy(false);
394
- return false;
395
- }
396
-
397
- // Reset the double check
398
- History.doubleCheckComplete();
399
-
400
- // Store our location for use in detecting back/forward direction
401
- History.saveHash(currentHash);
402
-
403
- // Expand Hash
404
- currentState = History.extractState(currentHash||document.location.href);
405
- if ( !currentState ) {
406
- //History.debug('History.onHashChange: traditional anchor', currentHash);
407
- // Traditional Anchor Hash
408
- History.Adapter.trigger(window,'anchorchange');
409
- History.busy(false);
410
- return false;
411
- }
412
-
413
- // Check if we are the same state
414
- if ( History.isLastSavedState(currentState) ) {
415
- //History.debug('History.onHashChange: no change');
416
- // There has been no change (just the page's hash has finally propagated)
417
- History.busy(false);
418
- return false;
419
- }
420
-
421
- // Create the state Hash
422
- currentStateHash = History.getHashByState(currentState);
423
-
424
- // Check if we are DiscardedState
425
- var discardObject = History.discardedState(currentState);
426
- if ( discardObject ) {
427
- // Ignore this state as it has been discarded and go back to the state before it
428
- if ( History.getHashByIndex(-2) === History.getHashByState(discardObject.forwardState) ) {
429
- // We are going backwards
430
- //History.debug('History.onHashChange: go backwards');
431
- History.back(false);
432
- } else {
433
- // We are going forwards
434
- //History.debug('History.onHashChange: go forwards');
435
- History.forward(false);
436
- }
437
- History.busy(false);
438
- return false;
439
- }
440
-
441
- // Push the new HTML5 State
442
- //History.debug('History.onHashChange: success hashchange');
443
- History.pushState(currentState.data,currentState.title,currentState.url,false);
444
-
445
- // End onHashChange closure
446
- return true;
447
- };
448
- History.Adapter.bind(window,'hashchange',History.onHashChange);
449
-
450
- /**
451
- * History.pushState(data,title,url)
452
- * Add a new State to the history object, become it, and trigger onpopstate
453
- * We have to trigger for HTML4 compatibility
454
- * @param {object} data
455
- * @param {string} title
456
- * @param {string} url
457
- * @return {true}
458
- */
459
- History.pushState = function(data,title,url,queue){
460
- //History.debug('History.pushState: called', arguments);
461
-
462
- // Check the State
463
- if ( History.getHashByUrl(url) ) {
464
- throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
465
- }
466
-
467
- // Handle Queueing
468
- if ( queue !== false && History.busy() ) {
469
- // Wait + Push to Queue
470
- //History.debug('History.pushState: we must wait', arguments);
471
- History.pushQueue({
472
- scope: History,
473
- callback: History.pushState,
474
- args: arguments,
475
- queue: queue
476
- });
477
- return false;
478
- }
479
-
480
- // Make Busy
481
- History.busy(true);
482
-
483
- // Fetch the State Object
484
- var
485
- newState = History.createStateObject(data,title,url),
486
- newStateHash = History.getHashByState(newState),
487
- oldState = History.getState(false),
488
- oldStateHash = History.getHashByState(oldState),
489
- html4Hash = History.getHash();
490
-
491
- // Store the newState
492
- History.storeState(newState);
493
- History.expectedStateId = newState.id;
494
-
495
- // Recycle the State
496
- History.recycleState(newState);
497
-
498
- // Force update of the title
499
- History.setTitle(newState);
500
-
501
- // Check if we are the same State
502
- if ( newStateHash === oldStateHash ) {
503
- //History.debug('History.pushState: no change', newStateHash);
504
- History.busy(false);
505
- return false;
506
- }
507
-
508
- // Update HTML4 Hash
509
- if ( newStateHash !== html4Hash && newStateHash !== History.getShortUrl(document.location.href) ) {
510
- //History.debug('History.pushState: update hash', newStateHash, html4Hash);
511
- History.setHash(newStateHash,false);
512
- return false;
513
- }
514
-
515
- // Update HTML5 State
516
- History.saveState(newState);
517
-
518
- // Fire HTML5 Event
519
- //History.debug('History.pushState: trigger popstate');
520
- History.Adapter.trigger(window,'statechange');
521
- History.busy(false);
522
-
523
- // End pushState closure
524
- return true;
525
- };
526
-
527
- /**
528
- * History.replaceState(data,title,url)
529
- * Replace the State and trigger onpopstate
530
- * We have to trigger for HTML4 compatibility
531
- * @param {object} data
532
- * @param {string} title
533
- * @param {string} url
534
- * @return {true}
535
- */
536
- History.replaceState = function(data,title,url,queue){
537
- //History.debug('History.replaceState: called', arguments);
538
-
539
- // Check the State
540
- if ( History.getHashByUrl(url) ) {
541
- throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
542
- }
543
-
544
- // Handle Queueing
545
- if ( queue !== false && History.busy() ) {
546
- // Wait + Push to Queue
547
- //History.debug('History.replaceState: we must wait', arguments);
548
- History.pushQueue({
549
- scope: History,
550
- callback: History.replaceState,
551
- args: arguments,
552
- queue: queue
553
- });
554
- return false;
555
- }
556
-
557
- // Make Busy
558
- History.busy(true);
559
-
560
- // Fetch the State Objects
561
- var
562
- newState = History.createStateObject(data,title,url),
563
- oldState = History.getState(false),
564
- previousState = History.getStateByIndex(-2);
565
-
566
- // Discard Old State
567
- History.discardState(oldState,newState,previousState);
568
-
569
- // Alias to PushState
570
- History.pushState(newState.data,newState.title,newState.url,false);
571
-
572
- // End replaceState closure
573
- return true;
574
- };
575
-
576
- /**
577
- * Create the initial State
578
- */
579
- History.saveState(History.storeState(History.createStateObject({},'',document.location.href)));
580
-
581
- /**
582
- * Ensure initial state is handled correctly
583
- */
584
- if ( History.getHash() && !History.emulated.hashChange ) {
585
- History.Adapter.onDomLoad(function(){
586
- History.Adapter.trigger(window,'hashchange');
587
- });
588
- }
589
-
590
- } // History.emulated.pushState
591
-
592
- }; // History.initHtml4
593
-
594
- // Try and Initialise History
595
- History.init();
9
+ (function(window, undefined) {
10
+ "use strict";
11
+
12
+ // --------------------------------------------------------------------------
13
+ // Initialise
14
+
15
+ // Localise Globals
16
+ var
17
+ document = window.document, // Make sure we are using the correct document
18
+ setTimeout = window.setTimeout || setTimeout,
19
+ clearTimeout = window.clearTimeout || clearTimeout,
20
+ setInterval = window.setInterval || setInterval,
21
+ History = window.History = window.History || {}; // Public History Object
22
+
23
+ // Check Existence
24
+ if (typeof History.initHtml4 !== 'undefined') {
25
+ throw new Error('History.js HTML4 Support has already been loaded...');
26
+ }
27
+
28
+ // --------------------------------------------------------------------------
29
+ // Initialise HTML4 Support
30
+
31
+ // Initialise HTML4 Support
32
+ History.initHtml4 = function() {
33
+ // Initialise
34
+ if (typeof History.initHtml4.initialized !== 'undefined') {
35
+ // Already Loaded
36
+ return false;
37
+ }
38
+ else {
39
+ History.initHtml4.initialized = true;
40
+ }
41
+
42
+ // ----------------------------------------------------------------------
43
+ // Properties
44
+
45
+ /**
46
+ * History.enabled
47
+ * Is History enabled?
48
+ */
49
+ History.enabled = true;
50
+
51
+
52
+ // ----------------------------------------------------------------------
53
+ // Hash Storage
54
+
55
+ /**
56
+ * History.savedHashes
57
+ * Store the hashes in an array
58
+ */
59
+ History.savedHashes = [];
60
+
61
+ /**
62
+ * History.isLastHash(newHash)
63
+ * Checks if the hash is the last hash
64
+ * @param {string} newHash
65
+ * @return {boolean} true
66
+ */
67
+ History.isLastHash = function(newHash) {
68
+ // Prepare
69
+ var oldHash = History.getHashByIndex();
70
+
71
+ // Check
72
+ var isLast = newHash === oldHash;
73
+
74
+ // Return isLast
75
+ return isLast;
76
+ };
77
+
78
+ /**
79
+ * History.saveHash(newHash)
80
+ * Push a Hash
81
+ * @param {string} newHash
82
+ * @return {boolean} true
83
+ */
84
+ History.saveHash = function(newHash) {
85
+ // Check Hash
86
+ if (History.isLastHash(newHash)) {
87
+ return false;
88
+ }
89
+
90
+ // Push the Hash
91
+ History.savedHashes.push(newHash);
92
+
93
+ // Return true
94
+ return true;
95
+ };
96
+
97
+ /**
98
+ * History.getHashByIndex()
99
+ * Gets a hash by the index
100
+ * @param {integer} index
101
+ * @return {string}
102
+ */
103
+ History.getHashByIndex = function(index) {
104
+ // Prepare
105
+ var hash = null;
106
+
107
+ // Handle
108
+ if (typeof index === 'undefined') {
109
+ // Get the last inserted
110
+ hash = History.savedHashes[History.savedHashes.length - 1];
111
+ }
112
+ else if (index < 0) {
113
+ // Get from the end
114
+ hash = History.savedHashes[History.savedHashes.length + index];
115
+ }
116
+ else {
117
+ // Get from the beginning
118
+ hash = History.savedHashes[index];
119
+ }
120
+
121
+ // Return hash
122
+ return hash;
123
+ };
124
+
125
+ // ----------------------------------------------------------------------
126
+ // Discarded States
127
+
128
+ /**
129
+ * History.discardedHashes
130
+ * A hashed array of discarded hashes
131
+ */
132
+ History.discardedHashes = {};
133
+
134
+ /**
135
+ * History.discardedStates
136
+ * A hashed array of discarded states
137
+ */
138
+ History.discardedStates = {};
139
+
140
+ /**
141
+ * History.discardState(State)
142
+ * Discards the state by ignoring it through History
143
+ * @param {object} State
144
+ * @return {true}
145
+ */
146
+ History.discardState = function(discardedState, forwardState, backState) {
147
+ //History.debug('History.discardState', arguments);
148
+ // Prepare
149
+ var discardedStateHash = History.getHashByState(discardedState);
150
+
151
+ // Create Discard Object
152
+ var discardObject = {
153
+ 'discardedState': discardedState,
154
+ 'backState': backState,
155
+ 'forwardState': forwardState
156
+ };
157
+
158
+ // Add to DiscardedStates
159
+ History.discardedStates[discardedStateHash] = discardObject;
160
+
161
+ // Return true
162
+ return true;
163
+ };
164
+
165
+ /**
166
+ * History.discardHash(hash)
167
+ * Discards the hash by ignoring it through History
168
+ * @param {string} hash
169
+ * @return {true}
170
+ */
171
+ History.discardHash = function(discardedHash, forwardState, backState) {
172
+ //History.debug('History.discardState', arguments);
173
+ // Create Discard Object
174
+ var discardObject = {
175
+ 'discardedHash': discardedHash,
176
+ 'backState': backState,
177
+ 'forwardState': forwardState
178
+ };
179
+
180
+ // Add to discardedHash
181
+ History.discardedHashes[discardedHash] = discardObject;
182
+
183
+ // Return true
184
+ return true;
185
+ };
186
+
187
+ /**
188
+ * History.discardState(State)
189
+ * Checks to see if the state is discarded
190
+ * @param {object} State
191
+ * @return {bool}
192
+ */
193
+ History.discardedState = function(State) {
194
+ // Prepare
195
+ var StateHash = History.getHashByState(State);
196
+
197
+ // Check
198
+ var discarded = History.discardedStates[StateHash] || false;
199
+
200
+ // Return true
201
+ return discarded;
202
+ };
203
+
204
+ /**
205
+ * History.discardedHash(hash)
206
+ * Checks to see if the state is discarded
207
+ * @param {string} State
208
+ * @return {bool}
209
+ */
210
+ History.discardedHash = function(hash) {
211
+ // Check
212
+ var discarded = History.discardedHashes[hash] || false;
213
+
214
+ // Return true
215
+ return discarded;
216
+ };
217
+
218
+ /**
219
+ * History.recycleState(State)
220
+ * Allows a discarded state to be used again
221
+ * @param {object} data
222
+ * @param {string} title
223
+ * @param {string} url
224
+ * @return {true}
225
+ */
226
+ History.recycleState = function(State) {
227
+ //History.debug('History.recycleState', arguments);
228
+ // Prepare
229
+ var StateHash = History.getHashByState(State);
230
+
231
+ // Remove from DiscardedStates
232
+ if (History.discardedState(State)) {
233
+ delete History.discardedStates[StateHash];
234
+ }
235
+
236
+ // Return true
237
+ return true;
238
+ };
239
+
240
+ // ----------------------------------------------------------------------
241
+ // HTML4 HashChange Support
242
+
243
+ if (History.emulated.hashChange) {
244
+ /*
245
+ * We must emulate the HTML4 HashChange Support by manually checking for hash changes
246
+ */
247
+
248
+ /**
249
+ * History.hashChangeInit()
250
+ * Init the HashChange Emulation
251
+ */
252
+ History.hashChangeInit = function() {
253
+ // Define our Checker Function
254
+ History.checkerFunction = null;
255
+
256
+ // Define some variables that will help in our checker function
257
+ var
258
+ lastDocumentHash = '';
259
+
260
+ // Handle depending on the browser
261
+ if (History.isInternetExplorer()) {
262
+ // IE6 and IE7
263
+ // We need to use an iframe to emulate the back and forward buttons
264
+
265
+ // Create iFrame
266
+ var
267
+ iframeId = 'historyjs-iframe',
268
+ iframe = document.createElement('iframe');
269
+
270
+ // Adjust iFarme
271
+ iframe.setAttribute('id', iframeId);
272
+ iframe.style.display = 'none';
273
+
274
+ // Append iFrame
275
+ document.body.appendChild(iframe);
276
+
277
+ // Create initial history entry
278
+ iframe.contentWindow.document.open();
279
+ iframe.contentWindow.document.close();
280
+
281
+ // Define some variables that will help in our checker function
282
+ var
283
+ lastIframeHash = '',
284
+ checkerRunning = false;
285
+
286
+ // Define the checker function
287
+ History.checkerFunction = function() {
288
+ // Check Running
289
+ if (checkerRunning) {
290
+ return false;
291
+ }
292
+
293
+ // Update Running
294
+ checkerRunning = true;
295
+
296
+ // Fetch
297
+ var
298
+ documentHash = History.getHash() || '',
299
+ iframeHash = History.unescapeHash(iframe.contentWindow.document.location.hash) || '';
300
+
301
+ // The Document Hash has changed (application caused)
302
+ if (documentHash !== lastDocumentHash) {
303
+ // Equalise
304
+ lastDocumentHash = documentHash;
305
+
306
+ // Create a history entry in the iframe
307
+ if (iframeHash !== documentHash) {
308
+ //History.debug('hashchange.checker: iframe hash change', 'documentHash (new):', documentHash, 'iframeHash (old):', iframeHash);
309
+
310
+ // Equalise
311
+ lastIframeHash = iframeHash = documentHash;
312
+
313
+ // Create History Entry
314
+ iframe.contentWindow.document.open();
315
+ iframe.contentWindow.document.close();
316
+
317
+ // Update the iframe's hash
318
+ iframe.contentWindow.document.location.hash = History.escapeHash(documentHash);
319
+ }
320
+
321
+ // Trigger Hashchange Event
322
+ History.Adapter.trigger(window, 'hashchange');
323
+ }
324
+
325
+ // The iFrame Hash has changed (back button caused)
326
+ else if (iframeHash !== lastIframeHash) {
327
+ //History.debug('hashchange.checker: iframe hash out of sync', 'iframeHash (new):', iframeHash, 'documentHash (old):', documentHash);
328
+
329
+ // Equalise
330
+ lastIframeHash = iframeHash;
331
+
332
+ // Update the Hash
333
+ History.setHash(iframeHash, false);
334
+ }
335
+
336
+ // Reset Running
337
+ checkerRunning = false;
338
+
339
+ // Return true
340
+ return true;
341
+ };
342
+ }
343
+ else {
344
+ // We are not IE
345
+ // Firefox 1 or 2, Opera
346
+
347
+ // Define the checker function
348
+ History.checkerFunction = function() {
349
+ // Prepare
350
+ var documentHash = History.getHash();
351
+
352
+ // The Document Hash has changed (application caused)
353
+ if (documentHash !== lastDocumentHash) {
354
+ // Equalise
355
+ lastDocumentHash = documentHash;
356
+
357
+ // Trigger Hashchange Event
358
+ History.Adapter.trigger(window, 'hashchange');
359
+ }
360
+
361
+ // Return true
362
+ return true;
363
+ };
364
+ }
365
+
366
+ // Apply the checker function
367
+ setInterval(History.checkerFunction, History.options.hashChangeInterval);
368
+
369
+ // Done
370
+ return true;
371
+ }; // History.hashChangeInit
372
+
373
+ // Bind hashChangeInit
374
+ History.Adapter.onDomLoad(History.hashChangeInit);
375
+
376
+ } // History.emulated.hashChange
377
+
378
+
379
+ // ----------------------------------------------------------------------
380
+ // HTML5 State Support
381
+
382
+ if (History.emulated.pushState) {
383
+ /*
384
+ * We must emulate the HTML5 State Management by using HTML4 HashChange
385
+ */
386
+
387
+ /**
388
+ * History.onHashChange(event)
389
+ * Trigger HTML5's window.onpopstate via HTML4 HashChange Support
390
+ */
391
+ History.onHashChange = function(event) {
392
+ //History.debug('History.onHashChange', arguments);
393
+
394
+ // Prepare
395
+ var
396
+ currentUrl = ((event && event.newURL) || document.location.href),
397
+ currentHash = History.getHashByUrl(currentUrl),
398
+ currentState = null,
399
+ currentStateHash = null,
400
+ currentStateHashExits = null;
401
+
402
+ // Check if we are the same state
403
+ if (History.isLastHash(currentHash)) {
404
+ // There has been no change (just the page's hash has finally propagated)
405
+ //History.debug('History.onHashChange: no change');
406
+ History.busy(false);
407
+ return false;
408
+ }
409
+
410
+ // Reset the double check
411
+ History.doubleCheckComplete();
412
+
413
+ // Store our location for use in detecting back/forward direction
414
+ History.saveHash(currentHash);
415
+
416
+ // Expand Hash
417
+ if (currentHash && History.isTraditionalAnchor(currentHash)) {
418
+ //History.debug('History.onHashChange: traditional anchor', currentHash);
419
+ // Traditional Anchor Hash
420
+ History.Adapter.trigger(window, 'anchorchange');
421
+ History.busy(false);
422
+ return false;
423
+ }
424
+
425
+ // Create State
426
+ currentState = History.extractState(History.getFullUrl(currentHash || document.location.href, false), true);
427
+
428
+ // Check if we are the same state
429
+ if (History.isLastSavedState(currentState)) {
430
+ //History.debug('History.onHashChange: no change');
431
+ // There has been no change (just the page's hash has finally propagated)
432
+ History.busy(false);
433
+ return false;
434
+ }
435
+
436
+ // Create the state Hash
437
+ currentStateHash = History.getHashByState(currentState);
438
+
439
+ // Check if we are DiscardedState
440
+ var discardObject = History.discardedState(currentState);
441
+ if (discardObject) {
442
+ // Ignore this state as it has been discarded and go back to the state before it
443
+ if (History.getHashByIndex(-2) === History.getHashByState(discardObject.forwardState)) {
444
+ // We are going backwards
445
+ //History.debug('History.onHashChange: go backwards');
446
+ History.back(false);
447
+ } else {
448
+ // We are going forwards
449
+ //History.debug('History.onHashChange: go forwards');
450
+ History.forward(false);
451
+ }
452
+ return false;
453
+ }
454
+
455
+ // Push the new HTML5 State
456
+ //History.debug('History.onHashChange: success hashchange');
457
+ History.pushState(currentState.data, currentState.title, currentState.url, false);
458
+
459
+ // End onHashChange closure
460
+ return true;
461
+ };
462
+ History.Adapter.bind(window, 'hashchange', History.onHashChange);
463
+
464
+ /**
465
+ * History.pushState(data,title,url)
466
+ * Add a new State to the history object, become it, and trigger onpopstate
467
+ * We have to trigger for HTML4 compatibility
468
+ * @param {object} data
469
+ * @param {string} title
470
+ * @param {string} url
471
+ * @return {true}
472
+ */
473
+ History.pushState = function(data, title, url, queue) {
474
+ //History.debug('History.pushState: called', arguments);
475
+
476
+ // Check the State
477
+ if (History.getHashByUrl(url)) {
478
+ throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
479
+ }
480
+
481
+ // Handle Queueing
482
+ if (queue !== false && History.busy()) {
483
+ // Wait + Push to Queue
484
+ //History.debug('History.pushState: we must wait', arguments);
485
+ History.pushQueue({
486
+ scope: History,
487
+ callback: History.pushState,
488
+ args: arguments,
489
+ queue: queue
490
+ });
491
+ return false;
492
+ }
493
+
494
+ // Make Busy
495
+ History.busy(true);
496
+
497
+ // Fetch the State Object
498
+ var
499
+ newState = History.createStateObject(data, title, url),
500
+ newStateHash = History.getHashByState(newState),
501
+ oldState = History.getState(false),
502
+ oldStateHash = History.getHashByState(oldState),
503
+ html4Hash = History.getHash();
504
+
505
+ // Store the newState
506
+ History.storeState(newState);
507
+ History.expectedStateId = newState.id;
508
+
509
+ // Recycle the State
510
+ History.recycleState(newState);
511
+
512
+ // Force update of the title
513
+ History.setTitle(newState);
514
+
515
+ // Check if we are the same State
516
+ if (newStateHash === oldStateHash) {
517
+ //History.debug('History.pushState: no change', newStateHash);
518
+ History.busy(false);
519
+ return false;
520
+ }
521
+
522
+ // Update HTML4 Hash
523
+ if (newStateHash !== html4Hash && newStateHash !== History.getShortUrl(document.location.href)) {
524
+ //History.debug('History.pushState: update hash', newStateHash, html4Hash);
525
+ History.setHash(newStateHash, false);
526
+ return false;
527
+ }
528
+
529
+ // Update HTML5 State
530
+ History.saveState(newState);
531
+
532
+ // Fire HTML5 Event
533
+ //History.debug('History.pushState: trigger popstate');
534
+ History.Adapter.trigger(window, 'statechange');
535
+ History.busy(false);
536
+
537
+ // End pushState closure
538
+ return true;
539
+ };
540
+
541
+ /**
542
+ * History.replaceState(data,title,url)
543
+ * Replace the State and trigger onpopstate
544
+ * We have to trigger for HTML4 compatibility
545
+ * @param {object} data
546
+ * @param {string} title
547
+ * @param {string} url
548
+ * @return {true}
549
+ */
550
+ History.replaceState = function(data, title, url, queue) {
551
+ //History.debug('History.replaceState: called', arguments);
552
+
553
+ // Check the State
554
+ if (History.getHashByUrl(url)) {
555
+ throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
556
+ }
557
+
558
+ // Handle Queueing
559
+ if (queue !== false && History.busy()) {
560
+ // Wait + Push to Queue
561
+ //History.debug('History.replaceState: we must wait', arguments);
562
+ History.pushQueue({
563
+ scope: History,
564
+ callback: History.replaceState,
565
+ args: arguments,
566
+ queue: queue
567
+ });
568
+ return false;
569
+ }
570
+
571
+ // Make Busy
572
+ History.busy(true);
573
+
574
+ // Fetch the State Objects
575
+ var
576
+ newState = History.createStateObject(data, title, url),
577
+ oldState = History.getState(false),
578
+ previousState = History.getStateByIndex(-2);
579
+
580
+ // Discard Old State
581
+ History.discardState(oldState, newState, previousState);
582
+
583
+ // Alias to PushState
584
+ History.pushState(newState.data, newState.title, newState.url, false);
585
+
586
+ // End replaceState closure
587
+ return true;
588
+ };
589
+
590
+ /**
591
+ * Ensure initial state is handled correctly
592
+ */
593
+ if (History.getHash() && !History.emulated.hashChange) {
594
+ History.Adapter.onDomLoad(function() {
595
+ History.Adapter.trigger(window, 'hashchange');
596
+ });
597
+ }
598
+
599
+ } // History.emulated.pushState
600
+
601
+ }; // History.initHtml4
602
+
603
+ // Try and Initialise History
604
+ History.init();
596
605
 
597
606
  })(window);