compass-jquery-plugin 0.3.2.3 → 0.3.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. data/README.md +54 -37
  2. data/VERSION.yml +1 -1
  3. data/lib/handle_attributes.rb +4 -4
  4. data/lib/handle_js_files.rb +5 -5
  5. data/lib/jqtouch_theme.rb +2 -2
  6. data/lib/jquery/dynatree.rb +2 -2
  7. data/lib/jquery/emulators.rb +1 -1
  8. data/lib/jquery/flash_messages.rb +6 -6
  9. data/lib/jquery/graphics.rb +5 -0
  10. data/lib/jquery/gridify/assertions.rb +1 -1
  11. data/lib/jquery/gridify/grid.rb +76 -59
  12. data/lib/jquery/gridify/grid_column.rb +73 -67
  13. data/lib/jquery/gridify/grid_finder.rb +79 -79
  14. data/lib/jquery/gridify/grid_options.rb +154 -149
  15. data/lib/jquery/gridify/grid_view.rb +143 -143
  16. data/lib/jquery/gridify.rb +25 -25
  17. data/lib/jquery/ical/calendar.rb +2 -2
  18. data/lib/jquery/ical/event.rb +48 -44
  19. data/lib/jquery/ical/helpers/ui_event_helper.rb +3 -3
  20. data/lib/jquery/jqgrid/jqgrid.rb +58 -58
  21. data/lib/jquery/jqgrid.rb +1 -1
  22. data/lib/jquery/jqtouch.rb +1 -1
  23. data/lib/jquery/jquery.rb +117 -117
  24. data/lib/jquery/jquery_auto_complete.rb +9 -9
  25. data/lib/jquery/jquery_json_response.rb +12 -12
  26. data/lib/jquery/jquery_selector_assertions.rb +55 -53
  27. data/lib/jquery/jstree.rb +2 -2
  28. data/lib/jquery/mobile.rb +1 -1
  29. data/lib/jquery/ribbon.rb +2 -2
  30. data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +5 -5
  31. data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +5 -5
  32. data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +1 -1
  33. data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +39 -39
  34. data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +74 -74
  35. data/lib/jquery/secret_sauce/model/find_for_grid.rb +21 -21
  36. data/lib/jquery/secret_sauce.rb +1 -1
  37. data/lib/jquery/tools.rb +1 -1
  38. data/lib/jquery_mobile_theme.rb +2 -2
  39. data/lib/jquery_ui_theme.rb +12 -12
  40. data/templates/dynatree/config/initializers/dynatree.rb +3 -3
  41. data/templates/dynatree/jquery/dynatree/aero.scss +16 -16
  42. data/templates/dynatree/jquery/dynatree/aqua.scss +16 -16
  43. data/templates/dynatree/jquery/dynatree/crystal.scss +16 -16
  44. data/templates/dynatree/jquery/dynatree/xp.scss +17 -17
  45. data/templates/dynatree/jquery.dynatree.js +2926 -2912
  46. data/templates/emulators/config/initializers/emulators.rb +6 -6
  47. data/templates/graphics/config/initializers/graphics.rb +5 -0
  48. data/templates/graphics/jquery/ganttView.scss +89 -0
  49. data/templates/graphics/jquery.ganttView.js +1669 -0
  50. data/templates/graphics/jquery.ganttView.min.js +70 -0
  51. data/templates/{jquery → graphics}/jquery.sparkline.js +466 -438
  52. data/templates/{jquery → graphics}/jquery.sparkline.min.js +0 -0
  53. data/templates/graphics/manifest.rb +9 -0
  54. data/templates/jqgrid/config/initializers/jqgrid.rb +1 -1
  55. data/templates/jqgrid/i18n/jqgrid/locale-ar.js +131 -125
  56. data/templates/jqgrid/i18n/jqgrid/locale-bg.js +135 -131
  57. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +135 -131
  58. data/templates/jqgrid/i18n/jqgrid/locale-cat.js +132 -126
  59. data/templates/jqgrid/i18n/jqgrid/locale-cn.js +137 -131
  60. data/templates/jqgrid/i18n/jqgrid/locale-cs.js +133 -127
  61. data/templates/jqgrid/i18n/jqgrid/locale-da.js +132 -126
  62. data/templates/jqgrid/i18n/jqgrid/locale-de.js +138 -132
  63. data/templates/jqgrid/i18n/jqgrid/locale-el.js +131 -125
  64. data/templates/jqgrid/i18n/jqgrid/locale-en.js +133 -127
  65. data/templates/jqgrid/i18n/jqgrid/locale-es.js +133 -127
  66. data/templates/jqgrid/i18n/jqgrid/locale-fa.js +19 -16
  67. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +132 -126
  68. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +131 -125
  69. data/templates/jqgrid/i18n/jqgrid/locale-gl.js +131 -125
  70. data/templates/jqgrid/i18n/jqgrid/locale-he.js +132 -126
  71. data/templates/jqgrid/i18n/jqgrid/locale-hu.js +133 -127
  72. data/templates/jqgrid/i18n/jqgrid/locale-is.js +131 -125
  73. data/templates/jqgrid/i18n/jqgrid/locale-it.js +8 -1
  74. data/templates/jqgrid/i18n/jqgrid/locale-ja.js +139 -136
  75. data/templates/jqgrid/i18n/jqgrid/locale-nl.js +4 -1
  76. data/templates/jqgrid/i18n/jqgrid/locale-no.js +14 -1
  77. data/templates/jqgrid/i18n/jqgrid/locale-pl.js +132 -126
  78. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +132 -126
  79. data/templates/jqgrid/i18n/jqgrid/locale-pt.js +130 -124
  80. data/templates/jqgrid/i18n/jqgrid/locale-ro.js +144 -138
  81. data/templates/jqgrid/i18n/jqgrid/locale-ru.js +132 -126
  82. data/templates/jqgrid/i18n/jqgrid/locale-sk.js +132 -126
  83. data/templates/jqgrid/i18n/jqgrid/locale-sr.js +133 -127
  84. data/templates/jqgrid/i18n/jqgrid/locale-sv.js +132 -126
  85. data/templates/jqgrid/i18n/jqgrid/locale-tr.js +131 -125
  86. data/templates/jqgrid/i18n/jqgrid/locale-ua.js +132 -126
  87. data/templates/jqgrid/jquery.jqGrid.js +12735 -10444
  88. data/templates/jqgrid/jquery.jqGrid.min.js +477 -469
  89. data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +12 -10
  90. data/templates/jqtouch/config/initializers/jqtouch.rb +3 -3
  91. data/templates/jqtouch/jquery/touch/jqtouch.scss +1 -1
  92. data/templates/jqtouch/jquery.jqtouch.js +10025 -10043
  93. data/templates/jquery/config/initializers/jquery.rb +2 -4
  94. data/templates/jquery/history.adapter.jquery.js +71 -0
  95. data/templates/jquery/history.adapter.jquery.min.js +4 -0
  96. data/templates/jquery/history.html4.js +690 -0
  97. data/templates/jquery/history.html4.min.js +21 -0
  98. data/templates/jquery/history.js +1297 -0
  99. data/templates/jquery/history.min.js +29 -0
  100. data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
  101. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +19 -19
  102. data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
  103. data/templates/jquery/i18n/jquery.ui/datepicker-az.js +19 -19
  104. data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +8 -8
  105. data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
  106. data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +20 -20
  107. data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
  108. data/templates/jquery/i18n/jquery.ui/datepicker-da.js +14 -14
  109. data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
  110. data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
  111. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +20 -20
  112. data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
  113. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +20 -20
  114. data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
  115. data/templates/jquery/i18n/jquery.ui/datepicker-es.js +20 -20
  116. data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
  117. data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
  118. data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +18 -18
  119. data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +15 -15
  120. data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
  121. data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
  122. data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +22 -22
  123. data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +20 -20
  124. data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
  125. data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
  126. data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +20 -20
  127. data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
  128. data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +20 -20
  129. data/templates/jquery/i18n/jquery.ui/datepicker-id.js +20 -20
  130. data/templates/jquery/i18n/jquery.ui/datepicker-is.js +20 -20
  131. data/templates/jquery/i18n/jquery.ui/datepicker-it.js +20 -20
  132. data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
  133. data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +20 -20
  134. data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +20 -20
  135. data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +20 -20
  136. data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +20 -20
  137. data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
  138. data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +20 -20
  139. data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
  140. data/templates/jquery/i18n/jquery.ui/datepicker-no.js +16 -16
  141. data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +2 -2
  142. data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +20 -20
  143. data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +20 -20
  144. data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +20 -20
  145. data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +18 -18
  146. data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
  147. data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +20 -20
  148. data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +20 -20
  149. data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +20 -20
  150. data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
  151. data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
  152. data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
  153. data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +14 -14
  154. data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
  155. data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
  156. data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +20 -20
  157. data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +20 -20
  158. data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
  159. data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +20 -20
  160. data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +20 -20
  161. data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
  162. data/templates/jquery/{partials → jquery/ui}/_flash_messages.scss +0 -0
  163. data/templates/jquery/jquery/ui/_theme.scss +14 -13
  164. data/templates/jquery/jquery/ui/contextMenu/configure.png +0 -0
  165. data/templates/jquery/jquery/ui/contextMenu/copy.png +0 -0
  166. data/templates/jquery/jquery/ui/contextMenu/cut.png +0 -0
  167. data/templates/jquery/jquery/ui/contextMenu/delete.png +0 -0
  168. data/templates/jquery/jquery/ui/contextMenu/edit.png +0 -0
  169. data/templates/jquery/jquery/ui/contextMenu/exit.png +0 -0
  170. data/templates/jquery/jquery/ui/contextMenu/new.png +0 -0
  171. data/templates/jquery/jquery/ui/contextMenu/paste.png +0 -0
  172. data/templates/jquery/jquery/ui/contextMenu/rename.png +0 -0
  173. data/templates/jquery/jquery/ui/contextMenu/show.png +0 -0
  174. data/templates/jquery/jquery/ui/contextMenu/trash.png +0 -0
  175. data/templates/jquery/jquery/ui/contextMenu.scss +16 -10
  176. data/templates/jquery/jquery-ui.js +11839 -23066
  177. data/templates/jquery/jquery-ui.min.js +401 -795
  178. data/templates/jquery/jquery.bgiframe.js +27 -25
  179. data/templates/jquery/jquery.contextMenu.js +209 -196
  180. data/templates/jquery/jquery.cookie.js +3 -1
  181. data/templates/jquery/jquery.dotimeout.js +236 -228
  182. data/templates/jquery/jquery.dst.js +154 -151
  183. data/templates/jquery/jquery.farbtastic.js +293 -293
  184. data/templates/jquery/jquery.flashMessages.js +26 -0
  185. data/templates/jquery/jquery.flashMessages.min.js +1 -0
  186. data/templates/jquery/jquery.form.js +803 -786
  187. data/templates/jquery/jquery.haml.js +248 -247
  188. data/templates/jquery/jquery.hotkeys.js +89 -89
  189. data/templates/jquery/jquery.js +8141 -8106
  190. data/templates/jquery/jquery.layout.js +2451 -2415
  191. data/templates/jquery/jquery.min.js +167 -166
  192. data/templates/jquery/jquery.mousewheel.js +62 -54
  193. data/templates/jquery/jquery.offline.js +171 -171
  194. data/templates/jquery/jquery.pngFix.js +76 -76
  195. data/templates/jquery/jquery.replacetext.js +83 -83
  196. data/templates/jquery/jquery.themeswitchertool.js +202 -177
  197. data/templates/jquery/jquery.tmpl.js +478 -473
  198. data/templates/jquery/jquery.tmplPlus.js +82 -81
  199. data/templates/jquery/jrails.js +178 -175
  200. data/templates/jquery/json.js +77 -7
  201. data/templates/jquery/json2.js +480 -0
  202. data/templates/jquery/json2.min.js +7 -0
  203. data/templates/jquery/lib/tasks/haml.rake +2 -2
  204. data/templates/jquery/manifest.rb +21 -17
  205. data/templates/jstree/jquery.jstree.js +5967 -4536
  206. data/templates/mobile/config/initializers/mobile.rb +1 -1
  207. data/templates/mobile/jquery/mobile/_base.scss +944 -927
  208. data/templates/mobile/jquery/mobile/default.scss +61 -48
  209. data/templates/mobile/jquery/mobile/valencia.scss +56 -42
  210. data/templates/mobile/jquery.mobile.js +4461 -4347
  211. data/templates/mobile/jquery.mobile.min.js +11 -2
  212. data/templates/mobile/lib/tasks/jquery.mobile.rake +12 -12
  213. data/templates/ribbon/config/initializers/ribbon.rb +2 -2
  214. data/templates/ribbon/jquery.ribbon.js +50 -29
  215. data/templates/secret_sauce/secret_sauce.js +8 -8
  216. data/templates/tools/flowplayer.js +945 -1
  217. data/templates/tools/jquery.tools.js +4645 -4335
  218. data/templates/tools/jquery.tools.min.js +37 -37
  219. data/templates/tools/lib/tasks/jquery.tools.rake +4 -4
  220. data/templates/tools/swfobject.js +813 -773
  221. metadata +33 -21
  222. data/templates/jquery/haml.js +0 -506
  223. data/templates/jquery/haml.min.js +0 -5
  224. data/templates/jquery/jquery/ui/contextMenu/door.png +0 -0
  225. data/templates/jquery/jquery/ui/contextMenu/page_white_copy.png +0 -0
  226. data/templates/jquery/jquery/ui/contextMenu/page_white_delete.png +0 -0
  227. data/templates/jquery/jquery/ui/contextMenu/page_white_edit.png +0 -0
  228. data/templates/jquery/jquery/ui/contextMenu/page_white_new.png +0 -0
  229. data/templates/jquery/jquery/ui/contextMenu/page_white_paste.png +0 -0
  230. data/templates/jquery/jquery.compat-1.3.js +0 -291
  231. data/templates/jquery/jquery.compat-1.3.min.js +0 -6
  232. data/templates/jquery/jquery.flash_messages.js +0 -5
  233. data/templates/jquery/jquery.flash_messages.min.js +0 -1
  234. data/templates/jquery/jquery.history.js +0 -194
  235. data/templates/jquery/jquery.history.min.js +0 -5
