0
@@ -7,7 +7,7 @@ if (Prototype.Version.indexOf(LowPro.CompatibleWithPrototype) != 0 && window.con
0
" it may not work as expected with this version (" + Prototype.Version + ")");
0
if (!Element.addMethods)
0
- Element.addMethods = function(o) { Object.extend(Element.Methods, o)
};
0
+ Element.addMethods = function(o) { Object.extend(Element.Methods, o)
; };
0
// Simple utility methods for working with the DOM
0
@@ -24,7 +24,7 @@ DOM.Builder = {
0
- children = $A(children).flatten()
0
+ children = $A(children).flatten()
;0
return DOM.Builder.create(tag, attrs, children);
0
@@ -97,7 +97,7 @@ Event.addBehavior = function(rules) {
0
Ajax.Responders.register({
0
onComplete : function() {
0
if (Event.addBehavior.reassignAfterAjax)
0
- setTimeout(function() { ab.reload()
}, 10);
0
+ setTimeout(function() { ab.reload()
; }, 10);
0
ab.responderApplied = true;
0
@@ -114,8 +114,8 @@ Event.delegate = function(rules) {
0
var element = $(e.element());
0
for (var selector in rules)
0
if (element.match(selector)) return rules[selector].apply(this, $A(arguments));
0
Object.extend(Event.addBehavior, {
0
rules : {}, cache : [],
0
@@ -163,7 +163,7 @@ Object.extend(Event.addBehavior, {
0
_wrapObserver: function(observer) {
0
return function(event) {
0
if (observer.call(this, event) === false) event.stop();
0
@@ -278,9 +278,17 @@ Remote.Base = {
0
_makeRequest : function(options) {
0
- if (options.update) new Ajax.Updater(options.update, options.url, options);
0
- else new Ajax.Request(options.url, options);
0
+ if (options.confirm) {
0
+ if (confirm(options.confirm)) {
0
+ if (options.update) new Ajax.Updater(options.update, options.url, options);
0
+ else new Ajax.Request(options.url, options);
0
+ if (options.update) new Ajax.Updater(options.update, options.url, options);
0
+ else new Ajax.Request(options.url, options);
0
_bindCallbacks: function() {
0
$w('onCreate onComplete onException onFailure onInteractive onLoading onLoaded onSuccess').each(function(cb) {
0
@@ -288,7 +296,7 @@ Remote.Base = {
0
this.options[cb] = this.options[cb].bind(this);
0
Remote.Link = Behavior.create(Remote.Base, {
0
@@ -307,10 +315,25 @@ Remote.Form = Behavior.create(Remote.Base, {
0
this._submitButton = sourceElement;
0
onsubmit : function() {
0
+ var parameters = this.element.serialize();
0
+ if (parameters.blank()) {
0
+ parameters = this.options.parameters;
0
+ parameters = parameters + '&' + this.options.parameters;
0
+ delete this.options.parameters;
0
+ if (this._submitButton) {
0
+ if (parameters.blank()) {
0
+ parameters = this._submitButton.name + "=" + this._submitButton.value;
0
+ parameters = parameters + '&' + this._submitButton.name + "=" + this._submitButton.value;
0
var options = Object.extend({
0
url : this.element.action,
0
method : this.element.method || 'get',
0
- parameters :
this.element.serialize({ submit: this._submitButton.name })0
+ parameters :
parameters0
this._submitButton = null;
0
return this._makeRequest(options);
Comments
No one has commented yet.