Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
@@ -581,6 +581,7 @@ define(function () {
|
|||||||
out.upload_mustLogin = "You must be logged in to upload files";
|
out.upload_mustLogin = "You must be logged in to upload files";
|
||||||
out.download_button = "Decrypt & Download";
|
out.download_button = "Decrypt & Download";
|
||||||
out.download_mt_button = "Download";
|
out.download_mt_button = "Download";
|
||||||
|
out.download_resourceNotAvailable = "The requested resource was not available...";
|
||||||
|
|
||||||
out.todo_title = "CryptTodo";
|
out.todo_title = "CryptTodo";
|
||||||
out.todo_newTodoNamePlaceholder = "Describe your task...";
|
out.todo_newTodoNamePlaceholder = "Describe your task...";
|
||||||
|
|||||||
@@ -21,6 +21,19 @@ define([
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RPC breaks if you don't support Number.MAX_SAFE_INTEGER
|
||||||
|
if (Number && !Number.MAX_SAFE_INTEGER) {
|
||||||
|
Number.MAX_SAFE_INTEGER = 9007199254740991;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof(window.Symbol) !== 'function') {
|
||||||
|
var idCounter = 0;
|
||||||
|
var Symbol = window.Symbol = function Symbol(key) {
|
||||||
|
return '__' + key + '_' + Math.floor(Math.random() * 1e9) + '_' + (++idCounter) + '__';
|
||||||
|
};
|
||||||
|
Symbol.iterator = Symbol('Symbol.iterator');
|
||||||
|
}
|
||||||
|
|
||||||
var failStore = function () {
|
var failStore = function () {
|
||||||
console.error(new Error('wut'));
|
console.error(new Error('wut'));
|
||||||
require(['jquery'], function ($) {
|
require(['jquery'], function ($) {
|
||||||
|
|||||||
@@ -18,6 +18,14 @@ define([
|
|||||||
Number.MAX_SAFE_INTEGER = 9007199254740991;
|
Number.MAX_SAFE_INTEGER = 9007199254740991;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof(window.Symbol) !== 'function') {
|
||||||
|
var idCounter = 0;
|
||||||
|
var Symbol = window.Symbol = function Symbol(key) {
|
||||||
|
return '__' + key + '_' + Math.floor(Math.random() * 1e9) + '_' + (++idCounter) + '__';
|
||||||
|
};
|
||||||
|
Symbol.iterator = Symbol('Symbol.iterator');
|
||||||
|
}
|
||||||
|
|
||||||
var mkFakeStore = function () {
|
var mkFakeStore = function () {
|
||||||
var fakeStorage = {
|
var fakeStorage = {
|
||||||
getItem: function (k) { return fakeStorage[k]; },
|
getItem: function (k) { return fakeStorage[k]; },
|
||||||
|
|||||||
@@ -91,7 +91,12 @@ define([
|
|||||||
var key = Nacl.util.decodeBase64(cryptKey);
|
var key = Nacl.util.decodeBase64(cryptKey);
|
||||||
|
|
||||||
FileCrypto.fetchDecryptedMetadata(src, key, function (e, metadata) {
|
FileCrypto.fetchDecryptedMetadata(src, key, function (e, metadata) {
|
||||||
if (e) { return void console.error(e); }
|
if (e) {
|
||||||
|
if (e === 'XHR_ERROR') {
|
||||||
|
return void UI.errorLoadingScreen(Messages.download_resourceNotAvailable);
|
||||||
|
}
|
||||||
|
return void console.error(e);
|
||||||
|
}
|
||||||
var title = document.title = metadata.name;
|
var title = document.title = metadata.name;
|
||||||
Title.updateTitle(title || Title.defaultTitle);
|
Title.updateTitle(title || Title.defaultTitle);
|
||||||
toolbar.addElement(['pageTitle'], {pageTitle: title});
|
toolbar.addElement(['pageTitle'], {pageTitle: title});
|
||||||
@@ -238,10 +243,9 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we're in upload mode
|
// we're in upload mode
|
||||||
|
|
||||||
if (!common.isLoggedIn()) {
|
if (!common.isLoggedIn()) {
|
||||||
|
UI.removeLoadingScreen();
|
||||||
return UI.alert(Messages.upload_mustLogin, function () {
|
return UI.alert(Messages.upload_mustLogin, function () {
|
||||||
UI.errorLoadingScreen(Messages.upload_mustLogin);
|
|
||||||
common.setLoginRedirect(function () {
|
common.setLoginRedirect(function () {
|
||||||
common.gotoURL('/login/');
|
common.gotoURL('/login/');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user