Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump to Prototype 1.4.0_rc2

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2755 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit f15819e8f0cece48ccd5117a37cf6d37374d1bb1 1 parent d6461bf
Sam Stephenson sstephenson authored
16 actionpack/lib/action_view/helpers/javascripts/prototype.js
View
@@ -1,4 +1,4 @@
-/* Prototype JavaScript framework, version 1.4.0_rc1
+/* Prototype JavaScript framework, version 1.4.0_rc2
* (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_rc1',
+ Version: '1.4.0_rc2',
emptyFunction: function() {},
K: function(x) {return x}
@@ -787,7 +787,7 @@ Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
document.getElementsByClassName = function(className, parentElement) {
var children = ($(parentElement) || document.body).getElementsByTagName('*');
return $A(children).inject([], function(elements, child) {
- if (Element.hasClassName(child, className))
+ if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
elements.push(child);
return elements;
});
@@ -1131,7 +1131,7 @@ var Form = {
},
getElements: function(form) {
- var form = $(form);
+ form = $(form);
var elements = new Array();
for (tagName in Form.Element.Serializers) {
@@ -1143,7 +1143,7 @@ var Form = {
},
getInputs: function(form, typeName, name) {
- var form = $(form);
+ form = $(form);
var inputs = form.getElementsByTagName('input');
if (!typeName && !name)
@@ -1179,7 +1179,7 @@ var Form = {
},
focusFirstElement: function(form) {
- var form = $(form);
+ form = $(form);
var elements = Form.getElements(form);
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
@@ -1197,7 +1197,7 @@ var Form = {
Form.Element = {
serialize: function(element) {
- var element = $(element);
+ element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
@@ -1207,7 +1207,7 @@ Form.Element = {
},
getValue: function(element) {
- var element = $(element);
+ element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
24 railties/html/javascripts/prototype.js
View
@@ -1,4 +1,4 @@
-/* Prototype JavaScript framework, version 1.4.0_rc0
+/* Prototype JavaScript framework, version 1.4.0_rc2
* (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_rc0',
+ Version: '1.4.0_rc2',
emptyFunction: function() {},
K: function(x) {return x}
@@ -607,8 +607,8 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
try {
this.url = url;
- if (this.options.method == 'get')
- this.url += '?' + parameters;
+ if (this.options.method == 'get' && parameters.length > 0)
+ this.url += (this.url.match(/\?/) ? '&' : '?') + parameters;
Ajax.Responders.dispatch('onCreate', this, this.transport);
@@ -626,6 +626,8 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
this.transport.send(this.options.method == 'post' ? body : null);
} catch (e) {
+ (this.options.onException || Prototype.emptyFunction)(this, e);
+ Ajax.Responders.dispatch('onException', this, e);
}
},
@@ -783,9 +785,9 @@ Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
}
});
document.getElementsByClassName = function(className, parentElement) {
- var children = (document.body || $(parentElement)).getElementsByTagName('*');
+ var children = ($(parentElement) || document.body).getElementsByTagName('*');
return $A(children).inject([], function(elements, child) {
- if (Element.hasClassName(child, className))
+ if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
elements.push(child);
return elements;
});
@@ -1129,7 +1131,7 @@ var Form = {
},
getElements: function(form) {
- var form = $(form);
+ form = $(form);
var elements = new Array();
for (tagName in Form.Element.Serializers) {
@@ -1141,7 +1143,7 @@ var Form = {
},
getInputs: function(form, typeName, name) {
- var form = $(form);
+ form = $(form);
var inputs = form.getElementsByTagName('input');
if (!typeName && !name)
@@ -1177,7 +1179,7 @@ var Form = {
},
focusFirstElement: function(form) {
- var form = $(form);
+ form = $(form);
var elements = Form.getElements(form);
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
@@ -1195,7 +1197,7 @@ var Form = {
Form.Element = {
serialize: function(element) {
- var element = $(element);
+ element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
@@ -1205,7 +1207,7 @@ Form.Element = {
},
getValue: function(element) {
- var element = $(element);
+ element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
Please sign in to comment.
Something went wrong with that request. Please try again.