public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Update to Prototype 1.5.0_rc0

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4182 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
sstephenson (author)
Wed Apr 05 21:57:14 -0700 2006
commit  26e381302c7eee09b8d03d32dc7a8233098a9abf
tree    6f302ede739d413636cc4227654b637bb84ba7c3
parent  ac97c7a90e5fd1799b1239210a42f8f35c383998
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Update to Prototype 1.5.0_rc0 [Sam Stephenson]
0
+
0
 * Honor skipping filters conditionally for only certain actions even when the parent class sets that filter to conditionally be executed only for the same actions. #4522 [Marcel Molina Jr.]
0
 
0
 * Delegate xml_http_request in integration tests to the session instance. [Jamis Buck]
...
1
 
2
3
4
...
7
8
9
10
 
11
12
13
...
25
26
27
28
 
29
30
31
...
176
177
178
179
 
180
181
182
...
355
356
357
358
 
359
360
361
...
365
366
367
368
 
369
370
371
...
447
448
449
450
 
 
451
452
453
...
476
477
478
479
 
480
481
482
483
...
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
 
516
517
518
519
...
590
591
592
 
593
594
595
 
596
597
598
...
644
645
646
 
647
648
649
...
707
708
709
710
711
 
712
713
714
...
739
740
741
742
 
743
744
745
...
915
916
917
918
919
920
921
922
 
 
 
 
 
923
924
925
...
1044
1045
1046
1047
 
1048
1049
1050
1051
1052
...
1123
1124
1125
1126
 
1127
1128
1129
1130
1131
 
1132
1133
1134
1135
1136
...
1156
1157
1158
1159
 
 
1160
1161
1162
...
1429
1430
1431
1432
 
1433
1434
1435
1436
1437
...
1551
1552
1553
1554
1555
1556
 
1557
1558
1559
1560
1561
1562
 
1563
1564
1565
1566
1567
1568
1569
1570
 
 
1571
1572
1573
...
1784
1785
1786
1787
 
 
1788
1789
1790
...
 
1
2
3
4
...
7
8
9
 
10
11
12
13
...
25
26
27
 
28
29
30
31
...
176
177
178
 
179
180
181
182
...
355
356
357
 
358
359
360
361
...
365
366
367
 
368
369
370
371
...
447
448
449
 
450
451
452
453
454
...
477
478
479
 
480
481
482
483
484
...
499
500
501
 
 
 
 
 
 
 
 
502
503
504
505
506
507
 
508
509
510
511
512
...
583
584
585
586
587
 
 
588
589
590
591
...
637
638
639
640
641
642
643
...
701
702
703
 
 
704
705
706
707
...
732
733
734
 
735
736
737
738
...
908
909
910
 
 
 
 
 
911
912
913
914
915
916
917
918
...
1037
1038
1039
 
1040
1041
1042
1043
1044
1045
...
1116
1117
1118
 
1119
1120
1121
1122
1123
 
1124
1125
 
1126
1127
1128
...
1148
1149
1150
 
1151
1152
1153
1154
1155
...
1422
1423
1424
 
1425
1426
1427
1428
1429
1430
...
1544
1545
1546
 
 
 
1547
1548
1549
1550
1551
1552
 
1553
1554
1555
 
 
 
 
 
 
1556
1557
1558
1559
1560
...
1771
1772
1773
 
1774
1775
1776
1777
1778
0
@@ -1,4 +1,4 @@
0
-/* Prototype JavaScript framework, version 1.5.0_pre1
0
+/* Prototype JavaScript framework, version 1.5.0_rc0
0
  * (c) 2005 Sam Stephenson <sam@conio.net>
0
  *
0
  * Prototype is freely distributable under the terms of an MIT-style license.
0
@@ -7,7 +7,7 @@
0
 /*--------------------------------------------------------------------------*/
0
 
