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