Make the settings app available to anonymous users
parent
0224d6489b
commit
4f4075ed6e
|
@ -62,9 +62,9 @@ define(function () {
|
|||
|
||||
out.clickToEdit = 'Cliquer pour modifier';
|
||||
|
||||
out.forgetButton = 'OUBLIER';
|
||||
out.forgetButtonTitle = 'Enlever ce document de la liste en page d\'accueil';
|
||||
out.forgetPrompt = 'Cliquer sur OK supprimera l\'URL de ce document de la mémoire de votre navigateur (localStorage), êtes-vous sûr ?';
|
||||
out.forgetButton = 'SUPPRIMER';
|
||||
out.forgetButtonTitle = 'Déplacer ce pad vers la corbeille';
|
||||
out.forgetPrompt = 'Cliquer sur OK déplacera ce pad vers la corbeille de votre CryptDrive, êtes-vous sûr ?';
|
||||
out.movedToTrash = 'Ce document a été déplacé vers la corbeille.<br><a href="/drive/">Accéder à mon Drive</a>';
|
||||
|
||||
out.shareButton = 'Partager';
|
||||
|
@ -258,6 +258,8 @@ define(function () {
|
|||
out.settings_userFeedbackHint2 = "Le contenu de vos pads et les clés de déchiffrement ne seront jamais partagés avec le serveur.";
|
||||
out.settings_userFeedback = "Désactiver l'envoi de retours d'expérience";
|
||||
|
||||
out.settings_anonymous = "Vous n'êtes pas connectés. Ces préférences seront utilisées pour ce navigateur.";
|
||||
|
||||
// index.html
|
||||
|
||||
//about.html
|
||||
|
|
|
@ -1160,14 +1160,6 @@ define([
|
|||
content: $userAdminContent.html()
|
||||
});
|
||||
}
|
||||
// Add the change display name button if not in read only mode
|
||||
if (config.changeNameButtonCls && config.displayChangeName) { //readOnly !== 1) { TODO
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {'class': config.changeNameButtonCls},
|
||||
content: Messages.user_rename
|
||||
});
|
||||
}
|
||||
var parsed = parsePadUrl(window.location.href);
|
||||
if (parsed && (!parsed.type || parsed.type && parsed.type !== 'drive')) {
|
||||
options.push({
|
||||
|
@ -1179,15 +1171,23 @@ define([
|
|||
content: Messages.login_accessDrive
|
||||
});
|
||||
}
|
||||
// Add the change display name button if not in read only mode
|
||||
if (config.changeNameButtonCls && config.displayChangeName) { //readOnly !== 1) { TODO
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {'class': config.changeNameButtonCls},
|
||||
content: Messages.user_rename
|
||||
});
|
||||
}
|
||||
if (parsed && parsed.type && parsed.type !== 'settings') {
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {'class': 'settings'},
|
||||
content: Messages.settingsButton
|
||||
});
|
||||
}
|
||||
// Add login or logout button depending on the current status
|
||||
if (account) {
|
||||
if (parsed && parsed.type && parsed.type !== 'settings') {
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {'class': 'settings'},
|
||||
content: Messages.settingsButton
|
||||
});
|
||||
}
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {'class': 'logout'},
|
||||
|
|
|
@ -42,9 +42,13 @@ define([
|
|||
var $div = $('<div>', {'class': 'infoBlock'});
|
||||
|
||||
var accountName = obj.login_name;
|
||||
if (!accountName) { return; }
|
||||
var $label = $('<span>', {'class': 'label'}).text(Messages.user_accountName + ':');
|
||||
var $name = $('<span>').text(accountName);
|
||||
var $name = $('<span>').text(accountName || '');
|
||||
if (!accountName) {
|
||||
$label.text('');
|
||||
$name.text(Messages.settings_anonymous);
|
||||
}
|
||||
|
||||
$div.append($label).append($name);
|
||||
|
||||
return $div;
|
||||
|
@ -71,6 +75,7 @@ define([
|
|||
// When the display name is changed (enter or button clicked)
|
||||
var todo = function () {
|
||||
displayName = $input.val();
|
||||
if (displayName === obj[USERNAME_KEY]) { return; }
|
||||
obj[USERNAME_KEY] = displayName;
|
||||
$spinner.show();
|
||||
Cryptpad.whenRealtimeSyncs(store.info.realtime, function () {
|
||||
|
@ -233,7 +238,7 @@ define([
|
|||
APP.$container = $('#container');
|
||||
|
||||
Cryptpad.ready(function () {
|
||||
if (!Cryptpad.getUserHash()) { return redirectToMain(); }
|
||||
//if (!Cryptpad.getUserHash()) { return redirectToMain(); }
|
||||
|
||||
var storeObj = Cryptpad.getStore().getProxy && Cryptpad.getStore().getProxy().proxy
|
||||
? Cryptpad.getStore().getProxy() : undefined;
|
||||
|
@ -247,8 +252,9 @@ define([
|
|||
if (e.key !== Cryptpad.userHashKey) { return; }
|
||||
var o = e.oldValue;
|
||||
var n = e.newValue;
|
||||
window.location.reload();
|
||||
if (o && !n) { // disconnect
|
||||
redirectToMain();
|
||||
//redirectToMain();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue