This commit is contained in:
Mo Bitar
2018-01-16 13:42:58 -06:00
parent 47f81e84ad
commit 0b430d4d08
7 changed files with 22 additions and 44 deletions

View File

@@ -95,6 +95,9 @@ module.exports = function(grunt) {
},
css: {
options: {
separator: '',
},
src: [
'vendor/assets/stylesheets/app.css',
'node_modules/sn-stylekit/dist/stylekit.css'

View File

@@ -45,27 +45,18 @@ angular.module('app.frontend')
this.showAccountMenu = false;
}.bind(this)
this.closeAccountMenu = () => {
this.showAccountMenu = false;
}
this.accountMenuPressed = function() {
this.serverData = {};
this.showAccountMenu = !this.showAccountMenu;
this.showFaq = false;
this.showNewPasswordForm = false;
this.showExtensionsMenu = false;
this.showIOMenu = false;
}
this.toggleExtensions = function() {
this.showAccountMenu = false;
this.showIOMenu = false;
this.showExtensionsMenu = !this.showExtensionsMenu;
}
this.toggleIO = function() {
this.showIOMenu = !this.showIOMenu;
this.showExtensionsMenu = false;
this.showAccountMenu = false;
}
this.hasPasscode = function() {
return passcodeManager.hasPasscode();
}

View File

@@ -64,9 +64,9 @@ angular.module('app.frontend')
syncManager.sync(null);
// refresh every 30s
// setInterval(function () {
// syncManager.sync(null);
// }, 30000);
setInterval(function () {
syncManager.sync(null);
}, 30000);
});
}

View File

@@ -4,7 +4,8 @@ class AccountMenu {
this.restrict = "E";
this.templateUrl = "frontend/directives/account-menu.html";
this.scope = {
"onSuccessfulAuth" : "&"
"onSuccessfulAuth" : "&",
"closeFunction" : "&"
};
}
@@ -15,28 +16,15 @@ class AccountMenu {
$scope.user = authManager.user;
$scope.server = syncManager.serverURL;
$scope.close = function() {
$scope.closeFunction()();
}
$scope.encryptedBackupsAvailable = function() {
return authManager.user || passcodeManager.hasPasscode();
}
$scope.syncStatus = syncManager.syncStatus;
$scope.encryptionKey = function() {
return authManager.keys().mk;
}
$scope.authKey = function() {
return authManager.keys().ak;
}
$scope.serverPassword = function() {
return syncManager.serverPassword;
}
$scope.dashboardURL = function() {
return `${$scope.server}/dashboard/#server=${$scope.server}&id=${encodeURIComponent($scope.user.email)}&pw=${$scope.serverPassword()}`;
}
$scope.newPasswordData = {};
$scope.showPasswordChangeForm = function() {

View File

@@ -21,10 +21,6 @@ class SyncManager {
return this.storageManager.getItem("mk");
}
get serverPassword() {
return this.storageManager.getItem("pw");
}
writeItemsToLocalStorage(items, offlineOnly, callback) {
if(items.length == 0) {
callback && callback();

View File

@@ -2,7 +2,7 @@
.panel#account-panel
.header
%h1.title Account
%a.close-button Close
%a.close-button{"ng-click" => "close()"} Close
.content
.panel-section.hero{"ng-if" => "!user && !formData.showLogin && !formData.showRegister && !formData.mfa"}
@@ -67,8 +67,9 @@
.subtitle.danger.panel-row{"ng-if" => "syncStatus.error"} Error syncing: {{syncStatus.error.message}}
.subtitle.subtle.panel-row {{server}}
.subtitle.subtle.normal {{server}}
.panel-row
%a.panel-row.condensed{"ng-click" => "newPasswordData.changePassword = !newPasswordData.changePassword"} Change Password
.notification.default{"ng-if" => "newPasswordData.changePassword"}
@@ -94,8 +95,7 @@
%a.panel-row.condensed{"ng-click" => "showAdvanced = !showAdvanced"} Advanced
%div{"ng-if" => "showAdvanced"}
%a.panel-row{"href" => "{{dashboardURL()}}", "target" => "_blank"} Data Dashboard
%a.panel-row{"ng-click" => "reencryptPressed()"} Re-encrypt All Items
%a.panel-row{"ng-click" => "reencryptPressed()"} Resync All Items
%div{"ng-if" => "securityUpdateAvailable()"}

View File

@@ -3,10 +3,10 @@
.left
.item{"click-outside" => "ctrl.showAccountMenu = false;", "is-open" => "ctrl.showAccountMenu"}
.column
.circle.small.info
.circle.small{"ng-class" => "ctrl.error ? 'danger' : (ctrl.user ? 'info' : 'default')"}
.column{"ng-click" => "ctrl.accountMenuPressed()"}
.label.title{"ng-class" => "{red: ctrl.error}"} Account
%account-menu{"ng-if" => "ctrl.showAccountMenu", "on-successful-auth" => "ctrl.onAuthSuccess"}
%account-menu{"ng-if" => "ctrl.showAccountMenu", "on-successful-auth" => "ctrl.onAuthSuccess", "close-function" => "ctrl.closeAccountMenu"}
.item{"click-outside" => "ctrl.showExtensionsMenu = false;", "is-open" => "ctrl.showExtensionsMenu"}
.column{"ng-click" => "ctrl.toggleExtensions()"}