From a6cf761172dcae7c654f3cb70e9d7489b4a8ce2d Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 May 2017 14:45:14 +0200 Subject: [PATCH 1/4] don't store media tag pages in the drive --- www/media/main.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/www/media/main.js b/www/media/main.js index 4b8f45ecf..bd1764f9c 100644 --- a/www/media/main.js +++ b/www/media/main.js @@ -41,16 +41,9 @@ define([ }; var updateTitle = function (newTitle) { - Cryptpad.renamePad(newTitle, function (err, data) { - if (err) { - console.log("Couldn't set pad title"); - console.error(err); - return; - } - document.title = newTitle; - $bar.find('.' + Toolbar.constants.title).find('span.title').text(data); - $bar.find('.' + Toolbar.constants.title).find('input').val(data); - }); + document.title = newTitle; + $bar.find('.' + Toolbar.constants.title).find('span.title').text(data); + $bar.find('.' + Toolbar.constants.title).find('input').val(data); }; var suggestName = function () { From 6dc3c62ba46fed98386368509d0ce071ebc118b3 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 May 2017 15:12:39 +0200 Subject: [PATCH 2/4] check for src before trying to ajax --- www/file/file-crypto.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/file/file-crypto.js b/www/file/file-crypto.js index 61e11ecdc..49ced7553 100644 --- a/www/file/file-crypto.js +++ b/www/file/file-crypto.js @@ -112,6 +112,11 @@ define([ }; var fetchDecryptedMetadata = function (src, key, cb) { + if (typeof(src) !== 'string') { + return window.setTimeout(function () { + cb('NO_SOURCE'); + }); + } fetchMetadata(src, function (e, buffer) { if (e) { return cb(e); } cb(void 0, decryptMetadata(buffer, key)); From ff8701b6ba753ea2647a0067b08b3804fa12ad91 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 May 2017 15:56:24 +0200 Subject: [PATCH 3/4] send note along with limit --- rpc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc.js b/rpc.js index 3442a4c96..489f8b725 100644 --- a/rpc.js +++ b/rpc.js @@ -407,7 +407,7 @@ var updateLimits = function (config, publicKey, cb) { if (publicKey) { var limit = limits[publicKey]; l = limit && typeof limit.limit === "number" ? - [limit.limit, limit.plan] : [defaultLimit, '']; + [limit.limit, limit.plan, limit.note] : [defaultLimit, '', '']; } cb(void 0, l); } catch (e) { @@ -431,7 +431,7 @@ var getLimit = function (Env, publicKey, cb) { Env.defaultStorageLimit: DEFAULT_LIMIT; var toSend = limit && typeof(limit.limit) === "number"? - [limit.limit, limit.plan] : [defaultLimit, '']; + [limit.limit, limit.plan, limit.note] : [defaultLimit, '', '']; cb(void 0, toSend); }; From 259d34b7c8128e5500e6a3c2fd04e68685ad4c32 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 May 2017 16:34:22 +0200 Subject: [PATCH 4/4] jshint compliance --- www/media/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/media/main.js b/www/media/main.js index bd1764f9c..81820f8c0 100644 --- a/www/media/main.js +++ b/www/media/main.js @@ -41,9 +41,9 @@ define([ }; var updateTitle = function (newTitle) { - document.title = newTitle; - $bar.find('.' + Toolbar.constants.title).find('span.title').text(data); - $bar.find('.' + Toolbar.constants.title).find('input').val(data); + var title = document.title = newTitle; + $bar.find('.' + Toolbar.constants.title).find('span.title').text(title); + $bar.find('.' + Toolbar.constants.title).find('input').val(title); }; var suggestName = function () {