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

pull/1/head
yflory 8 years ago
commit 91d46cdee4

@ -470,5 +470,19 @@ define(function () {
out.login_notRegistered = "¿No estás registrado?"; out.login_notRegistered = "¿No estás registrado?";
out.upload_mustLogin = "Tienes que estar conectado para subir archivos"; out.upload_mustLogin = "Tienes que estar conectado para subir archivos";
out.uploadButton = "Subir";
out.uploadButtonTitle = "Subir un archivo a la carpeta";
out.filePickerButton = "Incrustar un archivo";
out.filePicker_close = "Cerrar";
out.filePicker_description = "Elige un archivo de tu CryptDrive para incrustarlo o sube uno nuevo";
out.filePicker_filter = "Filtrar por nombre";
out.or = "o";
out.languageButton = "Lenguaje";
out.languageButtonTitle = "Elige el lenguaje para resaltado de sintaxis";
out.themeButton = "Tema";
out.themeButtonTitle = "Selecciona el tema de color para los editores de código y presentación";
out.canvas_opacityLabel = "Opacidad: {0}";
out.canvas_widthLabel = "Talla: {0}";
return out; return out;
}); });

@ -64,7 +64,12 @@ define([
$('button.login').click(); $('button.login').click();
}); });
var hashing = false;
$('button.login').click(function () { $('button.login').click(function () {
if (hashing) { return void console.log("hashing is already in progress"); }
hashing = true;
// setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up // setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up
window.setTimeout(function () { window.setTimeout(function () {
Cryptpad.addLoadingScreen(Messages.login_hashing); Cryptpad.addLoadingScreen(Messages.login_hashing);
@ -89,6 +94,7 @@ define([
Cryptpad.feedback('LOGIN', true); Cryptpad.feedback('LOGIN', true);
Cryptpad.whenRealtimeSyncs(result.realtime, function() { Cryptpad.whenRealtimeSyncs(result.realtime, function() {
Cryptpad.login(result.userHash, result.userName, function () { Cryptpad.login(result.userHash, result.userName, function () {
hashing = false;
if (sessionStorage.redirectTo) { if (sessionStorage.redirectTo) {
var h = sessionStorage.redirectTo; var h = sessionStorage.redirectTo;
var parser = document.createElement('a'); var parser = document.createElement('a');
@ -107,17 +113,23 @@ define([
switch (err) { switch (err) {
case 'NO_SUCH_USER': case 'NO_SUCH_USER':
Cryptpad.removeLoadingScreen(function () { Cryptpad.removeLoadingScreen(function () {
Cryptpad.alert(Messages.login_noSuchUser); Cryptpad.alert(Messages.login_noSuchUser, function () {
hashing = false;
});
}); });
break; break;
case 'INVAL_USER': case 'INVAL_USER':
Cryptpad.removeLoadingScreen(function () { Cryptpad.removeLoadingScreen(function () {
Cryptpad.alert(Messages.login_invalUser); Cryptpad.alert(Messages.login_invalUser, function () {
hashing = false;
});
}); });
break; break;
case 'INVAL_PASS': case 'INVAL_PASS':
Cryptpad.removeLoadingScreen(function () { Cryptpad.removeLoadingScreen(function () {
Cryptpad.alert(Messages.login_invalPass); Cryptpad.alert(Messages.login_invalPass, function () {
hashing = false;
});
}); });
break; break;
default: // UNHANDLED ERROR default: // UNHANDLED ERROR

@ -491,7 +491,7 @@ var ready = function (info, userid, readOnly) {
APP.$createRow = $('#create-option').click(function () { APP.$createRow = $('#create-option').click(function () {
Render.createRow(proxy, function (empty, id) { Render.createRow(proxy, function (empty, id) {
change(null, null, null, null, function() { change(null, null, null, null, function() {
$('.edit[data-rt-id="' + id + '"]').click(); handleSpan($('.edit[data-rt-id="' + id + '"]')[0]);
}); });
}); });
}); });
@ -499,7 +499,7 @@ var ready = function (info, userid, readOnly) {
APP.$createCol = $('#create-user').click(function () { APP.$createCol = $('#create-user').click(function () {
Render.createColumn(proxy, function (empty, id) { Render.createColumn(proxy, function (empty, id) {
change(null, null, null, null, function() { change(null, null, null, null, function() {
$('.lock[data-rt-id="' + id + '"]').click(); handleSpan($('.lock[data-rt-id="' + id + '"]')[0]);
}); });
}); });
}); });

@ -338,12 +338,12 @@ window.canvas = canvas;
}); });
$rightside.append($forget); $rightside.append($forget);
makeColorButton($rightside);
var editHash; var editHash;
if (!readOnly) { if (!readOnly) {
editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys); editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
makeColorButton($rightside);
} }
if (!readOnly) { Cryptpad.replaceHash(editHash); } if (!readOnly) { Cryptpad.replaceHash(editHash); }
}; };

Loading…
Cancel
Save