Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 8 years ago
commit a50805545d

@ -407,7 +407,7 @@ var updateLimits = function (config, publicKey, cb) {
if (publicKey) { if (publicKey) {
var limit = limits[publicKey]; var limit = limits[publicKey];
l = limit && typeof limit.limit === "number" ? l = limit && typeof limit.limit === "number" ?
[limit.limit, limit.plan] : [defaultLimit, '']; [limit.limit, limit.plan, limit.note] : [defaultLimit, '', ''];
} }
cb(void 0, l); cb(void 0, l);
} catch (e) { } catch (e) {
@ -431,7 +431,7 @@ var getLimit = function (Env, publicKey, cb) {
Env.defaultStorageLimit: DEFAULT_LIMIT; Env.defaultStorageLimit: DEFAULT_LIMIT;
var toSend = limit && typeof(limit.limit) === "number"? var toSend = limit && typeof(limit.limit) === "number"?
[limit.limit, limit.plan] : [defaultLimit, '']; [limit.limit, limit.plan, limit.note] : [defaultLimit, '', ''];
cb(void 0, toSend); cb(void 0, toSend);
}; };

@ -112,6 +112,11 @@ define([
}; };
var fetchDecryptedMetadata = function (src, key, cb) { var fetchDecryptedMetadata = function (src, key, cb) {
if (typeof(src) !== 'string') {
return window.setTimeout(function () {
cb('NO_SOURCE');
});
}
fetchMetadata(src, function (e, buffer) { fetchMetadata(src, function (e, buffer) {
if (e) { return cb(e); } if (e) { return cb(e); }
cb(void 0, decryptMetadata(buffer, key)); cb(void 0, decryptMetadata(buffer, key));

@ -41,16 +41,9 @@ define([
}; };
var updateTitle = function (newTitle) { var updateTitle = function (newTitle) {
Cryptpad.renamePad(newTitle, function (err, data) { var title = document.title = newTitle;
if (err) { $bar.find('.' + Toolbar.constants.title).find('span.title').text(title);
console.log("Couldn't set pad title"); $bar.find('.' + Toolbar.constants.title).find('input').val(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);
});
}; };
var suggestName = function () { var suggestName = function () {

Loading…
Cancel
Save