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,598 +0,0 @@
1
- /*
2
- * jQuery UI Accordion 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/Accordion
9
- *
10
- * Depends:
11
- * jquery.ui.core.js
12
- * jquery.ui.widget.js
13
- */
14
- (function( $, undefined ) {
15
-
16
- $.widget( "ui.accordion", {
17
- options: {
18
- active: 0,
19
- animated: "slide",
20
- autoHeight: true,
21
- clearStyle: false,
22
- collapsible: false,
23
- event: "click",
24
- fillSpace: false,
25
- header: "> li > :first-child,> :not(li):even",
26
- icons: {
27
- header: "ui-icon-triangle-1-e",
28
- headerSelected: "ui-icon-triangle-1-s"
29
- },
30
- navigation: false,
31
- navigationFilter: function() {
32
- return this.href.toLowerCase() === location.href.toLowerCase();
33
- }
34
- },
35
-
36
- _create: function() {
37
- var self = this,
38
- options = self.options;
39
-
40
- self.running = 0;
41
-
42
- self.element
43
- .addClass( "ui-accordion ui-widget ui-helper-reset" )
44
- // in lack of child-selectors in CSS
45
- // we need to mark top-LIs in a UL-accordion for some IE-fix
46
- .children( "li" )
47
- .addClass( "ui-accordion-li-fix" );
48
-
49
- self.headers = self.element.find( options.header )
50
- .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" )
51
- .bind( "mouseenter.accordion", function() {
52
- if ( options.disabled ) {
53
- return;
54
- }
55
- $( this ).addClass( "ui-state-hover" );
56
- })
57
- .bind( "mouseleave.accordion", function() {
58
- if ( options.disabled ) {
59
- return;
60
- }
61
- $( this ).removeClass( "ui-state-hover" );
62
- })
63
- .bind( "focus.accordion", function() {
64
- if ( options.disabled ) {
65
- return;
66
- }
67
- $( this ).addClass( "ui-state-focus" );
68
- })
69
- .bind( "blur.accordion", function() {
70
- if ( options.disabled ) {
71
- return;
72
- }
73
- $( this ).removeClass( "ui-state-focus" );
74
- });
75
-
76
- self.headers.next()
77
- .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );
78
-
79
- if ( options.navigation ) {
80
- var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 );
81
- if ( current.length ) {
82
- var header = current.closest( ".ui-accordion-header" );
83
- if ( header.length ) {
84
- // anchor within header
85
- self.active = header;
86
- } else {
87
- // anchor within content
88
- self.active = current.closest( ".ui-accordion-content" ).prev();
89
- }
90
- }
91
- }
92
-
93
- self.active = self._findActive( self.active || options.active )
94
- .addClass( "ui-state-default ui-state-active" )
95
- .toggleClass( "ui-corner-all ui-corner-top" );
96
- self.active.next().addClass( "ui-accordion-content-active" );
97
-
98
- self._createIcons();
99
- self.resize();
100
-
101
- // ARIA
102
- self.element.attr( "role", "tablist" );
103
-
104
- self.headers
105
- .attr( "role", "tab" )
106
- .bind( "keydown.accordion", function( event ) {
107
- return self._keydown( event );
108
- })
109
- .next()
110
- .attr( "role", "tabpanel" );
111
-
112
- self.headers
113
- .not( self.active || "" )
114
- .attr({
115
- "aria-expanded": "false",
116
- tabIndex: -1
117
- })
118
- .next()
119
- .hide();
120
-
121
- // make sure at least one header is in the tab order
122
- if ( !self.active.length ) {
123
- self.headers.eq( 0 ).attr( "tabIndex", 0 );
124
- } else {
125
- self.active
126
- .attr({
127
- "aria-expanded": "true",
128
- tabIndex: 0
129
- });
130
- }
131
-
132
- // only need links in tab order for Safari
133
- if ( !$.browser.safari ) {
134
- self.headers.find( "a" ).attr( "tabIndex", -1 );
135
- }
136
-
137
- if ( options.event ) {
138
- self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) {
139
- self._clickHandler.call( self, event, this );
140
- event.preventDefault();
141
- });
142
- }
143
- },
144
-
145
- _createIcons: function() {
146
- var options = this.options;
147
- if ( options.icons ) {
148
- $( "<span></span>" )
149
- .addClass( "ui-icon " + options.icons.header )
150
- .prependTo( this.headers );
151
- this.active.children( ".ui-icon" )
152
- .toggleClass(options.icons.header)
153
- .toggleClass(options.icons.headerSelected);
154
- this.element.addClass( "ui-accordion-icons" );
155
- }
156
- },
157
-
158
- _destroyIcons: function() {
159
- this.headers.children( ".ui-icon" ).remove();
160
- this.element.removeClass( "ui-accordion-icons" );
161
- },
162
-
163
- destroy: function() {
164
- var options = this.options;
165
-
166
- this.element
167
- .removeClass( "ui-accordion ui-widget ui-helper-reset" )
168
- .removeAttr( "role" );
169
-
170
- this.headers
171
- .unbind( ".accordion" )
172
- .removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
173
- .removeAttr( "role" )
174
- .removeAttr( "aria-expanded" )
175
- .removeAttr( "tabIndex" );
176
-
177
- this.headers.find( "a" ).removeAttr( "tabIndex" );
178
- this._destroyIcons();
179
- var contents = this.headers.next()
180
- .css( "display", "" )
181
- .removeAttr( "role" )
182
- .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" );
183
- if ( options.autoHeight || options.fillHeight ) {
184
- contents.css( "height", "" );
185
- }
186
-
187
- return $.Widget.prototype.destroy.call( this );
188
- },
189
-
190
- _setOption: function( key, value ) {
191
- $.Widget.prototype._setOption.apply( this, arguments );
192
-
193
- if ( key == "active" ) {
194
- this.activate( value );
195
- }
196
- if ( key == "icons" ) {
197
- this._destroyIcons();
198
- if ( value ) {
199
- this._createIcons();
200
- }
201
- }
202
- // #5332 - opacity doesn't cascade to positioned elements in IE
203
- // so we need to add the disabled class to the headers and panels
204
- if ( key == "disabled" ) {
205
- this.headers.add(this.headers.next())
206
- [ value ? "addClass" : "removeClass" ](
207
- "ui-accordion-disabled ui-state-disabled" );
208
- }
209
- },
210
-
211
- _keydown: function( event ) {
212
- if ( this.options.disabled || event.altKey || event.ctrlKey ) {
213
- return;
214
- }
215
-
216
- var keyCode = $.ui.keyCode,
217
- length = this.headers.length,
218
- currentIndex = this.headers.index( event.target ),
219
- toFocus = false;
220
-
221
- switch ( event.keyCode ) {
222
- case keyCode.RIGHT:
223
- case keyCode.DOWN:
224
- toFocus = this.headers[ ( currentIndex + 1 ) % length ];
225
- break;
226
- case keyCode.LEFT:
227
- case keyCode.UP:
228
- toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
229
- break;
230
- case keyCode.SPACE:
231
- case keyCode.ENTER:
232
- this._clickHandler( { target: event.target }, event.target );
233
- event.preventDefault();
234
- }
235
-
236
- if ( toFocus ) {
237
- $( event.target ).attr( "tabIndex", -1 );
238
- $( toFocus ).attr( "tabIndex", 0 );
239
- toFocus.focus();
240
- return false;
241
- }
242
-
243
- return true;
244
- },
245
-
246
- resize: function() {
247
- var options = this.options,
248
- maxHeight;
249
-
250
- if ( options.fillSpace ) {
251
- if ( $.browser.msie ) {
252
- var defOverflow = this.element.parent().css( "overflow" );
253
- this.element.parent().css( "overflow", "hidden");
254
- }
255
- maxHeight = this.element.parent().height();
256
- if ($.browser.msie) {
257
- this.element.parent().css( "overflow", defOverflow );
258
- }
259
-
260
- this.headers.each(function() {
261
- maxHeight -= $( this ).outerHeight( true );
262
- });
263
-
264
- this.headers.next()
265
- .each(function() {
266
- $( this ).height( Math.max( 0, maxHeight -
267
- $( this ).innerHeight() + $( this ).height() ) );
268
- })
269
- .css( "overflow", "auto" );
270
- } else if ( options.autoHeight ) {
271
- maxHeight = 0;
272
- this.headers.next()
273
- .each(function() {
274
- maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
275
- })
276
- .height( maxHeight );
277
- }
278
-
279
- return this;
280
- },
281
-
282
- activate: function( index ) {
283
- // TODO this gets called on init, changing the option without an explicit call for that
284
- this.options.active = index;
285
- // call clickHandler with custom event
286
- var active = this._findActive( index )[ 0 ];
287
- this._clickHandler( { target: active }, active );
288
-
289
- return this;
290
- },
291
-
292
- _findActive: function( selector ) {
293
- return selector
294
- ? typeof selector === "number"
295
- ? this.headers.filter( ":eq(" + selector + ")" )
296
- : this.headers.not( this.headers.not( selector ) )
297
- : selector === false
298
- ? $( [] )
299
- : this.headers.filter( ":eq(0)" );
300
- },
301
-
302
- // TODO isn't event.target enough? why the separate target argument?
303
- _clickHandler: function( event, target ) {
304
- var options = this.options;
305
- if ( options.disabled ) {
306
- return;
307
- }
308
-
309
- // called only when using activate(false) to close all parts programmatically
310
- if ( !event.target ) {
311
- if ( !options.collapsible ) {
312
- return;
313
- }
314
- this.active
315
- .removeClass( "ui-state-active ui-corner-top" )
316
- .addClass( "ui-state-default ui-corner-all" )
317
- .children( ".ui-icon" )
318
- .removeClass( options.icons.headerSelected )
319
- .addClass( options.icons.header );
320
- this.active.next().addClass( "ui-accordion-content-active" );
321
- var toHide = this.active.next(),
322
- data = {
323
- options: options,
324
- newHeader: $( [] ),
325
- oldHeader: options.active,
326
- newContent: $( [] ),
327
- oldContent: toHide
328
- },
329
- toShow = ( this.active = $( [] ) );
330
- this._toggle( toShow, toHide, data );
331
- return;
332
- }
333
-
334
- // get the click target
335
- var clicked = $( event.currentTarget || target ),
336
- clickedIsActive = clicked[0] === this.active[0];
337
-
338
- // TODO the option is changed, is that correct?
339
- // TODO if it is correct, shouldn't that happen after determining that the click is valid?
340
- options.active = options.collapsible && clickedIsActive ?
341
- false :
342
- this.headers.index( clicked );
343
-
344
- // if animations are still active, or the active header is the target, ignore click
345
- if ( this.running || ( !options.collapsible && clickedIsActive ) ) {
346
- return;
347
- }
348
-
349
- // switch classes
350
- this.active
351
- .removeClass( "ui-state-active ui-corner-top" )
352
- .addClass( "ui-state-default ui-corner-all" )
353
- .children( ".ui-icon" )
354
- .removeClass( options.icons.headerSelected )
355
- .addClass( options.icons.header );
356
- if ( !clickedIsActive ) {
357
- clicked
358
- .removeClass( "ui-state-default ui-corner-all" )
359
- .addClass( "ui-state-active ui-corner-top" )
360
- .children( ".ui-icon" )
361
- .removeClass( options.icons.header )
362
- .addClass( options.icons.headerSelected );
363
- clicked
364
- .next()
365
- .addClass( "ui-accordion-content-active" );
366
- }
367
-
368
- // find elements to show and hide
369
- var toShow = clicked.next(),
370
- toHide = this.active.next(),
371
- data = {
372
- options: options,
373
- newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
374
- oldHeader: this.active,
375
- newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
376
- oldContent: toHide
377
- },
378
- down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
379
-
380
- this.active = clickedIsActive ? $([]) : clicked;
381
- this._toggle( toShow, toHide, data, clickedIsActive, down );
382
-
383
- return;
384
- },
385
-
386
- _toggle: function( toShow, toHide, data, clickedIsActive, down ) {
387
- var self = this,
388
- options = self.options;
389
-
390
- self.toShow = toShow;
391
- self.toHide = toHide;
392
- self.data = data;
393
-
394
- var complete = function() {
395
- if ( !self ) {
396
- return;
397
- }
398
- return self._completed.apply( self, arguments );
399
- };
400
-
401
- // trigger changestart event
402
- self._trigger( "changestart", null, self.data );
403
-
404
- // count elements to animate
405
- self.running = toHide.size() === 0 ? toShow.size() : toHide.size();
406
-
407
- if ( options.animated ) {
408
- var animOptions = {};
409
-
410
- if ( options.collapsible && clickedIsActive ) {
411
- animOptions = {
412
- toShow: $( [] ),
413
- toHide: toHide,
414
- complete: complete,
415
- down: down,
416
- autoHeight: options.autoHeight || options.fillSpace
417
- };
418
- } else {
419
- animOptions = {
420
- toShow: toShow,
421
- toHide: toHide,
422
- complete: complete,
423
- down: down,
424
- autoHeight: options.autoHeight || options.fillSpace
425
- };
426
- }
427
-
428
- if ( !options.proxied ) {
429
- options.proxied = options.animated;
430
- }
431
-
432
- if ( !options.proxiedDuration ) {
433
- options.proxiedDuration = options.duration;
434
- }
435
-
436
- options.animated = $.isFunction( options.proxied ) ?
437
- options.proxied( animOptions ) :
438
- options.proxied;
439
-
440
- options.duration = $.isFunction( options.proxiedDuration ) ?
441
- options.proxiedDuration( animOptions ) :
442
- options.proxiedDuration;
443
-
444
- var animations = $.ui.accordion.animations,
445
- duration = options.duration,
446
- easing = options.animated;
447
-
448
- if ( easing && !animations[ easing ] && !$.easing[ easing ] ) {
449
- easing = "slide";
450
- }
451
- if ( !animations[ easing ] ) {
452
- animations[ easing ] = function( options ) {
453
- this.slide( options, {
454
- easing: easing,
455
- duration: duration || 700
456
- });
457
- };
458
- }
459
-
460
- animations[ easing ]( animOptions );
461
- } else {
462
- if ( options.collapsible && clickedIsActive ) {
463
- toShow.toggle();
464
- } else {
465
- toHide.hide();
466
- toShow.show();
467
- }
468
-
469
- complete( true );
470
- }
471
-
472
- // TODO assert that the blur and focus triggers are really necessary, remove otherwise
473
- toHide.prev()
474
- .attr({
475
- "aria-expanded": "false",
476
- tabIndex: -1
477
- })
478
- .blur();
479
- toShow.prev()
480
- .attr({
481
- "aria-expanded": "true",
482
- tabIndex: 0
483
- })
484
- .focus();
485
- },
486
-
487
- _completed: function( cancel ) {
488
- this.running = cancel ? 0 : --this.running;
489
- if ( this.running ) {
490
- return;
491
- }
492
-
493
- if ( this.options.clearStyle ) {
494
- this.toShow.add( this.toHide ).css({
495
- height: "",
496
- overflow: ""
497
- });
498
- }
499
-
500
- // other classes are removed before the animation; this one needs to stay until completed
501
- this.toHide.removeClass( "ui-accordion-content-active" );
502
-
503
- this._trigger( "change", null, this.data );
504
- }
505
- });
506
-
507
- $.extend( $.ui.accordion, {
508
- version: "1.8.4",
509
- animations: {
510
- slide: function( options, additions ) {
511
- options = $.extend({
512
- easing: "swing",
513
- duration: 300
514
- }, options, additions );
515
- if ( !options.toHide.size() ) {
516
- options.toShow.animate({
517
- height: "show",
518
- paddingTop: "show",
519
- paddingBottom: "show"
520
- }, options );
521
- return;
522
- }
523
- if ( !options.toShow.size() ) {
524
- options.toHide.animate({
525
- height: "hide",
526
- paddingTop: "hide",
527
- paddingBottom: "hide"
528
- }, options );
529
- return;
530
- }
531
- var overflow = options.toShow.css( "overflow" ),
532
- percentDone = 0,
533
- showProps = {},
534
- hideProps = {},
535
- fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
536
- originalWidth;
537
- // fix width before calculating height of hidden element
538
- var s = options.toShow;
539
- originalWidth = s[0].style.width;
540
- s.width( parseInt( s.parent().width(), 10 )
541
- - parseInt( s.css( "paddingLeft" ), 10 )
542
- - parseInt( s.css( "paddingRight" ), 10 )
543
- - ( parseInt( s.css( "borderLeftWidth" ), 10 ) || 0 )
544
- - ( parseInt( s.css( "borderRightWidth" ), 10) || 0 ) );
545
-
546
- $.each( fxAttrs, function( i, prop ) {
547
- hideProps[ prop ] = "hide";
548
-
549
- var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
550
- showProps[ prop ] = {
551
- value: parts[ 1 ],
552
- unit: parts[ 2 ] || "px"
553
- };
554
- });
555
- options.toShow.css({ height: 0, overflow: "hidden" }).show();
556
- options.toHide
557
- .filter( ":hidden" )
558
- .each( options.complete )
559
- .end()
560
- .filter( ":visible" )
561
- .animate( hideProps, {
562
- step: function( now, settings ) {
563
- // only calculate the percent when animating height
564
- // IE gets very inconsistent results when animating elements
565
- // with small values, which is common for padding
566
- if ( settings.prop == "height" ) {
567
- percentDone = ( settings.end - settings.start === 0 ) ? 0 :
568
- ( settings.now - settings.start ) / ( settings.end - settings.start );
569
- }
570
-
571
- options.toShow[ 0 ].style[ settings.prop ] =
572
- ( percentDone * showProps[ settings.prop ].value )
573
- + showProps[ settings.prop ].unit;
574
- },
575
- duration: options.duration,
576
- easing: options.easing,
577
- complete: function() {
578
- if ( !options.autoHeight ) {
579
- options.toShow.css( "height", "" );
580
- }
581
- options.toShow.css({
582
- width: originalWidth,
583
- overflow: overflow
584
- });
585
- options.complete();
586
- }
587
- });
588
- },
589
- bounceslide: function( options ) {
590
- this.slide( options, {
591
- easing: options.down ? "easeOutBounce" : "swing",
592
- duration: options.down ? 1000 : 200
593
- });
594
- }
595
- }
596
- });
597
-
598
- })( jQuery );