From e6c3644bd770e4af06cc73558b4e0926ecebe08b Mon Sep 17 00:00:00 2001 From: Usman Khalid <2200617@gmail.com> Date: Sat, 11 Apr 2015 20:10:06 +0500 Subject: [PATCH] Quality fixes. --- .../js/student_account/models/user_account_model.js | 4 ++-- .../student_account/models/user_preferences_model.js | 2 +- .../views/account_settings_factory.js | 10 +++++----- .../student_account/views/account_settings_fields.js | 12 +++++------- .../student_account/views/account_settings_view.js | 2 +- lms/static/js/views/fields.js | 2 +- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/lms/static/js/student_account/models/user_account_model.js b/lms/static/js/student_account/models/user_account_model.js index 868b275846..c12ce9b293 100644 --- a/lms/static/js/student_account/models/user_account_model.js +++ b/lms/static/js/student_account/models/user_account_model.js @@ -1,7 +1,7 @@ ;(function (define, undefined) { 'use strict'; define([ - 'gettext', 'underscore', 'backbone', + 'gettext', 'underscore', 'backbone' ], function (gettext, _, Backbone) { var UserAccountModel = Backbone.Model.extend({ @@ -25,7 +25,7 @@ default_public_account_fields: [] }, - parse : function(response, xhr) { + parse : function(response) { if (_.isNull(response)) { return {}; } diff --git a/lms/static/js/student_account/models/user_preferences_model.js b/lms/static/js/student_account/models/user_preferences_model.js index 273e2ea852..99578130e4 100644 --- a/lms/static/js/student_account/models/user_preferences_model.js +++ b/lms/static/js/student_account/models/user_preferences_model.js @@ -1,7 +1,7 @@ ;(function (define, undefined) { 'use strict'; define([ - 'gettext', 'underscore', 'backbone', + 'gettext', 'underscore', 'backbone' ], function (gettext, _, Backbone) { var UserPreferencesModel = Backbone.Model.extend({ diff --git a/lms/static/js/student_account/views/account_settings_factory.js b/lms/static/js/student_account/views/account_settings_factory.js index 768f23e8c7..ebe73ec316 100644 --- a/lms/static/js/student_account/views/account_settings_factory.js +++ b/lms/static/js/student_account/views/account_settings_factory.js @@ -6,7 +6,7 @@ 'js/student_account/models/user_account_model', 'js/student_account/models/user_preferences_model', 'js/student_account/views/account_settings_fields', - 'js/student_account/views/account_settings_view', + 'js/student_account/views/account_settings_view' ], function (gettext, $, _, Backbone, FieldViews, UserAccountModel, UserPreferencesModel, AccountSettingsFieldViews, AccountSettingsView) { @@ -116,7 +116,7 @@ }) } ] - }, + } ]; if (_.isArray(authData.providers)) { @@ -145,14 +145,14 @@ accountSettingsView.render(); - var showLoadingError = function (model, response, options) { + var showLoadingError = function () { accountSettingsView.showLoadingError(); }; userAccountModel.fetch({ - success: function (model, response, options) { + success: function () { userPreferencesModel.fetch({ - success: function (model, response, options) { + success: function () { accountSettingsView.renderFields(); }, error: showLoadingError diff --git a/lms/static/js/student_account/views/account_settings_fields.js b/lms/static/js/student_account/views/account_settings_fields.js index 8d9eb5a3d6..f2be5aecce 100644 --- a/lms/static/js/student_account/views/account_settings_fields.js +++ b/lms/static/js/student_account/views/account_settings_fields.js @@ -4,8 +4,6 @@ 'gettext', 'jquery', 'underscore', 'backbone', 'js/mustache', 'js/views/fields' ], function (gettext, $, _, Backbone, RequireMustache, FieldViews) { - var Mustache = window.Mustache || RequireMustache; - var AccountSettingsFieldViews = {}; AccountSettingsFieldViews.EmailFieldView = FieldViews.TextFieldView.extend({ @@ -31,7 +29,7 @@ url: '/i18n/setlang/', data: data, dataType: 'html', - success: function (data, status, xhr) { + success: function () { view.showSuccessMessage(); }, error: function (xhr, status, error) { @@ -65,7 +63,7 @@ type: 'POST', url: view.options.linkHref, data: data, - success: function (data, status, xhr) { + success: function () { view.showSuccessMessage() }, error: function (xhr, status, error) { @@ -79,7 +77,7 @@ gettext('We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'), {'email_address': this.model.get(this.options.emailAttribute)} ); - }, + } }); AccountSettingsFieldViews.LanguageProficienciesFieldView = FieldViews.DropdownFieldView.extend({ @@ -149,7 +147,7 @@ url: this.options.disconnectUrl, data: data, dataType: 'html', - success: function (data, status, xhr) { + success: function () { view.options.connected = false; view.render(); view.showSuccessMessage(); @@ -166,7 +164,7 @@ successMessage: function() { return this.indicators['success'] + gettext('Successfully unlinked.'); - }, + } }); return AccountSettingsFieldViews; diff --git a/lms/static/js/student_account/views/account_settings_view.js b/lms/static/js/student_account/views/account_settings_view.js index 20222f8ea4..747d0d7a3f 100644 --- a/lms/static/js/student_account/views/account_settings_view.js +++ b/lms/static/js/student_account/views/account_settings_view.js @@ -1,7 +1,7 @@ ;(function (define, undefined) { 'use strict'; define([ - 'gettext', 'jquery', 'underscore', 'backbone', + 'gettext', 'jquery', 'underscore', 'backbone' ], function (gettext, $, _, Backbone) { var AccountSettingsView = Backbone.View.extend({ diff --git a/lms/static/js/views/fields.js b/lms/static/js/views/fields.js index bc6fd57b31..b3fcb4f995 100644 --- a/lms/static/js/views/fields.js +++ b/lms/static/js/views/fields.js @@ -485,7 +485,7 @@ title: this.options.title, linkTitle: this.options.linkTitle, linkHref: this.options.linkHref, - message: this.helpMessage, + message: this.helpMessage })); return this; },