From b767e82ec7bb04e747961e7ecee0e288fde719f0 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 16 Sep 2006 05:21:24 +0000 Subject: update ajax js files. --- framework/Web/Javascripts/js/compressed/ajax.js | 10 ++++++---- framework/Web/Javascripts/js/debug/ajax.js | 12 +++++++----- framework/Web/Javascripts/prado/ajax3.js | 8 +++++--- framework/Web/Javascripts/prado/inlineeditor.js | 4 ++-- 4 files changed, 20 insertions(+), 14 deletions(-) (limited to 'framework/Web/Javascripts') diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js index 7e9cf3ec..32893e07 100644 --- a/framework/Web/Javascripts/js/compressed/ajax.js +++ b/framework/Web/Javascripts/js/compressed/ajax.js @@ -47,8 +47,10 @@ catch(e) Prado.CallbackRequest.Exception.onException(null,e);}}},Exception:{"on500":function(request,transport,data) {var e=request.getHeaderData(Prado.CallbackRequest.ERROR_HEADER);Logger.error("Callback Server Error "+e.code,this.formatException(e));},'on200':function(request,transport,data) {if(transport.status<500) -{var msg='HTTP '+transport.status+" with response : \n";msg+=transport.responseText+"\n";msg+="Data : \n"+inspect(data)+"\n";msg+="Actions : \n";data=request.getHeaderData(Prado.CallbackRequest.ACTION_HEADER);if(data&&data.length>0) -{data.each(function(action) +{var msg='HTTP '+transport.status+" with response : \n";if(transport.responseText.trim().length>0) +msg+=transport.responseText+"\n";if(typeof(data)!="undefined"&&data!=null) +msg+="Data : \n"+inspect(data)+"\n";data=request.getHeaderData(Prado.CallbackRequest.ACTION_HEADER);if(data&&data.length>0) +{msg+="Actions : \n";data.each(function(action) {msg+=inspect(action)+"\n";});} Logger.info(msg);}},onException:function(request,e) {msg="";$H(e).each(function(item) @@ -266,7 +268,7 @@ Event.stop(evt);return false;},showTextBox:function() {Element.show(this.element);Element.hide(this.editField);},createEditorInput:function() {if(this.editField==null) this.createTextBox();this.editField.value=this.getText();},loadExternalText:function() -{this.editField.disabled=true;this.onLoadingText();options=new Array('__InlineEditor_loadExternalText__',this.getText());request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.setCausesValidation(false);request.setParameter(options);request.options.onSuccess=this.onloadExternalTextSuccess.bind(this);request.options.onFailure=this.onloadExternalTextFailure.bind(this);request.dispatch();},createTextBox:function() +{this.editField.disabled=true;this.onLoadingText();options=new Array('__InlineEditor_loadExternalText__',this.getText());request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.setCausesValidation(false);request.setCallbackParameter(options);request.options.onSuccess=this.onloadExternalTextSuccess.bind(this);request.options.onFailure=this.onloadExternalTextFailure.bind(this);request.dispatch();},createTextBox:function() {cssClass=this.element.className||'';inputName=this.options.EventTarget;options={'className':cssClass,name:inputName,id:this.options.TextBoxID};if(this.options.TextMode=='SingleLine') {if(this.options.MaxLength>0) options['maxlength']=this.options.MaxLength;this.editField=INPUT(options);} @@ -289,7 +291,7 @@ this.options.onEnterEditMode(this,null);},onTextBoxBlur:function(e) this.onTextChanged(text);else {this.element.innerHTML=this.editField.value;this.isEditing=false;if(this.options.AutoHide) this.showLabel();}},onTextChanged:function(text) -{request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.setParameter(text);request.options.onSuccess=this.onTextChangedSuccess.bind(this);request.options.onFailure=this.onTextChangedFailure.bind(this);if(request.dispatch()) +{request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.setCallbackParameter(text);request.options.onSuccess=this.onTextChangedSuccess.bind(this);request.options.onFailure=this.onTextChangedFailure.bind(this);if(request.dispatch()) {this.isSaving=true;this.editField.disabled=true;}},onLoadingText:function() {},onloadExternalTextSuccess:function(request,parameter) {this.isEditing=true;this.editField.disabled=false;this.editField.value=this.getText();Prado.Element.focus(this.editField);},onloadExternalTextFailure:function(request,parameter) diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js index 5c1fbdcc..76c7e52a 100644 --- a/framework/Web/Javascripts/js/debug/ajax.js +++ b/framework/Web/Javascripts/js/debug/ajax.js @@ -468,12 +468,14 @@ Object.extend(Prado.CallbackRequest, if(transport.status < 500) { var msg = 'HTTP '+transport.status+" with response : \n"; - msg += transport.responseText + "\n"; - msg += "Data : \n"+inspect(data)+"\n"; - msg += "Actions : \n"; + if(transport.responseText.trim().length >0) + msg += transport.responseText + "\n"; + if(typeof(data)!="undefined" && data != null) + msg += "Data : \n"+inspect(data)+"\n"; data = request.getHeaderData(Prado.CallbackRequest.ACTION_HEADER); if(data && data.length > 0) { + msg += "Actions : \n"; data.each(function(action) { msg += inspect(action)+"\n"; @@ -2427,7 +2429,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( options = new Array('__InlineEditor_loadExternalText__', this.getText()); request = new Prado.CallbackRequest(this.options.EventTarget, this.options); request.setCausesValidation(false); - request.setParameter(options); + request.setCallbackParameter(options); request.options.onSuccess = this.onloadExternalTextSuccess.bind(this); request.options.onFailure = this.onloadExternalTextFailure.bind(this); request.dispatch(); @@ -2519,7 +2521,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( onTextChanged : function(text) { request = new Prado.CallbackRequest(this.options.EventTarget, this.options); - request.setParameter(text); + request.setCallbackParameter(text); request.options.onSuccess = this.onTextChangedSuccess.bind(this); request.options.onFailure = this.onTextChangedFailure.bind(this); if(request.dispatch()) diff --git a/framework/Web/Javascripts/prado/ajax3.js b/framework/Web/Javascripts/prado/ajax3.js index 5374387d..3b6a1d31 100644 --- a/framework/Web/Javascripts/prado/ajax3.js +++ b/framework/Web/Javascripts/prado/ajax3.js @@ -180,12 +180,14 @@ Object.extend(Prado.CallbackRequest, if(transport.status < 500) { var msg = 'HTTP '+transport.status+" with response : \n"; - msg += transport.responseText + "\n"; - msg += "Data : \n"+inspect(data)+"\n"; - msg += "Actions : \n"; + if(transport.responseText.trim().length >0) + msg += transport.responseText + "\n"; + if(typeof(data)!="undefined" && data != null) + msg += "Data : \n"+inspect(data)+"\n"; data = request.getHeaderData(Prado.CallbackRequest.ACTION_HEADER); if(data && data.length > 0) { + msg += "Actions : \n"; data.each(function(action) { msg += inspect(action)+"\n"; diff --git a/framework/Web/Javascripts/prado/inlineeditor.js b/framework/Web/Javascripts/prado/inlineeditor.js index 24cc9b70..14f4b73c 100644 --- a/framework/Web/Javascripts/prado/inlineeditor.js +++ b/framework/Web/Javascripts/prado/inlineeditor.js @@ -79,7 +79,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( options = new Array('__InlineEditor_loadExternalText__', this.getText()); request = new Prado.CallbackRequest(this.options.EventTarget, this.options); request.setCausesValidation(false); - request.setParameter(options); + request.setCallbackParameter(options); request.options.onSuccess = this.onloadExternalTextSuccess.bind(this); request.options.onFailure = this.onloadExternalTextFailure.bind(this); request.dispatch(); @@ -171,7 +171,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( onTextChanged : function(text) { request = new Prado.CallbackRequest(this.options.EventTarget, this.options); - request.setParameter(text); + request.setCallbackParameter(text); request.options.onSuccess = this.onTextChangedSuccess.bind(this); request.options.onFailure = this.onTextChangedFailure.bind(this); if(request.dispatch()) -- cgit v1.2.3