diff --git a/plugins/scm-bzr-plugin/src/main/resources/sonia/scm/bzr.config.js b/plugins/scm-bzr-plugin/src/main/resources/sonia/scm/bzr.config.js index 6212aa3cde..8a759857a8 100644 --- a/plugins/scm-bzr-plugin/src/main/resources/sonia/scm/bzr.config.js +++ b/plugins/scm-bzr-plugin/src/main/resources/sonia/scm/bzr.config.js @@ -32,8 +32,9 @@ registerConfigPanel({ - xtype : 'configForm', + xtype : 'simpleConfigForm', title : 'Bazaar Settings', + configUrl: restUrl + 'config/repositories/bzr.json', items : [{ xtype : 'textfield', fieldLabel : 'Bzr Binary', @@ -53,44 +54,5 @@ registerConfigPanel({ name: 'repositoryDirectory', fieldLabel: 'Repository directory', allowBlank : false - }], - - onSubmit: function(values){ - this.el.mask('Submit ...'); - Ext.Ajax.request({ - url: restUrl + 'config/repositories/bzr.json', - method: 'POST', - jsonData: values, - scope: this, - disableCaching: true, - success: function(response){ - this.el.unmask(); - }, - failure: function(){ - this.el.unmask(); - } - }); - }, - - onLoad: function(el){ - var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100); - Ext.Ajax.request({ - url: restUrl + 'config/repositories/bzr.json', - method: 'GET', - scope: this, - disableCaching: true, - success: function(response){ - var obj = Ext.decode(response.responseText); - this.load(obj); - clearTimeout(tid); - el.unmask(); - }, - failure: function(){ - el.unmask(); - clearTimeout(tid); - alert('failure'); - } - }); - } - + }] }); diff --git a/plugins/scm-git-plugin/src/main/resources/sonia/scm/git.config.js b/plugins/scm-git-plugin/src/main/resources/sonia/scm/git.config.js index 651e9e4f54..73140140bc 100644 --- a/plugins/scm-git-plugin/src/main/resources/sonia/scm/git.config.js +++ b/plugins/scm-git-plugin/src/main/resources/sonia/scm/git.config.js @@ -30,51 +30,13 @@ */ registerConfigPanel({ - xtype : 'configForm', + xtype : 'simpleConfigForm', title : 'Git Settings', + configUrl: restUrl + 'config/repositories/git.json', items : [{ xtype: 'textfield', name: 'repositoryDirectory', fieldLabel: 'Repository directory', allowBlank : false - }], - - onSubmit: function(values){ - this.el.mask('Submit ...'); - Ext.Ajax.request({ - url: restUrl + 'config/repositories/git.json', - method: 'POST', - jsonData: values, - scope: this, - disableCaching: true, - success: function(response){ - this.el.unmask(); - }, - failure: function(){ - this.el.unmask(); - } - }); - }, - - onLoad: function(el){ - var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100); - Ext.Ajax.request({ - url: restUrl + 'config/repositories/git.json', - method: 'GET', - scope: this, - disableCaching: true, - success: function(response){ - var obj = Ext.decode(response.responseText); - this.load(obj); - clearTimeout(tid); - el.unmask(); - }, - failure: function(){ - el.unmask(); - clearTimeout(tid); - alert('failure'); - } - }); - } - + }] }); diff --git a/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js b/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js index 70915091af..c3fd59f90f 100644 --- a/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js +++ b/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js @@ -30,51 +30,13 @@ */ registerConfigPanel({ - xtype : 'configForm', + xtype : 'simpleConfigForm', title : 'Subversion Settings', + configUrl: restUrl + 'config/repositories/svn.json', items : [{ xtype: 'textfield', name: 'repositoryDirectory', fieldLabel: 'Repository directory', allowBlank : false - }], - - onSubmit: function(values){ - this.el.mask('Submit ...'); - Ext.Ajax.request({ - url: restUrl + 'config/repositories/svn.json', - method: 'POST', - jsonData: values, - scope: this, - disableCaching: true, - success: function(response){ - this.el.unmask(); - }, - failure: function(){ - this.el.unmask(); - } - }); - }, - - onLoad: function(el){ - var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100); - Ext.Ajax.request({ - url: restUrl + 'config/repositories/svn.json', - method: 'GET', - scope: this, - disableCaching: true, - success: function(response){ - var obj = Ext.decode(response.responseText); - this.load(obj); - clearTimeout(tid); - el.unmask(); - }, - failure: function(){ - el.unmask(); - clearTimeout(tid); - alert('failure'); - } - }); - } - + }] });