From 7fd337f5f836001fdda433622cacaa8954c264a2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 02:35:48 +0000 Subject: [PATCH] API CHANGE Removed ajaxLoadPage(), ajaxLoadPage_success(), ajaxLink() javascript methods - were never used in core MINOR Moved ajaxSubmitFieldSet() javascript from LeftAndMain.js to MemberTableField.js (only place where its actually used) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92594 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain.js | 53 ---------------------------------- javascript/MemberTableField.js | 26 +++++++++++++++++ 2 files changed, 26 insertions(+), 53 deletions(-) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index f624598a..791e1fef 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -145,59 +145,6 @@ function ajaxSubmitForm(automated, callAfter, form, action, verb) { return false; }; -/** - * Post the given fields to the given url - */ -function ajaxSubmitFieldSet(href, fieldSet, extraData) { - // Build data - var i,field,data = "ajax=1"; - for(i=0;field=fieldSet[i];i++) { - data += '&' + Form.Element.serialize(field); - } - if(extraData){ - data += '&'+extraData; - } - // Send request - new Ajax.Request(href, { - method : 'post', postBody : data, - onSuccess : function(response) { - //alert(response.responseText); - Ajax.Evaluator(response); - }, - onFailure : function(response) { - alert(response.responseText); - //errorMessage('Error: ', response); - } - }); -} - -/** - * Post the given fields to the given url - */ -function ajaxLink(href) { - // Send request - new Ajax.Request(href + (href.indexOf("?") == -1 ? "?" : "&") + "ajax=1", { - method : 'get', - onSuccess : Ajax.Evaluator, - onFailure : ajaxErrorHandler - }); -} - -/** - * Load a URL into the given form - */ -function ajaxLoadPage() { - statusMessage('loading...', 2, true); - new Ajax.Request(this.URL + '&ajax=1', { - method : 'get', - onSuccess : ajaxLoadPage_success.bind(this) - }); -} -function ajaxLoadPage_success(response) { - statusMessage('loaded'); - $(this.form).loadNewPage(response.responseText); -} - /** * Behaviour of the statuts message. */ diff --git a/javascript/MemberTableField.js b/javascript/MemberTableField.js index 33f7fa98..f7d8b604 100755 --- a/javascript/MemberTableField.js +++ b/javascript/MemberTableField.js @@ -277,3 +277,29 @@ MemberFilterButton.prototype = { Behaviour.register({ '#Form_EditForm div.MemberTableField table.data input.text' : AjaxMemberLookup }); + +/** + * Post the given fields to the given url + */ +function ajaxSubmitFieldSet(href, fieldSet, extraData) { + // Build data + var i,field,data = "ajax=1"; + for(i=0;field=fieldSet[i];i++) { + data += '&' + Form.Element.serialize(field); + } + if(extraData){ + data += '&'+extraData; + } + // Send request + new Ajax.Request(href, { + method : 'post', postBody : data, + onSuccess : function(response) { + //alert(response.responseText); + Ajax.Evaluator(response); + }, + onFailure : function(response) { + alert(response.responseText); + //errorMessage('Error: ', response); + } + }); +} \ No newline at end of file