|
|
@ -215,7 +215,9 @@ define([
|
|
|
|
defaultTitle: defaultName
|
|
|
|
defaultTitle: defaultName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
obj.metadata.title = APP.title;
|
|
|
|
if (!initializing) {
|
|
|
|
|
|
|
|
obj.metadata.title = APP.title;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (textColor) {
|
|
|
|
if (textColor) {
|
|
|
|
obj.metadata.color = textColor;
|
|
|
|
obj.metadata.color = textColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -383,6 +385,7 @@ define([
|
|
|
|
var updateMetadata = function(shjson) {
|
|
|
|
var updateMetadata = function(shjson) {
|
|
|
|
// Extract the user list (metadata) from the hyperjson
|
|
|
|
// Extract the user list (metadata) from the hyperjson
|
|
|
|
var json = (shjson === "") ? "" : JSON.parse(shjson);
|
|
|
|
var json = (shjson === "") ? "" : JSON.parse(shjson);
|
|
|
|
|
|
|
|
var titleUpdated = false;
|
|
|
|
if (json && json.metadata) {
|
|
|
|
if (json && json.metadata) {
|
|
|
|
if (json.metadata.users) {
|
|
|
|
if (json.metadata.users) {
|
|
|
|
var userData = json.metadata.users;
|
|
|
|
var userData = json.metadata.users;
|
|
|
@ -393,10 +396,14 @@ define([
|
|
|
|
updateDefaultTitle(json.metadata.defaultTitle);
|
|
|
|
updateDefaultTitle(json.metadata.defaultTitle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (typeof json.metadata.title !== "undefined") {
|
|
|
|
if (typeof json.metadata.title !== "undefined") {
|
|
|
|
updateTitle(json.metadata.title);
|
|
|
|
updateTitle(json.metadata.title || defaultName);
|
|
|
|
|
|
|
|
titleUpdated = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateColors(json.metadata.color, json.metadata.backColor);
|
|
|
|
updateColors(json.metadata.color, json.metadata.backColor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!titleUpdated) {
|
|
|
|
|
|
|
|
updateTitle(defaultName);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var renameCb = function (err, title) {
|
|
|
|
var renameCb = function (err, title) {
|
|
|
@ -589,15 +596,6 @@ define([
|
|
|
|
if (!window.location.hash || window.location.hash === '#') {
|
|
|
|
if (!window.location.hash || window.location.hash === '#') {
|
|
|
|
Cryptpad.replaceHash(editHash);
|
|
|
|
Cryptpad.replaceHash(editHash);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Cryptpad.getPadTitle(function (err, title) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
|
|
|
console.log("Unable to get pad title");
|
|
|
|
|
|
|
|
console.error(err);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
updateTitle(title || defaultName);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var unnotify = module.unnotify = function () {
|
|
|
|
var unnotify = module.unnotify = function () {
|
|
|
|