|
|
@ -272,23 +272,25 @@ define([
|
|
|
|
var parsed = Utils.Hash.parsePadUrl(window.location.href);
|
|
|
|
var parsed = Utils.Hash.parsePadUrl(window.location.href);
|
|
|
|
if (!parsed.type) { throw new Error(); }
|
|
|
|
if (!parsed.type) { throw new Error(); }
|
|
|
|
var defaultTitle = Utils.Hash.getDefaultName(parsed);
|
|
|
|
var defaultTitle = Utils.Hash.getDefaultName(parsed);
|
|
|
|
var edPublic;
|
|
|
|
var edPublic, isTemplate;
|
|
|
|
var forceCreationScreen = cfg.useCreationScreen &&
|
|
|
|
var forceCreationScreen = cfg.useCreationScreen &&
|
|
|
|
sessionStorage[Utils.Constants.displayPadCreationScreen];
|
|
|
|
sessionStorage[Utils.Constants.displayPadCreationScreen];
|
|
|
|
delete sessionStorage[Utils.Constants.displayPadCreationScreen];
|
|
|
|
delete sessionStorage[Utils.Constants.displayPadCreationScreen];
|
|
|
|
var updateMeta = function () {
|
|
|
|
var updateMeta = function () {
|
|
|
|
//console.log('EV_METADATA_UPDATE');
|
|
|
|
//console.log('EV_METADATA_UPDATE');
|
|
|
|
var metaObj, isTemplate;
|
|
|
|
var metaObj;
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
Cryptpad.getMetadata(waitFor(function (err, m) {
|
|
|
|
Cryptpad.getMetadata(waitFor(function (err, m) {
|
|
|
|
if (err) { console.log(err); }
|
|
|
|
if (err) { console.log(err); }
|
|
|
|
metaObj = m;
|
|
|
|
metaObj = m;
|
|
|
|
edPublic = metaObj.priv.edPublic; // needed to create an owned pad
|
|
|
|
edPublic = metaObj.priv.edPublic; // needed to create an owned pad
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
Cryptpad.isTemplate(window.location.href, waitFor(function (err, t) {
|
|
|
|
if (typeof(isTemplate) === "undefined") {
|
|
|
|
if (err) { console.log(err); }
|
|
|
|
Cryptpad.isTemplate(window.location.href, waitFor(function (err, t) {
|
|
|
|
isTemplate = t;
|
|
|
|
if (err) { console.log(err); }
|
|
|
|
}));
|
|
|
|
isTemplate = t;
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
}).nThen(function (/*waitFor*/) {
|
|
|
|
}).nThen(function (/*waitFor*/) {
|
|
|
|
metaObj.doc = {
|
|
|
|
metaObj.doc = {
|
|
|
|
defaultTitle: defaultTitle,
|
|
|
|
defaultTitle: defaultTitle,
|
|
|
@ -735,6 +737,7 @@ define([
|
|
|
|
var initShareModal = function (cfg) {
|
|
|
|
var initShareModal = function (cfg) {
|
|
|
|
cfg.hashes = hashes;
|
|
|
|
cfg.hashes = hashes;
|
|
|
|
cfg.password = password;
|
|
|
|
cfg.password = password;
|
|
|
|
|
|
|
|
cfg.isTemplate = isTemplate;
|
|
|
|
// cfg.hidden means pre-loading the filepicker while keeping it hidden.
|
|
|
|
// cfg.hidden means pre-loading the filepicker while keeping it hidden.
|
|
|
|
// if cfg.hidden is true and the iframe already exists, do nothing
|
|
|
|
// if cfg.hidden is true and the iframe already exists, do nothing
|
|
|
|
if (!ShareModal.$iframe) {
|
|
|
|
if (!ShareModal.$iframe) {
|
|
|
|