0
 var Prototype = {
0
- Version: '1.5.0_pre1',
0
+ Version: '1.5.0_rc0',
0
   ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
0
 
0
   emptyFunction: function() {},
0
@@ -25,7 +25,7 @@
0
 var Abstract = new Object();
0
 
0
 Object.extend = function(destination, source) {
0
- for (property in source) {
0
+ for (var property in source) {
0
     destination[property] = source[property];
0
   }
0
   return destination;
0
@@ -176,7 +176,7 @@
0
   },
0
 
0
   evalScripts: function() {
0
- return this.extractScripts().map(eval);
0
+ return this.extractScripts().map(function(script) { return eval(script) });
0
   },
0
 
0
   escapeHTML: function() {
0
@@ -355,7 +355,7 @@
0
     var result;
0
     this.each(function(value, index) {
0
       value = (iterator || Prototype.K)(value, index);
0
- if (value >= (result || value))
0
+ if (result == undefined || value >= result)
0
         result = value;
0
     });
0
     return result;
0
@@ -365,7 +365,7 @@
0
     var result;
0
     this.each(function(value, index) {
0
       value = (iterator || Prototype.K)(value, index);
0
- if (value <= (result || value))
0
+ if (result == undefined || value < result)
0
         result = value;
0
     });
0
     return result;
0
@@ -447,7 +447,8 @@
0
 
0
 Object.extend(Array.prototype, Enumerable);
0
 
0
-Array.prototype._reverse = Array.prototype.reverse;
0
+if (!Array.prototype._reverse)
0
+ Array.prototype._reverse = Array.prototype.reverse;
0
 
0
 Object.extend(Array.prototype, {
0
   _each: function(iterator) {
0
@@ -476,7 +477,7 @@
0
 
0
   flatten: function() {
0
     return this.inject([], function(array, value) {
0
- return array.concat(valuevalue.constructor == Array ?
0
+ return array.concat(value && value.constructor == Array ?
0
         value.flatten() : [value]);
0
     });
0
   },
0
0
@@ -498,21 +499,13 @@
0
     return (inline !== false ? this : this.toArray())._reverse();
0
   },
0
 
0
- shift: function() {
0
- var result = this[0];
0
- for (var i = 0; i < this.length - 1; i++)
0
- this[i] = this[i + 1];
0
- this.length--;
0
- return result;
0
- },
0
-
0
   inspect: function() {
0
     return '[' + this.map(Object.inspect).join(', ') + ']';
0
   }
0
 });
0
 var Hash = {
0
   _each: function(iterator) {
0
- for (key in this) {
0
+ for (var key in this) {
0
       var value = this[key];
0
       if (typeof value == 'function') continue;
0
 
0
0
@@ -590,9 +583,9 @@
0
 var Ajax = {
0
   getTransport: function() {
0
     return Try.these(
0
+ function() {return new XMLHttpRequest()},
0
       function() {return new ActiveXObject('Msxml2.XMLHTTP')},
0
- function() {return new ActiveXObject('Microsoft.XMLHTTP')},
0
- function() {return new XMLHttpRequest()}
0
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
0
     ) || false;
0
   },
0
 
0
@@ -644,6 +637,7 @@
0
     this.options = {
0
       method: 'post',
0
       asynchronous: true,
0
+ contentType: 'application/x-www-form-urlencoded',
0
       parameters: ''
0
     }
0
     Object.extend(this.options, options || {});
0
@@ -707,8 +701,7 @@
0
        'Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];
0
 
0
     if (this.options.method == 'post') {
0
- requestHeaders.push('Content-type',
0
- 'application/x-www-form-urlencoded');
0
+ requestHeaders.push('Content-type', this.options.contentType);
0
 
0
       /* Force "Connection: close" for Mozilla browsers to work around
0
        * a bug where XMLHttpReqeuest sends an incorrect Content-length
0
@@ -739,7 +732,7 @@
0
 
0
   evalJSON: function() {
0
     try {
0
- return eval(this.header('X-JSON'));
0
+ return eval('(' + this.header('X-JSON') + ')');
0
     } catch (e) {}
0
   },
0
 
0
@@ -915,11 +908,11 @@
0
   return element;
0
 }
0
 
0
-Element.extend.cache = {
0
- findOrStore: function(value) {
0
- return this[value] = this[value] || function() {
0
- return value.apply(null, [this].concat($A(arguments)));
0
- }
0
+Element.extend.cache = {
0
+ findOrStore: function(value) {
0
+ return this[value] = this[value] || function() {
0
+ return value.apply(null, [this].concat($A(arguments)));
0
+ }
0
   }
0
 }
0
 
0
@@ -1044,7 +1037,7 @@
0
 
0
   setStyle: function(element, style) {
0
     element = $(element);
0
- for (name in style)
0
+ for (var name in style)
0
       element.style[name.camelize()] = style[name];
0
   },
0
 
0
0
0
@@ -1123,14 +1116,13 @@
0
 
0
 Element.addMethods = function(methods) {
0
   Object.extend(Element.Methods, methods || {});
0
-
0
+
0
   if(typeof HTMLElement != 'undefined') {
0
     var methods = Element.Methods, cache = Element.extend.cache;
0
     for (property in methods) {
0
       var value = methods[property];
0
- if (typeof value == 'function') {
0
+ if (typeof value == 'function')
0
         HTMLElement.prototype[property] = cache.findOrStore(value);
0
- }
0
     }
0
     _nativeExtensions = true;
0
   }
0
@@ -1156,7 +1148,8 @@
0
       try {
0
         this.element.insertAdjacentHTML(this.adjacency, this.content);
0
       } catch (e) {
0
- if (this.element.tagName.toLowerCase() == 'tbody') {
0
+ var tagName = this.element.tagName.toLowerCase();
0
+ if (tagName == 'tbody' || tagName == 'tr') {
0
           this.insertContent(this.contentFromAnonymousTable());
0
         } else {
0
           throw e;
0
@@ -1429,7 +1422,7 @@
0
     form = $(form);
0
     var elements = new Array();
0
 
0
- for (tagName in Form.Element.Serializers) {
0
+ for (var tagName in Form.Element.Serializers) {
0
       var tagElements = form.getElementsByTagName(tagName);
0
       for (var j = 0; j < tagElements.length; j++)
0
         elements.push(tagElements[j]);
0
0
0
@@ -1551,23 +1544,17 @@
0
     var value = '', opt, index = element.selectedIndex;
0
     if (index >= 0) {
0
       opt = element.options[index];
0
- value = opt.value;
0
- if (!value && !('value' in opt))
0
- value = opt.text;
0
+ value = opt.value || opt.text;
0
     }
0
     return [element.name, value];
0
   },
0
 
0
   selectMany: function(element) {
0
- var value = new Array();
0
+ var value = [];
0
     for (var i = 0; i < element.length; i++) {
0
       var opt = element.options[i];
0
- if (opt.selected) {
0
- var optValue = opt.value;
0
- if (!optValue && !('value' in opt))
0
- optValue = opt.text;
0
- value.push(optValue);
0
- }
0
+ if (opt.selected)
0
+ value.push(opt.value || opt.text);
0
     }
0
     return [element.name, value];
0
   }
0
@@ -1784,7 +1771,8 @@
0
 });
0
 
0
 /* prevent memory leaks in IE */
0
-Event.observe(window, 'unload', Event.unloadCache, false);
0
+if (navigator.appVersion.match(/\bMSIE\b/))
0
+ Event.observe(window, 'unload', Event.unloadCache, false);
0
 var Position = {
0
   // set to true if needed, warning: firefox performance problems
0
   // NOT neeeded for page scrolling, only if draggable contained in
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Update to Prototype 1.5.0_rc0 [Sam Stephenson]
0
+
0
 * Fixed that the -r/--ruby path option of the rails command was not being respected #4549 [ryan.raaum@gmail.com]
0
 
0
 * Added that Dispatcher exceptions should not be shown to the user unless a default log has not been configured. Instead show public/500.html [DHH]
...
1
 
2
3
4
...
7
8
9
10
 
11
12
13
...
25
26
27
28
 
29
30
31
...
176
177
178
179
 
180
181
182
...
355
356
357
358
 
359
360
361
...
365
366
367
368
 
369
370
371
...
447
448
449
450
 
 
451
452
453
...
476
477
478
479
 
480
481
482
483
...
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
 
516
517
518
519
...
590
591
592
 
593
594
595
 
596
597
598
...
644
645
646
 
647
648
649
...
707
708
709
710
711
 
712
713
714
...
739
740
741
742
 
743
744
745
...
915
916
917
918
919
920
921
922
 
 
 
 
 
923
924
925
...
1044
1045
1046
1047
 
1048
1049
1050
1051
1052
...
1123
1124
1125
1126
 
1127
1128
1129
1130
1131
 
1132
1133
1134
1135
1136
...
1156
1157
1158
1159
 
 
1160
1161
1162
...
1429
1430
1431
1432
 
1433
1434
1435
1436
1437
...
1551
1552
1553
1554
1555
1556
 
1557
1558
1559
1560
1561
1562
 
1563
1564
1565
1566
1567
1568
1569
1570
 
 
1571
1572
1573
...
1784
1785
1786
1787
 
 
1788
1789
1790
...
 
1
2
3
4
...
7
8
9
 
10
11
12
13
...
25
26
27
 
28
29
30
31
...
176
177
178
 
179
180
181
182
...
355
356
357
 
358
359
360
361
...
365
366
367
 
368
369
370
371
...
447
448
449
 
450
451
452
453
454
...
477
478
479
 
480
481
482
483
484
...
499
500
501
 
 
 
 
 
 
 
 
502
503
504
505
506
507
 
508
509
510
511
512
...
583
584
585
586
587
 
 
588
589
590
591
...
637
638
639
640
641
642
643
...
701
702
703
 
 
704
705
706
707
...
732
733
734
 
735
736
737
738
...
908
909
910
 
 
 
 
 
911
912
913
914
915
916
917
918
...
1037
1038
1039
 
1040
1041
1042
1043
1044
1045
...
1116
1117
1118
 
1119
1120
1121
1122
1123
 
1124
1125
 
1126
1127
1128
...
1148
1149
1150
 
1151
1152
1153
1154
1155
...
1422
1423
1424
 
1425
1426
1427
1428
1429
1430
...
1544
1545
1546
 
 
 
1547
1548
1549
1550
1551
1552
 
1553
1554
1555
 
 
 
 
 
 
1556
1557
1558
1559
1560
...
1771
1772
1773
 
1774
1775
1776
1777
1778
0
@@ -1,4 +1,4 @@
0
-/* Prototype JavaScript framework, version 1.5.0_pre1
0
+/* Prototype JavaScript framework, version 1.5.0_rc0
0
  * (c) 2005 Sam Stephenson <sam@conio.net>
0
  *
0
  * Prototype is freely distributable under the terms of an MIT-style license.
0
@@ -7,7 +7,7 @@
0
 /*--------------------------------------------------------------------------*/
0
 
0
 var Prototype = {
0
- Version: '1.5.0_pre1',
0
+ Version: '1.5.0_rc0',
0
   ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
0
 
0
   emptyFunction: function() {},
0
@@ -25,7 +25,7 @@
0
 var Abstract = new Object();
0
 
0
 Object.extend = function(destination, source) {
0
- for (property in source) {
0
+ for (var property in source) {
0
     destination[property] = source[property];
0
   }
0
   return destination;
0
@@ -176,7 +176,7 @@
0
   },
0
 
0
   evalScripts: function() {
0
- return this.extractScripts().map(eval);
0
+ return this.extractScripts().map(function(script) { return eval(script) });
0
   },
0
 
0
   escapeHTML: function() {
0
@@ -355,7 +355,7 @@
0
     var result;
0
     this.each(function(value, index) {
0
       value = (iterator || Prototype.K)(value, index);
0
- if (value >= (result || value))
0
+ if (result == undefined || value >= result)
0
         result = value;
0
     });
0
     return result;
0
@@ -365,7 +365,7 @@
0
     var result;
0
     this.each(function(value, index) {
0
       value = (iterator || Prototype.K)(value, index);
0
- if (value <= (result || value))
0
+ if (result == undefined || value < result)
0
         result = value;
0
     });
0
     return result;
0
@@ -447,7 +447,8 @@
0
 
0
 Object.extend(Array.prototype, Enumerable);
0
 
0
-Array.prototype._reverse = Array.prototype.reverse;
0
+if (!Array.prototype._reverse)
0
+ Array.prototype._reverse = Array.prototype.reverse;
0
 
0
 Object.extend(Array.prototype, {
0
   _each: function(iterator) {
0
@@ -476,7 +477,7 @@
0
 
0
   flatten: function() {
0
     return this.inject([], function(array, value) {
0
- return array.concat(valuevalue.constructor == Array ?
0
+ return array.concat(value && value.constructor == Array ?
0
         value.flatten() : [value]);
0
     });
0
   },
0
0
@@ -498,21 +499,13 @@
0
     return (inline !== false ? this : this.toArray())._reverse();
0
   },
0
 
0
- shift: function() {
0
- var result = this[0];
0
- for (var i = 0; i < this.length - 1; i++)
0
- this[i] = this[i + 1];
0
- this.length--;
0
- return result;
0
- },
0
-
0
   inspect: function() {
0
     return '[' + this.map(Object.inspect).join(', ') + ']';
0
   }
0
 });
0
 var Hash = {
0
   _each: function(iterator) {
0
- for (key in this) {
0
+ for (var key in this) {
0
       var value = this[key];
0
       if (typeof value == 'function') continue;
0
 
0
0
@@ -590,9 +583,9 @@
0
 var Ajax = {
0
   getTransport: function() {
0
     return Try.these(
0
+ function() {return new XMLHttpRequest()},
0
       function() {return new ActiveXObject('Msxml2.XMLHTTP')},
0
- function() {return new ActiveXObject('Microsoft.XMLHTTP')},
0
- function() {return new XMLHttpRequest()}
0
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
0
     ) || false;
0
   },
0
 
0
@@ -644,6 +637,7 @@
0
     this.options = {
0
       method: 'post',
0
       asynchronous: true,
0
+ contentType: 'application/x-www-form-urlencoded',
0
       parameters: ''
0
     }
0
     Object.extend(this.options, options || {});
0
@@ -707,8 +701,7 @@
0
        'Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];
0
 
0
     if (this.options.method == 'post') {
0
- requestHeaders.push('Content-type',
0
- 'application/x-www-form-urlencoded');
0
+ requestHeaders.push('Content-type', this.options.contentType);
0
 
0
       /* Force "Connection: close" for Mozilla browsers to work around
0
        * a bug where XMLHttpReqeuest sends an incorrect Content-length
0
@@ -739,7 +732,7 @@
0
 
0
   evalJSON: function() {
0
     try {
0
- return eval(this.header('X-JSON'));
0
+ return eval('(' + this.header('X-JSON') + ')');
0
     } catch (e) {}
0
   },
0
 
0
@@ -915,11 +908,11 @@
0
   return element;
0
 }
0
 
0
-Element.extend.cache = {
0
- findOrStore: function(value) {
0
- return this[value] = this[value] || function() {
0
- return value.apply(null, [this].concat($A(arguments)));
0
- }
0
+Element.extend.cache = {
0
+ findOrStore: function(value) {
0
+ return this[value] = this[value] || function() {
0
+ return value.apply(null, [this].concat($A(arguments)));
0
+ }
0
   }
0
 }
0
 
0
@@ -1044,7 +1037,7 @@
0
 
0
   setStyle: function(element, style) {
0
     element = $(element);
0
- for (name in style)
0
+ for (var name in style)
0
       element.style[name.camelize()] = style[name];
0
   },
0
 
0
0
0
@@ -1123,14 +1116,13 @@
0
 
0
 Element.addMethods = function(methods) {
0
   Object.extend(Element.Methods, methods || {});
0
-
0
+
0
   if(typeof HTMLElement != 'undefined') {
0
     var methods = Element.Methods, cache = Element.extend.cache;
0
     for (property in methods) {
0
       var value = methods[property];
0
- if (typeof value == 'function') {
0
+ if (typeof value == 'function')
0
         HTMLElement.prototype[property] = cache.findOrStore(value);
0
- }
0
     }
0
     _nativeExtensions = true;
0
   }
0
@@ -1156,7 +1148,8 @@
0
       try {
0
         this.element.insertAdjacentHTML(this.adjacency, this.content);
0
       } catch (e) {
0
- if (this.element.tagName.toLowerCase() == 'tbody') {
0
+ var tagName = this.element.tagName.toLowerCase();
0
+ if (tagName == 'tbody' || tagName == 'tr') {
0
           this.insertContent(this.contentFromAnonymousTable());
0
         } else {
0
           throw e;
0
@@ -1429,7 +1422,7 @@
0
     form = $(form);
0
     var elements = new Array();
0
 
0
- for (tagName in Form.Element.Serializers) {
0
+ for (var tagName in Form.Element.Serializers) {
0
       var tagElements = form.getElementsByTagName(tagName);
0
       for (var j = 0; j < tagElements.length; j++)
0
         elements.push(tagElements[j]);
0
0
0
@@ -1551,23 +1544,17 @@
0
     var value = '', opt, index = element.selectedIndex;
0
     if (index >= 0) {
0
       opt = element.options[index];
0
- value = opt.value;
0
- if (!value && !('value' in opt))
0
- value = opt.text;
0
+ value = opt.value || opt.text;
0
     }
0
     return [element.name, value];
0
   },
0
 
0
   selectMany: function(element) {
0
- var value = new Array();
0
+ var value = [];
0
     for (var i = 0; i < element.length; i++) {
0
       var opt = element.options[i];
0
- if (opt.selected) {
0
- var optValue = opt.value;
0
- if (!optValue && !('value' in opt))
0
- optValue = opt.text;
0
- value.push(optValue);
0
- }
0
+ if (opt.selected)
0
+ value.push(opt.value || opt.text);
0
     }
0
     return [element.name, value];
0
   }
0
@@ -1784,7 +1771,8 @@
0
 });
0
 
0
 /* prevent memory leaks in IE */
0
-Event.observe(window, 'unload', Event.unloadCache, false);
0
+if (navigator.appVersion.match(/\bMSIE\b/))
0
+ Event.observe(window, 'unload', Event.unloadCache, false);
0
 var Position = {
0
   // set to true if needed, warning: firefox performance problems
0
   // NOT neeeded for page scrolling, only if draggable contained in

Comments

    No one has commented yet.