Skip to content

Commit

Permalink
Remove inconsistent function names
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Oct 17, 2016
1 parent f87047c commit 1eeb21f
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 50 deletions.
10 changes: 3 additions & 7 deletions client/galaxy/scripts/mvc/user/change-api-key.js
@@ -1,6 +1,6 @@
/** Get API Keys view */
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var APIKeys = Backbone.View.extend({
return Backbone.View.extend({
initialize: function ( app, options ) {
var self = this;
this.model = options && options.model || new Backbone.Model( options );
Expand All @@ -26,15 +26,15 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
title: 'Generate a new key',
cls: 'ui-button btn btn-primary',
floating: 'clear',
onclick: function() { self._getNewApiKey() }
onclick: function() { self._submit() }
})
}
});
this.setElement( this.form.$el );
},

/** Generate new API key */
_getNewApiKey: function() {
_submit: function() {
var self = this;
$.getJSON( Galaxy.root + 'api/user_preferences/change_api_key', { 'new_api_key': true }, function( response ) {
if( response.user_api_key ) {
Expand All @@ -48,9 +48,5 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
});
}
});

return {
APIKeys: APIKeys
};
});

10 changes: 3 additions & 7 deletions client/galaxy/scripts/mvc/user/change-communication.js
@@ -1,6 +1,6 @@
/** Change communication settings view */
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var ChangeCommunication = Backbone.View.extend({
return Backbone.View.extend({
initialize: function ( app, options ) {
var self = this;
this.model = options && options.model || new Backbone.Model( options );
Expand All @@ -17,14 +17,14 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
})
},
onchange: function() {
self.saveCommunicationChanges();
self._save();
}
});
this.setElement( this.form.$el );
},

/** Saves changes */
saveCommunicationChanges: function() {
_save: function() {
var self = this;
var data = { 'enable_communication_server': self.form.data.create()[ 'change-communication' ] };
$.getJSON( Galaxy.root + 'api/user_preferences/change_communication', data, function( response ) {
Expand All @@ -35,8 +35,4 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
});
}
});

return {
ChangeCommunication: ChangeCommunication
};
});
10 changes: 3 additions & 7 deletions client/galaxy/scripts/mvc/user/change-password.js
@@ -1,6 +1,6 @@
/** Change password view */
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var ChangePassword = Backbone.View.extend({
return Backbone.View.extend({
initialize: function ( app, options ) {
var self = this;
this.model = options && options.model || new Backbone.Model( options );
Expand All @@ -26,15 +26,15 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
title: 'Save Password',
cls: 'ui-button btn btn-primary',
floating: 'clear',
onclick: function() { self._savePassword() }
onclick: function() { self._save() }
})
}
});
this.setElement( this.form.$el );
},

/** Saves the changed password */
_savePassword: function() {
_save: function() {
var self = this;
$.getJSON( Galaxy.root + 'api/user_preferences/change_password', this.form.data.create(), function( response ) {
self.form.message.update({
Expand All @@ -44,8 +44,4 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
});
}
});

return {
ChangePassword: ChangePassword
};
});
6 changes: 1 addition & 5 deletions client/galaxy/scripts/mvc/user/change-permissions.js
@@ -1,6 +1,6 @@
/** Show and save permissions view */
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var ChangePermissions = Backbone.View.extend({
return Backbone.View.extend({
initialize: function ( app, options, $el ) {
var self = this;
this.model = options && options.model || new Backbone.Model( options );
Expand Down Expand Up @@ -64,9 +64,5 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
}
}
});

return {
ChangePermissions: ChangePermissions
};
});

10 changes: 3 additions & 7 deletions client/galaxy/scripts/mvc/user/change-toolbox-filter.js
@@ -1,6 +1,6 @@
/** Save the toolbox filters view */
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var ToolboxFilter = Backbone.View.extend({
return Backbone.View.extend({
initialize: function ( app, options ) {
var self = this;
this.model = options && options.model || new Backbone.Model( options );
Expand All @@ -23,7 +23,7 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
title: 'Save changes',
cls: 'ui-button btn btn-primary',
floating: 'clear',
onclick: function() { self._saveToolboxFilter() }
onclick: function() { self._save() }
})
}
});
Expand Down Expand Up @@ -106,7 +106,7 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
},

/** Save the changes made to the filters */
_saveToolboxFilter: function() {
_save: function() {
var url = Galaxy.root + 'api/user_preferences/change_toolbox_filters',
data = {},
self = this;
Expand All @@ -119,9 +119,5 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
});
}
});

return {
ToolboxFilter: ToolboxFilter
};
});

6 changes: 1 addition & 5 deletions client/galaxy/scripts/mvc/user/change-user-information.js
@@ -1,6 +1,6 @@
/** Show and edit user information */
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var ManageUserInformation = Backbone.View.extend({
return Backbone.View.extend({
initialize: function ( app, options, address_message ) {
var self = this;
this.app = app;
Expand Down Expand Up @@ -53,8 +53,4 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
});
}
});

return {
ManageUserInformation: ManageUserInformation
};
});
2 changes: 1 addition & 1 deletion static/maps/mvc/user/change-api-key.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/maps/mvc/user/change-communication.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/maps/mvc/user/change-password.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/maps/mvc/user/change-permissions.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1eeb21f

Please sign in to comment.