Private key save and fogot to sidebar

This commit is contained in:
shortcutme 2018-09-21 02:17:53 +02:00
parent 2a1849d027
commit 8fd2af1870
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
5 changed files with 57 additions and 7 deletions

View file

@ -202,6 +202,19 @@ class Sidebar extends Class
return true
}
# Save and forgot privatekey for site signing
@tag.find("#privatekey-add").off("click, touchend").on "click touchend", (e) =>
@wrapper.displayPrompt "Enter your private key:", "password", "Save", "", (privatekey) =>
@wrapper.ws.cmd "userSetSitePrivatekey", [privatekey], (res) =>
@wrapper.notifications.add "privatekey", "done", "Private key saved for site signing", 5000
return false
@tag.find("#privatekey-forgot").off("click, touchend").on "click touchend", (e) =>
@wrapper.ws.cmd "userSetSitePrivatekey", [""], (res) =>
@wrapper.notifications.add "privatekey", "done", "Saved private key removed", 5000
return false
animDrag: (e) =>
mousex = e.pageX

View file

@ -12,7 +12,8 @@
.body-sidebar iframe { transform: rotateY(5deg); opacity: 0.8; pointer-events: none; outline: 1px solid transparent }
.body-internals iframe { transform: rotateX(5deg); opacity: 0.8; pointer-events: none; outline: 1px solid transparent }
.sidebar .link-right { color: white; text-decoration: none; border-bottom: 1px solid #666; text-transform: uppercase; float: right; margin-right: 7px; margin-top: 1px; }
.sidebar .label-right { float: right; margin-right: 7px; margin-top: 1px; float: right; }
.sidebar .link-right { color: white; text-decoration: none; border-bottom: 1px solid #666; text-transform: uppercase; }
.sidebar .link-right:hover { border-color: #CCC; }
.sidebar .link-right:active { background-color: #444 }
/* SIDEBAR */

View file

@ -113,7 +113,8 @@
.body-sidebar iframe { -webkit-transform: rotateY(5deg); -moz-transform: rotateY(5deg); -o-transform: rotateY(5deg); -ms-transform: rotateY(5deg); transform: rotateY(5deg) ; opacity: 0.8; pointer-events: none; outline: 1px solid transparent }
.body-internals iframe { -webkit-transform: rotateX(5deg); -moz-transform: rotateX(5deg); -o-transform: rotateX(5deg); -ms-transform: rotateX(5deg); transform: rotateX(5deg) ; opacity: 0.8; pointer-events: none; outline: 1px solid transparent }
.sidebar .link-right { color: white; text-decoration: none; border-bottom: 1px solid #666; text-transform: uppercase; float: right; margin-right: 7px; margin-top: 1px; }
.sidebar .label-right { float: right; margin-right: 7px; margin-top: 1px; float: right; }
.sidebar .link-right { color: white; text-decoration: none; border-bottom: 1px solid #666; text-transform: uppercase; }
.sidebar .link-right:hover { border-color: #CCC; }
.sidebar .link-right:active { background-color: #444 }
/* SIDEBAR */

View file

@ -584,9 +584,9 @@ window.initScrollable = function () {
this.log("Creating content");
this.container.addClass("loaded");
morphdom(this.tag.find(".content")[0], '<div class="content">' + res + '</div>');
return this.when_loaded.resolve();
this.when_loaded.resolve();
} else {
return morphdom(this.tag.find(".content")[0], '<div class="content">' + res + '</div>', {
morphdom(this.tag.find(".content")[0], '<div class="content">' + res + '</div>', {
onBeforeMorphEl: function(from_el, to_el) {
if (from_el.className === "globe" || from_el.className.indexOf("noupdate") >= 0) {
return false;
@ -596,6 +596,24 @@ window.initScrollable = function () {
}
});
}
this.tag.find("#privatekey-add").off("click, touchend").on("click touchend", (function(_this) {
return function(e) {
_this.wrapper.displayPrompt("Enter your private key:", "password", "Save", "", function(privatekey) {
return _this.wrapper.ws.cmd("userSetSitePrivatekey", [privatekey], function(res) {
return _this.wrapper.notifications.add("privatekey", "done", "Private key saved for site signing", 5000);
});
});
return false;
};
})(this));
return this.tag.find("#privatekey-forgot").off("click, touchend").on("click touchend", (function(_this) {
return function(e) {
_this.wrapper.ws.cmd("userSetSitePrivatekey", [""], function(res) {
return _this.wrapper.notifications.add("privatekey", "done", "Saved private key removed", 5000);
});
return false;
};
})(this));
};
Sidebar.prototype.animDrag = function(e) {