jquery-ui-rails 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jquery-ui-rails might be problematic. Click here for more details.

Files changed (137) hide show
  1. data/.gitignore +0 -1
  2. data/History.md +6 -0
  3. data/README.md +1 -0
  4. data/Rakefile +13 -2
  5. data/lib/jquery/ui/rails/version.rb +1 -1
  6. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  7. data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  8. data/vendor/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  9. data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  10. data/vendor/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
  11. data/vendor/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  12. data/vendor/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  13. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  14. data/vendor/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  15. data/vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  16. data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  17. data/vendor/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
  18. data/vendor/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  19. data/vendor/assets/javascripts/jquery.effects.all.js +14 -0
  20. data/vendor/assets/javascripts/jquery.effects.blind.js +51 -0
  21. data/vendor/assets/javascripts/jquery.effects.bounce.js +80 -0
  22. data/vendor/assets/javascripts/jquery.effects.clip.js +56 -0
  23. data/vendor/assets/javascripts/jquery.effects.core.js +763 -0
  24. data/vendor/assets/javascripts/jquery.effects.drop.js +52 -0
  25. data/vendor/assets/javascripts/jquery.effects.explode.js +81 -0
  26. data/vendor/assets/javascripts/jquery.effects.fade.js +34 -0
  27. data/vendor/assets/javascripts/jquery.effects.fold.js +58 -0
  28. data/vendor/assets/javascripts/jquery.effects.highlight.js +52 -0
  29. data/vendor/assets/javascripts/jquery.effects.pulsate.js +53 -0
  30. data/vendor/assets/javascripts/jquery.effects.scale.js +180 -0
  31. data/vendor/assets/javascripts/jquery.effects.shake.js +59 -0
  32. data/vendor/assets/javascripts/jquery.effects.slide.js +52 -0
  33. data/vendor/assets/javascripts/jquery.effects.transfer.js +47 -0
  34. data/vendor/assets/javascripts/jquery.ui.accordion.js +614 -0
  35. data/vendor/assets/javascripts/jquery.ui.all.js +31 -0
  36. data/vendor/assets/javascripts/jquery.ui.autocomplete.js +635 -0
  37. data/vendor/assets/javascripts/jquery.ui.button.js +417 -0
  38. data/vendor/assets/javascripts/jquery.ui.core.js +321 -0
  39. data/vendor/assets/javascripts/jquery.ui.datepicker-af.js +25 -0
  40. data/vendor/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +25 -0
  41. data/vendor/assets/javascripts/jquery.ui.datepicker-ar.js +25 -0
  42. data/vendor/assets/javascripts/jquery.ui.datepicker-az.js +25 -0
  43. data/vendor/assets/javascripts/jquery.ui.datepicker-bg.js +26 -0
  44. data/vendor/assets/javascripts/jquery.ui.datepicker-bs.js +25 -0
  45. data/vendor/assets/javascripts/jquery.ui.datepicker-ca.js +25 -0
  46. data/vendor/assets/javascripts/jquery.ui.datepicker-cs.js +25 -0
  47. data/vendor/assets/javascripts/jquery.ui.datepicker-cy-GB.js +25 -0
  48. data/vendor/assets/javascripts/jquery.ui.datepicker-da.js +25 -0
  49. data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +25 -0
  50. data/vendor/assets/javascripts/jquery.ui.datepicker-el.js +25 -0
  51. data/vendor/assets/javascripts/jquery.ui.datepicker-en-AU.js +25 -0
  52. data/vendor/assets/javascripts/jquery.ui.datepicker-en-GB.js +25 -0
  53. data/vendor/assets/javascripts/jquery.ui.datepicker-en-NZ.js +25 -0
  54. data/vendor/assets/javascripts/jquery.ui.datepicker-eo.js +25 -0
  55. data/vendor/assets/javascripts/jquery.ui.datepicker-es.js +25 -0
  56. data/vendor/assets/javascripts/jquery.ui.datepicker-et.js +25 -0
  57. data/vendor/assets/javascripts/jquery.ui.datepicker-eu.js +25 -0
  58. data/vendor/assets/javascripts/jquery.ui.datepicker-fa.js +61 -0
  59. data/vendor/assets/javascripts/jquery.ui.datepicker-fi.js +25 -0
  60. data/vendor/assets/javascripts/jquery.ui.datepicker-fo.js +25 -0
  61. data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CH.js +25 -0
  62. data/vendor/assets/javascripts/jquery.ui.datepicker-fr.js +27 -0
  63. data/vendor/assets/javascripts/jquery.ui.datepicker-ge.js +23 -0
  64. data/vendor/assets/javascripts/jquery.ui.datepicker-gl.js +25 -0
  65. data/vendor/assets/javascripts/jquery.ui.datepicker-he.js +25 -0
  66. data/vendor/assets/javascripts/jquery.ui.datepicker-hi.js +25 -0
  67. data/vendor/assets/javascripts/jquery.ui.datepicker-hr.js +25 -0
  68. data/vendor/assets/javascripts/jquery.ui.datepicker-hu.js +25 -0
  69. data/vendor/assets/javascripts/jquery.ui.datepicker-hy.js +25 -0
  70. data/vendor/assets/javascripts/jquery.ui.datepicker-id.js +25 -0
  71. data/vendor/assets/javascripts/jquery.ui.datepicker-is.js +25 -0
  72. data/vendor/assets/javascripts/jquery.ui.datepicker-it.js +25 -0
  73. data/vendor/assets/javascripts/jquery.ui.datepicker-ja.js +25 -0
  74. data/vendor/assets/javascripts/jquery.ui.datepicker-kk.js +25 -0
  75. data/vendor/assets/javascripts/jquery.ui.datepicker-km.js +25 -0
  76. data/vendor/assets/javascripts/jquery.ui.datepicker-ko.js +25 -0
  77. data/vendor/assets/javascripts/jquery.ui.datepicker-lb.js +25 -0
  78. data/vendor/assets/javascripts/jquery.ui.datepicker-lt.js +25 -0
  79. data/vendor/assets/javascripts/jquery.ui.datepicker-lv.js +25 -0
  80. data/vendor/assets/javascripts/jquery.ui.datepicker-mk.js +25 -0
  81. data/vendor/assets/javascripts/jquery.ui.datepicker-ml.js +25 -0
  82. data/vendor/assets/javascripts/jquery.ui.datepicker-ms.js +25 -0
  83. data/vendor/assets/javascripts/jquery.ui.datepicker-nl-BE.js +25 -0
  84. data/vendor/assets/javascripts/jquery.ui.datepicker-nl.js +25 -0
  85. data/vendor/assets/javascripts/jquery.ui.datepicker-no.js +25 -0
  86. data/vendor/assets/javascripts/jquery.ui.datepicker-pl.js +25 -0
  87. data/vendor/assets/javascripts/jquery.ui.datepicker-pt-BR.js +25 -0
  88. data/vendor/assets/javascripts/jquery.ui.datepicker-pt.js +24 -0
  89. data/vendor/assets/javascripts/jquery.ui.datepicker-rm.js +23 -0
  90. data/vendor/assets/javascripts/jquery.ui.datepicker-ro.js +28 -0
  91. data/vendor/assets/javascripts/jquery.ui.datepicker-ru.js +25 -0
  92. data/vendor/assets/javascripts/jquery.ui.datepicker-sk.js +25 -0
  93. data/vendor/assets/javascripts/jquery.ui.datepicker-sl.js +26 -0
  94. data/vendor/assets/javascripts/jquery.ui.datepicker-sq.js +25 -0
  95. data/vendor/assets/javascripts/jquery.ui.datepicker-sr-SR.js +25 -0
  96. data/vendor/assets/javascripts/jquery.ui.datepicker-sr.js +25 -0
  97. data/vendor/assets/javascripts/jquery.ui.datepicker-sv.js +25 -0
  98. data/vendor/assets/javascripts/jquery.ui.datepicker-ta.js +25 -0
  99. data/vendor/assets/javascripts/jquery.ui.datepicker-th.js +25 -0
  100. data/vendor/assets/javascripts/jquery.ui.datepicker-tj.js +25 -0
  101. data/vendor/assets/javascripts/jquery.ui.datepicker-tr.js +25 -0
  102. data/vendor/assets/javascripts/jquery.ui.datepicker-uk.js +26 -0
  103. data/vendor/assets/javascripts/jquery.ui.datepicker-vi.js +25 -0
  104. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-CN.js +25 -0
  105. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-HK.js +25 -0
  106. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-TW.js +25 -0
  107. data/vendor/assets/javascripts/jquery.ui.datepicker.js +1826 -0
  108. data/vendor/assets/javascripts/jquery.ui.dialog.js +882 -0
  109. data/vendor/assets/javascripts/jquery.ui.draggable.js +835 -0
  110. data/vendor/assets/javascripts/jquery.ui.droppable.js +301 -0
  111. data/vendor/assets/javascripts/jquery.ui.mouse.js +168 -0
  112. data/vendor/assets/javascripts/jquery.ui.position.js +298 -0
  113. data/vendor/assets/javascripts/jquery.ui.progressbar.js +112 -0
  114. data/vendor/assets/javascripts/jquery.ui.resizable.js +811 -0
  115. data/vendor/assets/javascripts/jquery.ui.selectable.js +271 -0
  116. data/vendor/assets/javascripts/jquery.ui.slider.js +666 -0
  117. data/vendor/assets/javascripts/jquery.ui.sortable.js +1085 -0
  118. data/vendor/assets/javascripts/jquery.ui.tabs.js +760 -0
  119. data/vendor/assets/javascripts/jquery.ui.widget.js +272 -0
  120. data/vendor/assets/stylesheets/jquery.ui.accordion.css.erb +23 -0
  121. data/vendor/assets/stylesheets/jquery.ui.all.css.erb +13 -0
  122. data/vendor/assets/stylesheets/jquery.ui.autocomplete.css.erb +57 -0
  123. data/vendor/assets/stylesheets/jquery.ui.base.css.erb +23 -0
  124. data/vendor/assets/stylesheets/jquery.ui.button.css.erb +42 -0
  125. data/vendor/assets/stylesheets/jquery.ui.core.css.erb +38 -0
  126. data/vendor/assets/stylesheets/jquery.ui.datepicker.css.erb +72 -0
  127. data/vendor/assets/stylesheets/jquery.ui.dialog.css.erb +25 -0
  128. data/vendor/assets/stylesheets/jquery.ui.progressbar.css.erb +15 -0
  129. data/vendor/assets/stylesheets/jquery.ui.resizable.css.erb +24 -0
  130. data/vendor/assets/stylesheets/jquery.ui.selectable.css.erb +14 -0
  131. data/vendor/assets/stylesheets/jquery.ui.slider.css.erb +28 -0
  132. data/vendor/assets/stylesheets/jquery.ui.tabs.css.erb +22 -0
  133. data/vendor/assets/stylesheets/jquery.ui.theme.css.erb +250 -0
  134. metadata +111 -113
  135. data/jquery-ui/GPL-LICENSE.txt +0 -278
  136. data/jquery-ui/MIT-LICENSE.txt +0 -25
  137. data/jquery-ui/package.json +0 -36
