Permalink
Browse files

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
  • Loading branch information...
chillu committed Nov 21, 2009
1 parent 908409a commit 7fd337f5f836001fdda433622cacaa8954c264a2
Showing with 26 additions and 53 deletions.
  1. +0 −53 javascript/LeftAndMain.js
  2. +26 −0 javascript/MemberTableField.js
View
@@ -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.
*/
@@ -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);
+ }
+ });
+}

0 comments on commit 7fd337f

Please sign in to comment.