jquery-ui-rails 0.0.1

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