Skip to content

Commit

Permalink
Updated login panel, invalid cred error now focuses on password field.
Browse files Browse the repository at this point in the history
Added skip button to help panel.
Updated dependencies.
  • Loading branch information
nero120 committed Jul 31, 2019
1 parent 7abf37f commit e01cc3a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 9 deletions.
12 changes: 8 additions & 4 deletions js/app.js
Expand Up @@ -927,7 +927,7 @@ xBrowserSync.App.Controller = function ($scope, $q, $timeout, platform, globals,
if (!utility.IsMobilePlatform(vm.platformName)) {
// Set initial focus
var element = document.querySelector('.focused');
element.select ? element.select() : element.focus();
if (element.select) { element.select(); } else { element.focus(); }
}
}, 100);
})
Expand Down Expand Up @@ -1846,9 +1846,6 @@ xBrowserSync.App.Controller = function ($scope, $q, $timeout, platform, globals,
.catch(syncBookmarksFailed);
})
.catch(function (err) {
// Hide loading panel
platform.Interface.Loading.Hide(null, loadingTimeout);

// Disable upgrade confirmed flag
vm.sync.upgradeConfirmed = false;

Expand Down Expand Up @@ -1887,6 +1884,13 @@ xBrowserSync.App.Controller = function ($scope, $q, $timeout, platform, globals,
// Display alert
errMessage = utility.GetErrorMessageFromException(err);
vm.alert.display(errMessage.title, errMessage.message, 'danger');

// If creds were incorrect, focus on password field
if (err.code === globals.ErrorCodes.InvalidCredentials) {
$timeout(function () {
document.querySelector('.login-form-existing input[name="txtPassword"]').select();
}, 100);
}
}
};

Expand Down
1 change: 1 addition & 0 deletions js/global.js
Expand Up @@ -195,6 +195,7 @@ xBrowserSync.App.Global = function (platform) {
Button_Help_Label: 'button_Help_Label',
Button_Next_Label: 'button_Next_Label',
Button_Previous_Label: 'button_Previous_Label',
Button_Skip_Label: 'button_Skip_Label',
Button_ScanCode_Label: 'button_ScanCode_Label',
Button_DisableSync_Label: 'button_DisableSync_Label',
Button_EnableSync_Label: 'button_EnableSync_Label',
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"base64-js": "^1.3.0",
"bootstrap": "^4.3.1",
"browser-detect": "^0.2.28",
"compare-versions": "^3.5.0",
"compare-versions": "^3.5.1",
"crypto-js": "^3.1.9-1",
"dompurify": "^1.0.11",
"fastclick": "^1.0.6",
Expand Down
3 changes: 3 additions & 0 deletions platform/android/js/platformImplementation.js
Expand Up @@ -39,6 +39,9 @@ xBrowserSync.App.PlatformImplementation = function ($interval, $q, $timeout, pla
"button_Previous_Label": {
"message": "Previous"
},
"button_Skip_Label": {
"message": "Skip"
},
"login_GetSyncId_Title": {
"message": "Need a sync ID?"
},
Expand Down
3 changes: 3 additions & 0 deletions platform/chrome/_locales/de/messages.json
Expand Up @@ -23,6 +23,9 @@
"button_Previous_Label": {
"message": "Zurück"
},
"button_Skip_Label": {
"message": "Skip"
},
"login_GetSyncId_Title": {
"message": "Need a sync ID?"
},
Expand Down
3 changes: 3 additions & 0 deletions platform/chrome/_locales/en/messages.json
Expand Up @@ -23,6 +23,9 @@
"button_Previous_Label": {
"message": "Previous"
},
"button_Skip_Label": {
"message": "Skip"
},
"login_GetSyncId_Title": {
"message": "Need a sync ID?"
},
Expand Down
3 changes: 3 additions & 0 deletions platform/chrome/_locales/fr/messages.json
Expand Up @@ -23,6 +23,9 @@
"button_Previous_Label": {
"message": "Précédent"
},
"button_Skip_Label": {
"message": "Skip"
},
"login_GetSyncId_Title": {
"message": "Need a sync ID?"
},
Expand Down
3 changes: 3 additions & 0 deletions platform/firefox/_locales/en/messages.json
Expand Up @@ -23,6 +23,9 @@
"button_Previous_Label": {
"message": "Previous"
},
"button_Skip_Label": {
"message": "Skip"
},
"login_GetSyncId_Title": {
"message": "Need a sync ID?"
},
Expand Down
6 changes: 5 additions & 1 deletion views/help.html
Expand Up @@ -5,8 +5,12 @@
data-ng-repeat="page in vm.help.pages track by $index">
<div data-ng-bind-html="page"></div>
<div class="pagination">
<a href="#" data-ng-click="vm.events.helpPanel_Close()" data-ng-keydown="vm.events.helpPanel_KeyDown($event)"
data-ng-show="$index === 0">
<span>{{ vm.platform.GetConstant(vm.globals.Constants.Button_Skip_Label) }}</span>
</a>
<a class="prev-link" href="#" data-ng-click="vm.events.helpPanel_PreviousPage()"
data-ng-keydown="vm.events.helpPanel_KeyDown($event)" data-ng-class="{ 'invisible': $index === 0 }">
data-ng-keydown="vm.events.helpPanel_KeyDown($event)" data-ng-hide="$index === 0">
<span>{{ vm.platform.GetConstant(vm.globals.Constants.Button_Previous_Label) }}</span>
</a>
<span class="page-number">{{$index + 1}} / {{vm.help.pages.length}}</span>
Expand Down

0 comments on commit e01cc3a

Please sign in to comment.