diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-06-27 18:23:00 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-06-27 18:23:00 +0200 |
commit | 6670d3765881a1a7579bd96a523a90c2a52aec4a (patch) | |
tree | 4251976f5699d7b9e0b1b0aa42b3a5baca5432b5 /settings/js | |
parent | cee2f5dc65f743e0e6470e852978d8bb8e346012 (diff) | |
parent | f8fa031e9f81ba052930d2de647d997af3c309c6 (diff) | |
download | nextcloud-server-6670d3765881a1a7579bd96a523a90c2a52aec4a.tar.gz nextcloud-server-6670d3765881a1a7579bd96a523a90c2a52aec4a.zip |
Merge remote-tracking branch 'upstream/master' into master-sync-upstream
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/authtoken.js | 6 | ||||
-rw-r--r-- | settings/js/authtoken_collection.js | 6 | ||||
-rw-r--r-- | settings/js/authtoken_view.js | 21 |
3 files changed, 22 insertions, 11 deletions
diff --git a/settings/js/authtoken.js b/settings/js/authtoken.js index 215192d7163..1d958a4d675 100644 --- a/settings/js/authtoken.js +++ b/settings/js/authtoken.js @@ -20,14 +20,14 @@ * */ -(function(OC, Backbone) { +(function(OC) { 'use strict'; OC.Settings = OC.Settings || {}; - var AuthToken = Backbone.Model.extend({ + var AuthToken = OC.Backbone.Model.extend({ }); OC.Settings.AuthToken = AuthToken; -})(OC, Backbone); +})(OC); diff --git a/settings/js/authtoken_collection.js b/settings/js/authtoken_collection.js index a78e053995f..ab7f7d5804a 100644 --- a/settings/js/authtoken_collection.js +++ b/settings/js/authtoken_collection.js @@ -20,12 +20,12 @@ * */ -(function(OC, Backbone) { +(function(OC) { 'use strict'; OC.Settings = OC.Settings || {}; - var AuthTokenCollection = Backbone.Collection.extend({ + var AuthTokenCollection = OC.Backbone.Collection.extend({ model: OC.Settings.AuthToken, @@ -49,4 +49,4 @@ OC.Settings.AuthTokenCollection = AuthTokenCollection; -})(OC, Backbone); +})(OC); diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index da5861689a0..01fc1b2ea34 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -1,4 +1,4 @@ -/* global Backbone, Handlebars, moment */ +/* global Handlebars, moment */ /** * @author Christoph Wurst <christoph@owncloud.com> @@ -20,7 +20,7 @@ * */ -(function(OC, _, Backbone, $, Handlebars, moment) { +(function(OC, _, $, Handlebars, moment) { 'use strict'; OC.Settings = OC.Settings || {}; @@ -32,7 +32,7 @@ + '<td><a class="icon-delete has-tooltip" title="' + t('core', 'Disconnect') + '"></a></td>' + '<tr>'; - var SubView = Backbone.View.extend({ + var SubView = OC.Backbone.View.extend({ collection: null, /** @@ -94,7 +94,7 @@ } }); - var AuthTokenView = Backbone.View.extend({ + var AuthTokenView = OC.Backbone.View.extend({ collection: null, _views: [], @@ -107,6 +107,8 @@ _result: undefined, + _newAppLoginName: undefined, + _newAppPassword: undefined, _hideAppPasswordBtn: undefined, @@ -136,6 +138,8 @@ this._addAppPasswordBtn.click(_.bind(this._addAppPassword, this)); this._result = $('#app-password-result'); + this._newAppLoginName = $('#new-app-login-name'); + this._newAppLoginName.on('focus', _.bind(this._onNewTokenLoginNameFocus, this)); this._newAppPassword = $('#new-app-password'); this._newAppPassword.on('focus', _.bind(this._onNewTokenFocus, this)); this._hideAppPasswordBtn = $('#app-password-hide'); @@ -181,6 +185,7 @@ $.when(creatingToken).done(function(resp) { _this.collection.add(resp.deviceToken); _this.render(); + _this._newAppLoginName.val(resp.loginName); _this._newAppPassword.val(resp.token); _this._toggleFormResult(false); _this._newAppPassword.select(); @@ -194,6 +199,10 @@ }); }, + _onNewTokenLoginNameFocus: function() { + this._newAppLoginName.select(); + }, + _onNewTokenFocus: function() { this._newAppPassword.select(); }, @@ -220,6 +229,8 @@ var destroyingToken = token.destroy(); + $row.find('.icon-delete').tooltip('hide'); + var _this = this; $.when(destroyingToken).fail(function() { OC.Notification.showTemporary(t('core', 'Error while deleting the token')); @@ -237,4 +248,4 @@ OC.Settings.AuthTokenView = AuthTokenView; -})(OC, _, Backbone, $, Handlebars, moment); +})(OC, _, $, Handlebars, moment); |