Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
commit
ef155d8ccf
|
@ -54,6 +54,10 @@ define(function () {
|
|||
|
||||
out.comingSoon = "Bientôt disponible...";
|
||||
|
||||
out.newVersion = '<b>CryptPad a été mis à jour !</b><br>' +
|
||||
'Découvrez les nouveautés de la dernière version :<br>'+
|
||||
'<a href="https://github.com/xwiki-labs/cryptpad/releases/tag/{0}" target="_blank">Notes de version pour CryptPad {0}</a>';
|
||||
|
||||
out.upgrade = "Améliorer";
|
||||
out.upgradeTitle = "Améliorer votre compte pour augmenter la limite de stockage";
|
||||
out.MB = "Mo";
|
||||
|
|
|
@ -56,6 +56,10 @@ define(function () {
|
|||
|
||||
out.comingSoon = "Coming soon...";
|
||||
|
||||
out.newVersion = '<b>CryptPad has been updated!</b><br>' +
|
||||
'Check out what\'s new in the latest version:<br>'+
|
||||
'<a href="https://github.com/xwiki-labs/cryptpad/releases/tag/{0}" target="_blank">Release notes for CryptPad {0}</a>';
|
||||
|
||||
out.upgrade = "Upgrade";
|
||||
out.upgradeTitle = "Upgrade your account to increase the storage limit";
|
||||
out.MB = "MB";
|
||||
|
|
|
@ -23,7 +23,6 @@ define([
|
|||
|
||||
Additionally, there is some basic functionality for import/export.
|
||||
*/
|
||||
|
||||
var common = window.Cryptpad = {
|
||||
Messages: Messages,
|
||||
Clipboard: Clipboard
|
||||
|
@ -1296,6 +1295,25 @@ define([
|
|||
return $userAdmin;
|
||||
};
|
||||
|
||||
var CRYPTPAD_VERSION = 'cryptpad-version';
|
||||
var updateLocalVersion = function () {
|
||||
// Check for CryptPad updates
|
||||
var urlArgs = Config.requireConf ? Config.requireConf.urlArgs : null;
|
||||
if (!urlArgs) { return; }
|
||||
var arr = /ver=([0-9.]+)(-[0-9]*)?/.exec(urlArgs);
|
||||
var ver = arr[1];
|
||||
if (!ver) { return; }
|
||||
var verArr = ver.split('.');
|
||||
if (verArr.length !== 3) { return; }
|
||||
var stored = localStorage[CRYPTPAD_VERSION] || '0.0.0';
|
||||
var storedArr = stored.split('.');
|
||||
var shouldUpdate = parseInt(verArr[0]) > parseInt(storedArr[0]) ||
|
||||
(parseInt(verArr[0]) === parseInt(storedArr[0]) &&
|
||||
parseInt(verArr[1]) > parseInt(storedArr[1]));
|
||||
if (!shouldUpdate) { return; }
|
||||
common.alert(Messages._getKey('newVersion', [ver]), null, true);
|
||||
localStorage[CRYPTPAD_VERSION] = ver;
|
||||
};
|
||||
|
||||
common.ready = (function () {
|
||||
var env = {};
|
||||
|
@ -1313,6 +1331,9 @@ define([
|
|||
block--;
|
||||
if (!block) {
|
||||
initialized = true;
|
||||
|
||||
updateLocalVersion();
|
||||
|
||||
f(void 0, env);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue