jquery_rails3 1.4.2.b2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. data/Rakefile +1 -1
  2. data/lib/generators/{jquery_install → jquery/install}/USAGE +3 -2
  3. data/lib/generators/jquery/install/install_generator.rb +40 -0
  4. data/lib/jquery_rails3.rb +11 -0
  5. metadata +13 -186
  6. data/lib/generators/jquery_install/jquery_install_generator.rb +0 -102
  7. data/lib/generators/jquery_install/templates/jquery-1.4.2.js +0 -6240
  8. data/lib/generators/jquery_install/templates/jquery-1.4.2.min.js +0 -154
  9. data/lib/generators/jquery_install/templates/layout.html.erb +0 -14
  10. data/lib/generators/jquery_install/templates/rails.js +0 -132
  11. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  13. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  14. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  15. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  16. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  17. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  18. data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  19. data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_222222_256x240.png +0 -0
  20. data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  21. data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_454545_256x240.png +0 -0
  22. data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_888888_256x240.png +0 -0
  23. data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  24. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.accordion.css +0 -19
  25. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.all.css +0 -11
  26. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.autocomplete.css +0 -53
  27. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.base.css +0 -11
  28. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.button.css +0 -38
  29. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.core.css +0 -41
  30. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.datepicker.css +0 -68
  31. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.dialog.css +0 -21
  32. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.progressbar.css +0 -11
  33. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.resizable.css +0 -20
  34. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.selectable.css +0 -10
  35. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.slider.css +0 -24
  36. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.tabs.css +0 -18
  37. data/lib/generators/jquery_install/templates/themes/base/jquery.ui.theme.css +0 -252
  38. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  39. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  40. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  41. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  42. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  43. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  44. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  45. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  46. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
  47. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  48. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
  49. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
  50. data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  51. data/lib/generators/jquery_install/templates/themes/smoothness/jquery-ui-1.8.4.custom.css +0 -572
  52. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.accordion.css +0 -19
  53. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.all.css +0 -11
  54. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.autocomplete.css +0 -53
  55. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.base.css +0 -11
  56. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.button.css +0 -38
  57. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.core.css +0 -41
  58. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.datepicker.css +0 -68
  59. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.dialog.css +0 -21
  60. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.progressbar.css +0 -11
  61. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.resizable.css +0 -20
  62. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.selectable.css +0 -10
  63. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.slider.css +0 -24
  64. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.tabs.css +0 -18
  65. data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.theme.css +0 -254
  66. data/lib/generators/jquery_install/templates/ui/i18n/jquery-ui-i18n.js +0 -1176
  67. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-af.js +0 -23
  68. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ar.js +0 -24
  69. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-az.js +0 -23
  70. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-bg.js +0 -24
  71. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-bs.js +0 -23
  72. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ca.js +0 -23
  73. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-cs.js +0 -23
  74. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-da.js +0 -23
  75. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-de.js +0 -23
  76. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-el.js +0 -23
  77. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -23
  78. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-eo.js +0 -23
  79. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-es.js +0 -23
  80. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-et.js +0 -23
  81. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-eu.js +0 -23
  82. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fa.js +0 -23
  83. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fi.js +0 -23
  84. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fo.js +0 -23
  85. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -23
  86. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fr.js +0 -23
  87. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-he.js +0 -23
  88. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hr.js +0 -23
  89. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hu.js +0 -23
  90. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hy.js +0 -23
  91. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-id.js +0 -23
  92. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-is.js +0 -23
  93. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-it.js +0 -23
  94. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ja.js +0 -23
  95. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ko.js +0 -23
  96. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-lt.js +0 -23
  97. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-lv.js +0 -23
  98. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ms.js +0 -23
  99. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-nl.js +0 -23
  100. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-no.js +0 -23
  101. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-pl.js +0 -23
  102. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -23
  103. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ro.js +0 -26
  104. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ru.js +0 -23
  105. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sk.js +0 -23
  106. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sl.js +0 -24
  107. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sq.js +0 -23
  108. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -23
  109. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sr.js +0 -23
  110. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sv.js +0 -23
  111. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ta.js +0 -23
  112. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-th.js +0 -23
  113. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-tr.js +0 -23
  114. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-uk.js +0 -23
  115. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-vi.js +0 -23
  116. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -23
  117. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -23
  118. data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -23
  119. data/lib/generators/jquery_install/templates/ui/jquery-ui-1.8.4.custom.js +0 -11241
  120. data/lib/generators/jquery_install/templates/ui/jquery.effects.blind.js +0 -49
  121. data/lib/generators/jquery_install/templates/ui/jquery.effects.bounce.js +0 -78
  122. data/lib/generators/jquery_install/templates/ui/jquery.effects.clip.js +0 -54
  123. data/lib/generators/jquery_install/templates/ui/jquery.effects.core.js +0 -714
  124. data/lib/generators/jquery_install/templates/ui/jquery.effects.drop.js +0 -50
  125. data/lib/generators/jquery_install/templates/ui/jquery.effects.explode.js +0 -79
  126. data/lib/generators/jquery_install/templates/ui/jquery.effects.fold.js +0 -56
  127. data/lib/generators/jquery_install/templates/ui/jquery.effects.highlight.js +0 -50
  128. data/lib/generators/jquery_install/templates/ui/jquery.effects.pulsate.js +0 -51
  129. data/lib/generators/jquery_install/templates/ui/jquery.effects.scale.js +0 -178
  130. data/lib/generators/jquery_install/templates/ui/jquery.effects.shake.js +0 -57
  131. data/lib/generators/jquery_install/templates/ui/jquery.effects.slide.js +0 -50
  132. data/lib/generators/jquery_install/templates/ui/jquery.effects.transfer.js +0 -45
  133. data/lib/generators/jquery_install/templates/ui/jquery.ui.accordion.js +0 -598
  134. data/lib/generators/jquery_install/templates/ui/jquery.ui.autocomplete.js +0 -544
  135. data/lib/generators/jquery_install/templates/ui/jquery.ui.button.js +0 -365
  136. data/lib/generators/jquery_install/templates/ui/jquery.ui.core.js +0 -281
  137. data/lib/generators/jquery_install/templates/ui/jquery.ui.datepicker.js +0 -1732
  138. data/lib/generators/jquery_install/templates/ui/jquery.ui.dialog.js +0 -827
  139. data/lib/generators/jquery_install/templates/ui/jquery.ui.draggable.js +0 -797
  140. data/lib/generators/jquery_install/templates/ui/jquery.ui.droppable.js +0 -285
  141. data/lib/generators/jquery_install/templates/ui/jquery.ui.mouse.js +0 -151
  142. data/lib/generators/jquery_install/templates/ui/jquery.ui.position.js +0 -233
  143. data/lib/generators/jquery_install/templates/ui/jquery.ui.progressbar.js +0 -94
  144. data/lib/generators/jquery_install/templates/ui/jquery.ui.resizable.js +0 -812
  145. data/lib/generators/jquery_install/templates/ui/jquery.ui.selectable.js +0 -266
  146. data/lib/generators/jquery_install/templates/ui/jquery.ui.slider.js +0 -680
  147. data/lib/generators/jquery_install/templates/ui/jquery.ui.sortable.js +0 -1071
  148. data/lib/generators/jquery_install/templates/ui/jquery.ui.tabs.js +0 -757
  149. data/lib/generators/jquery_install/templates/ui/jquery.ui.widget.js +0 -237
  150. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.blind.min.js +0 -14
  151. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.bounce.min.js +0 -15
  152. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.clip.min.js +0 -14
  153. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.core.min.js +0 -30
  154. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.drop.min.js +0 -14
  155. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.explode.min.js +0 -15
  156. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.fold.min.js +0 -14
  157. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.highlight.min.js +0 -14
  158. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.pulsate.min.js +0 -14
  159. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.scale.min.js +0 -20
  160. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.shake.min.js +0 -14
  161. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.slide.min.js +0 -14
  162. data/lib/generators/jquery_install/templates/ui-min/jquery.effects.transfer.min.js +0 -14
  163. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.accordion.min.js +0 -30
  164. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.autocomplete.min.js +0 -31
  165. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.button.min.js +0 -24
  166. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.core.min.js +0 -17
  167. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.datepicker.min.js +0 -80
  168. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.dialog.min.js +0 -39
  169. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.draggable.min.js +0 -49
  170. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.droppable.min.js +0 -26
  171. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.mouse.min.js +0 -17
  172. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.position.min.js +0 -15
  173. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.progressbar.min.js +0 -16
  174. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.resizable.min.js +0 -47
  175. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.selectable.min.js +0 -22
  176. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.slider.min.js +0 -33
  177. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.sortable.min.js +0 -60
  178. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.tabs.min.js +0 -35
  179. data/lib/generators/jquery_install/templates/ui-min/jquery.ui.widget.min.js +0 -15
