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

pull/1/head
yflory 8 years ago
commit b3e73b0f0b

@ -63,7 +63,7 @@ define([
tag: 'a',
attributes: {
'class': 'newdoc',
'href': '/' + el,
'href': '/' + el + '/',
'target': '_blank'
},
content: Messages['button_new' + el] // Pretty name of the language value
@ -86,7 +86,7 @@ define([
sessionStorage.login_pass = passwd;
sessionStorage.login_rmb = remember;
sessionStorage.login = 1;
document.location.href = '/user';
document.location.href = '/user/';
});
$('button.register').click(function (e) {
var username = $('#name').val();
@ -96,10 +96,10 @@ define([
sessionStorage.login_pass = passwd;
sessionStorage.login_rmb = remember;
sessionStorage.register = 1;
document.location.href = '/user';
document.location.href = '/user/';
});
$('button.nologin').click(function (e) {
document.location.href = '/drive';
document.location.href = '/drive/';
});
$('button.knowmore').click(function (e) {
e.preventDefault();

@ -82,6 +82,19 @@ define([
if (cb) { cb(); }
};
var eraseTempSessionValues = common.eraseTempSessionValues = function () {
// delete sessionStorage values that might have been left over
// from the main page's /user redirect
[
'login_user',
'login_pass',
'login_remember',
'register'
].forEach(function (k) {
delete sessionStorage[k];
});
};
var logout = common.logout = function (cb) {
[
userNameKey,
@ -97,6 +110,8 @@ define([
if (!localStorage[fileHashKey]) {
localStorage[fileHashKey] = common.createRandomHash();
}
eraseTempSessionValues();
if (cb) { cb(); }
};

Loading…
Cancel
Save