smparkes-envjs 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/bin/envjsrb +157 -73
  2. data/bin/jquery-1.3.2-test.js +11 -4
  3. data/lib/envjs/env.js +935 -11028
  4. data/lib/envjs/net/cgi.rb +94 -0
  5. data/lib/envjs/net/file.rb +4 -4
  6. data/lib/envjs/runtime.rb +80 -24
  7. data/test/call-load-test.js +0 -2
  8. data/test/firebug/errorIcon.png +0 -0
  9. data/test/firebug/firebug.css +209 -0
  10. data/test/firebug/firebug.html +23 -0
  11. data/test/firebug/firebug.js +672 -0
  12. data/test/firebug/firebugx.js +10 -0
  13. data/test/firebug/infoIcon.png +0 -0
  14. data/test/firebug/warningIcon.png +0 -0
  15. data/test/fixtures/html/events.html +171 -0
  16. data/test/fixtures/html/iframe1.html +46 -0
  17. data/test/fixtures/html/iframe1a.html +46 -0
  18. data/test/fixtures/html/iframe2.html +45 -0
  19. data/test/fixtures/html/iframe3.html +28 -0
  20. data/test/fixtures/html/iframeN.html +57 -0
  21. data/test/fixtures/html/malformed.html +181 -0
  22. data/test/fixtures/html/scope.html +81 -0
  23. data/test/fixtures/html/trivial.html +19 -0
  24. data/test/fixtures/html/with_js.html +26 -0
  25. data/test/fixtures/images/icon-blue.png +0 -0
  26. data/test/fixtures/js/external_script.js +1 -0
  27. data/test/fixtures/js/script.js +1 -0
  28. data/test/fixtures/js/script_error.js +2 -0
  29. data/test/html/malformed.html +1 -0
  30. data/test/index.html +21 -19
  31. data/test/{primaryTests.js → primary-tests.js} +1 -3
  32. data/test/{prototype.js → prototype-test.js} +0 -2
  33. data/test/qunit/qunit/qunit.css +0 -0
  34. data/test/qunit/qunit/qunit.js +2 -2
  35. data/test/{qunit/qunit/qunit.js.smp → specs/dist/env.spec.js} +539 -7
  36. data/test/specs/envjs.spec.css +46 -0
  37. data/test/specs/parser/html.js +31 -0
  38. data/test/specs/parser/spec.html +40 -0
  39. data/test/specs/parser/xml.js +31 -0
  40. data/test/specs/qunit.bdd.js +210 -0
  41. data/test/{qunit.smp/qunit → specs}/qunit.css +0 -0
  42. data/test/{qunit.smp/qunit → specs}/qunit.js +2 -2
  43. data/test/specs/template/spec-0.js +31 -0
  44. data/test/specs/template/spec-1.js +31 -0
  45. data/test/specs/template/spec.html +40 -0
  46. data/test/specs/window/css.js +23 -0
  47. data/test/specs/window/dialog.js +25 -0
  48. data/test/specs/window/document.js +23 -0
  49. data/test/specs/window/event.js +25 -0
  50. data/test/specs/window/history.js +34 -0
  51. data/test/specs/window/location.js +34 -0
  52. data/test/specs/window/navigator.js +71 -0
  53. data/test/specs/window/screen.js +42 -0
  54. data/test/specs/window/spec.html +48 -0
  55. data/test/specs/window/timer.js +26 -0
  56. data/test/specs/window/window.js +53 -0
  57. data/test/specs/xhr/spec.html +47 -0
  58. data/test/specs/xhr/xhr.js +31 -0
  59. data/test/test.js +10 -0
  60. data/test/unit/elementmembers.js +31 -0
  61. data/test/unit/nu.validator.js +34 -0
  62. data/test/unit/onload.js +1 -3
  63. data/test/unit/parser.js +106 -98
  64. data/test/unit/prototypecompat.js +2 -2
  65. data/test/vendor/jQuery/1.3.2/ChangeLog.txt +98 -0
  66. data/test/vendor/jQuery/1.3.2/GPL-LICENSE.txt +278 -0
  67. data/test/vendor/jQuery/1.3.2/MIT-LICENSE.txt +20 -0
  68. data/test/vendor/jQuery/1.3.2/Makefile +154 -0
  69. data/test/vendor/jQuery/1.3.2/README +67 -0
  70. data/test/vendor/jQuery/1.3.2/build/ant-contrib-0.6.jar +0 -0
  71. data/test/vendor/jQuery/1.3.2/build/build/min.js +11 -0
  72. data/test/vendor/jQuery/1.3.2/build/build/pack.js +19 -0
  73. data/test/vendor/jQuery/1.3.2/build/js/Packer.js +209 -0
  74. data/test/vendor/jQuery/1.3.2/build/js/ParseMaster.js +106 -0
  75. data/test/vendor/jQuery/1.3.2/build/js/Words.js +62 -0
  76. data/test/vendor/jQuery/1.3.2/build/js/base2.js +978 -0
  77. data/test/vendor/jQuery/1.3.2/build/js/jsmin.js +316 -0
  78. data/test/vendor/jQuery/1.3.2/build/js/json.js +117 -0
  79. data/test/vendor/jQuery/1.3.2/build/js/pack.js +316 -0
  80. data/test/vendor/jQuery/1.3.2/build/js/parse.js +105 -0
  81. data/test/vendor/jQuery/1.3.2/build/js/writeFile.js +19 -0
  82. data/test/vendor/jQuery/1.3.2/build/js/xml.js +25 -0
  83. data/test/vendor/jQuery/1.3.2/build/js.jar +0 -0
  84. data/test/vendor/jQuery/1.3.2/build/runtest/env.js +1 -0
  85. data/test/vendor/jQuery/1.3.2/build/runtest/test.js +106 -0
  86. data/test/vendor/jQuery/1.3.2/build/runtest/testrunner.js +197 -0
  87. data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.css +65 -0
  88. data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.js +181 -0
  89. data/test/vendor/jQuery/1.3.2/build/speed/index.html +72 -0
  90. data/test/vendor/jQuery/1.3.2/build/speed/jquery-basis.js +3549 -0
  91. data/test/vendor/jQuery/1.3.2/build/style.xsl +99 -0
  92. data/test/vendor/jQuery/1.3.2/build/yuicompressor-2.4.2.jar +0 -0
  93. data/test/vendor/jQuery/1.3.2/build.xml +123 -0
  94. data/test/vendor/jQuery/1.3.2/dist/jquery.js +4376 -0
  95. data/test/vendor/jQuery/1.3.2/reminder.txt +3 -0
  96. data/test/vendor/jQuery/1.3.2/src/ajax.js +541 -0
  97. data/test/vendor/jQuery/1.3.2/src/core.js +1255 -0
  98. data/test/vendor/jQuery/1.3.2/src/data.js +145 -0
  99. data/test/vendor/jQuery/1.3.2/src/dimensions.js +49 -0
  100. data/test/vendor/jQuery/1.3.2/src/event.js +684 -0
  101. data/test/vendor/jQuery/1.3.2/src/fx.js +407 -0
  102. data/test/vendor/jQuery/1.3.2/src/intro.js +13 -0
  103. data/test/vendor/jQuery/1.3.2/src/offset.js +155 -0
  104. data/test/vendor/jQuery/1.3.2/src/outro.js +1 -0
  105. data/test/vendor/jQuery/1.3.2/src/selector.js +1015 -0
  106. data/test/vendor/jQuery/1.3.2/src/support.js +112 -0
  107. data/test/vendor/jQuery/1.3.2/test/data/cow.jpg +0 -0
  108. data/test/vendor/jQuery/1.3.2/test/data/dashboard.xml +11 -0
  109. data/test/vendor/jQuery/1.3.2/test/data/echoQuery.php +1 -0
  110. data/test/vendor/jQuery/1.3.2/test/data/iframe.html +8 -0
  111. data/test/vendor/jQuery/1.3.2/test/data/json.php +9 -0
  112. data/test/vendor/jQuery/1.3.2/test/data/json_assigned_obj.js +1 -0
  113. data/test/vendor/jQuery/1.3.2/test/data/json_obj.js +1 -0
  114. data/test/vendor/jQuery/1.3.2/test/data/jsonp.php +10 -0
  115. data/test/vendor/jQuery/1.3.2/test/data/name.html +1 -0
  116. data/test/vendor/jQuery/1.3.2/test/data/name.php +29 -0
  117. data/test/vendor/jQuery/1.3.2/test/data/offset/absolute.html +39 -0
  118. data/test/vendor/jQuery/1.3.2/test/data/offset/body.html +24 -0
  119. data/test/vendor/jQuery/1.3.2/test/data/offset/fixed.html +33 -0
  120. data/test/vendor/jQuery/1.3.2/test/data/offset/relative.html +31 -0
  121. data/test/vendor/jQuery/1.3.2/test/data/offset/scroll.html +39 -0
  122. data/test/vendor/jQuery/1.3.2/test/data/offset/static.html +31 -0
  123. data/test/vendor/jQuery/1.3.2/test/data/offset/table.html +43 -0
  124. data/test/vendor/jQuery/1.3.2/test/data/params_html.php +12 -0
  125. data/test/vendor/jQuery/1.3.2/test/data/test.html +7 -0
  126. data/test/vendor/jQuery/1.3.2/test/data/test.js +3 -0
  127. data/test/vendor/jQuery/1.3.2/test/data/test.php +7 -0
  128. data/test/vendor/jQuery/1.3.2/test/data/test2.html +5 -0
  129. data/test/vendor/jQuery/1.3.2/test/data/test3.html +3 -0
  130. data/test/vendor/jQuery/1.3.2/test/data/testrunner.js +1 -0
  131. data/test/vendor/jQuery/1.3.2/test/data/text.php +12 -0
  132. data/test/vendor/jQuery/1.3.2/test/data/with_fries.xml +25 -0
  133. data/test/vendor/jQuery/1.3.2/test/index.html +229 -0
  134. data/test/vendor/jQuery/1.3.2/test/jqenv-1259090275493.html +247 -0
  135. data/test/vendor/jQuery/1.3.2/test/jqenv-1259091671501.html +247 -0
  136. data/test/vendor/jQuery/1.3.2/test/jqenv-1259175319655.html +247 -0
  137. data/test/vendor/jQuery/1.3.2/test/offset.html +28 -0
  138. data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
  139. data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
  140. data/test/vendor/jQuery/1.3.2/test/otherlibs/mootools/1.11/mootools.js +1577 -0
  141. data/test/vendor/jQuery/1.3.2/test/otherlibs/prototype/1.6.0.2/prototype.js +4221 -0
  142. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/builder.js +131 -0
  143. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/controls.js +835 -0
  144. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/dragdrop.js +944 -0
  145. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/effects.js +1090 -0
  146. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/scriptaculous.js +51 -0
  147. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/slider.js +278 -0
  148. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/unittest.js +564 -0
  149. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/builder.js +136 -0
  150. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/controls.js +965 -0
  151. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/dragdrop.js +974 -0
  152. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/effects.js +1122 -0
  153. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/scriptaculous.js +58 -0
  154. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/slider.js +275 -0
  155. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/sound.js +55 -0
  156. data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/unittest.js +568 -0
  157. data/test/vendor/jQuery/1.3.2/test/polluted.php +64 -0
  158. data/test/vendor/jQuery/1.3.2/test/qunit/testrunner.js +780 -0
  159. data/test/vendor/jQuery/1.3.2/test/qunit/testsuite.css +120 -0
  160. data/test/vendor/jQuery/1.3.2/test/test.js +41 -0
  161. data/test/vendor/jQuery/1.3.2/test/unit/ajax.js +856 -0
  162. data/test/vendor/jQuery/1.3.2/test/unit/core.js +1872 -0
  163. data/test/vendor/jQuery/1.3.2/test/unit/data.js +160 -0
  164. data/test/vendor/jQuery/1.3.2/test/unit/dimensions.js +86 -0
  165. data/test/vendor/jQuery/1.3.2/test/unit/event.js +670 -0
  166. data/test/vendor/jQuery/1.3.2/test/unit/fx.js +451 -0
  167. data/test/vendor/jQuery/1.3.2/test/unit/offset.js +173 -0
  168. data/test/vendor/jQuery/1.3.2/test/unit/selector.js +395 -0
  169. data/test/vendor/jQuery/1.3.2/test/xhtml.php +5 -0
  170. data/test/vendor/jQuery/1.3.2/version.txt +1 -0
  171. metadata +158 -22
  172. data/lib/envjs/runtime.rb.smp +0 -133
  173. data/test/envjs-call-load-test.js +0 -5
  174. data/test/envjs-prototype.js +0 -5
  175. data/test/qunit/package.json +0 -21
  176. data/test/qunit/test/index.html +0 -17
  177. data/test/qunit/test/same.js +0 -1368
  178. data/test/qunit/test/test.js +0 -136
  179. data/test/qunit.smp/package.json +0 -21
  180. data/test/qunit.smp/test/index.html +0 -17
  181. data/test/qunit.smp/test/same.js +0 -1368
  182. data/test/qunit.smp/test/test.js +0 -136
  183. data/test/rhino-call-load-test.js +0 -5
  184. data/test/rhino-prototype.js +0 -5
  185. data/test/test-with-envs-jar.js +0 -8
  186. data/test/test-with-rhino-jar.js +0 -9