@@ -1,757 +0,0 @@
1
- /*
2
- * jQuery UI Tabs 1.8.4
3
- *
4
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI/Tabs
9
- *
10
- * Depends:
11
- * jquery.ui.core.js
12
- * jquery.ui.widget.js
13
- */
14
- (function( $, undefined ) {
15
-
16
- var tabId = 0,
17
- listId = 0;
18
-
19
- function getNextTabId() {
20
- return ++tabId;
21
- }
22
-
23
- function getNextListId() {
24
- return ++listId;
25
- }
26
-
27
- $.widget( "ui.tabs", {
28
- options: {
29
- add: null,
30
- ajaxOptions: null,
31
- cache: false,
32
- cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
33
- collapsible: false,
34
- disable: null,
35
- disabled: [],
36
- enable: null,
37
- event: "click",
38
- fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
39
- idPrefix: "ui-tabs-",
40
- load: null,
41
- panelTemplate: "<div></div>",
42
- remove: null,
43
- select: null,
44
- show: null,
45
- spinner: "<em>Loading&#8230;</em>",
46
- tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
47
- },
48
-
49
- _create: function() {
50
- this._tabify( true );
51
- },
52
-
53
- _setOption: function( key, value ) {
54
- if ( key == "selected" ) {
55
- if (this.options.collapsible && value == this.options.selected ) {
56
- return;
57
- }
58
- this.select( value );
59
- } else {
60
- this.options[ key ] = value;
61
- this._tabify();
62
- }
63
- },
64
-
65
- _tabId: function( a ) {
66
- return a.title && a.title.replace( /\s/g, "_" ).replace( /[^A-Za-z0-9\-_:\.]/g, "" ) ||
67
- this.options.idPrefix + getNextTabId();
68
- },
69
-
70
- _sanitizeSelector: function( hash ) {
71
- // we need this because an id may contain a ":"
72
- return hash.replace( /:/g, "\\:" );
73
- },
74
-
75
- _cookie: function() {
76
- var cookie = this.cookie ||
77
- ( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() );
78
- return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) );
79
- },
80
-
81
- _ui: function( tab, panel ) {
82
- return {
83
- tab: tab,
84
- panel: panel,
85
- index: this.anchors.index( tab )
86
- };
87
- },
88
-
89
- _cleanup: function() {
90
- // restore all former loading tabs labels
91
- this.lis.filter( ".ui-state-processing" )
92
- .removeClass( "ui-state-processing" )
93
- .find( "span:data(label.tabs)" )
94
- .each(function() {
95
- var el = $( this );
96
- el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" );
97
- });
98
- },
99
-
100
- _tabify: function( init ) {
101
- var self = this,
102
- o = this.options,
103
- fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
104
-
105
- this.list = this.element.find( "ol,ul" ).eq( 0 );
106
- this.lis = $( "li:has(a[href])", this.list );
107
- this.anchors = this.lis.map(function() {
108
- return $( "a", this )[ 0 ];
109
- });
110
- this.panels = $( [] );
111
-
112
- this.anchors.each(function( i, a ) {
113
- var href = $( a ).attr( "href" );
114
- // For dynamically created HTML that contains a hash as href IE < 8 expands
115
- // such href to the full page url with hash and then misinterprets tab as ajax.
116
- // Same consideration applies for an added tab with a fragment identifier
117
- // since a[href=#fragment-identifier] does unexpectedly not match.
118
- // Thus normalize href attribute...
119
- var hrefBase = href.split( "#" )[ 0 ],
120
- baseEl;
121
- if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] ||
122
- ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) {
123
- href = a.hash;
124
- a.href = href;
125
- }
126
-
127
- // inline tab
128
- if ( fragmentId.test( href ) ) {
129
- self.panels = self.panels.add( self._sanitizeSelector( href ) );
130
- // remote tab
131
- // prevent loading the page itself if href is just "#"
132
- } else if ( href !== "#" ) {
133
- // required for restore on destroy
134
- $.data( a, "href.tabs", href );
135
-
136
- // TODO until #3808 is fixed strip fragment identifier from url
137
- // (IE fails to load from such url)
138
- $.data( a, "load.tabs", href.replace( /#.*$/, "" ) );
139
-
140
- var id = self._tabId( a );
141
- a.href = "#" + id;
142
- var $panel = $( "#" + id );
143
- if ( !$panel.length ) {
144
- $panel = $( o.panelTemplate )
145
- .attr( "id", id )
146
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
147
- .insertAfter( self.panels[ i - 1 ] || self.list );
148
- $panel.data( "destroy.tabs", true );
149
- }
150
- self.panels = self.panels.add( $panel );
151
- // invalid tab href
152
- } else {
153
- o.disabled.push( i );
154
- }
155
- });
156
-
157
- // initialization from scratch
158
- if ( init ) {
159
- // attach necessary classes for styling
160
- this.element.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" );
161
- this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
162
- this.lis.addClass( "ui-state-default ui-corner-top" );
163
- this.panels.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" );
164
-
165
- // Selected tab
166
- // use "selected" option or try to retrieve:
167
- // 1. from fragment identifier in url
168
- // 2. from cookie
169
- // 3. from selected class attribute on <li>
170
- if ( o.selected === undefined ) {
171
- if ( location.hash ) {
172
- this.anchors.each(function( i, a ) {
173
- if ( a.hash == location.hash ) {
174
- o.selected = i;
175
- return false;
176
- }
177
- });
178
- }
179
- if ( typeof o.selected !== "number" && o.cookie ) {
180
- o.selected = parseInt( self._cookie(), 10 );
181
- }
182
- if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) {
183
- o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
184
- }
185
- o.selected = o.selected || ( this.lis.length ? 0 : -1 );
186
- } else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release
187
- o.selected = -1;
188
- }
189
-
190
- // sanity check - default to first tab...
191
- o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 )
192
- ? o.selected
193
- : 0;
194
-
195
- // Take disabling tabs via class attribute from HTML
196
- // into account and update option properly.
197
- // A selected tab cannot become disabled.
198
- o.disabled = $.unique( o.disabled.concat(
199
- $.map( this.lis.filter( ".ui-state-disabled" ), function( n, i ) {
200
- return self.lis.index( n );
201
- })
202
- ) ).sort();
203
-
204
- if ( $.inArray( o.selected, o.disabled ) != -1 ) {
205
- o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 );
206
- }
207
-
208
- // highlight selected tab
209
- this.panels.addClass( "ui-tabs-hide" );
210
- this.lis.removeClass( "ui-tabs-selected ui-state-active" );
211
- // check for length avoids error when initializing empty list
212
- if ( o.selected >= 0 && this.anchors.length ) {
213
- this.panels.eq( o.selected ).removeClass( "ui-tabs-hide" );
214
- this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" );
215
-
216
- // seems to be expected behavior that the show callback is fired
217
- self.element.queue( "tabs", function() {
218
- self._trigger( "show", null,
219
- self._ui( self.anchors[ o.selected ], self.panels[ o.selected ] ) );
220
- });
221
-
222
- this.load( o.selected );
223
- }
224
-
225
- // clean up to avoid memory leaks in certain versions of IE 6
226
- // TODO: namespace this event
227
- $( window ).bind( "unload", function() {
228
- self.lis.add( self.anchors ).unbind( ".tabs" );
229
- self.lis = self.anchors = self.panels = null;
230
- });
231
- // update selected after add/remove
232
- } else {
233
- o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
234
- }
235
-
236
- // update collapsible
237
- // TODO: use .toggleClass()
238
- this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" );
239
-
240
- // set or update cookie after init and add/remove respectively
241
- if ( o.cookie ) {
242
- this._cookie( o.selected, o.cookie );
243
- }
244
-
245
- // disable tabs
246
- for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {
247
- $( li )[ $.inArray( i, o.disabled ) != -1 &&
248
- // TODO: use .toggleClass()
249
- !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" );
250
- }
251
-
252
- // reset cache if switching from cached to not cached
253
- if ( o.cache === false ) {
254
- this.anchors.removeData( "cache.tabs" );
255
- }
256
-
257
- // remove all handlers before, tabify may run on existing tabs after add or option change
258
- this.lis.add( this.anchors ).unbind( ".tabs" );
259
-
260
- if ( o.event !== "mouseover" ) {
261
- var addState = function( state, el ) {
262
- if ( el.is( ":not(.ui-state-disabled)" ) ) {
263
- el.addClass( "ui-state-" + state );
264
- }
265
- };
266
- var removeState = function( state, el ) {
267
- el.removeClass( "ui-state-" + state );
268
- };
269
- this.lis.bind( "mouseover.tabs" , function() {
270
- addState( "hover", $( this ) );
271
- });
272
- this.lis.bind( "mouseout.tabs", function() {
273
- removeState( "hover", $( this ) );
274
- });
275
- this.anchors.bind( "focus.tabs", function() {
276
- addState( "focus", $( this ).closest( "li" ) );
277
- });
278
- this.anchors.bind( "blur.tabs", function() {
279
- removeState( "focus", $( this ).closest( "li" ) );
280
- });
281
- }
282
-
283
- // set up animations
284
- var hideFx, showFx;
285
- if ( o.fx ) {
286
- if ( $.isArray( o.fx ) ) {
287
- hideFx = o.fx[ 0 ];
288
- showFx = o.fx[ 1 ];
289
- } else {
290
- hideFx = showFx = o.fx;
291
- }
292
- }
293
-
294
- // Reset certain styles left over from animation
295
- // and prevent IE's ClearType bug...
296
- function resetStyle( $el, fx ) {
297
- $el.css( "display", "" );
298
- if ( !$.support.opacity && fx.opacity ) {
299
- $el[ 0 ].style.removeAttribute( "filter" );
300
- }
301
- }
302
-
303
- // Show a tab...
304
- var showTab = showFx
305
- ? function( clicked, $show ) {
306
- $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
307
- $show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way
308
- .animate( showFx, showFx.duration || "normal", function() {
309
- resetStyle( $show, showFx );
310
- self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
311
- });
312
- }
313
- : function( clicked, $show ) {
314
- $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
315
- $show.removeClass( "ui-tabs-hide" );
316
- self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
317
- };
318
-
319
- // Hide a tab, $show is optional...
320
- var hideTab = hideFx
321
- ? function( clicked, $hide ) {
322
- $hide.animate( hideFx, hideFx.duration || "normal", function() {
323
- self.lis.removeClass( "ui-tabs-selected ui-state-active" );
324
- $hide.addClass( "ui-tabs-hide" );
325
- resetStyle( $hide, hideFx );
326
- self.element.dequeue( "tabs" );
327
- });
328
- }
329
- : function( clicked, $hide, $show ) {
330
- self.lis.removeClass( "ui-tabs-selected ui-state-active" );
331
- $hide.addClass( "ui-tabs-hide" );
332
- self.element.dequeue( "tabs" );
333
- };
334
-
335
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
336
- this.anchors.bind( o.event + ".tabs", function() {
337
- var el = this,
338
- $li = $(el).closest( "li" ),
339
- $hide = self.panels.filter( ":not(.ui-tabs-hide)" ),
340
- $show = $( self._sanitizeSelector( el.hash ) );
341
-
342
- // If tab is already selected and not collapsible or tab disabled or
343
- // or is already loading or click callback returns false stop here.
344
- // Check if click handler returns false last so that it is not executed
345
- // for a disabled or loading tab!
346
- if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) ||
347
- $li.hasClass( "ui-state-disabled" ) ||
348
- $li.hasClass( "ui-state-processing" ) ||
349
- self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
350
- this.blur();
351
- return false;
352
- }
353
-
354
- o.selected = self.anchors.index( this );
355
-
356
- self.abort();
357
-
358
- // if tab may be closed
359
- if ( o.collapsible ) {
360
- if ( $li.hasClass( "ui-tabs-selected" ) ) {
361
- o.selected = -1;
362
-
363
- if ( o.cookie ) {
364
- self._cookie( o.selected, o.cookie );
365
- }
366
-
367
- self.element.queue( "tabs", function() {
368
- hideTab( el, $hide );
369
- }).dequeue( "tabs" );
370
-
371
- this.blur();
372
- return false;
373
- } else if ( !$hide.length ) {
374
- if ( o.cookie ) {
375
- self._cookie( o.selected, o.cookie );
376
- }
377
-
378
- self.element.queue( "tabs", function() {
379
- showTab( el, $show );
380
- });
381
-
382
- // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
383
- self.load( self.anchors.index( this ) );
384
-
385
- this.blur();
386
- return false;
387
- }
388
- }
389
-
390
- if ( o.cookie ) {
391
- self._cookie( o.selected, o.cookie );
392
- }
393
-
394
- // show new tab
395
- if ( $show.length ) {
396
- if ( $hide.length ) {
397
- self.element.queue( "tabs", function() {
398
- hideTab( el, $hide );
399
- });
400
- }
401
- self.element.queue( "tabs", function() {
402
- showTab( el, $show );
403
- });
404
-
405
- self.load( self.anchors.index( this ) );
406
- } else {
407
- throw "jQuery UI Tabs: Mismatching fragment identifier.";
408
- }
409
-
410
- // Prevent IE from keeping other link focussed when using the back button
411
- // and remove dotted border from clicked link. This is controlled via CSS
412
- // in modern browsers; blur() removes focus from address bar in Firefox
413
- // which can become a usability and annoying problem with tabs('rotate').
414
- if ( $.browser.msie ) {
415
- this.blur();
416
- }
417
- });
418
-
419
- // disable click in any case
420
- this.anchors.bind( "click.tabs", function(){
421
- return false;
422
- });
423
- },
424
-
425
- _getIndex: function( index ) {
426
- // meta-function to give users option to provide a href string instead of a numerical index.
427
- // also sanitizes numerical indexes to valid values.
428
- if ( typeof index == "string" ) {
429
- index = this.anchors.index( this.anchors.filter( "[href$=" + index + "]" ) );
430
- }
431
-
432
- return index;
433
- },
434
-
435
- destroy: function() {
436
- var o = this.options;
437
-
438
- this.abort();
439
-
440
- this.element
441
- .unbind( ".tabs" )
442
- .removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" )
443
- .removeData( "tabs" );
444
-
445
- this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
446
-
447
- this.anchors.each(function() {
448
- var href = $.data( this, "href.tabs" );
449
- if ( href ) {
450
- this.href = href;
451
- }
452
- var $this = $( this ).unbind( ".tabs" );
453
- $.each( [ "href", "load", "cache" ], function( i, prefix ) {
454
- $this.removeData( prefix + ".tabs" );
455
- });
456
- });
457
-
458
- this.lis.unbind( ".tabs" ).add( this.panels ).each(function() {
459
- if ( $.data( this, "destroy.tabs" ) ) {
460
- $( this ).remove();
461
- } else {
462
- $( this ).removeClass([
463
- "ui-state-default",
464
- "ui-corner-top",
465
- "ui-tabs-selected",
466
- "ui-state-active",
467
- "ui-state-hover",
468
- "ui-state-focus",
469
- "ui-state-disabled",
470
- "ui-tabs-panel",
471
- "ui-widget-content",
472
- "ui-corner-bottom",
473
- "ui-tabs-hide"
474
- ].join( " " ) );
475
- }
476
- });
477
-
478
- if ( o.cookie ) {
479
- this._cookie( null, o.cookie );
480
- }
481
-
482
- return this;
483
- },
484
-
485
- add: function( url, label, index ) {
486
- if ( index === undefined ) {
487
- index = this.anchors.length;
488
- }
489
-
490
- var self = this,
491
- o = this.options,
492
- $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ),
493
- id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] );
494
-
495
- $li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true );
496
-
497
- // try to find an existing element before creating a new one
498
- var $panel = $( "#" + id );
499
- if ( !$panel.length ) {
500
- $panel = $( o.panelTemplate )
501
- .attr( "id", id )
502
- .data( "destroy.tabs", true );
503
- }
504
- $panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" );
505
-
506
- if ( index >= this.lis.length ) {
507
- $li.appendTo( this.list );
508
- $panel.appendTo( this.list[ 0 ].parentNode );
509
- } else {
510
- $li.insertBefore( this.lis[ index ] );
511
- $panel.insertBefore( this.panels[ index ] );
512
- }
513
-
514
- o.disabled = $.map( o.disabled, function( n, i ) {
515
- return n >= index ? ++n : n;
516
- });
517
-
518
- this._tabify();
519
-
520
- if ( this.anchors.length == 1 ) {
521
- o.selected = 0;
522
- $li.addClass( "ui-tabs-selected ui-state-active" );
523
- $panel.removeClass( "ui-tabs-hide" );
524
- this.element.queue( "tabs", function() {
525
- self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) );
526
- });
527
-
528
- this.load( 0 );
529
- }
530
-
531
- this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
532
- return this;
533
- },
534
-
535
- remove: function( index ) {
536
- index = this._getIndex( index );
537
- var o = this.options,
538
- $li = this.lis.eq( index ).remove(),
539
- $panel = this.panels.eq( index ).remove();
540
-
541
- // If selected tab was removed focus tab to the right or
542
- // in case the last tab was removed the tab to the left.
543
- if ( $li.hasClass( "ui-tabs-selected" ) && this.anchors.length > 1) {
544
- this.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) );
545
- }
546
-
547
- o.disabled = $.map(
548
- $.grep( o.disabled, function(n, i) {
549
- return n != index;
550
- }),
551
- function( n, i ) {
552
- return n >= index ? --n : n;
553
- });
554
-
555
- this._tabify();
556
-
557
- this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) );
558
- return this;
559
- },
560
-
561
- enable: function( index ) {
562
- index = this._getIndex( index );
563
- var o = this.options;
564
- if ( $.inArray( index, o.disabled ) == -1 ) {
565
- return;
566
- }
567
-
568
- this.lis.eq( index ).removeClass( "ui-state-disabled" );
569
- o.disabled = $.grep( o.disabled, function( n, i ) {
570
- return n != index;
571
- });
572
-
573
- this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
574
- return this;
575
- },
576
-
577
- disable: function( index ) {
578
- index = this._getIndex( index );
579
- var self = this, o = this.options;
580
- // cannot disable already selected tab
581
- if ( index != o.selected ) {
582
- this.lis.eq( index ).addClass( "ui-state-disabled" );
583
-
584
- o.disabled.push( index );
585
- o.disabled.sort();
586
-
587
- this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
588
- }
589
-
590
- return this;
591
- },
592
-
593
- select: function( index ) {
594
- index = this._getIndex( index );
595
- if ( index == -1 ) {
596
- if ( this.options.collapsible && this.options.selected != -1 ) {
597
- index = this.options.selected;
598
- } else {
599
- return this;
600
- }
601
- }
602
- this.anchors.eq( index ).trigger( this.options.event + ".tabs" );
603
- return this;
604
- },
605
-
606
- load: function( index ) {
607
- index = this._getIndex( index );
608
- var self = this,
609
- o = this.options,
610
- a = this.anchors.eq( index )[ 0 ],
611
- url = $.data( a, "load.tabs" );
612
-
613
- this.abort();
614
-
615
- // not remote or from cache
616
- if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) {
617
- this.element.dequeue( "tabs" );
618
- return;
619
- }
620
-
621
- // load remote from here on
622
- this.lis.eq( index ).addClass( "ui-state-processing" );
623
-
624
- if ( o.spinner ) {
625
- var span = $( "span", a );
626
- span.data( "label.tabs", span.html() ).html( o.spinner );
627
- }
628
-
629
- this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, {
630
- url: url,
631
- success: function( r, s ) {
632
- $( self._sanitizeSelector( a.hash ) ).html( r );
633
-
634
- // take care of tab labels
635
- self._cleanup();
636
-
637
- if ( o.cache ) {
638
- $.data( a, "cache.tabs", true );
639
- }
640
-
641
- self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
642
- try {
643
- o.ajaxOptions.success( r, s );
644
- }
645
- catch ( e ) {}
646
- },
647
- error: function( xhr, s, e ) {
648
- // take care of tab labels
649
- self._cleanup();
650
-
651
- self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
652
- try {
653
- // Passing index avoid a race condition when this method is
654
- // called after the user has selected another tab.
655
- // Pass the anchor that initiated this request allows
656
- // loadError to manipulate the tab content panel via $(a.hash)
657
- o.ajaxOptions.error( xhr, s, index, a );
658
- }
659
- catch ( e ) {}
660
- }
661
- } ) );
662
-
663
- // last, so that load event is fired before show...
664
- self.element.dequeue( "tabs" );
665
-
666
- return this;
667
- },
668
-
669
- abort: function() {
670
- // stop possibly running animations
671
- this.element.queue( [] );
672
- this.panels.stop( false, true );
673
-
674
- // "tabs" queue must not contain more than two elements,
675
- // which are the callbacks for the latest clicked tab...
676
- this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) );
677
-
678
- // terminate pending requests from other tabs
679
- if ( this.xhr ) {
680
- this.xhr.abort();
681
- delete this.xhr;
682
- }
683
-
684
- // take care of tab labels
685
- this._cleanup();
686
- return this;
687
- },
688
-
689
- url: function( index, url ) {
690
- this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url );
691
- return this;
692
- },
693
-
694
- length: function() {
695
- return this.anchors.length;
696
- }
697
- });
698
-
699
- $.extend( $.ui.tabs, {
700
- version: "1.8.4"
701
- });
702
-
703
- /*
704
- * Tabs Extensions
705
- */
706
-
707
- /*
708
- * Rotate
709
- */
710
- $.extend( $.ui.tabs.prototype, {
711
- rotation: null,
712
- rotate: function( ms, continuing ) {
713
- var self = this,
714
- o = this.options;
715
-
716
- var rotate = self._rotate || ( self._rotate = function( e ) {
717
- clearTimeout( self.rotation );
718
- self.rotation = setTimeout(function() {
719
- var t = o.selected;
720
- self.select( ++t < self.anchors.length ? t : 0 );
721
- }, ms );
722
-
723
- if ( e ) {
724
- e.stopPropagation();
725
- }
726
- });
727
-
728
- var stop = self._unrotate || ( self._unrotate = !continuing
729
- ? function(e) {
730
- if (e.clientX) { // in case of a true click
731
- self.rotate(null);
732
- }
733
- }
734
- : function( e ) {
735
- t = o.selected;
736
- rotate();
737
- });
738
-
739
- // start rotation
740
- if ( ms ) {
741
- this.element.bind( "tabsshow", rotate );
742
- this.anchors.bind( o.event + ".tabs", stop );
743
- rotate();
744
- // stop rotation
745
- } else {
746
- clearTimeout( self.rotation );
747
- this.element.unbind( "tabsshow", rotate );
748
- this.anchors.unbind( o.event + ".tabs", stop );
749
- delete this._rotate;
750
- delete this._unrotate;
751
- }
752
-
753
- return this;
754
- }
755
- });
756
-
757
- })( jQuery );