From 758804eacf0a9956ddd392b3e2db4f141f1b0630 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:16:21 +0000 Subject: [PATCH] API CHANGE Removed ajaxErrorHandler() javascript method from LeftAndMain.js, and changed two known references to custom code git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92736 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/AssetAdmin.js | 2 +- javascript/CommentTableField.js | 2 +- javascript/LeftAndMain.js | 13 +++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index 6ba4862b..8f08f02f 100755 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -419,7 +419,7 @@ Behaviour.register({ new Ajax.Request(this.href + (this.href.indexOf("?") == -1 ? "?" : "&") + "ajax=1", { method : 'get', onSuccess : Ajax.Evaluator, - onFailure : ajaxErrorHandler + onFailure : function(response) {errorMessage('Server Error', response);} }); Event.stop(event); return false; diff --git a/javascript/CommentTableField.js b/javascript/CommentTableField.js index f7f838c8..6ba82aac 100644 --- a/javascript/CommentTableField.js +++ b/javascript/CommentTableField.js @@ -49,7 +49,7 @@ CommentTableField.prototype = { onComplete: function(){ Effect.Fade(row); }.bind(this), - onFailure: ajaxErrorHandler + onFailure: function(response) {errorMessage('Server Error', response);} } ); Event.stop(e); diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index fa0cae6e..6deadd1b 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -389,18 +389,15 @@ var ss_MainLayout; // Backwards compatibility var statusMessage = function(text, type) { jQuery.noticeAdd({text: text, type: type}); -} +}; + var errorMessage = function(text) { jQuery.noticeAdd({text: text, type: 'error'}); -} - -function ajaxErrorHandler(response) { - errorMessage('Server Error', response); -} +}; returnFalse = function() { return false; -} +}; /** * Find and enable TinyMCE on all htmleditor fields @@ -409,4 +406,4 @@ returnFalse = function() { function nullConverter(url) { return url; -} \ No newline at end of file +}; \ No newline at end of file