stuff_to_do_plugin 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. data/COPYRIGHT.txt +18 -0
  2. data/CREDITS.txt +6 -0
  3. data/GPL.txt +339 -0
  4. data/README.rdoc +61 -0
  5. data/Rakefile +38 -0
  6. data/VERSION +1 -0
  7. data/app/controllers/stuff_to_do_controller.rb +161 -0
  8. data/app/helpers/stuff_to_do_helper.rb +88 -0
  9. data/app/models/stuff_to_do.rb +208 -0
  10. data/app/models/stuff_to_do_filter.rb +32 -0
  11. data/app/models/stuff_to_do_mailer.rb +16 -0
  12. data/app/views/settings/_stuff_to_do_settings.html.erb +27 -0
  13. data/app/views/stuff_to_do/_issue.html.erb +16 -0
  14. data/app/views/stuff_to_do/_item.html.erb +5 -0
  15. data/app/views/stuff_to_do/_left_panes.html.erb +51 -0
  16. data/app/views/stuff_to_do/_panes.html.erb +11 -0
  17. data/app/views/stuff_to_do/_project.html.erb +6 -0
  18. data/app/views/stuff_to_do/_right_panes.html.erb +25 -0
  19. data/app/views/stuff_to_do/_time_grid.html.erb +113 -0
  20. data/app/views/stuff_to_do/_time_grid_form.html.erb +32 -0
  21. data/app/views/stuff_to_do/index.html.erb +44 -0
  22. data/app/views/stuff_to_do_mailer/recommended_below_threshold.erb +3 -0
  23. data/app/views/stuff_to_do_mailer/recommended_below_threshold.text.html.rhtml +1 -0
  24. data/assets/images/b.png +0 -0
  25. data/assets/images/bl.png +0 -0
  26. data/assets/images/br.png +0 -0
  27. data/assets/images/closelabel.gif +0 -0
  28. data/assets/images/loading.gif +0 -0
  29. data/assets/images/tl.png +0 -0
  30. data/assets/images/tr.png +0 -0
  31. data/assets/javascripts/facebox.js +319 -0
  32. data/assets/javascripts/jquery-1.2.6.min.js +32 -0
  33. data/assets/javascripts/jquery-ui.js +2839 -0
  34. data/assets/javascripts/jquery.contextMenu.js +212 -0
  35. data/assets/javascripts/semantic.cache +15 -0
  36. data/assets/javascripts/stuff-to-do.js +270 -0
  37. data/assets/javascripts/ui/build.xml +24 -0
  38. data/assets/javascripts/ui/effects.blind.js +49 -0
  39. data/assets/javascripts/ui/effects.bounce.js +78 -0
  40. data/assets/javascripts/ui/effects.clip.js +54 -0
  41. data/assets/javascripts/ui/effects.core.js +510 -0
  42. data/assets/javascripts/ui/effects.drop.js +50 -0
  43. data/assets/javascripts/ui/effects.explode.js +79 -0
  44. data/assets/javascripts/ui/effects.fold.js +55 -0
  45. data/assets/javascripts/ui/effects.highlight.js +48 -0
  46. data/assets/javascripts/ui/effects.pulsate.js +55 -0
  47. data/assets/javascripts/ui/effects.scale.js +180 -0
  48. data/assets/javascripts/ui/effects.shake.js +57 -0
  49. data/assets/javascripts/ui/effects.slide.js +50 -0
  50. data/assets/javascripts/ui/effects.transfer.js +59 -0
  51. data/assets/javascripts/ui/i18n/ui.datepicker-ar.js +26 -0
  52. data/assets/javascripts/ui/i18n/ui.datepicker-bg.js +25 -0
  53. data/assets/javascripts/ui/i18n/ui.datepicker-ca.js +25 -0
  54. data/assets/javascripts/ui/i18n/ui.datepicker-cs.js +25 -0
  55. data/assets/javascripts/ui/i18n/ui.datepicker-da.js +25 -0
  56. data/assets/javascripts/ui/i18n/ui.datepicker-de.js +25 -0
  57. data/assets/javascripts/ui/i18n/ui.datepicker-eo.js +25 -0
  58. data/assets/javascripts/ui/i18n/ui.datepicker-es.js +25 -0
  59. data/assets/javascripts/ui/i18n/ui.datepicker-fa.js +25 -0
  60. data/assets/javascripts/ui/i18n/ui.datepicker-fi.js +25 -0
  61. data/assets/javascripts/ui/i18n/ui.datepicker-fr.js +25 -0
  62. data/assets/javascripts/ui/i18n/ui.datepicker-he.js +25 -0
  63. data/assets/javascripts/ui/i18n/ui.datepicker-hr.js +25 -0
  64. data/assets/javascripts/ui/i18n/ui.datepicker-hu.js +25 -0
  65. data/assets/javascripts/ui/i18n/ui.datepicker-hy.js +25 -0
  66. data/assets/javascripts/ui/i18n/ui.datepicker-id.js +25 -0
  67. data/assets/javascripts/ui/i18n/ui.datepicker-is.js +25 -0
  68. data/assets/javascripts/ui/i18n/ui.datepicker-it.js +25 -0
  69. data/assets/javascripts/ui/i18n/ui.datepicker-ja.js +26 -0
  70. data/assets/javascripts/ui/i18n/ui.datepicker-ko.js +25 -0
  71. data/assets/javascripts/ui/i18n/ui.datepicker-lt.js +25 -0
  72. data/assets/javascripts/ui/i18n/ui.datepicker-lv.js +25 -0
  73. data/assets/javascripts/ui/i18n/ui.datepicker-nl.js +25 -0
  74. data/assets/javascripts/ui/i18n/ui.datepicker-no.js +25 -0
  75. data/assets/javascripts/ui/i18n/ui.datepicker-pl.js +25 -0
  76. data/assets/javascripts/ui/i18n/ui.datepicker-pt-BR.js +25 -0
  77. data/assets/javascripts/ui/i18n/ui.datepicker-ro.js +25 -0
  78. data/assets/javascripts/ui/i18n/ui.datepicker-ru.js +25 -0
  79. data/assets/javascripts/ui/i18n/ui.datepicker-sk.js +25 -0
  80. data/assets/javascripts/ui/i18n/ui.datepicker-sl.js +26 -0
  81. data/assets/javascripts/ui/i18n/ui.datepicker-sq.js +25 -0
  82. data/assets/javascripts/ui/i18n/ui.datepicker-sv.js +25 -0
  83. data/assets/javascripts/ui/i18n/ui.datepicker-th.js +25 -0
  84. data/assets/javascripts/ui/i18n/ui.datepicker-tr.js +25 -0
  85. data/assets/javascripts/ui/i18n/ui.datepicker-uk.js +25 -0
  86. data/assets/javascripts/ui/i18n/ui.datepicker-zh-CN.js +25 -0
  87. data/assets/javascripts/ui/i18n/ui.datepicker-zh-TW.js +25 -0
  88. data/assets/javascripts/ui/svn.log +11 -0
  89. data/assets/javascripts/ui/ui.accordion.js +400 -0
  90. data/assets/javascripts/ui/ui.core.js +533 -0
  91. data/assets/javascripts/ui/ui.datepicker.js +1754 -0
  92. data/assets/javascripts/ui/ui.dialog.js +630 -0
  93. data/assets/javascripts/ui/ui.draggable.js +696 -0
  94. data/assets/javascripts/ui/ui.droppable.js +314 -0
  95. data/assets/javascripts/ui/ui.progressbar.js +114 -0
  96. data/assets/javascripts/ui/ui.resizable.js +805 -0
  97. data/assets/javascripts/ui/ui.selectable.js +266 -0
  98. data/assets/javascripts/ui/ui.slider.js +552 -0
  99. data/assets/javascripts/ui/ui.sortable.js +1012 -0
  100. data/assets/javascripts/ui/ui.tabs.js +572 -0
  101. data/assets/stylesheets/stuff_to_do.css +216 -0
  102. data/config/locales/bg.yml +18 -0
  103. data/config/locales/ca-fr.yml +18 -0
  104. data/config/locales/cs.yml +16 -0
  105. data/config/locales/da.yml +16 -0
  106. data/config/locales/de.yml +18 -0
  107. data/config/locales/en.yml +24 -0
  108. data/config/locales/es.yml +19 -0
  109. data/config/locales/fr.yml +17 -0
  110. data/config/locales/hu.yml +16 -0
  111. data/config/locales/it.yml +16 -0
  112. data/config/locales/ja.yml +18 -0
  113. data/config/locales/ko.yml +18 -0
  114. data/config/locales/lt.yml +18 -0
  115. data/config/locales/nl.yml +20 -0
  116. data/config/locales/pt-BR.yml +18 -0
  117. data/config/locales/ru.yml +19 -0
  118. data/config/locales/sv.yml +19 -0
  119. data/config/locales/tr.yml +18 -0
  120. data/config/routes.rb +3 -0
  121. data/init.rb +54 -0
  122. data/lang/bg.yml +17 -0
  123. data/lang/ca-fr.yml +17 -0
  124. data/lang/cs.yml +15 -0
  125. data/lang/da.yml +15 -0
  126. data/lang/de.yml +17 -0
  127. data/lang/en.yml +21 -0
  128. data/lang/es.yml +18 -0
  129. data/lang/fr.yml +16 -0
  130. data/lang/hu.yml +15 -0
  131. data/lang/it.yml +15 -0
  132. data/lang/ja.yml +17 -0
  133. data/lang/ko.yml +17 -0
  134. data/lang/lt.yml +17 -0
  135. data/lang/pt-br.yml +17 -0
  136. data/lang/ru.yml +15 -0
  137. data/lang/sv.yml +18 -0
  138. data/lang/tr.yml +17 -0
  139. data/lib/redmine_stuff_to_do/stuff_to_do_compatibility.rb +15 -0
  140. data/lib/stuff_to_do_array_patch.rb +8 -0
  141. data/lib/stuff_to_do_issue_patch.rb +57 -0
  142. data/lib/stuff_to_do_project_patch.rb +31 -0
  143. data/lib/stuff_to_do_user_patch.rb +10 -0
  144. data/rails/init.rb +1 -0
  145. data/spec/controllers/stuff_to_do_controller_add_to_time_grid_spec.rb +58 -0
  146. data/spec/controllers/stuff_to_do_controller_index_spec.rb +155 -0
  147. data/spec/controllers/stuff_to_do_controller_remove_from_time_grid_spec.rb +56 -0
  148. data/spec/controllers/stuff_to_do_controller_reorder_spec.rb +179 -0
  149. data/spec/controllers/stuff_to_do_controller_save_time_entries_spec.rb +56 -0
  150. data/spec/controllers/stuff_to_do_private_methods_spec.rb +82 -0
  151. data/spec/lib/stuff_to_do_issue_patch_spec.rb +60 -0
  152. data/spec/lib/stuff_to_do_project_patch_spec.rb +50 -0
  153. data/spec/lib/stuff_to_do_user_patch_spec.rb +8 -0
  154. data/spec/models/stuff_to_do_filter_spec.rb +3 -0
  155. data/spec/models/stuff_to_do_mailer_spec.rb +42 -0
  156. data/spec/models/stuff_to_do_spec.rb +426 -0
  157. data/spec/sanity_spec.rb +7 -0
  158. data/spec/spec_helper.rb +130 -0
  159. metadata +211 -0
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+
3
+ <!--
4
+ jQuery UI Tasks
5
+ @author Eduardo Lundgren (eduardolundgren@gmail.com)
6
+ -->
7
+
8
+ <project name="jquery-ui" default="remove-spaces" basedir=".">
9
+
10
+ <target name="load.properties">
11
+ <property file="ant.properties" />
12
+ <property name="ui.dir" value="." />
13
+ <property name="src.dir" value="${ui.dir}/" />
14
+ </target>
15
+
16
+ <target name="remove-spaces" depends="load.properties">
17
+ <replaceregexp match="[\t ]+$" replace="" flags="g" byline="true">
18
+ <fileset dir="${src.dir}" includes="*.js"/>
19
+ <fileset dir="${src.dir}/i18n/" includes="*.js"/>
20
+ </replaceregexp>
21
+ <echo message="All trailing spaces removed." />
22
+ </target>
23
+
24
+ </project>
@@ -0,0 +1,49 @@
1
+ /*
2
+ * jQuery UI Effects Blind @VERSION
3
+ *
4
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Effects/Blind
9
+ *
10
+ * Depends:
11
+ * effects.core.js
12
+ */
13
+ (function($) {
14
+
15
+ $.effects.blind = function(o) {
16
+
17
+ return this.queue(function() {
18
+
19
+ // Create element
20
+ var el = $(this), props = ['position','top','left'];
21
+
22
+ // Set options
23
+ var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
24
+ var direction = o.options.direction || 'vertical'; // Default direction
25
+
26
+ // Adjust
27
+ $.effects.save(el, props); el.show(); // Save & Show
28
+ var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
29
+ var ref = (direction == 'vertical') ? 'height' : 'width';
30
+ var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
31
+ if(mode == 'show') wrapper.css(ref, 0); // Shift
32
+
33
+ // Animation
34
+ var animation = {};
35
+ animation[ref] = mode == 'show' ? distance : 0;
36
+
37
+ // Animate
38
+ wrapper.animate(animation, o.duration, o.options.easing, function() {
39
+ if(mode == 'hide') el.hide(); // Hide
40
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
41
+ if(o.callback) o.callback.apply(el[0], arguments); // Callback
42
+ el.dequeue();
43
+ });
44
+
45
+ });
46
+
47
+ };
48
+
49
+ })(jQuery);
@@ -0,0 +1,78 @@
1
+ /*
2
+ * jQuery UI Effects Bounce @VERSION
3
+ *
4
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Effects/Bounce
9
+ *
10
+ * Depends:
11
+ * effects.core.js
12
+ */
13
+ (function($) {
14
+
15
+ $.effects.bounce = function(o) {
16
+
17
+ return this.queue(function() {
18
+
19
+ // Create element
20
+ var el = $(this), props = ['position','top','left'];
21
+
22
+ // Set options
23
+ var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
24
+ var direction = o.options.direction || 'up'; // Default direction
25
+ var distance = o.options.distance || 20; // Default distance
26
+ var times = o.options.times || 5; // Default # of times
27
+ var speed = o.duration || 250; // Default speed per bounce
28
+ if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
29
+
30
+ // Adjust
31
+ $.effects.save(el, props); el.show(); // Save & Show
32
+ $.effects.createWrapper(el); // Create Wrapper
33
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
34
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
35
+ var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
36
+ if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
37
+ if (mode == 'hide') distance = distance / (times * 2);
38
+ if (mode != 'hide') times--;
39
+
40
+ // Animate
41
+ if (mode == 'show') { // Show Bounce
42
+ var animation = {opacity: 1};
43
+ animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
44
+ el.animate(animation, speed / 2, o.options.easing);
45
+ distance = distance / 2;
46
+ times--;
47
+ };
48
+ for (var i = 0; i < times; i++) { // Bounces
49
+ var animation1 = {}, animation2 = {};
50
+ animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
51
+ animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
52
+ el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
53
+ distance = (mode == 'hide') ? distance * 2 : distance / 2;
54
+ };
55
+ if (mode == 'hide') { // Last Bounce
56
+ var animation = {opacity: 0};
57
+ animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
58
+ el.animate(animation, speed / 2, o.options.easing, function(){
59
+ el.hide(); // Hide
60
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
61
+ if(o.callback) o.callback.apply(this, arguments); // Callback
62
+ });
63
+ } else {
64
+ var animation1 = {}, animation2 = {};
65
+ animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
66
+ animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
67
+ el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
68
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
69
+ if(o.callback) o.callback.apply(this, arguments); // Callback
70
+ });
71
+ };
72
+ el.queue('fx', function() { el.dequeue(); });
73
+ el.dequeue();
74
+ });
75
+
76
+ };
77
+
78
+ })(jQuery);
@@ -0,0 +1,54 @@
1
+ /*
2
+ * jQuery UI Effects Clip @VERSION
3
+ *
4
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Effects/Clip
9
+ *
10
+ * Depends:
11
+ * effects.core.js
12
+ */
13
+ (function($) {
14
+
15
+ $.effects.clip = function(o) {
16
+
17
+ return this.queue(function() {
18
+
19
+ // Create element
20
+ var el = $(this), props = ['position','top','left','height','width'];
21
+
22
+ // Set options
23
+ var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
24
+ var direction = o.options.direction || 'vertical'; // Default direction
25
+
26
+ // Adjust
27
+ $.effects.save(el, props); el.show(); // Save & Show
28
+ var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
29
+ var animate = el[0].tagName == 'IMG' ? wrapper : el;
30
+ var ref = {
31
+ size: (direction == 'vertical') ? 'height' : 'width',
32
+ position: (direction == 'vertical') ? 'top' : 'left'
33
+ };
34
+ var distance = (direction == 'vertical') ? animate.height() : animate.width();
35
+ if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
36
+
37
+ // Animation
38
+ var animation = {};
39
+ animation[ref.size] = mode == 'show' ? distance : 0;
40
+ animation[ref.position] = mode == 'show' ? 0 : distance / 2;
41
+
42
+ // Animate
43
+ animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
44
+ if(mode == 'hide') el.hide(); // Hide
45
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
46
+ if(o.callback) o.callback.apply(el[0], arguments); // Callback
47
+ el.dequeue();
48
+ }});
49
+
50
+ });
51
+
52
+ };
53
+
54
+ })(jQuery);
@@ -0,0 +1,510 @@
1
+ /*
2
+ * jQuery UI Effects @VERSION
3
+ *
4
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Effects/
9
+ */
10
+ ;(function($) {
11
+
12
+ $.effects = $.effects || {}; //Add the 'effects' scope
13
+
14
+ $.extend($.effects, {
15
+ version: "@VERSION",
16
+ save: function(el, set) {
17
+ for(var i=0;i<set.length;i++) {
18
+ if(set[i] !== null) $.data(el[0], "ec.storage."+set[i], el[0].style[set[i]]);
19
+ }
20
+ },
21
+ restore: function(el, set) {
22
+ for(var i=0;i<set.length;i++) {
23
+ if(set[i] !== null) el.css(set[i], $.data(el[0], "ec.storage."+set[i]));
24
+ }
25
+ },
26
+ setMode: function(el, mode) {
27
+ if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
28
+ return mode;
29
+ },
30
+ getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
31
+ // this should be a little more flexible in the future to handle a string & hash
32
+ var y, x;
33
+ switch (origin[0]) {
34
+ case 'top': y = 0; break;
35
+ case 'middle': y = 0.5; break;
36
+ case 'bottom': y = 1; break;
37
+ default: y = origin[0] / original.height;
38
+ };
39
+ switch (origin[1]) {
40
+ case 'left': x = 0; break;
41
+ case 'center': x = 0.5; break;
42
+ case 'right': x = 1; break;
43
+ default: x = origin[1] / original.width;
44
+ };
45
+ return {x: x, y: y};
46
+ },
47
+ createWrapper: function(el) {
48
+ if (el.parent().attr('id') == 'fxWrapper')
49
+ return el;
50
+ var props = {width: el.outerWidth({margin:true}), height: el.outerHeight({margin:true}), 'float': el.css('float')};
51
+ el.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
52
+ var wrapper = el.parent();
53
+ if (el.css('position') == 'static'){
54
+ wrapper.css({position: 'relative'});
55
+ el.css({position: 'relative'});
56
+ } else {
57
+ var top = el.css('top'); if(isNaN(parseInt(top))) top = 'auto';
58
+ var left = el.css('left'); if(isNaN(parseInt(left))) left = 'auto';
59
+ wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show();
60
+ el.css({position: 'relative', top:0, left:0});
61
+ }
62
+ wrapper.css(props);
63
+ return wrapper;
64
+ },
65
+ removeWrapper: function(el) {
66
+ if (el.parent().attr('id') == 'fxWrapper')
67
+ return el.parent().replaceWith(el);
68
+ return el;
69
+ },
70
+ setTransition: function(el, list, factor, val) {
71
+ val = val || {};
72
+ $.each(list,function(i, x){
73
+ unit = el.cssUnit(x);
74
+ if (unit[0] > 0) val[x] = unit[0] * factor + unit[1];
75
+ });
76
+ return val;
77
+ },
78
+ animateClass: function(value, duration, easing, callback) {
79
+
80
+ var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
81
+ var ea = (typeof easing == "object" ? easing : null);
82
+
83
+ return this.each(function() {
84
+
85
+ var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
86
+ if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
87
+ if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
88
+
89
+ //Let's get a style offset
90
+ var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
91
+ if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
92
+ var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
93
+ if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
94
+
95
+ // The main function to form the object for animation
96
+ for(var n in newStyle) {
97
+ if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
98
+ && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
99
+ && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
100
+ && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
101
+ && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
102
+ ) offset[n] = newStyle[n];
103
+ }
104
+
105
+ that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
106
+ // Change style attribute back to original. For stupid IE, we need to clear the damn object.
107
+ if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
108
+ if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
109
+ if(cb) cb.apply(this, arguments);
110
+ });
111
+
112
+ });
113
+ }
114
+ });
115
+
116
+ //Extend the methods of jQuery
117
+ $.fn.extend({
118
+ //Save old methods
119
+ _show: $.fn.show,
120
+ _hide: $.fn.hide,
121
+ __toggle: $.fn.toggle,
122
+ _addClass: $.fn.addClass,
123
+ _removeClass: $.fn.removeClass,
124
+ _toggleClass: $.fn.toggleClass,
125
+ // New ec methods
126
+ effect: function(fx,o,speed,callback) {
127
+ return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: o || {}, duration: speed, callback: callback }) : null;
128
+ },
129
+ show: function() {
130
+ if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
131
+ return this._show.apply(this, arguments);
132
+ else {
133
+ var o = arguments[1] || {}; o['mode'] = 'show';
134
+ return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
135
+ }
136
+ },
137
+ hide: function() {
138
+ if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
139
+ return this._hide.apply(this, arguments);
140
+ else {
141
+ var o = arguments[1] || {}; o['mode'] = 'hide';
142
+ return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
143
+ }
144
+ },
145
+ toggle: function(){
146
+ if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function))
147
+ return this.__toggle.apply(this, arguments);
148
+ else {
149
+ var o = arguments[1] || {}; o['mode'] = 'toggle';
150
+ return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
151
+ }
152
+ },
153
+ addClass: function(classNames,speed,easing,callback) {
154
+ return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
155
+ },
156
+ removeClass: function(classNames,speed,easing,callback) {
157
+ return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
158
+ },
159
+ toggleClass: function(classNames,speed,easing,callback) {
160
+ return speed ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames);
161
+ },
162
+ morph: function(remove,add,speed,easing,callback) {
163
+ return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
164
+ },
165
+ switchClass: function() {
166
+ return this.morph.apply(this, arguments);
167
+ },
168
+ // helper functions
169
+ cssUnit: function(key) {
170
+ var style = this.css(key), val = [];
171
+ $.each( ['em','px','%','pt'], function(i, unit){
172
+ if(style.indexOf(unit) > 0)
173
+ val = [parseFloat(style), unit];
174
+ });
175
+ return val;
176
+ }
177
+ });
178
+
179
+ /*
180
+ * jQuery Color Animations
181
+ * Copyright 2007 John Resig
182
+ * Released under the MIT and GPL licenses.
183
+ */
184
+
185
+ // We override the animation for all of these color styles
186
+ $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
187
+ $.fx.step[attr] = function(fx){
188
+ if ( fx.state == 0 ) {
189
+ fx.start = getColor( fx.elem, attr );
190
+ fx.end = getRGB( fx.end );
191
+ }
192
+
193
+ fx.elem.style[attr] = "rgb(" + [
194
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
195
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
196
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
197
+ ].join(",") + ")";
198
+ }
199
+ });
200
+
201
+ // Color Conversion functions from highlightFade
202
+ // By Blair Mitchelmore
203
+ // http://jquery.offput.ca/highlightFade/
204
+
205
+ // Parse strings looking for color tuples [255,255,255]
206
+ function getRGB(color) {
207
+ var result;
208
+
209
+ // Check if we're already dealing with an array of colors
210
+ if ( color && color.constructor == Array && color.length == 3 )
211
+ return color;
212
+
213
+ // Look for rgb(num,num,num)
214
+ if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
215
+ return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
216
+
217
+ // Look for rgb(num%,num%,num%)
218
+ if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
219
+ return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
220
+
221
+ // Look for #a0b1c2
222
+ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
223
+ return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
224
+
225
+ // Look for #fff
226
+ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
227
+ return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
228
+
229
+ // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
230
+ if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
231
+ return colors['transparent'];
232
+
233
+ // Otherwise, we're most likely dealing with a named color
234
+ return colors[$.trim(color).toLowerCase()];
235
+ }
236
+
237
+ function getColor(elem, attr) {
238
+ var color;
239
+
240
+ do {
241
+ color = $.curCSS(elem, attr);
242
+
243
+ // Keep going until we find an element that has color, or we hit the body
244
+ if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
245
+ break;
246
+
247
+ attr = "backgroundColor";
248
+ } while ( elem = elem.parentNode );
249
+
250
+ return getRGB(color);
251
+ };
252
+
253
+ // Some named colors to work with
254
+ // From Interface by Stefan Petre
255
+ // http://interface.eyecon.ro/
256
+
257
+ var colors = {
258
+ aqua:[0,255,255],
259
+ azure:[240,255,255],
260
+ beige:[245,245,220],
261
+ black:[0,0,0],
262
+ blue:[0,0,255],
263
+ brown:[165,42,42],
264
+ cyan:[0,255,255],
265
+ darkblue:[0,0,139],
266
+ darkcyan:[0,139,139],
267
+ darkgrey:[169,169,169],
268
+ darkgreen:[0,100,0],
269
+ darkkhaki:[189,183,107],
270
+ darkmagenta:[139,0,139],
271
+ darkolivegreen:[85,107,47],
272
+ darkorange:[255,140,0],
273
+ darkorchid:[153,50,204],
274
+ darkred:[139,0,0],
275
+ darksalmon:[233,150,122],
276
+ darkviolet:[148,0,211],
277
+ fuchsia:[255,0,255],
278
+ gold:[255,215,0],
279
+ green:[0,128,0],
280
+ indigo:[75,0,130],
281
+ khaki:[240,230,140],
282
+ lightblue:[173,216,230],
283
+ lightcyan:[224,255,255],
284
+ lightgreen:[144,238,144],
285
+ lightgrey:[211,211,211],
286
+ lightpink:[255,182,193],
287
+ lightyellow:[255,255,224],
288
+ lime:[0,255,0],
289
+ magenta:[255,0,255],
290
+ maroon:[128,0,0],
291
+ navy:[0,0,128],
292
+ olive:[128,128,0],
293
+ orange:[255,165,0],
294
+ pink:[255,192,203],
295
+ purple:[128,0,128],
296
+ violet:[128,0,128],
297
+ red:[255,0,0],
298
+ silver:[192,192,192],
299
+ white:[255,255,255],
300
+ yellow:[255,255,0],
301
+ transparent: [255,255,255]
302
+ };
303
+
304
+ /*
305
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
306
+ *
307
+ * Uses the built in easing capabilities added In jQuery 1.1
308
+ * to offer multiple easing options
309
+ *
310
+ * TERMS OF USE - jQuery Easing
311
+ *
312
+ * Open source under the BSD License.
313
+ *
314
+ * Copyright � 2008 George McGinley Smith
315
+ * All rights reserved.
316
+ *
317
+ * Redistribution and use in source and binary forms, with or without modification,
318
+ * are permitted provided that the following conditions are met:
319
+ *
320
+ * Redistributions of source code must retain the above copyright notice, this list of
321
+ * conditions and the following disclaimer.
322
+ * Redistributions in binary form must reproduce the above copyright notice, this list
323
+ * of conditions and the following disclaimer in the documentation and/or other materials
324
+ * provided with the distribution.
325
+ *
326
+ * Neither the name of the author nor the names of contributors may be used to endorse
327
+ * or promote products derived from this software without specific prior written permission.
328
+ *
329
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
330
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
331
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
332
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
333
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
334
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
335
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
336
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
337
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
338
+ *
339
+ */
340
+
341
+ // t: current time, b: begInnIng value, c: change In value, d: duration
342
+ $.easing.jswing = $.easing.swing;
343
+
344
+ $.extend($.easing,
345
+ {
346
+ def: 'easeOutQuad',
347
+ swing: function (x, t, b, c, d) {
348
+ //alert($.easing.default);
349
+ return $.easing[$.easing.def](x, t, b, c, d);
350
+ },
351
+ easeInQuad: function (x, t, b, c, d) {
352
+ return c*(t/=d)*t + b;
353
+ },
354
+ easeOutQuad: function (x, t, b, c, d) {
355
+ return -c *(t/=d)*(t-2) + b;
356
+ },
357
+ easeInOutQuad: function (x, t, b, c, d) {
358
+ if ((t/=d/2) < 1) return c/2*t*t + b;
359
+ return -c/2 * ((--t)*(t-2) - 1) + b;
360
+ },
361
+ easeInCubic: function (x, t, b, c, d) {
362
+ return c*(t/=d)*t*t + b;
363
+ },
364
+ easeOutCubic: function (x, t, b, c, d) {
365
+ return c*((t=t/d-1)*t*t + 1) + b;
366
+ },
367
+ easeInOutCubic: function (x, t, b, c, d) {
368
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
369
+ return c/2*((t-=2)*t*t + 2) + b;
370
+ },
371
+ easeInQuart: function (x, t, b, c, d) {
372
+ return c*(t/=d)*t*t*t + b;
373
+ },
374
+ easeOutQuart: function (x, t, b, c, d) {
375
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
376
+ },
377
+ easeInOutQuart: function (x, t, b, c, d) {
378
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
379
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
380
+ },
381
+ easeInQuint: function (x, t, b, c, d) {
382
+ return c*(t/=d)*t*t*t*t + b;
383
+ },
384
+ easeOutQuint: function (x, t, b, c, d) {
385
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
386
+ },
387
+ easeInOutQuint: function (x, t, b, c, d) {
388
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
389
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
390
+ },
391
+ easeInSine: function (x, t, b, c, d) {
392
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
393
+ },
394
+ easeOutSine: function (x, t, b, c, d) {
395
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
396
+ },
397
+ easeInOutSine: function (x, t, b, c, d) {
398
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
399
+ },
400
+ easeInExpo: function (x, t, b, c, d) {
401
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
402
+ },
403
+ easeOutExpo: function (x, t, b, c, d) {
404
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
405
+ },
406
+ easeInOutExpo: function (x, t, b, c, d) {
407
+ if (t==0) return b;
408
+ if (t==d) return b+c;
409
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
410
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
411
+ },
412
+ easeInCirc: function (x, t, b, c, d) {
413
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
414
+ },
415
+ easeOutCirc: function (x, t, b, c, d) {
416
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
417
+ },
418
+ easeInOutCirc: function (x, t, b, c, d) {
419
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
420
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
421
+ },
422
+ easeInElastic: function (x, t, b, c, d) {
423
+ var s=1.70158;var p=0;var a=c;
424
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
425
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
426
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
427
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
428
+ },
429
+ easeOutElastic: function (x, t, b, c, d) {
430
+ var s=1.70158;var p=0;var a=c;
431
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
432
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
433
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
434
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
435
+ },
436
+ easeInOutElastic: function (x, t, b, c, d) {
437
+ var s=1.70158;var p=0;var a=c;
438
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
439
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
440
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
441
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
442
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
443
+ },
444
+ easeInBack: function (x, t, b, c, d, s) {
445
+ if (s == undefined) s = 1.70158;
446
+ return c*(t/=d)*t*((s+1)*t - s) + b;
447
+ },
448
+ easeOutBack: function (x, t, b, c, d, s) {
449
+ if (s == undefined) s = 1.70158;
450
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
451
+ },
452
+ easeInOutBack: function (x, t, b, c, d, s) {
453
+ if (s == undefined) s = 1.70158;
454
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
455
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
456
+ },
457
+ easeInBounce: function (x, t, b, c, d) {
458
+ return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
459
+ },
460
+ easeOutBounce: function (x, t, b, c, d) {
461
+ if ((t/=d) < (1/2.75)) {
462
+ return c*(7.5625*t*t) + b;
463
+ } else if (t < (2/2.75)) {
464
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
465
+ } else if (t < (2.5/2.75)) {
466
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
467
+ } else {
468
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
469
+ }
470
+ },
471
+ easeInOutBounce: function (x, t, b, c, d) {
472
+ if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
473
+ return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
474
+ }
475
+ });
476
+
477
+ /*
478
+ *
479
+ * TERMS OF USE - EASING EQUATIONS
480
+ *
481
+ * Open source under the BSD License.
482
+ *
483
+ * Copyright � 2001 Robert Penner
484
+ * All rights reserved.
485
+ *
486
+ * Redistribution and use in source and binary forms, with or without modification,
487
+ * are permitted provided that the following conditions are met:
488
+ *
489
+ * Redistributions of source code must retain the above copyright notice, this list of
490
+ * conditions and the following disclaimer.
491
+ * Redistributions in binary form must reproduce the above copyright notice, this list
492
+ * of conditions and the following disclaimer in the documentation and/or other materials
493
+ * provided with the distribution.
494
+ *
495
+ * Neither the name of the author nor the names of contributors may be used to endorse
496
+ * or promote products derived from this software without specific prior written permission.
497
+ *
498
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
499
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
500
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
501
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
502
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
503
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
504
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
505
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
506
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
507
+ *
508
+ */
509
+
510
+ })(jQuery);