Add passwod prompt to access protected pads

This commit is contained in:
yflory
2018-04-25 19:03:58 +02:00
parent 811463b870
commit 1879c1829c
17 changed files with 281 additions and 69 deletions

View File

@@ -198,6 +198,7 @@ define([
ctx.sframeChan.query("Q_CREATE_PAD", {
owned: cfg.owned,
expire: cfg.expire,
password: cfg.password,
template: cfg.template,
templateId: cfg.templateId
}, cb);
@@ -379,6 +380,7 @@ define([
Object.freeze(funcs);
return { create: function (cb) {
console.log('create');
if (window.CryptPad_sframe_common) {
throw new Error("Sframe-common should only be created once");
}
@@ -429,6 +431,14 @@ define([
UI.log(data.logText);
});
ctx.sframeChan.on("EV_PAD_PASSWORD", function (data) {
UIElements.displayPasswordPrompt(funcs);
/*UI.prompt("Password?", "", function (val) {
ctx.sframeChan.event("EV_PAD_PASSWORD_VALUE", val);
});
$('div.alertify').last().css("z-index", Number.MAX_SAFE_INTEGER);*/
});
ctx.metadataMgr.onReady(waitFor());
}).nThen(function () {
try {