@@ -0,0 +1,59 @@
1
+ //= require jquery.effects.core
2
+
3
+ /*!
4
+ * jQuery UI Effects Shake 1.8.20
5
+ *
6
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
+ * Dual licensed under the MIT or GPL Version 2 licenses.
8
+ * http://jquery.org/license
9
+ *
10
+ * http://docs.jquery.com/UI/Effects/Shake
11
+ *
12
+ * Depends:
13
+ * jquery.effects.core.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.effects.shake = function(o) {
18
+
19
+ return this.queue(function() {
20
+
21
+ // Create element
22
+ var el = $(this), props = ['position','top','bottom','left','right'];
23
+
24
+ // Set options
25
+ var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
26
+ var direction = o.options.direction || 'left'; // Default direction
27
+ var distance = o.options.distance || 20; // Default distance
28
+ var times = o.options.times || 3; // Default # of times
29
+ var speed = o.duration || o.options.duration || 140; // Default speed per shake
30
+
31
+ // Adjust
32
+ $.effects.save(el, props); el.show(); // Save & Show
33
+ $.effects.createWrapper(el); // Create Wrapper
34
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
35
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
36
+
37
+ // Animation
38
+ var animation = {}, animation1 = {}, animation2 = {};
39
+ animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
40
+ animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
41
+ animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
42
+
43
+ // Animate
44
+ el.animate(animation, speed, o.options.easing);
45
+ for (var i = 1; i < times; i++) { // Shakes
46
+ el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
47
+ };
48
+ el.animate(animation1, speed, o.options.easing).
49
+ animate(animation, speed / 2, o.options.easing, function(){ // Last shake
50
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
51
+ if(o.callback) o.callback.apply(this, arguments); // Callback
52
+ });
53
+ el.queue('fx', function() { el.dequeue(); });
54
+ el.dequeue();
55
+ });
56
+
57
+ };
58
+
59
+ })(jQuery);
@@ -0,0 +1,52 @@
1
+ //= require jquery.effects.core
2
+
3
+ /*!
4
+ * jQuery UI Effects Slide 1.8.20
5
+ *
6
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
+ * Dual licensed under the MIT or GPL Version 2 licenses.
8
+ * http://jquery.org/license
9
+ *
10
+ * http://docs.jquery.com/UI/Effects/Slide
11
+ *
12
+ * Depends:
13
+ * jquery.effects.core.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.effects.slide = function(o) {
18
+
19
+ return this.queue(function() {
20
+
21
+ // Create element
22
+ var el = $(this), props = ['position','top','bottom','left','right'];
23
+
24
+ // Set options
25
+ var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
26
+ var direction = o.options.direction || 'left'; // Default Direction
27
+
28
+ // Adjust
29
+ $.effects.save(el, props); el.show(); // Save & Show
30
+ $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
31
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
32
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
33
+ var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
34
+ if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift
35
+
36
+ // Animation
37
+ var animation = {};
38
+ animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
39
+
40
+ // Animate
41
+ el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
42
+ if(mode == 'hide') el.hide(); // Hide
43
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
44
+ if(o.callback) o.callback.apply(this, arguments); // Callback
45
+ el.dequeue();
46
+ }});
47
+
48
+ });
49
+
50
+ };
51
+
52
+ })(jQuery);
@@ -0,0 +1,47 @@
1
+ //= require jquery.effects.core
2
+
3
+ /*!
4
+ * jQuery UI Effects Transfer 1.8.20
5
+ *
6
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
+ * Dual licensed under the MIT or GPL Version 2 licenses.
8
+ * http://jquery.org/license
9
+ *
10
+ * http://docs.jquery.com/UI/Effects/Transfer
11
+ *
12
+ * Depends:
13
+ * jquery.effects.core.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.effects.transfer = function(o) {
18
+ return this.queue(function() {
19
+ var elem = $(this),
20
+ target = $(o.options.to),
21
+ endPosition = target.offset(),
22
+ animation = {
23
+ top: endPosition.top,
24
+ left: endPosition.left,
25
+ height: target.innerHeight(),
26
+ width: target.innerWidth()
27
+ },
28
+ startPosition = elem.offset(),
29
+ transfer = $('<div class="ui-effects-transfer"></div>')
30
+ .appendTo(document.body)
31
+ .addClass(o.options.className)
32
+ .css({
33
+ top: startPosition.top,
34
+ left: startPosition.left,
35
+ height: elem.innerHeight(),
36
+ width: elem.innerWidth(),
37
+ position: 'absolute'
38
+ })
39
+ .animate(animation, o.duration, o.options.easing, function() {
40
+ transfer.remove();
41
+ (o.callback && o.callback.apply(elem[0], arguments));
42
+ elem.dequeue();
43
+ });
44
+ });
45
+ };
46
+
47
+ })(jQuery);
@@ -0,0 +1,614 @@
1
+ //= require jquery.ui.core
2
+ //= require jquery.ui.widget
3
+
4
+ /*!
5
+ * jQuery UI Accordion 1.8.20
6
+ *
7
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
8
+ * Dual licensed under the MIT or GPL Version 2 licenses.
9
+ * http://jquery.org/license
10
+ *
11
+ * http://docs.jquery.com/UI/Accordion
12
+ *
13
+ * Depends:
14
+ * jquery.ui.core.js
15
+ * jquery.ui.widget.js
16
+ */
17
+ (function( $, undefined ) {
18
+
19
+ $.widget( "ui.accordion", {
20
+ options: {
21
+ active: 0,
22
+ animated: "slide",
23
+ autoHeight: true,
24
+ clearStyle: false,
25
+ collapsible: false,
26
+ event: "click",
27
+ fillSpace: false,
28
+ header: "> li > :first-child,> :not(li):even",
29
+ icons: {
30
+ header: "ui-icon-triangle-1-e",
31
+ headerSelected: "ui-icon-triangle-1-s"
32
+ },
33
+ navigation: false,
34
+ navigationFilter: function() {
35
+ return this.href.toLowerCase() === location.href.toLowerCase();
36
+ }
37
+ },
38
+
39
+ _create: function() {
40
+ var self = this,
41
+ options = self.options;
42
+
43
+ self.running = 0;
44
+
45
+ self.element
46
+ .addClass( "ui-accordion ui-widget ui-helper-reset" )
47
+ // in lack of child-selectors in CSS
48
+ // we need to mark top-LIs in a UL-accordion for some IE-fix
49
+ .children( "li" )
50
+ .addClass( "ui-accordion-li-fix" );
51
+
52
+ self.headers = self.element.find( options.header )
53
+ .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" )
54
+ .bind( "mouseenter.accordion", function() {
55
+ if ( options.disabled ) {
56
+ return;
57
+ }
58
+ $( this ).addClass( "ui-state-hover" );
59
+ })
60
+ .bind( "mouseleave.accordion", function() {
61
+ if ( options.disabled ) {
62
+ return;
63
+ }
64
+ $( this ).removeClass( "ui-state-hover" );
65
+ })
66
+ .bind( "focus.accordion", function() {
67
+ if ( options.disabled ) {
68
+ return;
69
+ }
70
+ $( this ).addClass( "ui-state-focus" );
71
+ })
72
+ .bind( "blur.accordion", function() {
73
+ if ( options.disabled ) {
74
+ return;
75
+ }
76
+ $( this ).removeClass( "ui-state-focus" );
77
+ });
78
+
79
+ self.headers.next()
80
+ .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );
81
+
82
+ if ( options.navigation ) {
83
+ var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 );
84
+ if ( current.length ) {
85
+ var header = current.closest( ".ui-accordion-header" );
86
+ if ( header.length ) {
87
+ // anchor within header
88
+ self.active = header;
89
+ } else {
90
+ // anchor within content
91
+ self.active = current.closest( ".ui-accordion-content" ).prev();
92
+ }
93
+ }
94
+ }
95
+
96
+ self.active = self._findActive( self.active || options.active )
97
+ .addClass( "ui-state-default ui-state-active" )
98
+ .toggleClass( "ui-corner-all" )
99
+ .toggleClass( "ui-corner-top" );
100
+ self.active.next().addClass( "ui-accordion-content-active" );
101
+
102
+ self._createIcons();
103
+ self.resize();
104
+
105
+ // ARIA
106
+ self.element.attr( "role", "tablist" );
107
+
108
+ self.headers
109
+ .attr( "role", "tab" )
110
+ .bind( "keydown.accordion", function( event ) {
111
+ return self._keydown( event );
112
+ })
113
+ .next()
114
+ .attr( "role", "tabpanel" );
115
+
116
+ self.headers
117
+ .not( self.active || "" )
118
+ .attr({
119
+ "aria-expanded": "false",
120
+ "aria-selected": "false",
121
+ tabIndex: -1
122
+ })
123
+ .next()
124
+ .hide();
125
+
126
+ // make sure at least one header is in the tab order
127
+ if ( !self.active.length ) {
128
+ self.headers.eq( 0 ).attr( "tabIndex", 0 );
129
+ } else {
130
+ self.active
131
+ .attr({
132
+ "aria-expanded": "true",
133
+ "aria-selected": "true",
134
+ tabIndex: 0
135
+ });
136
+ }
137
+
138
+ // only need links in tab order for Safari
139
+ if ( !$.browser.safari ) {
140
+ self.headers.find( "a" ).attr( "tabIndex", -1 );
141
+ }
142
+
143
+ if ( options.event ) {
144
+ self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) {
145
+ self._clickHandler.call( self, event, this );
146
+ event.preventDefault();
147
+ });
148
+ }
149
+ },
150
+
151
+ _createIcons: function() {
152
+ var options = this.options;
153
+ if ( options.icons ) {
154
+ $( "<span></span>" )
155
+ .addClass( "ui-icon " + options.icons.header )
156
+ .prependTo( this.headers );
157
+ this.active.children( ".ui-icon" )
158
+ .toggleClass(options.icons.header)
159
+ .toggleClass(options.icons.headerSelected);
160
+ this.element.addClass( "ui-accordion-icons" );
161
+ }
162
+ },
163
+
164
+ _destroyIcons: function() {
165
+ this.headers.children( ".ui-icon" ).remove();
166
+ this.element.removeClass( "ui-accordion-icons" );
167
+ },
168
+
169
+ destroy: function() {
170
+ var options = this.options;
171
+
172
+ this.element
173
+ .removeClass( "ui-accordion ui-widget ui-helper-reset" )
174
+ .removeAttr( "role" );
175
+
176
+ this.headers
177
+ .unbind( ".accordion" )
178
+ .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" )
179
+ .removeAttr( "role" )
180
+ .removeAttr( "aria-expanded" )
181
+ .removeAttr( "aria-selected" )
182
+ .removeAttr( "tabIndex" );
183
+
184
+ this.headers.find( "a" ).removeAttr( "tabIndex" );
185
+ this._destroyIcons();
186
+ var contents = this.headers.next()
187
+ .css( "display", "" )
188
+ .removeAttr( "role" )
189
+ .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" );
190
+ if ( options.autoHeight || options.fillHeight ) {
191
+ contents.css( "height", "" );
192
+ }
193
+
194
+ return $.Widget.prototype.destroy.call( this );
195
+ },
196
+
197
+ _setOption: function( key, value ) {
198
+ $.Widget.prototype._setOption.apply( this, arguments );
199
+
200
+ if ( key == "active" ) {
201
+ this.activate( value );
202
+ }
203
+ if ( key == "icons" ) {
204
+ this._destroyIcons();
205
+ if ( value ) {
206
+ this._createIcons();
207
+ }
208
+ }
209
+ // #5332 - opacity doesn't cascade to positioned elements in IE
210
+ // so we need to add the disabled class to the headers and panels
211
+ if ( key == "disabled" ) {
212
+ this.headers.add(this.headers.next())
213
+ [ value ? "addClass" : "removeClass" ](
214
+ "ui-accordion-disabled ui-state-disabled" );
215
+ }
216
+ },
217
+
218
+ _keydown: function( event ) {
219
+ if ( this.options.disabled || event.altKey || event.ctrlKey ) {
220
+ return;
221
+ }
222
+
223
+ var keyCode = $.ui.keyCode,
224
+ length = this.headers.length,
225
+ currentIndex = this.headers.index( event.target ),
226
+ toFocus = false;
227
+
228
+ switch ( event.keyCode ) {
229
+ case keyCode.RIGHT:
230
+ case keyCode.DOWN:
231
+ toFocus = this.headers[ ( currentIndex + 1 ) % length ];
232
+ break;
233
+ case keyCode.LEFT:
234
+ case keyCode.UP:
235
+ toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
236
+ break;
237
+ case keyCode.SPACE:
238
+ case keyCode.ENTER:
239
+ this._clickHandler( { target: event.target }, event.target );
240
+ event.preventDefault();
241
+ }
242
+
243
+ if ( toFocus ) {
244
+ $( event.target ).attr( "tabIndex", -1 );
245
+ $( toFocus ).attr( "tabIndex", 0 );
246
+ toFocus.focus();
247
+ return false;
248
+ }
249
+
250
+ return true;
251
+ },
252
+
253
+ resize: function() {
254
+ var options = this.options,
255
+ maxHeight;
256
+
257
+ if ( options.fillSpace ) {
258
+ if ( $.browser.msie ) {
259
+ var defOverflow = this.element.parent().css( "overflow" );
260
+ this.element.parent().css( "overflow", "hidden");
261
+ }
262
+ maxHeight = this.element.parent().height();
263
+ if ($.browser.msie) {
264
+ this.element.parent().css( "overflow", defOverflow );
265
+ }
266
+
267
+ this.headers.each(function() {
268
+ maxHeight -= $( this ).outerHeight( true );
269
+ });
270
+
271
+ this.headers.next()
272
+ .each(function() {
273
+ $( this ).height( Math.max( 0, maxHeight -
274
+ $( this ).innerHeight() + $( this ).height() ) );
275
+ })
276
+ .css( "overflow", "auto" );
277
+ } else if ( options.autoHeight ) {
278
+ maxHeight = 0;
279
+ this.headers.next()
280
+ .each(function() {
281
+ maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
282
+ })
283
+ .height( maxHeight );
284
+ }
285
+
286
+ return this;
287
+ },
288
+
289
+ activate: function( index ) {
290
+ // TODO this gets called on init, changing the option without an explicit call for that
291
+ this.options.active = index;
292
+ // call clickHandler with custom event
293
+ var active = this._findActive( index )[ 0 ];
294
+ this._clickHandler( { target: active }, active );
295
+
296
+ return this;
297
+ },
298
+
299
+ _findActive: function( selector ) {
300
+ return selector
301
+ ? typeof selector === "number"
302
+ ? this.headers.filter( ":eq(" + selector + ")" )
303
+ : this.headers.not( this.headers.not( selector ) )
304
+ : selector === false
305
+ ? $( [] )
306
+ : this.headers.filter( ":eq(0)" );
307
+ },
308
+
309
+ // TODO isn't event.target enough? why the separate target argument?
310
+ _clickHandler: function( event, target ) {
311
+ var options = this.options;
312
+ if ( options.disabled ) {
313
+ return;
314
+ }
315
+
316
+ // called only when using activate(false) to close all parts programmatically
317
+ if ( !event.target ) {
318
+ if ( !options.collapsible ) {
319
+ return;
320
+ }
321
+ this.active
322
+ .removeClass( "ui-state-active ui-corner-top" )
323
+ .addClass( "ui-state-default ui-corner-all" )
324
+ .children( ".ui-icon" )
325
+ .removeClass( options.icons.headerSelected )
326
+ .addClass( options.icons.header );
327
+ this.active.next().addClass( "ui-accordion-content-active" );
328
+ var toHide = this.active.next(),
329
+ data = {
330
+ options: options,
331
+ newHeader: $( [] ),
332
+ oldHeader: options.active,
333
+ newContent: $( [] ),
334
+ oldContent: toHide
335
+ },
336
+ toShow = ( this.active = $( [] ) );
337
+ this._toggle( toShow, toHide, data );
338
+ return;
339
+ }
340
+
341
+ // get the click target
342
+ var clicked = $( event.currentTarget || target ),
343
+ clickedIsActive = clicked[0] === this.active[0];
344
+
345
+ // TODO the option is changed, is that correct?
346
+ // TODO if it is correct, shouldn't that happen after determining that the click is valid?
347
+ options.active = options.collapsible && clickedIsActive ?
348
+ false :
349
+ this.headers.index( clicked );
350
+
351
+ // if animations are still active, or the active header is the target, ignore click
352
+ if ( this.running || ( !options.collapsible && clickedIsActive ) ) {
353
+ return;
354
+ }
355
+
356
+ // find elements to show and hide
357
+ var active = this.active,
358
+ toShow = clicked.next(),
359
+ toHide = this.active.next(),
360
+ data = {
361
+ options: options,
362
+ newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
363
+ oldHeader: this.active,
364
+ newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
365
+ oldContent: toHide
366
+ },
367
+ down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
368
+
369
+ // when the call to ._toggle() comes after the class changes
370
+ // it causes a very odd bug in IE 8 (see #6720)
371
+ this.active = clickedIsActive ? $([]) : clicked;
372
+ this._toggle( toShow, toHide, data, clickedIsActive, down );
373
+
374
+ // switch classes
375
+ active
376
+ .removeClass( "ui-state-active ui-corner-top" )
377
+ .addClass( "ui-state-default ui-corner-all" )
378
+ .children( ".ui-icon" )
379
+ .removeClass( options.icons.headerSelected )
380
+ .addClass( options.icons.header );
381
+ if ( !clickedIsActive ) {
382
+ clicked
383
+ .removeClass( "ui-state-default ui-corner-all" )
384
+ .addClass( "ui-state-active ui-corner-top" )
385
+ .children( ".ui-icon" )
386
+ .removeClass( options.icons.header )
387
+ .addClass( options.icons.headerSelected );
388
+ clicked
389
+ .next()
390
+ .addClass( "ui-accordion-content-active" );
391
+ }
392
+
393
+ return;
394
+ },
395
+
396
+ _toggle: function( toShow, toHide, data, clickedIsActive, down ) {
397
+ var self = this,
398
+ options = self.options;
399
+
400
+ self.toShow = toShow;
401
+ self.toHide = toHide;
402
+ self.data = data;
403
+
404
+ var complete = function() {
405
+ if ( !self ) {
406
+ return;
407
+ }
408
+ return self._completed.apply( self, arguments );
409
+ };
410
+
411
+ // trigger changestart event
412
+ self._trigger( "changestart", null, self.data );
413
+
414
+ // count elements to animate
415
+ self.running = toHide.size() === 0 ? toShow.size() : toHide.size();
416
+
417
+ if ( options.animated ) {
418
+ var animOptions = {};
419
+
420
+ if ( options.collapsible && clickedIsActive ) {
421
+ animOptions = {
422
+ toShow: $( [] ),
423
+ toHide: toHide,
424
+ complete: complete,
425
+ down: down,
426
+ autoHeight: options.autoHeight || options.fillSpace
427
+ };
428
+ } else {
429
+ animOptions = {
430
+ toShow: toShow,
431
+ toHide: toHide,
432
+ complete: complete,
433
+ down: down,
434
+ autoHeight: options.autoHeight || options.fillSpace
435
+ };
436
+ }
437
+
438
+ if ( !options.proxied ) {
439
+ options.proxied = options.animated;
440
+ }
441
+
442
+ if ( !options.proxiedDuration ) {
443
+ options.proxiedDuration = options.duration;
444
+ }
445
+
446
+ options.animated = $.isFunction( options.proxied ) ?
447
+ options.proxied( animOptions ) :
448
+ options.proxied;
449
+
450
+ options.duration = $.isFunction( options.proxiedDuration ) ?
451
+ options.proxiedDuration( animOptions ) :
452
+ options.proxiedDuration;
453
+
454
+ var animations = $.ui.accordion.animations,
455
+ duration = options.duration,
456
+ easing = options.animated;
457
+
458
+ if ( easing && !animations[ easing ] && !$.easing[ easing ] ) {
459
+ easing = "slide";
460
+ }
461
+ if ( !animations[ easing ] ) {
462
+ animations[ easing ] = function( options ) {
463
+ this.slide( options, {
464
+ easing: easing,
465
+ duration: duration || 700
466
+ });
467
+ };
468
+ }
469
+
470
+ animations[ easing ]( animOptions );
471
+ } else {
472
+ if ( options.collapsible && clickedIsActive ) {
473
+ toShow.toggle();
474
+ } else {
475
+ toHide.hide();
476
+ toShow.show();
477
+ }
478
+
479
+ complete( true );
480
+ }
481
+
482
+ // TODO assert that the blur and focus triggers are really necessary, remove otherwise
483
+ toHide.prev()
484
+ .attr({
485
+ "aria-expanded": "false",
486
+ "aria-selected": "false",
487
+ tabIndex: -1
488
+ })
489
+ .blur();
490
+ toShow.prev()
491
+ .attr({
492
+ "aria-expanded": "true",
493
+ "aria-selected": "true",
494
+ tabIndex: 0
495
+ })
496
+ .focus();
497
+ },
498
+
499
+ _completed: function( cancel ) {
500
+ this.running = cancel ? 0 : --this.running;
501
+ if ( this.running ) {
502
+ return;
503
+ }
504
+
505
+ if ( this.options.clearStyle ) {
506
+ this.toShow.add( this.toHide ).css({
507
+ height: "",
508
+ overflow: ""
509
+ });
510
+ }
511
+
512
+ // other classes are removed before the animation; this one needs to stay until completed
513
+ this.toHide.removeClass( "ui-accordion-content-active" );
514
+ // Work around for rendering bug in IE (#5421)
515
+ if ( this.toHide.length ) {
516
+ this.toHide.parent()[0].className = this.toHide.parent()[0].className;
517
+ }
518
+
519
+ this._trigger( "change", null, this.data );
520
+ }
521
+ });
522
+
523
+ $.extend( $.ui.accordion, {
524
+ version: "1.8.20",
525
+ animations: {
526
+ slide: function( options, additions ) {
527
+ options = $.extend({
528
+ easing: "swing",
529
+ duration: 300
530
+ }, options, additions );
531
+ if ( !options.toHide.size() ) {
532
+ options.toShow.animate({
533
+ height: "show",
534
+ paddingTop: "show",
535
+ paddingBottom: "show"
536
+ }, options );
537
+ return;
538
+ }
539
+ if ( !options.toShow.size() ) {
540
+ options.toHide.animate({
541
+ height: "hide",
542
+ paddingTop: "hide",
543
+ paddingBottom: "hide"
544
+ }, options );
545
+ return;
546
+ }
547
+ var overflow = options.toShow.css( "overflow" ),
548
+ percentDone = 0,
549
+ showProps = {},
550
+ hideProps = {},
551
+ fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
552
+ originalWidth;
553
+ // fix width before calculating height of hidden element
554
+ var s = options.toShow;
555
+ originalWidth = s[0].style.width;
556
+ s.width( s.parent().width()
557
+ - parseFloat( s.css( "paddingLeft" ) )
558
+ - parseFloat( s.css( "paddingRight" ) )
559
+ - ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 )
560
+ - ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) );
561
+
562
+ $.each( fxAttrs, function( i, prop ) {
563
+ hideProps[ prop ] = "hide";
564
+
565
+ var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
566
+ showProps[ prop ] = {
567
+ value: parts[ 1 ],
568
+ unit: parts[ 2 ] || "px"
569
+ };
570
+ });
571
+ options.toShow.css({ height: 0, overflow: "hidden" }).show();
572
+ options.toHide
573
+ .filter( ":hidden" )
574
+ .each( options.complete )
575
+ .end()
576
+ .filter( ":visible" )
577
+ .animate( hideProps, {
578
+ step: function( now, settings ) {
579
+ // only calculate the percent when animating height
580
+ // IE gets very inconsistent results when animating elements
581
+ // with small values, which is common for padding
582
+ if ( settings.prop == "height" ) {
583
+ percentDone = ( settings.end - settings.start === 0 ) ? 0 :
584
+ ( settings.now - settings.start ) / ( settings.end - settings.start );
585
+ }
586
+
587
+ options.toShow[ 0 ].style[ settings.prop ] =
588
+ ( percentDone * showProps[ settings.prop ].value )
589
+ + showProps[ settings.prop ].unit;
590
+ },
591
+ duration: options.duration,
592
+ easing: options.easing,
593
+ complete: function() {
594
+ if ( !options.autoHeight ) {
595
+ options.toShow.css( "height", "" );
596
+ }
597
+ options.toShow.css({
598
+ width: originalWidth,
599
+ overflow: overflow
600
+ });
601
+ options.complete();
602
+ }
603
+ });
604
+ },
605
+ bounceslide: function( options ) {
606
+ this.slide( options, {
607
+ easing: options.down ? "easeOutBounce" : "swing",
608
+ duration: options.down ? 1000 : 200
609
+ });
610
+ }
611
+ }
612
+ });
613
+
614
+ })( jQuery );