summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-26 12:55:05 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-26 12:55:05 +0200
commit7a9d60d87eb8e4414e5fe05830b088d426ff810d (patch)
tree0fc97a7eacfd071475afd8bc6d4372babacb5740 /settings/js
parent5387b942c44e05b87ba2a0fd54168f5278a31344 (diff)
parent52eab2a61a5d27b64fcd0440b91f854c052933a9 (diff)
downloadnextcloud-server-7a9d60d87eb8e4414e5fe05830b088d426ff810d.tar.gz
nextcloud-server-7a9d60d87eb8e4414e5fe05830b088d426ff810d.zip
Merge remote-tracking branch 'upstream/master' into master-upstream-sync
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/authtoken_view.js45
-rw-r--r--settings/js/personal.js11
2 files changed, 33 insertions, 23 deletions
diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js
index 664dfd28148..da5861689a0 100644
--- a/settings/js/authtoken_view.js
+++ b/settings/js/authtoken_view.js
@@ -27,9 +27,9 @@
var TEMPLATE_TOKEN =
'<tr data-id="{{id}}">'
- + '<td>{{name}}</td>'
- + '<td><span class="last-activity" title="{{lastActivityTime}}">{{lastActivity}}</span></td>'
- + '<td><a class="icon-delete" title="' + t('core', 'Disconnect') + '"></a></td>'
+ + '<td class="has-tooltip" title="{{name}}"><span class="token-name">{{name}}</span></td>'
+ + '<td><span class="last-activity has-tooltip" title="{{lastActivityTime}}">{{lastActivity}}</span></td>'
+ + '<td><a class="icon-delete has-tooltip" title="' + t('core', 'Disconnect') + '"></a></td>'
+ '<tr>';
var SubView = Backbone.View.extend({
@@ -80,8 +80,7 @@
viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL');
var html = _this.template(viewData);
var $html = $(html);
- $html.find('.last-activity').tooltip();
- $html.find('.icon-delete').tooltip();
+ $html.find('.has-tooltip').tooltip({container: 'body'});
list.append($html);
});
},
@@ -104,13 +103,13 @@
_tokenName: undefined,
- _addTokenBtn: undefined,
+ _addAppPasswordBtn: undefined,
_result: undefined,
- _newToken: undefined,
+ _newAppPassword: undefined,
- _hideTokenBtn: undefined,
+ _hideAppPasswordBtn: undefined,
_addingToken: false,
@@ -120,7 +119,7 @@
var tokenTypes = [0, 1];
var _this = this;
_.each(tokenTypes, function(type) {
- var el = type === 0 ? '#sessions' : '#devices';
+ var el = type === 0 ? '#sessions' : '#apppasswords';
_this._views.push(new SubView({
el: el,
type: type,
@@ -131,16 +130,16 @@
$el.on('click', 'a.icon-delete', _.bind(_this._onDeleteToken, _this));
});
- this._form = $('#device-token-form');
- this._tokenName = $('#device-token-name');
- this._addTokenBtn = $('#device-add-token');
- this._addTokenBtn.click(_.bind(this._addDeviceToken, this));
+ this._form = $('#app-password-form');
+ this._tokenName = $('#app-password-name');
+ this._addAppPasswordBtn = $('#add-app-password');
+ this._addAppPasswordBtn.click(_.bind(this._addAppPassword, this));
- this._result = $('#device-token-result');
- this._newToken = $('#device-new-token');
- this._newToken.on('focus', _.bind(this._onNewTokenFocus, this));
- this._hideTokenBtn = $('#device-token-hide');
- this._hideTokenBtn.click(_.bind(this._hideToken, this));
+ this._result = $('#app-password-result');
+ this._newAppPassword = $('#new-app-password');
+ this._newAppPassword.on('focus', _.bind(this._onNewTokenFocus, this));
+ this._hideAppPasswordBtn = $('#app-password-hide');
+ this._hideAppPasswordBtn.click(_.bind(this._hideToken, this));
},
render: function() {
@@ -167,7 +166,7 @@
});
},
- _addDeviceToken: function() {
+ _addAppPassword: function() {
var _this = this;
this._toggleAddingToken(true);
@@ -182,9 +181,9 @@
$.when(creatingToken).done(function(resp) {
_this.collection.add(resp.deviceToken);
_this.render();
- _this._newToken.val(resp.token);
+ _this._newAppPassword.val(resp.token);
_this._toggleFormResult(false);
- _this._newToken.select();
+ _this._newAppPassword.select();
_this._tokenName.val('');
});
$.when(creatingToken).fail(function() {
@@ -196,7 +195,7 @@
},
_onNewTokenFocus: function() {
- this._newToken.select();
+ this._newAppPassword.select();
},
_hideToken: function() {
@@ -205,7 +204,7 @@
_toggleAddingToken: function(state) {
this._addingToken = state;
- this._addTokenBtn.toggleClass('icon-loading-small', state);
+ this._addAppPasswordBtn.toggleClass('icon-loading-small', state);
},
_onDeleteToken: function(event) {
diff --git a/settings/js/personal.js b/settings/js/personal.js
index d270a49f3ad..c9e575afd6b 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -369,6 +369,17 @@ $(document).ready(function () {
collection: collection
});
view.reload();
+
+ // 'redirect' to anchor sections
+ // anchors are lost on redirects (e.g. while solving the 2fa challenge) otherwise
+ // example: /settings/person?section=devices will result in /settings/person?#devices
+ if (!window.location.hash) {
+ var query = OC.parseQueryString(location.search);
+ if (query && query.section) {
+ OC.Util.History.replaceState({});
+ window.location.hash = query.section;
+ }
+ }
});
if (!OC.Encryption) {