compass-jquery-plugin 0.3.2.5 → 0.3.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. data/README.md +16 -1
  2. data/VERSION.yml +2 -2
  3. data/lib/handle_js_files.rb +21 -0
  4. data/lib/jquery/gridify/grid_view.rb +2 -2
  5. data/lib/jquery/jquery_selector_assertions.rb +0 -36
  6. data/lib/jquery/tiny_mce.rb +5 -0
  7. data/templates/dynatree/jquery.dynatree.js +17 -24
  8. data/templates/dynatree/jquery.dynatree.min.js +10 -10
  9. data/templates/ical/jquery.ical.js +107 -25
  10. data/templates/ical/jquery.ical.min.js +182 -180
  11. data/templates/ical/jquery/ical.scss +2 -2
  12. data/templates/jqgrid/jquery.jqGrid.js +2498 -2072
  13. data/templates/jqgrid/jquery.jqGrid.min.js +447 -431
  14. data/templates/jqgrid/jquery/jqGrid.scss +11 -9
  15. data/templates/jquery/history.adapter.jquery.js +52 -52
  16. data/templates/jquery/history.html4.js +680 -680
  17. data/templates/jquery/history.js +1288 -1288
  18. data/templates/jquery/jquery.js +8168 -8143
  19. data/templates/jquery/jquery/ui/cowboy.scss +87 -0
  20. data/templates/jquery/jquery/ui/cowboy/cowboy_hat.png +0 -0
  21. data/templates/jquery/jquery/ui/cowboy/ui-anim_basic_16x16.gif +0 -0
  22. data/templates/jquery/jquery/ui/cowboy/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  23. data/templates/jquery/jquery/ui/cowboy/ui-bg_diagonals-thick_20_ff7f00_40x40.png +0 -0
  24. data/templates/jquery/jquery/ui/cowboy/ui-bg_flat_10_000000_40x100.png +0 -0
  25. data/templates/jquery/jquery/ui/cowboy/ui-bg_glass_100_fdebdc_1x400.png +0 -0
  26. data/templates/jquery/jquery/ui/cowboy/ui-bg_glass_100_ffd6af_1x400.png +0 -0
  27. data/templates/jquery/jquery/ui/cowboy/ui-bg_glass_65_eeeeee_1x400.png +0 -0
  28. data/templates/jquery/jquery/ui/cowboy/ui-bg_gloss-wave_35_ff7f00_500x100.png +0 -0
  29. data/templates/jquery/jquery/ui/cowboy/ui-bg_highlight-soft_100_dddddd_1x100.png +0 -0
  30. data/templates/jquery/jquery/ui/cowboy/ui-bg_highlight-soft_75_c4884f_1x100.png +0 -0
  31. data/templates/jquery/jquery/ui/cowboy/ui-icons_222222_256x240.png +0 -0
  32. data/templates/jquery/jquery/ui/cowboy/ui-icons_228ef1_256x240.png +0 -0
  33. data/templates/jquery/jquery/ui/cowboy/ui-icons_333333_256x240.png +0 -0
  34. data/templates/jquery/jquery/ui/cowboy/ui-icons_913d00_256x240.png +0 -0
  35. data/templates/jquery/jquery/ui/cowboy/ui-icons_ff7f00_256x240.png +0 -0
  36. data/templates/jquery/jquery/ui/cowboy/ui-icons_ffd27a_256x240.png +0 -0
  37. data/templates/jquery/jquery/ui/cowboy/ui-icons_ffffff_256x240.png +0 -0
  38. data/templates/jquery/json2.js +214 -214
  39. data/templates/jquery/manifest.rb +19 -0
  40. data/templates/mobile/jquery.mobile.js +149 -96
  41. data/templates/mobile/jquery.mobile.min.js +2 -2
  42. data/templates/secret_sauce/app/views/shared/_ui_grid_for_without_block.js.haml +1 -1
  43. data/templates/tiny_mce/config/initializers/tiny_mce.rb +3 -0
  44. data/templates/tiny_mce/manifest.rb +251 -0
  45. data/templates/tiny_mce/tiny_mce/jquery.tinymce.js +1 -0
  46. data/templates/tiny_mce/tiny_mce/langs/en.js +222 -0
  47. data/templates/tiny_mce/tiny_mce/license.txt +504 -0
  48. data/templates/tiny_mce/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  49. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  50. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  51. data/templates/tiny_mce/tiny_mce/plugins/advhr/js/rule.js +43 -0
  52. data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/en_dlg.js +7 -0
  53. data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +58 -0
  54. data/templates/tiny_mce/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  55. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  56. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  57. data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +235 -0
  58. data/templates/tiny_mce/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  59. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +445 -0
  60. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/en_dlg.js +45 -0
  61. data/templates/tiny_mce/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  62. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  63. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  64. data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +525 -0
  65. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +54 -0
  66. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +338 -0
  67. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  68. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +154 -0
  69. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  70. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -0
  71. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  72. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +431 -0
  73. data/templates/tiny_mce/tiny_mce/plugins/autosave/langs/en.js +4 -0
  74. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  75. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  76. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  77. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +154 -0
  78. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  79. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  80. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  81. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  82. data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +41 -0
  83. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  84. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  85. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  86. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  87. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  88. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  89. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  90. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  91. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  92. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  93. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  94. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  95. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  96. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  97. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  98. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  99. data/templates/tiny_mce/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  100. data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  101. data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +22 -0
  102. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin.js +1 -0
  103. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  104. data/templates/tiny_mce/tiny_mce/plugins/example/img/example.gif +0 -0
  105. data/templates/tiny_mce/tiny_mce/plugins/example/js/dialog.js +19 -0
  106. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en.js +3 -0
  107. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  108. data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
  109. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  110. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +166 -0
  111. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +571 -0
  112. data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +492 -0
  113. data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  114. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  115. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin_src.js +159 -0
  116. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
  117. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  118. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  119. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  120. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +696 -0
  121. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  122. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  123. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  124. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  125. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  126. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  127. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  128. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  129. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  130. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  131. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  132. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  133. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin_src.js +214 -0
  134. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  135. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  136. data/templates/tiny_mce/tiny_mce/plugins/media/css/media.css +17 -0
  137. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -0
  138. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +770 -0
  139. data/templates/tiny_mce/tiny_mce/plugins/media/js/embed.js +73 -0
  140. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +340 -0
  141. data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +109 -0
  142. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +812 -0
  143. data/templates/tiny_mce/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  144. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  145. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
  146. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  147. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +90 -0
  148. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  149. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  150. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  151. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +899 -0
  152. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  153. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  154. data/templates/tiny_mce/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  155. data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +27 -0
  156. data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +21 -0
  157. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  158. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  159. data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +28 -0
  160. data/templates/tiny_mce/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  161. data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +17 -0
  162. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin.js +1 -0
  163. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  164. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin.js +1 -0
  165. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  166. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  167. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  168. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin_src.js +61 -0
  169. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +140 -0
  170. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  171. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +100 -0
  172. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  173. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  174. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +415 -0
  175. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  176. data/templates/tiny_mce/tiny_mce/plugins/style/css/props.css +13 -0
  177. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin.js +1 -0
  178. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  179. data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +635 -0
  180. data/templates/tiny_mce/tiny_mce/plugins/style/langs/en_dlg.js +70 -0
  181. data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +838 -0
  182. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  183. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +114 -0
  184. data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +178 -0
  185. data/templates/tiny_mce/tiny_mce/plugins/table/css/cell.css +17 -0
  186. data/templates/tiny_mce/tiny_mce/plugins/table/css/row.css +25 -0
  187. data/templates/tiny_mce/tiny_mce/plugins/table/css/table.css +13 -0
  188. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -0
  189. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1183 -0
  190. data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +284 -0
  191. data/templates/tiny_mce/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  192. data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +232 -0
  193. data/templates/tiny_mce/tiny_mce/plugins/table/js/table.js +450 -0
  194. data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  195. data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +32 -0
  196. data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +157 -0
  197. data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +188 -0
  198. data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +12 -0
  199. data/templates/tiny_mce/tiny_mce/plugins/template/css/template.css +23 -0
  200. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin.js +1 -0
  201. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  202. data/templates/tiny_mce/tiny_mce/plugins/template/js/template.js +106 -0
  203. data/templates/tiny_mce/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  204. data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +31 -0
  205. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  206. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin_src.js +83 -0
  207. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  208. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +114 -0
  209. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
  210. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
  211. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
  212. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
  213. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  214. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  215. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
  216. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  217. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  218. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
  219. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  220. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  221. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +125 -0
  222. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  223. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
  224. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/element_common.js +229 -0
  225. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/ins.js +53 -0
  226. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  227. data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +52 -0
  228. data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +26 -0
  229. data/templates/tiny_mce/tiny_mce/themes/advanced/charmap.htm +51 -0
  230. data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +74 -0
  231. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -0
  232. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1328 -0
  233. data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +80 -0
  234. data/templates/tiny_mce/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  235. data/templates/tiny_mce/tiny_mce/themes/advanced/img/flash.gif +0 -0
  236. data/templates/tiny_mce/tiny_mce/themes/advanced/img/icons.gif +0 -0
  237. data/templates/tiny_mce/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  238. data/templates/tiny_mce/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  239. data/templates/tiny_mce/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  240. data/templates/tiny_mce/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  241. data/templates/tiny_mce/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  242. data/templates/tiny_mce/tiny_mce/themes/advanced/img/trans.gif +0 -0
  243. data/templates/tiny_mce/tiny_mce/themes/advanced/img/video.gif +0 -0
  244. data/templates/tiny_mce/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  245. data/templates/tiny_mce/tiny_mce/themes/advanced/js/about.js +73 -0
  246. data/templates/tiny_mce/tiny_mce/themes/advanced/js/anchor.js +42 -0
  247. data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +354 -0
  248. data/templates/tiny_mce/tiny_mce/themes/advanced/js/color_picker.js +329 -0
  249. data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +247 -0
  250. data/templates/tiny_mce/tiny_mce/themes/advanced/js/link.js +153 -0
  251. data/templates/tiny_mce/tiny_mce/themes/advanced/js/source_editor.js +56 -0
  252. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en.js +68 -0
  253. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +54 -0
  254. data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +57 -0
  255. data/templates/tiny_mce/tiny_mce/themes/advanced/shortcuts.htm +47 -0
  256. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +47 -0
  257. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
  258. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  259. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  260. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  261. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  262. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  263. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  264. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +213 -0
  265. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/content.css +23 -0
  266. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  267. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +101 -0
  268. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +46 -0
  269. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +116 -0
  270. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  271. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  272. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  273. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
  274. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  275. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  276. data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +25 -0
  277. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template.js +1 -0
  278. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template_src.js +84 -0
  279. data/templates/tiny_mce/tiny_mce/themes/simple/img/icons.gif +0 -0
  280. data/templates/tiny_mce/tiny_mce/themes/simple/langs/en.js +11 -0
  281. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/content.css +25 -0
  282. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  283. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  284. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  285. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  286. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -0
  287. data/templates/tiny_mce/tiny_mce/tiny_mce_popup.js +5 -0
  288. data/templates/tiny_mce/tiny_mce/utils/editable_selects.js +70 -0
  289. data/templates/tiny_mce/tiny_mce/utils/form_utils.js +207 -0
  290. data/templates/tiny_mce/tiny_mce/utils/mctabs.js +162 -0
  291. data/templates/tiny_mce/tiny_mce/utils/validate.js +252 -0
  292. metadata +273 -4