@@ -18,10 +18,9 @@ ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery'
18
18
  #ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
19
19
 
20
20
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => ['jquery.min']
21
- ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery_ui => ['jquery.min', 'jquery.cookie.min', 'jquery.form.min', 'jquery.layout.min', 'jquery-ui.min']
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
22
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jrails => ['jrails.min']
23
23
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jhaml => ['jquery.haml.min']
24
- ActionView::Helpers::AssetTagHelper.register_javascript_expansion :haml_js => ['haml-js.min']
25
24
  ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :contextMenu => ['compiled/jquery/ui/contextMenu.css']
26
25
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :contextMenu => ['jquery.contextMenu.min']
27
26
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :cookie => ['jquery.cookie.min']
@@ -30,14 +29,13 @@ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :dst => ['jque
30
29
  ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :farbtastic => ['compiled/jquery/ui/farbtastic.css']
31
30
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :farbtastic => ['jquery.farbtastic.min']
32
31
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :form => ['jquery.form.min']
33
- ActionView::Helpers::AssetTagHelper.register_javascript_expansion :history => ['jquery.history.min']
32
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :history => ['history.adapter.jquery.min', 'history.min', 'history.html4.min']
34
33
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :hotkeys => ['jquery.hotkeys.min']
35
34
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :layout => ['jquery.layout.min']
36
35
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :mousewheel => ['jquery.mousewheel.min']
37
36
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :offline => ['json.min', 'jquery.offline.min']
38
37
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :pngFix => ['jquery.pngFix.min']
39
38
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :replaceText => ['jquery.replaceText.min']
40
- ActionView::Helpers::AssetTagHelper.register_javascript_expansion :sparklines => ['jquery.sparkline.min']
41
39
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :themeSwitcher => ['jquery.themeswitchertool.min']
42
40
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :tmpl => ['jquery.tmpl.min', 'jquery.tmplPlus.min']
43
41
 
@@ -0,0 +1,71 @@
1
+ /**
2
+ * History.js jQuery Adapter
3
+ * @author Benjamin Arthur Lupton
4
+ * @copyright 2010-2011 Benjamin Arthur Lupton
5
+ * @license New BSD License - http://creativecommons.org/licenses/BSD/
6
+ */
7
+
8
+ (function($,window,undefined){
9
+
10
+ // --------------------------------------------------------------------------
11
+ // Initialise
12
+
13
+ // History Object
14
+ window.History = window.History||{};
15
+
16
+ // Localise Globals
17
+ var
18
+ History = window.History||{},
19
+ history = window.history;
20
+
21
+ // Check Existence of Adapter
22
+ if ( typeof History.Adapter !== 'undefined' ) {
23
+ throw new Error('History.js Adapter has already been loaded...');
24
+ }
25
+
26
+ // Add the Adapter
27
+ History.Adapter = {
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
+ },
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
+ },
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
+ }
58
+
59
+ };
60
+
61
+ // Check Load Status of HTML5 Support
62
+ if ( typeof History.initHtml5 !== 'undefined' ) {
63
+ History.initHtml5();
64
+ }
65
+
66
+ // Check Load Status of HTML4 Support
67
+ if ( typeof History.initHtml4 !== 'undefined' ) {
68
+ History.initHtml4();
69
+ }
70
+
71
+ })(jQuery,window);
@@ -0,0 +1,4 @@
1
+ /*
2
+ New BSD License - http://creativecommons.org/licenses/BSD/
3
+ */
4
+ (function(e,c){c.History=c.History||{};var a=c.History||{};if(typeof a.Adapter!=="undefined")throw Error("History.js Adapter has already been loaded...");a.Adapter={bind:function(b,d,f){return e(b).bind(d,f)},trigger:function(b,d){return e(b).trigger(d)},onDomLoad:function(b){jQuery(b)}};typeof a.initHtml5!=="undefined"&&a.initHtml5();typeof a.initHtml4!=="undefined"&&a.initHtml4()})(jQuery,window);
@@ -0,0 +1,690 @@
1
+ /**
2
+ * History.js HTML4 Support
3
+ * Depends on the HTML5 Support
4
+ * @author Benjamin Arthur Lupton <contact@balupton.com>
5
+ * @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
6
+ * @license New BSD License <http://creativecommons.org/licenses/BSD/>
7
+ */
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();
689
+
690
+ })(window);