Merge branch 'staging' into newDrive
This commit is contained in:
commit
a5cb5f2ceb
@ -13,8 +13,6 @@ define(function () {
|
|||||||
out.type.slide = 'Presentación';
|
out.type.slide = 'Presentación';
|
||||||
out.type.whiteboard = 'Pizarra';
|
out.type.whiteboard = 'Pizarra';
|
||||||
|
|
||||||
out.common_connectionLost = "<b>Connexión perdida</b><br>El documento está ahora en modo solo lectura hasta que la conexión vuelva.";
|
|
||||||
|
|
||||||
out.disconnected = "Desconectado";
|
out.disconnected = "Desconectado";
|
||||||
out.synchronizing = "Sincronización";
|
out.synchronizing = "Sincronización";
|
||||||
out.reconnecting = "Reconectando...";
|
out.reconnecting = "Reconectando...";
|
||||||
@ -429,15 +427,12 @@ define(function () {
|
|||||||
out.upload_success = "Tu archivo ({0}) ha sido subido con éxito y fue añadido a tu drive.";
|
out.upload_success = "Tu archivo ({0}) ha sido subido con éxito y fue añadido a tu drive.";
|
||||||
|
|
||||||
// 1.7.0 - Hodag
|
// 1.7.0 - Hodag
|
||||||
out.comingSoon = "Próximamente..."; // "Coming soon..."
|
out.comingSoon = "Próximamente...";
|
||||||
out.newVersion = ["<b>CryptPad ha sido actualizado!</b>",
|
out.newVersion = ["<b>CryptPad ha sido actualizado!</b>",
|
||||||
"Puedes ver lo que ha cambiada aquí (en inglés):",
|
"Puedes ver lo que ha cambiado aquí (en inglés):",
|
||||||
"<a href=\"https://github.com/xwiki-labs/cryptpad/releases/tag/{0}\" target=\"_blank\">Notas de versión para CryptPad {0}</a>"].join("<br>");
|
"<a href=\"https://github.com/xwiki-labs/cryptpad/releases/tag/{0}\" target=\"_blank\">Notas de versión para CryptPad {0}</a>"].join("<br>");
|
||||||
out.pinLimitReachedAlert = ["Has llegado a tu limite de espacio. Nuevos pads no serán guardados en tu CryptDrive.",
|
|
||||||
"Puedes eliminar pads de tu CryptDrive o <a href=\"https://accounts.cryptpad.fr/#!on={0}\" target=\"_blank\">suscribirte a una oferta premium</a> para obtener más espacio."].join("<br>");
|
|
||||||
out.pinLimitReachedAlertNoAccounts = "Has llegado a tu limite de espacio";
|
out.pinLimitReachedAlertNoAccounts = "Has llegado a tu limite de espacio";
|
||||||
out.previewButtonTitle = "Mostrar/esconder la vista previa Markdown";
|
out.previewButtonTitle = "Mostrar/esconder la vista previa Markdown";
|
||||||
out.fm_info_trash = "Vacía tu papelera para liberar espaci en tu CryptDrive.";
|
|
||||||
out.fm_info_anonymous = "No estás conectado, así que estos pads pueden ser borrados (<a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">¿por qué?</a>). <a href=\"/register/\">Registrate</a> o <a href=\"/login/\">Inicia sesión</a> para asegurarlos.";
|
out.fm_info_anonymous = "No estás conectado, así que estos pads pueden ser borrados (<a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">¿por qué?</a>). <a href=\"/register/\">Registrate</a> o <a href=\"/login/\">Inicia sesión</a> para asegurarlos.";
|
||||||
out.fm_alert_anonymous = "Hola, estás usando CryptPad anónimamente. Está bien, pero tus pads pueden ser borrados después de un périodo de inactividad. Hemos desactivado funciones avanzadas de CryptDrive para usuarios anónimos porque queremos ser claros que no es un lugar seguro para almacenar cosas. Puedes <a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">leer este articulo</a> (en inglés) sobre por qué hacemos esto y por qué deberías <a href=\"/register/\">Registrarte</a> e <a href=\"/login/\">Iniciar sesión</a>.";
|
out.fm_alert_anonymous = "Hola, estás usando CryptPad anónimamente. Está bien, pero tus pads pueden ser borrados después de un périodo de inactividad. Hemos desactivado funciones avanzadas de CryptDrive para usuarios anónimos porque queremos ser claros que no es un lugar seguro para almacenar cosas. Puedes <a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">leer este articulo</a> (en inglés) sobre por qué hacemos esto y por qué deberías <a href=\"/register/\">Registrarte</a> e <a href=\"/login/\">Iniciar sesión</a>.";
|
||||||
out.fm_error_cantPin = "Error del servidor. Por favor, recarga la página e intentalo de nuevo.";
|
out.fm_error_cantPin = "Error del servidor. Por favor, recarga la página e intentalo de nuevo.";
|
||||||
@ -457,5 +452,20 @@ define(function () {
|
|||||||
out.poll_locked = "Cerrado";
|
out.poll_locked = "Cerrado";
|
||||||
out.poll_unlocked = "Abierto";
|
out.poll_unlocked = "Abierto";
|
||||||
|
|
||||||
|
// 1.8.0 - Idopogo
|
||||||
|
|
||||||
|
out.common_connectionLost = "<b>Connexión perdida</b><br>El documento está ahora en modo solo lectura hasta que la conexión vuelva.";
|
||||||
|
out.updated_0_common_connectionLost = out.common_connectionLost;
|
||||||
|
out.supportCryptpad = "Ayudar a CryptPad";
|
||||||
|
out.pinLimitReachedAlert = ["Has llegado a tu limite de espacio. Nuevos pads no serán guardados en tu CryptDrive.",
|
||||||
|
"Puedes eliminar pads de tu CryptDrive o <a href=\"https://accounts.cryptpad.fr/#!on={0}\" target=\"_blank\">suscribirte a una oferta premium</a> para obtener más espacio."].join("<br>");
|
||||||
|
out.updated_0_pinLimitReachedAlert = out.pinLimitReachedAlert;
|
||||||
|
out.fm_info_trash = "Vacía tu papelera para liberar espaci en tu CryptDrive.";
|
||||||
|
out.updated_0_fm_info_trash = out.fm_info_trash;
|
||||||
|
|
||||||
|
out.fs_migration = "Tu CryptDrive fue actualizado a una nueva versión.<br><strong>Por favor, recarga la página.</strong>";
|
||||||
|
out.login_notRegistered = "¿No estás registrado?";
|
||||||
|
out.upload_mustLogin = "Tienes que estar conectado para subir archivos";
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -30,7 +30,9 @@ define([
|
|||||||
Clipboard: Clipboard,
|
Clipboard: Clipboard,
|
||||||
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
|
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
|
||||||
upgradeURL: 'https://accounts.cryptpad.fr/#/?on=' + origin,
|
upgradeURL: 'https://accounts.cryptpad.fr/#/?on=' + origin,
|
||||||
account: {},
|
account: {
|
||||||
|
usage: 0,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// constants
|
// constants
|
||||||
@ -721,7 +723,11 @@ define([
|
|||||||
|
|
||||||
common.getPinnedUsage = function (cb) {
|
common.getPinnedUsage = function (cb) {
|
||||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||||
rpc.getFileListSize(cb);
|
|
||||||
|
rpc.getFileListSize(function (err, bytes) {
|
||||||
|
common.account.usage = typeof(bytes) === 'number'? bytes: 0;
|
||||||
|
cb(err, bytes);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
common.getFileSize = function (href, cb) {
|
common.getFileSize = function (href, cb) {
|
||||||
@ -736,6 +742,9 @@ define([
|
|||||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||||
rpc.updatePinLimits(function (e, limit, plan, note) {
|
rpc.updatePinLimits(function (e, limit, plan, note) {
|
||||||
if (e) { return cb(e); }
|
if (e) { return cb(e); }
|
||||||
|
common.account.limit = limit;
|
||||||
|
common.account.plan = plan;
|
||||||
|
common.account.note = note;
|
||||||
cb(e, limit, plan, note);
|
cb(e, limit, plan, note);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -744,6 +753,9 @@ define([
|
|||||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||||
rpc.getLimit(function (e, limit, plan, note) {
|
rpc.getLimit(function (e, limit, plan, note) {
|
||||||
if (e) { return cb(e); }
|
if (e) { return cb(e); }
|
||||||
|
common.account.limit = limit;
|
||||||
|
common.account.plan = plan;
|
||||||
|
common.account.note = note;
|
||||||
cb(void 0, limit, plan, note);
|
cb(void 0, limit, plan, note);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -760,8 +772,8 @@ define([
|
|||||||
return void cb (null, false, data);
|
return void cb (null, false, data);
|
||||||
};
|
};
|
||||||
var todo = function (e, used) {
|
var todo = function (e, used) {
|
||||||
usage = used; //common.bytesToMegabytes(used);
|
|
||||||
if (e) { return void cb(e); }
|
if (e) { return void cb(e); }
|
||||||
|
usage = used;
|
||||||
common.getPinLimit(andThen);
|
common.getPinLimit(andThen);
|
||||||
};
|
};
|
||||||
common.getPinnedUsage(todo);
|
common.getPinnedUsage(todo);
|
||||||
@ -783,41 +795,63 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var LIMIT_REFRESH_RATE = 30000; // milliseconds
|
var LIMIT_REFRESH_RATE = 30000; // milliseconds
|
||||||
common.createUsageBar = function (cb, alwaysDisplayUpgrade) {
|
common.createUsageBar = function (cb) {
|
||||||
var todo = function (err, state, data) {
|
// getPinnedUsage updates common.account.usage, and other values
|
||||||
|
// so we can just use those and only check for errors
|
||||||
|
var todo = function (err) {
|
||||||
var $container = $('<span>', {'class':'limit-container'});
|
var $container = $('<span>', {'class':'limit-container'});
|
||||||
if (!data) {
|
if (err) {
|
||||||
return void window.setTimeout(function () {
|
return void window.setTimeout(function () {
|
||||||
common.isOverPinLimit(todo);
|
common.getPinnedUsage(todo);
|
||||||
}, LIMIT_REFRESH_RATE);
|
}, LIMIT_REFRESH_RATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
var unit = Util.magnitudeOfBytes(data.limit);
|
var unit = Util.magnitudeOfBytes(common.account.limit);
|
||||||
|
|
||||||
var usage = unit === 'GB'? Util.bytesToGigabytes(data.usage):
|
var usage = unit === 'GB'? Util.bytesToGigabytes(common.account.usage):
|
||||||
Util.bytesToMegabytes(data.usage);
|
Util.bytesToMegabytes(common.account.usage);
|
||||||
var limit = unit === 'GB'? Util.bytesToGigabytes(data.limit):
|
var limit = unit === 'GB'? Util.bytesToGigabytes(common.account.limit):
|
||||||
Util.bytesToMegabytes(data.limit);
|
Util.bytesToMegabytes(common.account.limit);
|
||||||
|
|
||||||
var $limit = $('<span>', {'class': 'cryptpad-limit-bar'}).appendTo($container);
|
var $limit = $('<span>', {'class': 'cryptpad-limit-bar'}).appendTo($container);
|
||||||
var quota = usage/limit;
|
var quota = usage/limit;
|
||||||
var width = Math.floor(Math.min(quota, 1)*200); // the bar is 200px width
|
var width = Math.floor(Math.min(quota, 1)*200); // the bar is 200px width
|
||||||
var $usage = $('<span>', {'class': 'usage'}).css('width', width+'px');
|
var $usage = $('<span>', {'class': 'usage'}).css('width', width+'px');
|
||||||
|
|
||||||
if (Config.noSubscriptionButton !== true &&
|
var makeDonateButton = function () {
|
||||||
(quota >= 0.8 || alwaysDisplayUpgrade) &&
|
|
||||||
data.plan !== "power")
|
|
||||||
{
|
|
||||||
// TODO show donate url if applicable
|
|
||||||
var $upgradeLink = $('<a>', {
|
var $upgradeLink = $('<a>', {
|
||||||
href: common.upgradeLink,
|
href: common.donateURL,
|
||||||
|
rel: "noreferrer noopener",
|
||||||
|
target: "_blank",
|
||||||
|
}).appendTo($container);
|
||||||
|
$('<button>', {
|
||||||
|
'class': 'upgrade buttonSuccess',
|
||||||
|
}).text(Messages.supportCryptpad).appendTo($upgradeLink);
|
||||||
|
};
|
||||||
|
|
||||||
|
var makeUpgradeButton = function () {
|
||||||
|
var $upgradeLink = $('<a>', {
|
||||||
|
href: common.upgradeURL,
|
||||||
rel: "noreferrer noopener",
|
rel: "noreferrer noopener",
|
||||||
target: "_blank",
|
target: "_blank",
|
||||||
}).appendTo($container);
|
}).appendTo($container);
|
||||||
$('<button>', {
|
$('<button>', {
|
||||||
'class': 'upgrade buttonSuccess',
|
'class': 'upgrade buttonSuccess',
|
||||||
title: Messages.upgradeTitle
|
title: Messages.upgradeTitle
|
||||||
}).text(Messages.upgrade).appendTo($upgradeLink);
|
}).text(Messages.upgradeAccount).appendTo($upgradeLink);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!Config.removeDonateButton) {
|
||||||
|
if (!common.isLoggedIn() || !Config.allowSubscriptions) {
|
||||||
|
// user is not logged in, or subscriptions are disallowed
|
||||||
|
makeDonateButton();
|
||||||
|
} else if (!common.account.plan) {
|
||||||
|
// user is logged in and subscriptions are allowed
|
||||||
|
// and they don't have one. show upgrades
|
||||||
|
makeUpgradeButton();
|
||||||
|
} else {
|
||||||
|
// they have a plan. show nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var prettyUsage;
|
var prettyUsage;
|
||||||
@ -838,11 +872,11 @@ define([
|
|||||||
$text.text(usage + ' / ' + prettyLimit);
|
$text.text(usage + ' / ' + prettyLimit);
|
||||||
$limit.append($usage).append($text);
|
$limit.append($usage).append($text);
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
common.isOverPinLimit(todo);
|
common.getPinnedUsage(todo);
|
||||||
}, LIMIT_REFRESH_RATE);
|
}, LIMIT_REFRESH_RATE);
|
||||||
cb(err, $container);
|
cb(err, $container);
|
||||||
};
|
};
|
||||||
common.isOverPinLimit(todo);
|
common.getPinnedUsage(todo);
|
||||||
};
|
};
|
||||||
|
|
||||||
common.createButton = function (type, rightside, data, callback) {
|
common.createButton = function (type, rightside, data, callback) {
|
||||||
|
|||||||
@ -120,7 +120,7 @@ define([
|
|||||||
exp.getFileListSize = function (cb) {
|
exp.getFileListSize = function (cb) {
|
||||||
rpc.send('GET_TOTAL_SIZE', undefined, function (e, response) {
|
rpc.send('GET_TOTAL_SIZE', undefined, function (e, response) {
|
||||||
if (e) { return void cb(e); }
|
if (e) { return void cb(e); }
|
||||||
if (response && response.length) {
|
if (response && response.length && typeof(response[0]) === 'number') {
|
||||||
cb(void 0, response[0]);
|
cb(void 0, response[0]);
|
||||||
} else {
|
} else {
|
||||||
cb('INVALID_RESPONSE');
|
cb('INVALID_RESPONSE');
|
||||||
|
|||||||
@ -94,7 +94,7 @@ types of messages:
|
|||||||
delete ctx.pending[txid];
|
delete ctx.pending[txid];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("received message for txid with no callback");
|
console.error("received message for txid with no callback");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -626,7 +626,13 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Cryptpad.isOverPinLimit(todo);
|
var limit = Cryptpad.account.limit;
|
||||||
|
var usage = Cryptpad.account.usage;
|
||||||
|
if (typeof(limit) !== 'number' || typeof(usage) !== 'number') {
|
||||||
|
todo("invalid types");
|
||||||
|
} else if (Cryptpad.isLoggedIn() && usage >= limit) {
|
||||||
|
todo(void 0, true);
|
||||||
|
} else { todo(void 0, false); }
|
||||||
return $limit;
|
return $limit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2687,7 +2687,7 @@ define([
|
|||||||
if (err) { return void logError(err); }
|
if (err) { return void logError(err); }
|
||||||
$leftside.html('');
|
$leftside.html('');
|
||||||
$leftside.append($limitContainer);
|
$leftside.append($limitContainer);
|
||||||
}, true);
|
});
|
||||||
|
|
||||||
/* add a history button */
|
/* add a history button */
|
||||||
var histConfig = {
|
var histConfig = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user