aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/javascripts/prototype.js16
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/html/javascripts/prototype.js16
4 files changed, 26 insertions, 10 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 5c88d89b49..d2ad3ad159 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Update to latest Prototype, which doesn't serialize disabled form elements, adds clone() to arrays, empty/non-string Element.update() and adds a fixes excessive error reporting in WebKit beta versions [Thomas Fuchs]
+
* Deprecate start_form_tag and end_form_tag. Use form_tag / '</form>' from now on. [Rick]
* Added block-usage to PrototypeHelper#form_remote_tag, document block-usage of FormTagHelper#form_tag [Rick]
diff --git a/actionpack/lib/action_view/helpers/javascripts/prototype.js b/actionpack/lib/action_view/helpers/javascripts/prototype.js
index 831eb184d0..8ceb046995 100644
--- a/actionpack/lib/action_view/helpers/javascripts/prototype.js
+++ b/actionpack/lib/action_view/helpers/javascripts/prototype.js
@@ -560,6 +560,10 @@ Object.extend(Array.prototype, {
});
},
+ clone: function() {
+ return [].concat(this);
+ },
+
inspect: function() {
return '[' + this.map(Object.inspect).join(', ') + ']';
}
@@ -1040,6 +1044,7 @@ Element.Methods = {
},
update: function(element, html) {
+ html = typeof html == 'undefined' ? '' : html.toString();
$(element).innerHTML = html.stripScripts();
setTimeout(function() {html.evalScripts()}, 10);
return element;
@@ -1299,6 +1304,7 @@ Element.Methods = {
if(document.all){
Element.Methods.update = function(element, html) {
element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
var tagName = element.tagName.toUpperCase();
if (['THEAD','TBODY','TR','TD'].indexOf(tagName) > -1) {
var div = document.createElement('div');
@@ -1335,14 +1341,13 @@ Object.extend(Element, Element.Methods);
var _nativeExtensions = false;
-if (!window.HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
- /* Emulate HTMLElement, HTMLFormElement, HTMLInputElement, HTMLTextAreaElement,
- and HTMLSelectElement in Safari */
+if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) {
- var klass = window['HTML' + tag + 'Element'] = {};
+ var className = 'HTML' + tag + 'Element';
+ if(window[className]) return;
+ var klass = window[className] = {};
klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__;
});
-}
Element.addMethods = function(methods) {
Object.extend(Element.Methods, methods || {});
@@ -1732,6 +1737,7 @@ Form.Element = {
Form.Element.Methods = {
serialize: function(element) {
element = $(element);
+ if (element.disabled) return '';
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 6e029db550..a59177aa4d 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Update to latest Prototype, which doesn't serialize disabled form elements, adds clone() to arrays, empty/non-string Element.update() and adds a fixes excessive error reporting in WebKit beta versions [Thomas Fuchs]
+
* Clean up the output of rake stats, de-emphasise components and apis, and remove the indents for tests [Koz]
* Added option to script/process/spawner of specifying the binding address #5133 [zsombor]
diff --git a/railties/html/javascripts/prototype.js b/railties/html/javascripts/prototype.js
index 831eb184d0..8ceb046995 100644
--- a/railties/html/javascripts/prototype.js
+++ b/railties/html/javascripts/prototype.js
@@ -560,6 +560,10 @@ Object.extend(Array.prototype, {
});
},
+ clone: function() {
+ return [].concat(this);
+ },
+
inspect: function() {
return '[' + this.map(Object.inspect).join(', ') + ']';
}
@@ -1040,6 +1044,7 @@ Element.Methods = {
},
update: function(element, html) {
+ html = typeof html == 'undefined' ? '' : html.toString();
$(element).innerHTML = html.stripScripts();
setTimeout(function() {html.evalScripts()}, 10);
return element;
@@ -1299,6 +1304,7 @@ Element.Methods = {
if(document.all){
Element.Methods.update = function(element, html) {
element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
var tagName = element.tagName.toUpperCase();
if (['THEAD','TBODY','TR','TD'].indexOf(tagName) > -1) {
var div = document.createElement('div');
@@ -1335,14 +1341,13 @@ Object.extend(Element, Element.Methods);
var _nativeExtensions = false;
-if (!window.HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
- /* Emulate HTMLElement, HTMLFormElement, HTMLInputElement, HTMLTextAreaElement,
- and HTMLSelectElement in Safari */
+if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) {
- var klass = window['HTML' + tag + 'Element'] = {};
+ var className = 'HTML' + tag + 'Element';
+ if(window[className]) return;
+ var klass = window[className] = {};
klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__;
});
-}
Element.addMethods = function(methods) {
Object.extend(Element.Methods, methods || {});
@@ -1732,6 +1737,7 @@ Form.Element = {
Form.Element.Methods = {
serialize: function(element) {
element = $(element);
+ if (element.disabled) return '';
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);