|
|
@ -107,12 +107,28 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var currentTitle;
|
|
|
|
|
|
|
|
var currentTabTitle;
|
|
|
|
|
|
|
|
var setDocumentTitle = function () {
|
|
|
|
|
|
|
|
if (!currentTabTitle) {
|
|
|
|
|
|
|
|
document.title = currentTitle || 'CryptPad';
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var title = currentTabTitle.replace(/\{title\}/g, currentTitle || 'CryptPad');
|
|
|
|
|
|
|
|
document.title = title;
|
|
|
|
|
|
|
|
};
|
|
|
|
sframeChan.on('Q_SET_PAD_TITLE_IN_DRIVE', function (newTitle, cb) {
|
|
|
|
sframeChan.on('Q_SET_PAD_TITLE_IN_DRIVE', function (newTitle, cb) {
|
|
|
|
document.title = newTitle;
|
|
|
|
currentTitle = newTitle;
|
|
|
|
|
|
|
|
setDocumentTitle();
|
|
|
|
Cryptpad.renamePad(newTitle, undefined, function (err) {
|
|
|
|
Cryptpad.renamePad(newTitle, undefined, function (err) {
|
|
|
|
if (err) { cb('ERROR'); } else { cb(); }
|
|
|
|
if (err) { cb('ERROR'); } else { cb(); }
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
sframeChan.on('EV_SET_TAB_TITLE', function (newTabTitle) {
|
|
|
|
|
|
|
|
currentTabTitle = newTabTitle;
|
|
|
|
|
|
|
|
setDocumentTitle();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sframeChan.on('Q_SETTINGS_SET_DISPLAY_NAME', function (newName, cb) {
|
|
|
|
sframeChan.on('Q_SETTINGS_SET_DISPLAY_NAME', function (newName, cb) {
|
|
|
|
Cryptpad.setDisplayName(newName, function (err) {
|
|
|
|
Cryptpad.setDisplayName(newName, function (err) {
|
|
|
|