mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Update to Prototype 1.4.0_rc4. Closes #2943 (old Array.prototype.reverse behavior can be obtained by passing false as an argument)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Update to Prototype 1.4.0_rc4. Closes #2943 (old Array.prototype.reverse behavior can be obtained by passing false as an argument). [Sam Stephenson]
|
||||
|
||||
* Use Element.update('id', 'html') instead of $('id').innerHTML = 'html' in JavaScriptGenerator#replace_html so that script tags are evaluated. [Sam Stephenson]
|
||||
|
||||
* Make rjs templates always implicitly skip out on layouts. [Marcel Molina Jr.]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Prototype JavaScript framework, version 1.4.0_rc3
|
||||
/* Prototype JavaScript framework, version 1.4.0_rc4
|
||||
* (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
*
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
|
||||
@@ -11,7 +11,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var Prototype = {
|
||||
Version: '1.4.0_rc3',
|
||||
Version: '1.4.0_rc4',
|
||||
ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
|
||||
|
||||
emptyFunction: function() {},
|
||||
@@ -405,12 +405,19 @@ var $A = Array.from = function(iterable) {
|
||||
|
||||
Object.extend(Array.prototype, Enumerable);
|
||||
|
||||
Array.prototype._reverse = Array.prototype.reverse;
|
||||
|
||||
Object.extend(Array.prototype, {
|
||||
_each: function(iterator) {
|
||||
for (var i = 0; i < this.length; i++)
|
||||
iterator(this[i]);
|
||||
},
|
||||
|
||||
clear: function() {
|
||||
this.length = 0;
|
||||
return this;
|
||||
},
|
||||
|
||||
first: function() {
|
||||
return this[0];
|
||||
},
|
||||
@@ -445,11 +452,8 @@ Object.extend(Array.prototype, {
|
||||
return -1;
|
||||
},
|
||||
|
||||
reverse: function() {
|
||||
var result = [];
|
||||
for (var i = this.length; i > 0; i--)
|
||||
result.push(this[i-1]);
|
||||
return result;
|
||||
reverse: function(inline) {
|
||||
return (inline !== false ? this : this.toArray())._reverse();
|
||||
},
|
||||
|
||||
inspect: function() {
|
||||
@@ -709,7 +713,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
|
||||
if (this.header('Content-type') == 'text/javascript')
|
||||
if ((this.header('Content-type') || '').match(/^text\/javascript/i))
|
||||
this.evalResponse();
|
||||
}
|
||||
|
||||
@@ -932,6 +936,12 @@ Object.extend(Element, {
|
||||
return value == 'auto' ? null : value;
|
||||
},
|
||||
|
||||
setStyle: function(element, style) {
|
||||
element = $(element);
|
||||
for (name in style)
|
||||
element.style[name.camelize()] = style[name];
|
||||
},
|
||||
|
||||
getDimensions: function(element) {
|
||||
element = $(element);
|
||||
if (Element.getStyle(element, 'display') != 'none')
|
||||
@@ -1059,7 +1069,7 @@ Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
|
||||
},
|
||||
|
||||
insertContent: function(fragments) {
|
||||
fragments.reverse().each((function(fragment) {
|
||||
fragments.reverse(false).each((function(fragment) {
|
||||
this.element.insertBefore(fragment, this.element.firstChild);
|
||||
}).bind(this));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Update to Prototype 1.4.0_rc4. Closes #2943 (old Array.prototype.reverse behavior can be obtained by passing false as an argument). [Sam Stephenson]
|
||||
|
||||
* script/console uses RAILS_ENV environment variable if present. #2932 [Blair Zajac <blair@orcaware.com>
|
||||
|
||||
* Windows: eliminate the socket option in database.yml. #2924 [Wayne Vucenic <waynev@gmail.com>]
|
||||
|
||||
28
railties/html/javascripts/prototype.js
vendored
28
railties/html/javascripts/prototype.js
vendored
@@ -1,4 +1,4 @@
|
||||
/* Prototype JavaScript framework, version 1.4.0_rc3
|
||||
/* Prototype JavaScript framework, version 1.4.0_rc4
|
||||
* (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
*
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
|
||||
@@ -11,7 +11,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var Prototype = {
|
||||
Version: '1.4.0_rc3',
|
||||
Version: '1.4.0_rc4',
|
||||
ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
|
||||
|
||||
emptyFunction: function() {},
|
||||
@@ -405,12 +405,19 @@ var $A = Array.from = function(iterable) {
|
||||
|
||||
Object.extend(Array.prototype, Enumerable);
|
||||
|
||||
Array.prototype._reverse = Array.prototype.reverse;
|
||||
|
||||
Object.extend(Array.prototype, {
|
||||
_each: function(iterator) {
|
||||
for (var i = 0; i < this.length; i++)
|
||||
iterator(this[i]);
|
||||
},
|
||||
|
||||
clear: function() {
|
||||
this.length = 0;
|
||||
return this;
|
||||
},
|
||||
|
||||
first: function() {
|
||||
return this[0];
|
||||
},
|
||||
@@ -445,11 +452,8 @@ Object.extend(Array.prototype, {
|
||||
return -1;
|
||||
},
|
||||
|
||||
reverse: function() {
|
||||
var result = [];
|
||||
for (var i = this.length; i > 0; i--)
|
||||
result.push(this[i-1]);
|
||||
return result;
|
||||
reverse: function(inline) {
|
||||
return (inline !== false ? this : this.toArray())._reverse();
|
||||
},
|
||||
|
||||
inspect: function() {
|
||||
@@ -709,7 +713,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
|
||||
if (this.header('Content-type') == 'text/javascript')
|
||||
if ((this.header('Content-type') || '').match(/^text\/javascript/i))
|
||||
this.evalResponse();
|
||||
}
|
||||
|
||||
@@ -932,6 +936,12 @@ Object.extend(Element, {
|
||||
return value == 'auto' ? null : value;
|
||||
},
|
||||
|
||||
setStyle: function(element, style) {
|
||||
element = $(element);
|
||||
for (name in style)
|
||||
element.style[name.camelize()] = style[name];
|
||||
},
|
||||
|
||||
getDimensions: function(element) {
|
||||
element = $(element);
|
||||
if (Element.getStyle(element, 'display') != 'none')
|
||||
@@ -1059,7 +1069,7 @@ Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
|
||||
},
|
||||
|
||||
insertContent: function(fragments) {
|
||||
fragments.reverse().each((function(fragment) {
|
||||
fragments.reverse(false).each((function(fragment) {
|
||||
this.element.insertBefore(fragment, this.element.firstChild);
|
||||
}).bind(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user