From a9ea908413aa51c48739ea3e01811e36e819560c Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 10 Jun 2016 14:49:56 +0200 Subject: add tooltip to token names --- settings/js/authtoken_view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'settings/js') diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index 664dfd28148..47e6667925a 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -27,7 +27,7 @@ var TEMPLATE_TOKEN = '' - + '{{name}}' + + '{{name}}' + '{{lastActivity}}' + '' + ''; @@ -80,6 +80,7 @@ viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL'); var html = _this.template(viewData); var $html = $(html); + $html.find('.token-name').tooltip(); $html.find('.last-activity').tooltip(); $html.find('.icon-delete').tooltip(); list.append($html); -- cgit v1.2.3 From a5a66f38f1cae2b623d95c739e8f8f6087c41af2 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 17 Jun 2016 15:11:31 +0200 Subject: Fix tooltip position in token list --- settings/js/authtoken_view.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'settings/js') diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index 47e6667925a..b1906f0b338 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -27,9 +27,9 @@ var TEMPLATE_TOKEN = '' - + '{{name}}' - + '{{lastActivity}}' - + '' + + '{{name}}' + + '{{lastActivity}}' + + '' + ''; var SubView = Backbone.View.extend({ @@ -80,9 +80,7 @@ viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL'); var html = _this.template(viewData); var $html = $(html); - $html.find('.token-name').tooltip(); - $html.find('.last-activity').tooltip(); - $html.find('.icon-delete').tooltip(); + $html.find('.has-tooltip').tooltip({container: 'body'}); list.append($html); }); }, -- cgit v1.2.3 From 7f22aeb5d6779236efec72cdb6bb8703dd7c0ee1 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 21 Jun 2016 16:14:51 +0200 Subject: redirect to new login route (#25099) * redirect to new login route * encode anchor in url and restore it client-side --- lib/private/legacy/util.php | 11 ++++++----- settings/js/personal.js | 11 +++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'settings/js') diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 65d00c16388..78445dab020 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -962,11 +962,12 @@ class OC_Util { public static function checkLoggedIn() { // Check if we are a user if (!OC_User::isLoggedIn()) { - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php', - [ - 'redirect_url' => \OC::$server->getRequest()->getRequestUri() - ] - ) + header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( + 'core.login.showLoginForm', + [ + 'redirect_url' => urlencode(\OC::$server->getRequest()->getRequestUri()), + ] + ) ); exit(); } diff --git a/settings/js/personal.js b/settings/js/personal.js index aea2400e999..73d65034d9a 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -368,6 +368,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) { -- cgit v1.2.3 From 31f3aaa36b8ae5a06b7319f2036e6fb7c509c281 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 16 Jun 2016 10:54:03 +0200 Subject: app passwords/device tokens wording --- settings/css/settings.css | 14 +++++++------- settings/js/authtoken_view.js | 36 ++++++++++++++++++------------------ settings/personal.php | 2 +- settings/templates/personal.php | 20 ++++++++++---------- 4 files changed, 36 insertions(+), 36 deletions(-) (limited to 'settings/js') diff --git a/settings/css/settings.css b/settings/css/settings.css index 04538558cae..e4ddec9152a 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -101,24 +101,24 @@ table.nostyle label { margin-right: 2em; } table.nostyle td { padding: 0.2em 0; } #sessions table, -#devices table { +#apppasswords table { width: 100%; min-height: 150px; padding-top: 25px; } #sessions table th, -#devices table th { +#apppasswords table th { font-weight: 800; } #sessions table th, #sessions table td, -#devices table th, -#devices table td { +#apppasswords table th, +#apppasswords table td { padding: 10px; } #sessions .token-list td, -#devices .token-list td { +#apppasswords .token-list td { border-top: 1px solid #DDD; text-overflow: ellipsis; max-width: 200px; @@ -126,12 +126,12 @@ table.nostyle td { padding: 0.2em 0; } overflow: hidden; } #sessions .token-list td a.icon-delete, -#devices .token-list td a.icon-delete { +#apppasswords .token-list td a.icon-delete { display: block; opacity: 0.6; } -#device-new-token { +#new-app-password { width: 186px; font-family: monospace; background-color: lightyellow; diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index b1906f0b338..da5861689a0 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -103,13 +103,13 @@ _tokenName: undefined, - _addTokenBtn: undefined, + _addAppPasswordBtn: undefined, _result: undefined, - _newToken: undefined, + _newAppPassword: undefined, - _hideTokenBtn: undefined, + _hideAppPasswordBtn: undefined, _addingToken: false, @@ -119,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, @@ -130,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() { @@ -166,7 +166,7 @@ }); }, - _addDeviceToken: function() { + _addAppPassword: function() { var _this = this; this._toggleAddingToken(true); @@ -181,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() { @@ -195,7 +195,7 @@ }, _onNewTokenFocus: function() { - this._newToken.select(); + this._newAppPassword.select(); }, _hideToken: function() { @@ -204,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/personal.php b/settings/personal.php index 0b2781fb21b..e7a928f88bf 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -177,7 +177,7 @@ $tmpl->assign('groups', $groups2); $formsAndMore = []; $formsAndMore[]= ['anchor' => 'avatar', 'section-name' => $l->t('Personal info')]; $formsAndMore[]= ['anchor' => 'sessions', 'section-name' => $l->t('Sessions')]; -$formsAndMore[]= ['anchor' => 'devices', 'section-name' => $l->t('Devices')]; +$formsAndMore[]= ['anchor' => 'apppasswords', 'section-name' => $l->t('App passwords')]; $formsAndMore[]= ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync clients')]; $forms=OC_App::getForms('personal'); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 942944ffab7..1ba7026cd08 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -183,9 +183,9 @@ if($_['passwordChangeSupported']) { -
-

t('Devices'));?>

- t("You've linked these devices."));?> +
+

t('App passwords'));?>

+ t("You've linked these apps."));?> @@ -197,14 +197,14 @@ if($_['passwordChangeSupported']) {
-

t('A device password is a passcode that gives an app or device permissions to access your ownCloud account.'));?>

-
- - +

t('An app password is a passcode that gives an app or device permissions to access your ownCloud account.'));?>

+
+ +
- -- cgit v1.2.3