diff options
author | Sam Stephenson <sam@37signals.com> | 2005-11-19 06:59:07 +0000 |
---|---|---|
committer | Sam Stephenson <sam@37signals.com> | 2005-11-19 06:59:07 +0000 |
commit | d777e506f27debdb5c66cc6653e2f3dc1b634d88 (patch) | |
tree | e4facae43486162353fde6f3fbf89af5a3e3c56d /actionpack/lib/action_view/helpers/javascripts | |
parent | b51c3399eb0cbf07e64bd7a33d176eae3010d5c0 (diff) | |
download | rails-d777e506f27debdb5c66cc6653e2f3dc1b634d88.tar.gz rails-d777e506f27debdb5c66cc6653e2f3dc1b634d88.tar.bz2 rails-d777e506f27debdb5c66cc6653e2f3dc1b634d88.zip |
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
Diffstat (limited to 'actionpack/lib/action_view/helpers/javascripts')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascripts/prototype.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/prototype.js b/actionpack/lib/action_view/helpers/javascripts/prototype.js index 211814fdce..2cca7502f7 100644 --- a/actionpack/lib/action_view/helpers/javascripts/prototype.js +++ b/actionpack/lib/action_view/helpers/javascripts/prototype.js @@ -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)); } |