mirror of
https://github.com/moparisthebest/mail
synced 2024-11-26 19:02:20 -05:00
review and fix key export
This commit is contained in:
parent
33440ae16f
commit
ed3f4318b4
@ -15,10 +15,6 @@ define(function(require) {
|
||||
// scope functions
|
||||
//
|
||||
|
||||
$scope.hideAccountView = function() {
|
||||
$scope.$parent.$parent.accountOpen = false;
|
||||
};
|
||||
|
||||
$scope.exportKeyFile = function() {
|
||||
emailDao._crypto.exportKeys(function(err, keys) {
|
||||
if (err) {
|
||||
@ -26,7 +22,7 @@ define(function(require) {
|
||||
return;
|
||||
}
|
||||
|
||||
var id = keys.keyId.substring(8,keys.keyId.length);
|
||||
var id = keys.keyId.substring(8, keys.keyId.length);
|
||||
download(keys.publicKeyArmored + keys.privateKeyArmored, id + '.asc', 'text/plain');
|
||||
});
|
||||
};
|
||||
@ -47,7 +43,9 @@ define(function(require) {
|
||||
file.createWriter(function(writer) {
|
||||
writer.onerror = console.error;
|
||||
writer.onwriteend = function() {};
|
||||
writer.write(new Blob([content], { type: contentType }));
|
||||
writer.write(new Blob([content], {
|
||||
type: contentType
|
||||
}));
|
||||
}, console.error);
|
||||
});
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ define(function(require) {
|
||||
$scope.openNav = function() {
|
||||
$scope.navOpen = true;
|
||||
};
|
||||
|
||||
$scope.closeNav = function() {
|
||||
$scope.navOpen = false;
|
||||
};
|
||||
@ -33,7 +32,6 @@ define(function(require) {
|
||||
$scope.writerReply = !! (replyTo);
|
||||
$scope.writerOpen = true;
|
||||
};
|
||||
|
||||
$scope.closeWriter = function() {
|
||||
$scope.writerOpen = false;
|
||||
};
|
||||
@ -43,9 +41,12 @@ define(function(require) {
|
||||
$scope.closeNav();
|
||||
};
|
||||
|
||||
$scope.showAccountView = function() {
|
||||
$scope.openAccount = function() {
|
||||
$scope.accountOpen = true;
|
||||
};
|
||||
$scope.closeAccount = function() {
|
||||
$scope.accountOpen = false;
|
||||
};
|
||||
|
||||
$scope.remove = function(email) {
|
||||
var trashFolder = _.findWhere($scope.folders, {
|
||||
@ -150,25 +151,32 @@ define(function(require) {
|
||||
ngModule.directive('keyShortcuts', function() {
|
||||
return function(scope, elm) {
|
||||
elm.bind('keydown', function(e) {
|
||||
if (e.keyCode === 78 && !scope.$$childTail.writerOpen) {
|
||||
var cs = scope.$$childTail;
|
||||
|
||||
if (e.keyCode === 78 && !cs.writerOpen) {
|
||||
// n -> new mail
|
||||
e.preventDefault();
|
||||
scope.$$childTail.openWriter();
|
||||
cs.openWriter();
|
||||
|
||||
} else if (e.keyCode === 82 && !scope.$$childTail.writerOpen && scope.$$childTail.selected) {
|
||||
} else if (e.keyCode === 82 && !cs.writerOpen && cs.selected) {
|
||||
// r -> reply
|
||||
e.preventDefault();
|
||||
scope.$$childTail.openWriter(scope.$$childTail.selected);
|
||||
cs.openWriter(cs.selected);
|
||||
|
||||
} else if (e.keyCode === 27 && scope.$$childTail.writerOpen) {
|
||||
} else if (e.keyCode === 27 && cs.writerOpen) {
|
||||
// escape -> close writer
|
||||
e.preventDefault();
|
||||
scope.$$childTail.closeWriter();
|
||||
cs.closeWriter();
|
||||
|
||||
} else if (e.keyCode === 83 && !scope.$$childTail.writerOpen && scope.$$childTail.synchronize) {
|
||||
} else if (e.keyCode === 27 && cs.accountOpen) {
|
||||
// escape -> close account view
|
||||
e.preventDefault();
|
||||
cs.closeAccount();
|
||||
|
||||
} else if (e.keyCode === 83 && !cs.writerOpen && cs.synchronize) {
|
||||
// s -> sync folder
|
||||
e.preventDefault();
|
||||
scope.$$childTail.synchronize();
|
||||
cs.synchronize();
|
||||
}
|
||||
|
||||
scope.$apply();
|
||||
|
@ -173,10 +173,6 @@ define(function(require) {
|
||||
});
|
||||
}
|
||||
});
|
||||
// set attribute value to 'false' on blur event:
|
||||
element.bind('blur', function() {
|
||||
scope.$apply(model.assign(scope, false));
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="lightbox-body" ng-controller="AccountCtrl">
|
||||
<header>
|
||||
<h2>Account</h2>
|
||||
<button class="close" ng-click="hideAccountView()" data-action="lightbox-close"></button>
|
||||
<button class="close" ng-click="closeAccount()" data-action="lightbox-close"></button>
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
|
@ -13,7 +13,7 @@
|
||||
</ul>
|
||||
|
||||
<ul class="nav-secondary">
|
||||
<li><a href="#" ng-click="showAccountView(); $event.preventDefault()">Account</a></li>
|
||||
<li><a href="#" ng-click="openAccount(); $event.preventDefault()">Account</a></li>
|
||||
<li><a href="#">About whiteout.io</a></li>
|
||||
<li><a href="#">Help</a></li>
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user