@@ -0,0 +1,407 @@
1
+ var elemdisplay = {},
2
+ timerId,
3
+ fxAttrs = [
4
+ // height animations
5
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
6
+ // width animations
7
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
8
+ // opacity animations
9
+ [ "opacity" ]
10
+ ];
11
+
12
+ function genFx( type, num ){
13
+ var obj = {};
14
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
15
+ obj[ this ] = type;
16
+ });
17
+ return obj;
18
+ }
19
+
20
+ jQuery.fn.extend({
21
+ show: function(speed,callback){
22
+ if ( speed ) {
23
+ return this.animate( genFx("show", 3), speed, callback);
24
+ } else {
25
+ for ( var i = 0, l = this.length; i < l; i++ ){
26
+ var old = jQuery.data(this[i], "olddisplay");
27
+
28
+ this[i].style.display = old || "";
29
+
30
+ if ( jQuery.css(this[i], "display") === "none" ) {
31
+ var tagName = this[i].tagName, display;
32
+
33
+ if ( elemdisplay[ tagName ] ) {
34
+ display = elemdisplay[ tagName ];
35
+ } else {
36
+ var elem = jQuery("<" + tagName + " />").appendTo("body");
37
+
38
+ display = elem.css("display");
39
+ if ( display === "none" )
40
+ display = "block";
41
+
42
+ elem.remove();
43
+
44
+ elemdisplay[ tagName ] = display;
45
+ }
46
+
47
+ jQuery.data(this[i], "olddisplay", display);
48
+ }
49
+ }
50
+
51
+ // Set the display of the elements in a second loop
52
+ // to avoid the constant reflow
53
+ for ( var i = 0, l = this.length; i < l; i++ ){
54
+ this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
55
+ }
56
+
57
+ return this;
58
+ }
59
+ },
60
+
61
+ hide: function(speed,callback){
62
+ if ( speed ) {
63
+ return this.animate( genFx("hide", 3), speed, callback);
64
+ } else {
65
+ for ( var i = 0, l = this.length; i < l; i++ ){
66
+ var old = jQuery.data(this[i], "olddisplay");
67
+ if ( !old && old !== "none" )
68
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
69
+ }
70
+
71
+ // Set the display of the elements in a second loop
72
+ // to avoid the constant reflow
73
+ for ( var i = 0, l = this.length; i < l; i++ ){
74
+ this[i].style.display = "none";
75
+ }
76
+
77
+ return this;
78
+ }
79
+ },
80
+
81
+ // Save the old toggle function
82
+ _toggle: jQuery.fn.toggle,
83
+
84
+ toggle: function( fn, fn2 ){
85
+ var bool = typeof fn === "boolean";
86
+
87
+ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
88
+ this._toggle.apply( this, arguments ) :
89
+ fn == null || bool ?
90
+ this.each(function(){
91
+ var state = bool ? fn : jQuery(this).is(":hidden");
92
+ jQuery(this)[ state ? "show" : "hide" ]();
93
+ }) :
94
+ this.animate(genFx("toggle", 3), fn, fn2);
95
+ },
96
+
97
+ fadeTo: function(speed,to,callback){
98
+ return this.animate({opacity: to}, speed, callback);
99
+ },
100
+
101
+ animate: function( prop, speed, easing, callback ) {
102
+ var optall = jQuery.speed(speed, easing, callback);
103
+
104
+ return this[ optall.queue === false ? "each" : "queue" ](function(){
105
+
106
+ var opt = jQuery.extend({}, optall), p,
107
+ hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
108
+ self = this;
109
+
110
+ for ( p in prop ) {
111
+ if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
112
+ return opt.complete.call(this);
113
+
114
+ if ( ( p == "height" || p == "width" ) && this.style ) {
115
+ // Store display property
116
+ opt.display = jQuery.css(this, "display");
117
+
118
+ // Make sure that nothing sneaks out
119
+ opt.overflow = this.style.overflow;
120
+ }
121
+ }
122
+
123
+ if ( opt.overflow != null )
124
+ this.style.overflow = "hidden";
125
+
126
+ opt.curAnim = jQuery.extend({}, prop);
127
+
128
+ jQuery.each( prop, function(name, val){
129
+ var e = new jQuery.fx( self, opt, name );
130
+
131
+ if ( /toggle|show|hide/.test(val) )
132
+ e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
133
+ else {
134
+ var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
135
+ start = e.cur(true) || 0;
136
+
137
+ if ( parts ) {
138
+ var end = parseFloat(parts[2]),
139
+ unit = parts[3] || "px";
140
+
141
+ // We need to compute starting value
142
+ if ( unit != "px" ) {
143
+ self.style[ name ] = (end || 1) + unit;
144
+ start = ((end || 1) / e.cur(true)) * start;
145
+ self.style[ name ] = start + unit;
146
+ }
147
+
148
+ // If a +=/-= token was provided, we're doing a relative animation
149
+ if ( parts[1] )
150
+ end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
151
+
152
+ e.custom( start, end, unit );
153
+ } else
154
+ e.custom( start, val, "" );
155
+ }
156
+ });
157
+
158
+ // For JS strict compliance
159
+ return true;
160
+ });
161
+ },
162
+
163
+ stop: function(clearQueue, gotoEnd){
164
+ var timers = jQuery.timers;
165
+
166
+ if (clearQueue)
167
+ this.queue([]);
168
+
169
+ this.each(function(){
170
+ // go in reverse order so anything added to the queue during the loop is ignored
171
+ for ( var i = timers.length - 1; i >= 0; i-- )
172
+ if ( timers[i].elem == this ) {
173
+ if (gotoEnd)
174
+ // force the next step to be the last
175
+ timers[i](true);
176
+ timers.splice(i, 1);
177
+ }
178
+ });
179
+
180
+ // start the next in the queue if the last step wasn't forced
181
+ if (!gotoEnd)
182
+ this.dequeue();
183
+
184
+ return this;
185
+ }
186
+
187
+ });
188
+
189
+ // Generate shortcuts for custom animations
190
+ jQuery.each({
191
+ slideDown: genFx("show", 1),
192
+ slideUp: genFx("hide", 1),
193
+ slideToggle: genFx("toggle", 1),
194
+ fadeIn: { opacity: "show" },
195
+ fadeOut: { opacity: "hide" }
196
+ }, function( name, props ){
197
+ jQuery.fn[ name ] = function( speed, callback ){
198
+ return this.animate( props, speed, callback );
199
+ };
200
+ });
201
+
202
+ jQuery.extend({
203
+
204
+ speed: function(speed, easing, fn) {
205
+ var opt = typeof speed === "object" ? speed : {
206
+ complete: fn || !fn && easing ||
207
+ jQuery.isFunction( speed ) && speed,
208
+ duration: speed,
209
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
210
+ };
211
+
212
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
213
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
214
+
215
+ // Queueing
216
+ opt.old = opt.complete;
217
+ opt.complete = function(){
218
+ if ( opt.queue !== false )
219
+ jQuery(this).dequeue();
220
+ if ( jQuery.isFunction( opt.old ) )
221
+ opt.old.call( this );
222
+ };
223
+
224
+ return opt;
225
+ },
226
+
227
+ easing: {
228
+ linear: function( p, n, firstNum, diff ) {
229
+ return firstNum + diff * p;
230
+ },
231
+ swing: function( p, n, firstNum, diff ) {
232
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
233
+ }
234
+ },
235
+
236
+ timers: [],
237
+
238
+ fx: function( elem, options, prop ){
239
+ this.options = options;
240
+ this.elem = elem;
241
+ this.prop = prop;
242
+
243
+ if ( !options.orig )
244
+ options.orig = {};
245
+ }
246
+
247
+ });
248
+
249
+ jQuery.fx.prototype = {
250
+
251
+ // Simple function for setting a style value
252
+ update: function(){
253
+ if ( this.options.step )
254
+ this.options.step.call( this.elem, this.now, this );
255
+
256
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
257
+
258
+ // Set display property to block for height/width animations
259
+ if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
260
+ this.elem.style.display = "block";
261
+ },
262
+
263
+ // Get the current size
264
+ cur: function(force){
265
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
266
+ return this.elem[ this.prop ];
267
+
268
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
269
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
270
+ },
271
+
272
+ // Start an animation from one number to another
273
+ custom: function(from, to, unit){
274
+ this.startTime = now();
275
+ this.start = from;
276
+ this.end = to;
277
+ this.unit = unit || this.unit || "px";
278
+ this.now = this.start;
279
+ this.pos = this.state = 0;
280
+
281
+ var self = this;
282
+ function t(gotoEnd){
283
+ return self.step(gotoEnd);
284
+ }
285
+
286
+ t.elem = this.elem;
287
+
288
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
289
+ timerId = setInterval(function(){
290
+ var timers = jQuery.timers;
291
+
292
+ for ( var i = 0; i < timers.length; i++ )
293
+ if ( !timers[i]() )
294
+ timers.splice(i--, 1);
295
+
296
+ if ( !timers.length ) {
297
+ clearInterval( timerId );
298
+ timerId = undefined;
299
+ }
300
+ }, 13);
301
+ }
302
+ },
303
+
304
+ // Simple 'show' function
305
+ show: function(){
306
+ // Remember where we started, so that we can go back to it later
307
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
308
+ this.options.show = true;
309
+
310
+ // Begin the animation
311
+ // Make sure that we start at a small width/height to avoid any
312
+ // flash of content
313
+ this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
314
+
315
+ // Start by showing the element
316
+ jQuery(this.elem).show();
317
+ },
318
+
319
+ // Simple 'hide' function
320
+ hide: function(){
321
+ // Remember where we started, so that we can go back to it later
322
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
323
+ this.options.hide = true;
324
+
325
+ // Begin the animation
326
+ this.custom(this.cur(), 0);
327
+ },
328
+
329
+ // Each step of an animation
330
+ step: function(gotoEnd){
331
+ var t = now();
332
+
333
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
334
+ this.now = this.end;
335
+ this.pos = this.state = 1;
336
+ this.update();
337
+
338
+ this.options.curAnim[ this.prop ] = true;
339
+
340
+ var done = true;
341
+ for ( var i in this.options.curAnim )
342
+ if ( this.options.curAnim[i] !== true )
343
+ done = false;
344
+
345
+ if ( done ) {
346
+ if ( this.options.display != null ) {
347
+ // Reset the overflow
348
+ this.elem.style.overflow = this.options.overflow;
349
+
350
+ // Reset the display
351
+ this.elem.style.display = this.options.display;
352
+ if ( jQuery.css(this.elem, "display") == "none" )
353
+ this.elem.style.display = "block";
354
+ }
355
+
356
+ // Hide the element if the "hide" operation was done
357
+ if ( this.options.hide )
358
+ jQuery(this.elem).hide();
359
+
360
+ // Reset the properties, if the item has been hidden or shown
361
+ if ( this.options.hide || this.options.show )
362
+ for ( var p in this.options.curAnim )
363
+ jQuery.attr(this.elem.style, p, this.options.orig[p]);
364
+
365
+ // Execute the complete function
366
+ this.options.complete.call( this.elem );
367
+ }
368
+
369
+ return false;
370
+ } else {
371
+ var n = t - this.startTime;
372
+ this.state = n / this.options.duration;
373
+
374
+ // Perform the easing function, defaults to swing
375
+ this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
376
+ this.now = this.start + ((this.end - this.start) * this.pos);
377
+
378
+ // Perform the next step of the animation
379
+ this.update();
380
+ }
381
+
382
+ return true;
383
+ }
384
+
385
+ };
386
+
387
+ jQuery.extend( jQuery.fx, {
388
+ speeds:{
389
+ slow: 600,
390
+ fast: 200,
391
+ // Default speed
392
+ _default: 400
393
+ },
394
+ step: {
395
+
396
+ opacity: function(fx){
397
+ jQuery.attr(fx.elem.style, "opacity", fx.now);
398
+ },
399
+
400
+ _default: function(fx){
401
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
402
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
403
+ else
404
+ fx.elem[ fx.prop ] = fx.now;
405
+ }
406
+ }
407
+ });
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * jQuery JavaScript Library v@VERSION
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright (c) 2009 John Resig
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://docs.jquery.com/License
8
+ *
9
+ * Date:
10
+ * Revision:
11
+ */
12
+ (function(){
13
+
@@ -0,0 +1,155 @@
1
+ if ( document.documentElement["getBoundingClientRect"] )
2
+ jQuery.fn.offset = function() {
3
+ if ( !this[0] ) return { top: 0, left: 0 };
4
+ if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
5
+ var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
6
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
7
+ top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
8
+ left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
9
+ return { top: top, left: left };
10
+ };
11
+ else
12
+ jQuery.fn.offset = function() {
13
+ if ( !this[0] ) return { top: 0, left: 0 };
14
+ if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
15
+ jQuery.offset.initialized || jQuery.offset.initialize();
16
+
17
+ var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
18
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
19
+ body = doc.body, defaultView = doc.defaultView,
20
+ prevComputedStyle = defaultView.getComputedStyle(elem, null),
21
+ top = elem.offsetTop, left = elem.offsetLeft;
22
+
23
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
24
+ computedStyle = defaultView.getComputedStyle(elem, null);
25
+ top -= elem.scrollTop, left -= elem.scrollLeft;
26
+ if ( elem === offsetParent ) {
27
+ top += elem.offsetTop, left += elem.offsetLeft;
28
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
29
+ top += parseInt( computedStyle.borderTopWidth, 10) || 0,
30
+ left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
31
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
32
+ }
33
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
34
+ top += parseInt( computedStyle.borderTopWidth, 10) || 0,
35
+ left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
36
+ prevComputedStyle = computedStyle;
37
+ }
38
+
39
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
40
+ top += body.offsetTop,
41
+ left += body.offsetLeft;
42
+
43
+ if ( prevComputedStyle.position === "fixed" )
44
+ top += Math.max(docElem.scrollTop, body.scrollTop),
45
+ left += Math.max(docElem.scrollLeft, body.scrollLeft);
46
+
47
+ return { top: top, left: left };
48
+ };
49
+
50
+ jQuery.offset = {
51
+ initialize: function() {
52
+ if ( this.initialized ) return;
53
+ var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
54
+ html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
55
+
56
+ rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
57
+ for ( prop in rules ) container.style[prop] = rules[prop];
58
+
59
+ container.innerHTML = html;
60
+ body.insertBefore(container, body.firstChild);
61
+ innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
62
+
63
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
64
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
65
+
66
+ innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
67
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
68
+
69
+ body.style.marginTop = '1px';
70
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
71
+ body.style.marginTop = bodyMarginTop;
72
+
73
+ body.removeChild(container);
74
+ this.initialized = true;
75
+ },
76
+
77
+ bodyOffset: function(body) {
78
+ jQuery.offset.initialized || jQuery.offset.initialize();
79
+ var top = body.offsetTop, left = body.offsetLeft;
80
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
81
+ top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0,
82
+ left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
83
+ return { top: top, left: left };
84
+ }
85
+ };
86
+
87
+
88
+ jQuery.fn.extend({
89
+ position: function() {
90
+ var left = 0, top = 0, results;
91
+
92
+ if ( this[0] ) {
93
+ // Get *real* offsetParent
94
+ var offsetParent = this.offsetParent(),
95
+
96
+ // Get correct offsets
97
+ offset = this.offset(),
98
+ parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
99
+
100
+ // Subtract element margins
101
+ // note: when an element has margin: auto the offsetLeft and marginLeft
102
+ // are the same in Safari causing offset.left to incorrectly be 0
103
+ offset.top -= num( this, 'marginTop' );
104
+ offset.left -= num( this, 'marginLeft' );
105
+
106
+ // Add offsetParent borders
107
+ parentOffset.top += num( offsetParent, 'borderTopWidth' );
108
+ parentOffset.left += num( offsetParent, 'borderLeftWidth' );
109
+
110
+ // Subtract the two offsets
111
+ results = {
112
+ top: offset.top - parentOffset.top,
113
+ left: offset.left - parentOffset.left
114
+ };
115
+ }
116
+
117
+ return results;
118
+ },
119
+
120
+ offsetParent: function() {
121
+ var offsetParent = this[0].offsetParent || document.body;
122
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
123
+ offsetParent = offsetParent.offsetParent;
124
+ return jQuery(offsetParent);
125
+ }
126
+ });
127
+
128
+
129
+ // Create scrollLeft and scrollTop methods
130
+ jQuery.each( ['Left', 'Top'], function(i, name) {
131
+ var method = 'scroll' + name;
132
+
133
+ jQuery.fn[ method ] = function(val) {
134
+ if (!this[0]) return null;
135
+
136
+ return val !== undefined ?
137
+
138
+ // Set the scroll offset
139
+ this.each(function() {
140
+ this == window || this == document ?
141
+ window.scrollTo(
142
+ !i ? val : jQuery(window).scrollLeft(),
143
+ i ? val : jQuery(window).scrollTop()
144
+ ) :
145
+ this[ method ] = val;
146
+ }) :
147
+
148
+ // Return the scroll offset
149
+ this[0] == window || this[0] == document ?
150
+ self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
151
+ jQuery.boxModel && document.documentElement[ method ] ||
152
+ document.body[ method ] :
153
+ this[0][ method ];
154
+ };
155
+ });
@@ -0,0 +1 @@
1
+ })();