@@ -126,15 +126,17 @@ tr.ui-search-toolbar {
126
126
  table-layout: fixed;
127
127
  margin: 0em; }
128
128
  tr {
129
- &.jqgrow td {
130
- font-weight: normal;
131
- overflow: hidden;
132
- white-space: pre;
133
- height: 22px;
134
- padding: 0 2px 0 2px;
135
- border-bottom-width: 1px;
136
- border-bottom-color: inherit;
137
- border-bottom-style: solid; }
129
+ &.jqgrow {
130
+ outline-style: none;
131
+ td {
132
+ font-weight: normal;
133
+ overflow: hidden;
134
+ white-space: pre;
135
+ height: 22px;
136
+ padding: 0 2px 0 2px;
137
+ border-bottom-width: 1px;
138
+ border-bottom-color: inherit;
139
+ border-bottom-style: solid; } }
138
140
  &.jqgfirstrow td {
139
141
  padding: 0 2px 0 2px;
140
142
  border-right-width: 1px;
@@ -5,67 +5,67 @@
5
5
  * @license New BSD License - http://creativecommons.org/licenses/BSD/
6
6
  */
7
7
 
8
- (function($,window,undefined){
8
+ (function($, window, undefined) {
9
9
 
10
- // --------------------------------------------------------------------------
11
- // Initialise
10
+ // --------------------------------------------------------------------------
11
+ // Initialise
12
12
 
13
- // History Object
14
- window.History = window.History||{};
13
+ // History Object
14
+ window.History = window.History || {};
15
15
 
16
- // Localise Globals
17
- var
18
- History = window.History||{},
19
- history = window.history;
16
+ // Localise Globals
17
+ var
18
+ History = window.History || {},
19
+ history = window.history;
20
20
 
21
- // Check Existence of Adapter
22
- if ( typeof History.Adapter !== 'undefined' ) {
23
- throw new Error('History.js Adapter has already been loaded...');
24
- }
21
+ // Check Existence of Adapter
22
+ if (typeof History.Adapter !== 'undefined') {
23
+ throw new Error('History.js Adapter has already been loaded...');
24
+ }
25
25
 
26
- // Add the Adapter
27
- History.Adapter = {
26
+ // Add the Adapter
27
+ History.Adapter = {
28
28
 
29
- /**
30
- * History.Adapter.bind(el,event,callback)
31
- * @param {element} el
32
- * @param {string} event
33
- * @param {Function} callback
34
- * @return {element}
35
- */
36
- bind: function(el,event,callback){
37
- return $(el).bind(event,callback);
38
- },
29
+ /**
30
+ * History.Adapter.bind(el,event,callback)
31
+ * @param {element} el
32
+ * @param {string} event
33
+ * @param {Function} callback
34
+ * @return {element}
35
+ */
36
+ bind: function(el, event, callback) {
37
+ return $(el).bind(event, callback);
38
+ },
39
39
 
40
- /**
41
- * History.Adapter.trigger(el,event)
42
- * @param {element} el
43
- * @param {string} event
44
- * @return {element}
45
- */
46
- trigger: function(el,event){
47
- return $(el).trigger(event);
48
- },
40
+ /**
41
+ * History.Adapter.trigger(el,event)
42
+ * @param {element} el
43
+ * @param {string} event
44
+ * @return {element}
45
+ */
46
+ trigger: function(el, event) {
47
+ return $(el).trigger(event);
48
+ },
49
49
 
50
- /**
51
- * History.Adapter.trigger(el,event,data)
52
- * @param {Function} callback
53
- * @return {true}
54
- */
55
- onDomLoad: function(callback) {
56
- jQuery(callback);
57
- }
50
+ /**
51
+ * History.Adapter.trigger(el,event,data)
52
+ * @param {Function} callback
53
+ * @return {true}
54
+ */
55
+ onDomLoad: function(callback) {
56
+ jQuery(callback);
57
+ }
58
58
 
59
- };
59
+ };
60
60
 
61
- // Check Load Status of HTML5 Support
62
- if ( typeof History.initHtml5 !== 'undefined' ) {
63
- History.initHtml5();
64
- }
61
+ // Check Load Status of HTML5 Support
62
+ if (typeof History.initHtml5 !== 'undefined') {
63
+ History.initHtml5();
64
+ }
65
65
 
66
- // Check Load Status of HTML4 Support
67
- if ( typeof History.initHtml4 !== 'undefined' ) {
68
- History.initHtml4();
69
- }
66
+ // Check Load Status of HTML4 Support
67
+ if (typeof History.initHtml4 !== 'undefined') {
68
+ History.initHtml4();
69
+ }
70
70
 
71
- })(jQuery,window);
71
+ })(jQuery, window);
@@ -6,685 +6,685 @@
6
6
  * @license New BSD License <http://creativecommons.org/licenses/BSD/>
7
7
  */
8
8
 
9
- (function(window,undefined){
10
-
11
- // --------------------------------------------------------------------------
12
- // Initialise
13
-
14
- // History Object
15
- window.History = window.History||{};
16
- window._History = window._History||{};
17
-
18
- // Localise Globals
19
- var
20
- document = window.document, // Make sure we are using the correct document
21
- _History = window._History, // Private History Object
22
- History = window.History; // Public History Object
23
-
24
- // Check Existence of History.js
25
- if ( typeof History.initHtml4 !== 'undefined' ) {
26
- throw new Error('History.js HTML4 Support has already been loaded...');
27
- }
28
-
29
- // Initialise HTML4 Support
30
- History.initHtml4 = function(){
31
-
32
- // ----------------------------------------------------------------------
33
- // Check Status
34
-
35
- if ( typeof History.initHtml5 === 'undefined' || typeof History.Adapter === 'undefined' ) {
36
- return false;
37
- }
38
-
39
- // ----------------------------------------------------------------------
40
- // Emulated Status
41
-
42
- /**
43
- * _History.getInternetExplorerMajorVersion()
44
- * Get's the major version of Internet Explorer
45
- * @return {integer}
46
- * @license Public Domain
47
- * @author Benjamin Arthur Lupton <contact@balupton.com>
48
- * @author James Padolsey <https://gist.github.com/527683>
49
- */
50
- _History.getInternetExplorerMajorVersion = function(){
51
- var result = _History.getInternetExplorerMajorVersion.cached =
52
- (typeof _History.getInternetExplorerMajorVersion.cached !== 'undefined')
53
- ? _History.getInternetExplorerMajorVersion.cached
54
- : (function(){
55
- var undef,
56
- v = 3,
57
- div = document.createElement('div'),
58
- all = div.getElementsByTagName('i');
59
- while (
60
- div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
61
- all[0]
62
- );
63
- return v > 4 ? v : undef;
64
- })()
65
- ;
66
- return result;
67
- };
68
-
69
- /**
70
- * _History.isInternetExplorer()
71
- * Are we using Internet Explorer?
72
- * @return {boolean}
73
- * @license Public Domain
74
- * @author Benjamin Arthur Lupton <contact@balupton.com>
75
- */
76
- _History.isInternetExplorer = function(){
77
- var result = _History.isInternetExplorer.cached =
78
- (typeof _History.isInternetExplorer.cached !== 'undefined')
79
- ? _History.isInternetExplorer.cached
80
- : (_History.getInternetExplorerMajorVersion() !== 0)
81
- ;
82
- return result;
83
- };
84
-
85
- /**
86
- * History.emulated
87
- * Which features require emulating?
88
- */
89
- History.emulated.hashChange = Boolean(
90
- !('onhashchange' in window || 'onhashchange' in document)
91
- ||
92
- (_History.isInternetExplorer() && _History.getInternetExplorerMajorVersion() < 8)
93
- );
94
-
95
-
96
-
97
- // ----------------------------------------------------------------------
98
- // Hash Storage
99
-
100
- /**
101
- * _History.savedHashes
102
- * Store the hashes in an array
103
- */
104
- _History.savedHashes = [];
105
-
106
- /**
107
- * _History.isLastHash(newHash)
108
- * Checks if the hash is the last hash
109
- * @param {string} newHash
110
- * @return {boolean} true
111
- */
112
- _History.isLastHash = function(newHash){
113
- // Prepare
114
- var oldHash = _History.getHashByIndex();
115
-
116
- // Check
117
- var isLast = newHash === oldHash;
118
-
119
- // Return isLast
120
- return isLast;
121
- };
122
-
123
- /**
124
- * _History.saveHash(newHash)
125
- * Push a Hash
126
- * @param {string} newHash
127
- * @return {boolean} true
128
- */
129
- _History.saveHash = function(newHash){
130
- // Check Hash
131
- if ( _History.isLastHash(newHash) ) {
132
- return false;
133
- }
134
-
135
- // Push the Hash
136
- _History.savedHashes.push(newHash);
137
-
138
- // Return true
139
- return true;
140
- };
141
-
142
- /**
143
- * _History.getHashByIndex()
144
- * Gets a hash by the index
145
- * @param {integer} index
146
- * @return {string}
147
- */
148
- _History.getHashByIndex = function(index){
149
- // Prepare
150
- var hash = null;
151
-
152
- // Handle
153
- if ( typeof index === 'undefined' ) {
154
- // Get the last inserted
155
- hash = _History.savedHashes[_History.savedHashes.length-1];
156
- }
157
- else if ( index < 0 ) {
158
- // Get from the end
159
- hash = _History.savedHashes[_History.savedHashes.length+index];
160
- }
161
- else {
162
- // Get from the beginning
163
- hash = _History.savedHashes[index];
164
- }
165
-
166
- // Return hash
167
- return hash;
168
- };
169
-
170
- /**
171
- * _History.stateHashExists
172
- * Checks if the State Hash Exists
173
- * @param {string} stateHash
174
- * @return {boolean} exists
175
- */
176
- _History.stateHashExists = function(stateHash){
177
- // Prepare
178
- var exists = typeof _History.statesByHash[stateHash] !== 'undefined';
179
-
180
- // Return exists
181
- return exists;
182
- };
183
-
184
- // ----------------------------------------------------------------------
185
- // Discarded States
186
-
187
- /**
188
- * _History.discardedHashes
189
- * A hashed array of discarded hashes
190
- */
191
- _History.discardedHashes = {};
192
-
193
- /**
194
- * _History.discardedStates
195
- * A hashed array of discarded states
196
- */
197
- _History.discardedStates = {};
198
-
199
- /**
200
- * _History.discardState(State)
201
- * Discards the state by ignoring it through History
202
- * @param {object} State
203
- * @return {true}
204
- */
205
- _History.discardState = function(discardedState,forwardState,backState){
206
- History.debug('History.discardState',this,arguments);
207
- // Prepare
208
- var discardedStateHash = History.contractState(discardedState);
209
-
210
- // Create Discard Object
211
- var discardObject = {
212
- 'discardedState': discardedState,
213
- 'backState': backState,
214
- 'forwardState': forwardState
215
- };
216
-
217
- // Add to DiscardedStates
218
- _History.discardedStates[discardedStateHash] = discardObject;
219
-
220
- // Return true
221
- return true;
222
- };
223
-
224
- /**
225
- * _History.discardHash(hash)
226
- * Discards the hash by ignoring it through History
227
- * @param {string} hash
228
- * @return {true}
229
- */
230
- _History.discardHash = function(discardedHash,forwardState,backState){
231
- History.debug('History.discardState',this,arguments);
232
- // Create Discard Object
233
- var discardObject = {
234
- 'discardedHash': discardedHash,
235
- 'backState': backState,
236
- 'forwardState': forwardState
237
- };
238
-
239
- // Add to discardedHash
240
- _History.discardedHashes[discardedHash] = discardObject;
241
-
242
- // Return true
243
- return true;
244
- };
245
-
246
- /**
247
- * _History.discardState(State)
248
- * Checks to see if the state is discarded
249
- * @param {object} State
250
- * @return {bool}
251
- */
252
- _History.discardedState = function(State){
253
- // Prepare
254
- var StateHash = History.contractState(State);
255
-
256
- // Check
257
- var discarded = _History.discardedStates[StateHash]||false;
258
-
259
- // Return true
260
- return discarded;
261
- };
262
-
263
- /**
264
- * _History.discardedHash(hash)
265
- * Checks to see if the state is discarded
266
- * @param {string} State
267
- * @return {bool}
268
- */
269
- _History.discardedHash = function(hash){
270
- // Check
271
- var discarded = _History.discardedHashes[hash]||false;
272
-
273
- // Return true
274
- return discarded;
275
- };
276
-
277
- /**
278
- * _History.recycleState(State)
279
- * Allows a discarded state to be used again
280
- * @param {object} data
281
- * @param {string} title
282
- * @param {string} url
283
- * @return {true}
284
- */
285
- _History.recycleState = function(State){
286
- History.debug('History.recycleState',this,arguments);
287
- // Prepare
288
- var StateHash = History.contractState(State);
289
-
290
- // Remove from DiscardedStates
291
- if ( _History.discardedState(State) ) {
292
- delete _History.discardedStates[StateHash];
293
- }
294
-
295
- // Return true
296
- return true;
297
- };
298
-
299
- // ----------------------------------------------------------------------
300
- // HTML4 HashChange Support
301
-
302
- if ( History.emulated.hashChange ) {
303
- /*
304
- * We must emulate the HTML4 HashChange Support by manually checking for hash changes
305
- */
306
-
307
- History.Adapter.onDomLoad(function(){
308
- // Define our Checker Function
309
- _History.checkerFunction = null;
310
-
311
- // Handle depending on the browser
312
- if ( _History.isInternetExplorer() ) {
313
- // IE6 and IE7
314
- // We need to use an iframe to emulate the back and forward buttons
315
-
316
- // Create iFrame
317
- var
318
- iframeId = 'historyjs-iframe',
319
- iframe = document.createElement('iframe');
320
-
321
- // Adjust iFarme
322
- iframe.setAttribute('id', iframeId);
323
- iframe.style.display = 'none';
324
-
325
- // Append iFrame
326
- document.body.appendChild(iframe);
327
-
328
- // Create initial history entry
329
- iframe.contentWindow.document.open();
330
- iframe.contentWindow.document.close();
331
-
332
- // Define some variables that will help in our checker function
333
- var
334
- lastDocumentHash = null,
335
- lastIframeHash = null,
336
- checkerRunning = false;
337
-
338
- // Define the checker function
339
- _History.checkerFunction = function(){
340
- // Check Running
341
- if ( checkerRunning ) {
342
- History.debug('hashchange.checker: checker is running');
343
- return false;
344
- }
345
-
346
- // Update Running
347
- checkerRunning = true;
348
-
349
- // Fetch
350
- var
351
- documentHash = History.getHash(),
352
- iframeHash = _History.unescapeHash(iframe.contentWindow.document.location.hash);
353
-
354
- // The Document Hash has changed (application caused)
355
- if ( documentHash !== lastDocumentHash ) {
356
- // Equalise
357
- lastDocumentHash = documentHash;
358
-
359
- // Create a history entry in the iframe
360
- if ( iframeHash !== documentHash ) {
361
- History.debug('hashchange.checker: iframe hash change', 'documentHash (new):', documentHash, 'iframeHash (old):', iframeHash);
362
-
363
- // Equalise
364
- lastIframeHash = iframeHash = documentHash;
365
-
366
- // Create History Entry
367
- iframe.contentWindow.document.open();
368
- iframe.contentWindow.document.close();
369
-
370
- // Update the iframe's hash
371
- iframe.contentWindow.document.location.hash = _History.escapeHash(documentHash);
372
- }
373
-
374
- // Trigger Hashchange Event
375
- History.Adapter.trigger(window,'hashchange');
376
- }
377
-
378
- // The iFrame Hash has changed (back button caused)
379
- else if ( iframeHash !== lastIframeHash ) {
380
- History.debug('hashchange.checker: iframe hash out of sync', 'iframeHash (new):', iframeHash, 'documentHash (old):', documentHash);
381
-
382
- // Equalise
383
- lastIframeHash = iframeHash;
384
-
385
- // Update the Hash
386
- History.setHash(iframeHash,false);
387
- }
388
-
389
- // Reset Running
390
- checkerRunning = false;
391
-
392
- // Return true
393
- return true;
394
- };
395
- }
396
- else {
397
- // We are not IE
398
- // Firefox 1 or 2, Opera
399
-
400
- // Define some variables that will help in our checker function
401
- var
402
- lastDocumentHash = null;
403
-
404
- // Define the checker function
405
- _History.checkerFunction = function(){
406
- // Prepare
407
- var documentHash = History.getHash();
408
-
409
- // The Document Hash has changed (application caused)
410
- if ( documentHash !== lastDocumentHash ) {
411
- // Equalise
412
- lastDocumentHash = documentHash;
413
-
414
- // Trigger Hashchange Event
415
- History.Adapter.trigger(window,'hashchange');
416
- }
417
-
418
- // Return true
419
- return true;
420
- };
421
- }
422
-
423
- // Apply the checker function
424
- setInterval(_History.checkerFunction, History.options.hashChangeCheckerDelay);
425
-
426
- // End onDomLoad closure
427
- return true;
428
- });
429
-
430
- }
431
-
432
- // ----------------------------------------------------------------------
433
- // HTML5 State Support
434
-
435
- if ( History.emulated.pushState ) {
436
- /*
437
- * We must emulate the HTML5 State Management by using HTML4 HashChange
438
- */
439
-
440
- /**
441
- * _History.onHashChange(event)
442
- * Trigger HTML5's window.onpopstate via HTML4 HashChange Support
443
- */
444
- _History.onHashChange = function(event){
445
- History.debug('_History.onHashChange',this,arguments);
446
- // Prepare
447
- var
448
- currentUrl = (event && event.newURL) || document.location.href;
449
- currentHash = unescape(History.extractHashFromUrl(currentUrl)),
450
- currentState = null,
451
- currentStateHash = null,
452
- currentStateHashExits = null;
453
-
454
- // Check if we are the same state
455
- if ( _History.isLastHash(currentHash) ) {
456
- // There has been no change (just the page's hash has finally propagated)
457
- History.debug('_History.onHashChange: no change');
458
- History.busy(false);
459
- return false;
460
- }
461
-
462
- // Store our location for use in detecting back/forward direction
463
- _History.saveHash(currentHash);
464
-
465
- // Expand Hash
466
- currentState = History.expandHash(currentHash);
467
- if ( !currentState ) {
468
- // Traditional Anchor Hash
469
- History.debug('_History.onHashChange: traditional anchor');
470
- History.Adapter.trigger(window,'anchorchange');
471
- History.busy(false);
472
- return false;
473
- }
474
-
475
- // Check if we are the same state
476
- if ( _History.isLastState(currentState) ) {
477
- // There has been no change (just the page's hash has finally propagated)
478
- History.debug('_History.onHashChange: no change');
479
- History.busy(false);
480
- return false;
481
- }
482
-
483
- // Create the state Hash
484
- currentStateHash = History.contractState(currentState);
485
-
486
- // Log
487
- History.debug('_History.onHashChange: ',
488
- 'currentStateHash',
489
- currentStateHash,
490
- 'Hash -1',
491
- _History.getHashByIndex(-1),
492
- 'Hash -2',
493
- _History.getHashByIndex(-2),
494
- 'Hash -3',
495
- _History.getHashByIndex(-3),
496
- 'Hash -4',
497
- _History.getHashByIndex(-4),
498
- 'Hash -5',
499
- _History.getHashByIndex(-5),
500
- 'Hash -6',
501
- _History.getHashByIndex(-6),
502
- 'Hash -7',
503
- _History.getHashByIndex(-7)
504
- );
505
-
506
- // Check if we are DiscardedState
507
- var discardObject = _History.discardedState(currentState);
508
- if ( discardObject ) {
509
- History.debug('forwardState:',History.contractState(discardObject.forwardState),'backState:',History.contractState(discardObject.backState));
510
- // Ignore this state as it has been discarded and go back to the state before it
511
- if ( _History.getHashByIndex(-2) === History.contractState(discardObject.forwardState) ) {
512
- // We are going backwards
513
- History.debug('_History.onHashChange: go backwards');
514
- History.back(false);
515
- } else {
516
- // We are going forwards
517
- History.debug('_History.onHashChange: go forwards');
518
- History.forward(false);
519
- }
520
- History.busy(false);
521
- return false;
522
- }
523
-
524
- // Push the new HTML5 State
525
- History.debug('_History.onHashChange: success hashchange');
526
- History.pushState(currentState.data,currentState.title,currentState.url,false);
527
-
528
- // End onHashChange closure
529
- return true;
530
- };
531
- History.Adapter.bind(window,'hashchange',_History.onHashChange);
532
-
533
- /**
534
- * History.pushState(data,title,url)
535
- * Add a new State to the history object, become it, and trigger onpopstate
536
- * We have to trigger for HTML4 compatibility
537
- * @param {object} data
538
- * @param {string} title
539
- * @param {string} url
540
- * @return {true}
541
- */
542
- History.pushState = function(data,title,url,queue){
543
- History.debug('History.pushState',this,arguments);
544
-
545
- // Check the State
546
- if ( History.extractHashFromUrl(url) ) {
547
- throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
548
- }
549
-
550
- // Handle Queueing
551
- if ( queue !== false && History.busy() ) {
552
- // Wait + Push to Queue
553
- History.debug('History.pushState: we must wait', arguments);
554
- History.pushQueue({
555
- scope: History,
556
- callback: History.pushState,
557
- args: arguments,
558
- queue: queue
559
- });
560
- return false;
561
- }
562
-
563
- // Make Busy
564
- History.busy(true);
565
-
566
- // Fetch the State Object
567
- var
568
- newState = History.createStateObject(data,title,url),
569
- newStateHash = History.contractState(newState),
570
- oldState = History.getState(),
571
- oldStateHash = History.getStateHash(),
572
- html4Hash = unescape(History.getHash());
573
-
574
- // Store the newState
575
- _History.storeState(newState);
576
-
577
- // Recycle the State
578
- _History.recycleState(newState);
579
-
580
- // Force update of the title
581
- if ( document.title !== newState.title ) {
582
- document.title = newState.title
583
- try {
584
- document.getElementsByTagName('title')[0].innerHTML = newState.title;
585
- }
586
- catch ( Exception ) { }
587
- }
588
-
589
- History.debug(
590
- 'History.pushState: details',
591
- 'newStateHash:', newStateHash,
592
- 'oldStateHash:', oldStateHash,
593
- 'html4Hash:', html4Hash
594
- );
595
-
596
- // Check if we are the same State
597
- if ( newStateHash === oldStateHash ) {
598
- History.debug('History.pushState: no change', newStateHash);
599
- return false;
600
- }
601
-
602
- // Update HTML4 Hash
603
- if ( newStateHash !== html4Hash ) {
604
- History.debug('History.pushState: update hash', newStateHash);
605
- History.setHash(newStateHash,false);
606
- return false;
607
- }
608
-
609
- // Update HTML5 State
610
- _History.saveState(newState);
611
-
612
- // Fire HTML5 Event
613
- History.debug('History.pushState: trigger popstate');
614
- History.Adapter.trigger(window,'statechange');
615
- History.busy(false);
616
-
617
- // End pushState closure
618
- return true;
619
- };
620
-
621
- /**
622
- * History.replaceState(data,title,url)
623
- * Replace the State and trigger onpopstate
624
- * We have to trigger for HTML4 compatibility
625
- * @param {object} data
626
- * @param {string} title
627
- * @param {string} url
628
- * @return {true}
629
- */
630
- History.replaceState = function(data,title,url,queue){
631
- History.debug('History.replaceState',this,arguments);
632
- // Check the State
633
- if ( History.extractHashFromUrl(url) ) {
634
- throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
635
- }
636
-
637
- // Handle Queueing
638
- if ( queue !== false && History.busy() ) {
639
- // Wait + Push to Queue
640
- History.debug('History.replaceState: we must wait', arguments);
641
- History.pushQueue({
642
- scope: History,
643
- callback: History.replaceState,
644
- args: arguments,
645
- queue: queue
646
- });
647
- return false;
648
- }
649
-
650
- // Make Busy
651
- History.busy(true);
652
-
653
- // Fetch the State Objects
654
- var
655
- newState = History.createStateObject(data,title,url),
656
- oldState = History.getState(),
657
- previousState = _History.getStateByIndex(-2)
658
-
659
- // Discard Old State
660
- _History.discardState(oldState,newState,previousState);
661
-
662
- // Alias to PushState
663
- History.pushState(newState.data,newState.title,newState.url,false);
664
-
665
- // End replaceState closure
666
- return true;
667
- };
668
-
669
- /**
670
- * Ensure initial state is handled correctly
671
- **/
672
- if ( !document.location.hash || document.location.hash === '#' ) {
673
- History.Adapter.onDomLoad(function(){
674
- History.debug('Internet Explorer Initial State Change Fix');
675
- var currentState = History.createStateObject({},'',document.location.href);
676
- History.pushState(currentState.data,currentState.title,currentState.url);
677
- });
678
- } else if ( !History.emulated.hashChange ) {
679
- History.debug('Firefox Initial State Change Fix');
680
- History.Adapter.onDomLoad(function(){
681
- _History.onHashChange();
682
- });
683
- }
684
- }
685
- }
686
-
687
- // Try Load HTML4 Support
688
- History.initHtml4();
9
+ (function(window, undefined) {
10
+
11
+ // --------------------------------------------------------------------------
12
+ // Initialise
13
+
14
+ // History Object
15
+ window.History = window.History || {};
16
+ window._History = window._History || {};
17
+
18
+ // Localise Globals
19
+ var
20
+ document = window.document, // Make sure we are using the correct document
21
+ _History = window._History, // Private History Object
22
+ History = window.History; // Public History Object
23
+
24
+ // Check Existence of History.js
25
+ if (typeof History.initHtml4 !== 'undefined') {
26
+ throw new Error('History.js HTML4 Support has already been loaded...');
27
+ }
28
+
29
+ // Initialise HTML4 Support
30
+ History.initHtml4 = function() {
31
+
32
+ // ----------------------------------------------------------------------
33
+ // Check Status
34
+
35
+ if (typeof History.initHtml5 === 'undefined' || typeof History.Adapter === 'undefined') {
36
+ return false;
37
+ }
38
+
39
+ // ----------------------------------------------------------------------
40
+ // Emulated Status
41
+
42
+ /**
43
+ * _History.getInternetExplorerMajorVersion()
44
+ * Get's the major version of Internet Explorer
45
+ * @return {integer}
46
+ * @license Public Domain
47
+ * @author Benjamin Arthur Lupton <contact@balupton.com>
48
+ * @author James Padolsey <https://gist.github.com/527683>
49
+ */
50
+ _History.getInternetExplorerMajorVersion = function() {
51
+ var result = _History.getInternetExplorerMajorVersion.cached =
52
+ (typeof _History.getInternetExplorerMajorVersion.cached !== 'undefined')
53
+ ? _History.getInternetExplorerMajorVersion.cached
54
+ : (function() {
55
+ var undef,
56
+ v = 3,
57
+ div = document.createElement('div'),
58
+ all = div.getElementsByTagName('i');
59
+ while (
60
+ div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
61
+ all[0]
62
+ );
63
+ return v > 4 ? v : undef;
64
+ })()
65
+ ;
66
+ return result;
67
+ };
68
+
69
+ /**
70
+ * _History.isInternetExplorer()
71
+ * Are we using Internet Explorer?
72
+ * @return {boolean}
73
+ * @license Public Domain
74
+ * @author Benjamin Arthur Lupton <contact@balupton.com>
75
+ */
76
+ _History.isInternetExplorer = function() {
77
+ var result = _History.isInternetExplorer.cached =
78
+ (typeof _History.isInternetExplorer.cached !== 'undefined')
79
+ ? _History.isInternetExplorer.cached
80
+ : (_History.getInternetExplorerMajorVersion() !== 0)
81
+ ;
82
+ return result;
83
+ };
84
+
85
+ /**
86
+ * History.emulated
87
+ * Which features require emulating?
88
+ */
89
+ History.emulated.hashChange = Boolean(
90
+ !('onhashchange' in window || 'onhashchange' in document)
91
+ ||
92
+ (_History.isInternetExplorer() && _History.getInternetExplorerMajorVersion() < 8)
93
+ );
94
+
95
+
96
+ // ----------------------------------------------------------------------
97
+ // Hash Storage
98
+
99
+ /**
100
+ * _History.savedHashes
101
+ * Store the hashes in an array
102
+ */
103
+ _History.savedHashes = [];
104
+
105
+ /**
106
+ * _History.isLastHash(newHash)
107
+ * Checks if the hash is the last hash
108
+ * @param {string} newHash
109
+ * @return {boolean} true
110
+ */
111
+ _History.isLastHash = function(newHash) {
112
+ // Prepare
113
+ var oldHash = _History.getHashByIndex();
114
+
115
+ // Check
116
+ var isLast = newHash === oldHash;
117
+
118
+ // Return isLast
119
+ return isLast;
120
+ };
121
+
122
+ /**
123
+ * _History.saveHash(newHash)
124
+ * Push a Hash
125
+ * @param {string} newHash
126
+ * @return {boolean} true
127
+ */
128
+ _History.saveHash = function(newHash) {
129
+ // Check Hash
130
+ if (_History.isLastHash(newHash)) {
131
+ return false;
132
+ }
133
+
134
+ // Push the Hash
135
+ _History.savedHashes.push(newHash);
136
+
137
+ // Return true
138
+ return true;
139
+ };
140
+
141
+ /**
142
+ * _History.getHashByIndex()
143
+ * Gets a hash by the index
144
+ * @param {integer} index
145
+ * @return {string}
146
+ */
147
+ _History.getHashByIndex = function(index) {
148
+ // Prepare
149
+ var hash = null;
150
+
151
+ // Handle
152
+ if (typeof index === 'undefined') {
153
+ // Get the last inserted
154
+ hash = _History.savedHashes[_History.savedHashes.length - 1];
155
+ }
156
+ else if (index < 0) {
157
+ // Get from the end
158
+ hash = _History.savedHashes[_History.savedHashes.length + index];
159
+ }
160
+ else {
161
+ // Get from the beginning
162
+ hash = _History.savedHashes[index];
163
+ }
164
+
165
+ // Return hash
166
+ return hash;
167
+ };
168
+
169
+ /**
170
+ * _History.stateHashExists
171
+ * Checks if the State Hash Exists
172
+ * @param {string} stateHash
173
+ * @return {boolean} exists
174
+ */
175
+ _History.stateHashExists = function(stateHash) {
176
+ // Prepare
177
+ var exists = typeof _History.statesByHash[stateHash] !== 'undefined';
178
+
179
+ // Return exists
180
+ return exists;
181
+ };
182
+
183
+ // ----------------------------------------------------------------------
184
+ // Discarded States
185
+
186
+ /**
187
+ * _History.discardedHashes
188
+ * A hashed array of discarded hashes
189
+ */
190
+ _History.discardedHashes = {};
191
+
192
+ /**
193
+ * _History.discardedStates
194
+ * A hashed array of discarded states
195
+ */
196
+ _History.discardedStates = {};
197
+
198
+ /**
199
+ * _History.discardState(State)
200
+ * Discards the state by ignoring it through History
201
+ * @param {object} State
202
+ * @return {true}
203
+ */
204
+ _History.discardState = function(discardedState, forwardState, backState) {
205
+ History.debug('History.discardState', this, arguments);
206
+ // Prepare
207
+ var discardedStateHash = History.contractState(discardedState);
208
+
209
+ // Create Discard Object
210
+ var discardObject = {
211
+ 'discardedState': discardedState,
212
+ 'backState': backState,
213
+ 'forwardState': forwardState
214
+ };
215
+
216
+ // Add to DiscardedStates
217
+ _History.discardedStates[discardedStateHash] = discardObject;
218
+
219
+ // Return true
220
+ return true;
221
+ };
222
+
223
+ /**
224
+ * _History.discardHash(hash)
225
+ * Discards the hash by ignoring it through History
226
+ * @param {string} hash
227
+ * @return {true}
228
+ */
229
+ _History.discardHash = function(discardedHash, forwardState, backState) {
230
+ History.debug('History.discardState', this, arguments);
231
+ // Create Discard Object
232
+ var discardObject = {
233
+ 'discardedHash': discardedHash,
234
+ 'backState': backState,
235
+ 'forwardState': forwardState
236
+ };
237
+
238
+ // Add to discardedHash
239
+ _History.discardedHashes[discardedHash] = discardObject;
240
+
241
+ // Return true
242
+ return true;
243
+ };
244
+
245
+ /**
246
+ * _History.discardState(State)
247
+ * Checks to see if the state is discarded
248
+ * @param {object} State
249
+ * @return {bool}
250
+ */
251
+ _History.discardedState = function(State) {
252
+ // Prepare
253
+ var StateHash = History.contractState(State);
254
+
255
+ // Check
256
+ var discarded = _History.discardedStates[StateHash] || false;
257
+
258
+ // Return true
259
+ return discarded;
260
+ };
261
+
262
+ /**
263
+ * _History.discardedHash(hash)
264
+ * Checks to see if the state is discarded
265
+ * @param {string} State
266
+ * @return {bool}
267
+ */
268
+ _History.discardedHash = function(hash) {
269
+ // Check
270
+ var discarded = _History.discardedHashes[hash] || false;
271
+
272
+ // Return true
273
+ return discarded;
274
+ };
275
+
276
+ /**
277
+ * _History.recycleState(State)
278
+ * Allows a discarded state to be used again
279
+ * @param {object} data
280
+ * @param {string} title
281
+ * @param {string} url
282
+ * @return {true}
283
+ */
284
+ _History.recycleState = function(State) {
285
+ History.debug('History.recycleState', this, arguments);
286
+ // Prepare
287
+ var StateHash = History.contractState(State);
288
+
289
+ // Remove from DiscardedStates
290
+ if (_History.discardedState(State)) {
291
+ delete _History.discardedStates[StateHash];
292
+ }
293
+
294
+ // Return true
295
+ return true;
296
+ };
297
+
298
+ // ----------------------------------------------------------------------
299
+ // HTML4 HashChange Support
300
+
301
+ if (History.emulated.hashChange) {
302
+ /*
303
+ * We must emulate the HTML4 HashChange Support by manually checking for hash changes
304
+ */
305
+
306
+ History.Adapter.onDomLoad(function() {
307
+ // Define our Checker Function
308
+ _History.checkerFunction = null;
309
+
310
+ // Handle depending on the browser
311
+ if (_History.isInternetExplorer()) {
312
+ // IE6 and IE7
313
+ // We need to use an iframe to emulate the back and forward buttons
314
+
315
+ // Create iFrame
316
+ var
317
+ iframeId = 'historyjs-iframe',
318
+ iframe = document.createElement('iframe');
319
+
320
+ // Adjust iFarme
321
+ iframe.setAttribute('id', iframeId);
322
+ iframe.style.display = 'none';
323
+
324
+ // Append iFrame
325
+ document.body.appendChild(iframe);
326
+
327
+ // Create initial history entry
328
+ iframe.contentWindow.document.open();
329
+ iframe.contentWindow.document.close();
330
+
331
+ // Define some variables that will help in our checker function
332
+ var
333
+ lastDocumentHash = null,
334
+ lastIframeHash = null,
335
+ checkerRunning = false;
336
+
337
+ // Define the checker function
338
+ _History.checkerFunction = function() {
339
+ // Check Running
340
+ if (checkerRunning) {
341
+ History.debug('hashchange.checker: checker is running');
342
+ return false;
343
+ }
344
+
345
+ // Update Running
346
+ checkerRunning = true;
347
+
348
+ // Fetch
349
+ var
350
+ documentHash = History.getHash(),
351
+ iframeHash = _History.unescapeHash(iframe.contentWindow.document.location.hash);
352
+
353
+ // The Document Hash has changed (application caused)
354
+ if (documentHash !== lastDocumentHash) {
355
+ // Equalise
356
+ lastDocumentHash = documentHash;
357
+
358
+ // Create a history entry in the iframe
359
+ if (iframeHash !== documentHash) {
360
+ History.debug('hashchange.checker: iframe hash change', 'documentHash (new):', documentHash, 'iframeHash (old):', iframeHash);
361
+
362
+ // Equalise
363
+ lastIframeHash = iframeHash = documentHash;
364
+
365
+ // Create History Entry
366
+ iframe.contentWindow.document.open();
367
+ iframe.contentWindow.document.close();
368
+
369
+ // Update the iframe's hash
370
+ iframe.contentWindow.document.location.hash = _History.escapeHash(documentHash);
371
+ }
372
+
373
+ // Trigger Hashchange Event
374
+ History.Adapter.trigger(window, 'hashchange');
375
+ }
376
+
377
+ // The iFrame Hash has changed (back button caused)
378
+ else if (iframeHash !== lastIframeHash) {
379
+ History.debug('hashchange.checker: iframe hash out of sync', 'iframeHash (new):', iframeHash, 'documentHash (old):', documentHash);
380
+
381
+ // Equalise
382
+ lastIframeHash = iframeHash;
383
+
384
+ // Update the Hash
385
+ History.setHash(iframeHash, false);
386
+ }
387
+
388
+ // Reset Running
389
+ checkerRunning = false;
390
+
391
+ // Return true
392
+ return true;
393
+ };
394
+ }
395
+ else {
396
+ // We are not IE
397
+ // Firefox 1 or 2, Opera
398
+
399
+ // Define some variables that will help in our checker function
400
+ var
401
+ lastDocumentHash = null;
402
+
403
+ // Define the checker function
404
+ _History.checkerFunction = function() {
405
+ // Prepare
406
+ var documentHash = History.getHash();
407
+
408
+ // The Document Hash has changed (application caused)
409
+ if (documentHash !== lastDocumentHash) {
410
+ // Equalise
411
+ lastDocumentHash = documentHash;
412
+
413
+ // Trigger Hashchange Event
414
+ History.Adapter.trigger(window, 'hashchange');
415
+ }
416
+
417
+ // Return true
418
+ return true;
419
+ };
420
+ }
421
+
422
+ // Apply the checker function
423
+ setInterval(_History.checkerFunction, History.options.hashChangeCheckerDelay);
424
+
425
+ // End onDomLoad closure
426
+ return true;
427
+ });
428
+
429
+ }
430
+
431
+ // ----------------------------------------------------------------------
432
+ // HTML5 State Support
433
+
434
+ if (History.emulated.pushState) {
435
+ /*
436
+ * We must emulate the HTML5 State Management by using HTML4 HashChange
437
+ */
438
+
439
+ /**
440
+ * _History.onHashChange(event)
441
+ * Trigger HTML5's window.onpopstate via HTML4 HashChange Support
442
+ */
443
+ _History.onHashChange = function(event) {
444
+ History.debug('_History.onHashChange', this, arguments);
445
+ // Prepare
446
+ var
447
+ currentUrl = (event && event.newURL) || document.location.href;
448
+ currentHash = unescape(History.extractHashFromUrl(currentUrl)),
449
+ currentState = null,
450
+ currentStateHash = null,
451
+ currentStateHashExits = null;
452
+
453
+ // Check if we are the same state
454
+ if (_History.isLastHash(currentHash)) {
455
+ // There has been no change (just the page's hash has finally propagated)
456
+ History.debug('_History.onHashChange: no change');
457
+ History.busy(false);
458
+ return false;
459
+ }
460
+
461
+ // Store our location for use in detecting back/forward direction
462
+ _History.saveHash(currentHash);
463
+
464
+ // Expand Hash
465
+ currentState = History.expandHash(currentHash);
466
+ if (!currentState) {
467
+ // Traditional Anchor Hash
468
+ History.debug('_History.onHashChange: traditional anchor');
469
+ History.Adapter.trigger(window, 'anchorchange');
470
+ History.busy(false);
471
+ return false;
472
+ }
473
+
474
+ // Check if we are the same state
475
+ if (_History.isLastState(currentState)) {
476
+ // There has been no change (just the page's hash has finally propagated)
477
+ History.debug('_History.onHashChange: no change');
478
+ History.busy(false);
479
+ return false;
480
+ }
481
+
482
+ // Create the state Hash
483
+ currentStateHash = History.contractState(currentState);
484
+
485
+ // Log
486
+ History.debug('_History.onHashChange: ',
487
+ 'currentStateHash',
488
+ currentStateHash,
489
+ 'Hash -1',
490
+ _History.getHashByIndex(-1),
491
+ 'Hash -2',
492
+ _History.getHashByIndex(-2),
493
+ 'Hash -3',
494
+ _History.getHashByIndex(-3),
495
+ 'Hash -4',
496
+ _History.getHashByIndex(-4),
497
+ 'Hash -5',
498
+ _History.getHashByIndex(-5),
499
+ 'Hash -6',
500
+ _History.getHashByIndex(-6),
501
+ 'Hash -7',
502
+ _History.getHashByIndex(-7)
503
+ );
504
+
505
+ // Check if we are DiscardedState
506
+ var discardObject = _History.discardedState(currentState);
507
+ if (discardObject) {
508
+ History.debug('forwardState:', History.contractState(discardObject.forwardState), 'backState:', History.contractState(discardObject.backState));
509
+ // Ignore this state as it has been discarded and go back to the state before it
510
+ if (_History.getHashByIndex(-2) === History.contractState(discardObject.forwardState)) {
511
+ // We are going backwards
512
+ History.debug('_History.onHashChange: go backwards');
513
+ History.back(false);
514
+ } else {
515
+ // We are going forwards
516
+ History.debug('_History.onHashChange: go forwards');
517
+ History.forward(false);
518
+ }
519
+ History.busy(false);
520
+ return false;
521
+ }
522
+
523
+ // Push the new HTML5 State
524
+ History.debug('_History.onHashChange: success hashchange');
525
+ History.pushState(currentState.data, currentState.title, currentState.url, false);
526
+
527
+ // End onHashChange closure
528
+ return true;
529
+ };
530
+ History.Adapter.bind(window, 'hashchange', _History.onHashChange);
531
+
532
+ /**
533
+ * History.pushState(data,title,url)
534
+ * Add a new State to the history object, become it, and trigger onpopstate
535
+ * We have to trigger for HTML4 compatibility
536
+ * @param {object} data
537
+ * @param {string} title
538
+ * @param {string} url
539
+ * @return {true}
540
+ */
541
+ History.pushState = function(data, title, url, queue) {
542
+ History.debug('History.pushState', this, arguments);
543
+
544
+ // Check the State
545
+ if (History.extractHashFromUrl(url)) {
546
+ throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
547
+ }
548
+
549
+ // Handle Queueing
550
+ if (queue !== false && History.busy()) {
551
+ // Wait + Push to Queue
552
+ History.debug('History.pushState: we must wait', arguments);
553
+ History.pushQueue({
554
+ scope: History,
555
+ callback: History.pushState,
556
+ args: arguments,
557
+ queue: queue
558
+ });
559
+ return false;
560
+ }
561
+
562
+ // Make Busy
563
+ History.busy(true);
564
+
565
+ // Fetch the State Object
566
+ var
567
+ newState = History.createStateObject(data, title, url),
568
+ newStateHash = History.contractState(newState),
569
+ oldState = History.getState(),
570
+ oldStateHash = History.getStateHash(),
571
+ html4Hash = unescape(History.getHash());
572
+
573
+ // Store the newState
574
+ _History.storeState(newState);
575
+
576
+ // Recycle the State
577
+ _History.recycleState(newState);
578
+
579
+ // Force update of the title
580
+ if (document.title !== newState.title) {
581
+ document.title = newState.title
582
+ try {
583
+ document.getElementsByTagName('title')[0].innerHTML = newState.title;
584
+ }
585
+ catch (Exception) {
586
+ }
587
+ }
588
+
589
+ History.debug(
590
+ 'History.pushState: details',
591
+ 'newStateHash:', newStateHash,
592
+ 'oldStateHash:', oldStateHash,
593
+ 'html4Hash:', html4Hash
594
+ );
595
+
596
+ // Check if we are the same State
597
+ if (newStateHash === oldStateHash) {
598
+ History.debug('History.pushState: no change', newStateHash);
599
+ return false;
600
+ }
601
+
602
+ // Update HTML4 Hash
603
+ if (newStateHash !== html4Hash) {
604
+ History.debug('History.pushState: update hash', newStateHash);
605
+ History.setHash(newStateHash, false);
606
+ return false;
607
+ }
608
+
609
+ // Update HTML5 State
610
+ _History.saveState(newState);
611
+
612
+ // Fire HTML5 Event
613
+ History.debug('History.pushState: trigger popstate');
614
+ History.Adapter.trigger(window, 'statechange');
615
+ History.busy(false);
616
+
617
+ // End pushState closure
618
+ return true;
619
+ };
620
+
621
+ /**
622
+ * History.replaceState(data,title,url)
623
+ * Replace the State and trigger onpopstate
624
+ * We have to trigger for HTML4 compatibility
625
+ * @param {object} data
626
+ * @param {string} title
627
+ * @param {string} url
628
+ * @return {true}
629
+ */
630
+ History.replaceState = function(data, title, url, queue) {
631
+ History.debug('History.replaceState', this, arguments);
632
+ // Check the State
633
+ if (History.extractHashFromUrl(url)) {
634
+ throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
635
+ }
636
+
637
+ // Handle Queueing
638
+ if (queue !== false && History.busy()) {
639
+ // Wait + Push to Queue
640
+ History.debug('History.replaceState: we must wait', arguments);
641
+ History.pushQueue({
642
+ scope: History,
643
+ callback: History.replaceState,
644
+ args: arguments,
645
+ queue: queue
646
+ });
647
+ return false;
648
+ }
649
+
650
+ // Make Busy
651
+ History.busy(true);
652
+
653
+ // Fetch the State Objects
654
+ var
655
+ newState = History.createStateObject(data, title, url),
656
+ oldState = History.getState(),
657
+ previousState = _History.getStateByIndex(-2)
658
+
659
+ // Discard Old State
660
+ _History.discardState(oldState, newState, previousState);
661
+
662
+ // Alias to PushState
663
+ History.pushState(newState.data, newState.title, newState.url, false);
664
+
665
+ // End replaceState closure
666
+ return true;
667
+ };
668
+
669
+ /**
670
+ * Ensure initial state is handled correctly
671
+ **/
672
+ if (!document.location.hash || document.location.hash === '#') {
673
+ History.Adapter.onDomLoad(function() {
674
+ History.debug('Internet Explorer Initial State Change Fix');
675
+ var currentState = History.createStateObject({}, '', document.location.href);
676
+ History.pushState(currentState.data, currentState.title, currentState.url);
677
+ });
678
+ } else if (!History.emulated.hashChange) {
679
+ History.debug('Firefox Initial State Change Fix');
680
+ History.Adapter.onDomLoad(function() {
681
+ _History.onHashChange();
682
+ });
683
+ }
684
+ }
685
+ }
686
+
687
+ // Try Load HTML4 Support
688
+ History.initHtml4();
689
689
 
690
690
  })(window);