aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/javascripts')
-rw-r--r--actionpack/lib/action_view/helpers/javascripts/prototype.js28
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));
}