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