|
|
@ -27,6 +27,7 @@ define([
|
|
|
|
TextPatcher: TextPatcher,
|
|
|
|
TextPatcher: TextPatcher,
|
|
|
|
Slide: Slide,
|
|
|
|
Slide: Slide,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
var APP = window.APP;
|
|
|
|
|
|
|
|
|
|
|
|
Cryptpad.styleAlerts();
|
|
|
|
Cryptpad.styleAlerts();
|
|
|
|
|
|
|
|
|
|
|
@ -180,6 +181,11 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); };
|
|
|
|
var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var isDefaultTitle = function () {
|
|
|
|
|
|
|
|
var parsed = Cryptpad.parsePadUrl(window.location.href);
|
|
|
|
|
|
|
|
return Cryptpad.isDefaultName(parsed, APP.title);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var initializing = true;
|
|
|
|
var initializing = true;
|
|
|
|
|
|
|
|
|
|
|
|
var onLocal = config.onLocal = function () {
|
|
|
|
var onLocal = config.onLocal = function () {
|
|
|
@ -254,10 +260,6 @@ define([
|
|
|
|
return text.trim();
|
|
|
|
return text.trim();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var isDefaultTitle = function () {
|
|
|
|
|
|
|
|
var parsed = Cryptpad.parsePadUrl(window.location.href);
|
|
|
|
|
|
|
|
return Cryptpad.isDefaultName(parsed, APP.title);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
var suggestName = function () {
|
|
|
|
var suggestName = function () {
|
|
|
|
var parsed = Cryptpad.parsePadUrl(window.location.href);
|
|
|
|
var parsed = Cryptpad.parsePadUrl(window.location.href);
|
|
|
|
var name = Cryptpad.getDefaultName(parsed, []);
|
|
|
|
var name = Cryptpad.getDefaultName(parsed, []);
|
|
|
@ -348,15 +350,16 @@ define([
|
|
|
|
var $import = Cryptpad.createButton('import', true, {}, importText);
|
|
|
|
var $import = Cryptpad.createButton('import', true, {}, importText);
|
|
|
|
$rightside.append($import);
|
|
|
|
$rightside.append($import);
|
|
|
|
|
|
|
|
|
|
|
|
/* add a rename button */
|
|
|
|
/* add a rename button */
|
|
|
|
var renameCb = function (err, title) {
|
|
|
|
var renameCb = function (err, title) {
|
|
|
|
if (err) { return; }
|
|
|
|
if (err) { return; }
|
|
|
|
APP.title = title;
|
|
|
|
APP.title = title;
|
|
|
|
setTabTitle();
|
|
|
|
setTabTitle();
|
|
|
|
onLocal();
|
|
|
|
onLocal();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
|
|
|
|
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
|
|
|
|
$rightside.append($setTitle);
|
|
|
|
$rightside.append($setTitle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* add a forget button */
|
|
|
|
/* add a forget button */
|
|
|
|
var forgetCb = function (err, title) {
|
|
|
|
var forgetCb = function (err, title) {
|
|
|
@ -389,7 +392,7 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$rightside.append($leavePresent);
|
|
|
|
$rightside.append($leavePresent);
|
|
|
|
|
|
|
|
|
|
|
|
$language = $('<span>', {
|
|
|
|
var $language = $('<span>', {
|
|
|
|
'style': "margin-right: 10px;"
|
|
|
|
'style': "margin-right: 10px;"
|
|
|
|
}).text(Messages.type.slide + " (Markdown)");
|
|
|
|
}).text(Messages.type.slide + " (Markdown)");
|
|
|
|
$rightside.append($language);
|
|
|
|
$rightside.append($language);
|
|
|
|