Secure share modal

This commit is contained in:
yflory
2019-05-29 19:00:20 +02:00
parent bfba5ff33b
commit fb0827107b
19 changed files with 405 additions and 77 deletions

View File

@@ -322,6 +322,8 @@ define([
var hashes = config.hashes;
var common = config.common;
if (!hashes) { return; }
// Share link tab
var link = h('div.cp-share-modal', [
h('label', Messages.share_linkAccess),
@@ -403,7 +405,10 @@ define([
},
keys: [[13, 'ctrl']]
}];
var frameLink = UI.dialog.customModal(link, {buttons: linkButtons});
var frameLink = UI.dialog.customModal(link, {
buttons: linkButtons,
onClose: config.onClose
});
// Embed tab
var getEmbedValue = function () {
@@ -464,7 +469,9 @@ define([
$(link).find('#cp-share-link-preview').val(getLinkValue(val));
});
common.getMetadataMgr().onChange(function () {
hashes = common.getMetadataMgr().getPrivateData().availableHashes;
// "hashes" is only available is the secure "share" app
hashes = common.getMetadataMgr().getPrivateData().hashes;
if (!hashes) { return; }
$(link).find('#cp-share-link-preview').val(getLinkValue());
});
return tabs;