Move the file upload code in a separate file

This commit is contained in:
yflory
2017-06-13 11:21:26 +02:00
parent a58162a617
commit 803bad1421
8 changed files with 299 additions and 60 deletions

View File

@@ -43,11 +43,12 @@ define(function () {
onLocal();
};
exp.updateTitle = function (newTitle) {
// update title: href is optional; if not specified, we use window.location.href
exp.updateTitle = function (newTitle, href) {
if (newTitle === exp.title) { return; }
// Change the title now, and set it back to the old value if there is an error
var oldTitle = exp.title;
Cryptpad.renamePad(newTitle, function (err, data) {
Cryptpad.renamePad(newTitle, href, function (err, data) {
if (err) {
console.log("Couldn't set pad title");
console.error(err);