Make the settings app available to anonymous users
This commit is contained in:
@@ -62,9 +62,9 @@ define(function () {
|
|||||||
|
|
||||||
out.clickToEdit = 'Cliquer pour modifier';
|
out.clickToEdit = 'Cliquer pour modifier';
|
||||||
|
|
||||||
out.forgetButton = 'OUBLIER';
|
out.forgetButton = 'SUPPRIMER';
|
||||||
out.forgetButtonTitle = 'Enlever ce document de la liste en page d\'accueil';
|
out.forgetButtonTitle = 'Déplacer ce pad vers la corbeille';
|
||||||
out.forgetPrompt = 'Cliquer sur OK supprimera l\'URL de ce document de la mémoire de votre navigateur (localStorage), êtes-vous sûr ?';
|
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.movedToTrash = 'Ce document a été déplacé vers la corbeille.<br><a href="/drive/">Accéder à mon Drive</a>';
|
||||||
|
|
||||||
out.shareButton = 'Partager';
|
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_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_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
|
// index.html
|
||||||
|
|
||||||
//about.html
|
//about.html
|
||||||
|
|||||||
@@ -1160,14 +1160,6 @@ define([
|
|||||||
content: $userAdminContent.html()
|
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);
|
var parsed = parsePadUrl(window.location.href);
|
||||||
if (parsed && (!parsed.type || parsed.type && parsed.type !== 'drive')) {
|
if (parsed && (!parsed.type || parsed.type && parsed.type !== 'drive')) {
|
||||||
options.push({
|
options.push({
|
||||||
@@ -1179,8 +1171,14 @@ define([
|
|||||||
content: Messages.login_accessDrive
|
content: Messages.login_accessDrive
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Add login or logout button depending on the current status
|
// Add the change display name button if not in read only mode
|
||||||
if (account) {
|
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') {
|
if (parsed && parsed.type && parsed.type !== 'settings') {
|
||||||
options.push({
|
options.push({
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
@@ -1188,6 +1186,8 @@ define([
|
|||||||
content: Messages.settingsButton
|
content: Messages.settingsButton
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Add login or logout button depending on the current status
|
||||||
|
if (account) {
|
||||||
options.push({
|
options.push({
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
attributes: {'class': 'logout'},
|
attributes: {'class': 'logout'},
|
||||||
|
|||||||
@@ -42,9 +42,13 @@ define([
|
|||||||
var $div = $('<div>', {'class': 'infoBlock'});
|
var $div = $('<div>', {'class': 'infoBlock'});
|
||||||
|
|
||||||
var accountName = obj.login_name;
|
var accountName = obj.login_name;
|
||||||
if (!accountName) { return; }
|
|
||||||
var $label = $('<span>', {'class': 'label'}).text(Messages.user_accountName + ':');
|
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);
|
$div.append($label).append($name);
|
||||||
|
|
||||||
return $div;
|
return $div;
|
||||||
@@ -71,6 +75,7 @@ define([
|
|||||||
// When the display name is changed (enter or button clicked)
|
// When the display name is changed (enter or button clicked)
|
||||||
var todo = function () {
|
var todo = function () {
|
||||||
displayName = $input.val();
|
displayName = $input.val();
|
||||||
|
if (displayName === obj[USERNAME_KEY]) { return; }
|
||||||
obj[USERNAME_KEY] = displayName;
|
obj[USERNAME_KEY] = displayName;
|
||||||
$spinner.show();
|
$spinner.show();
|
||||||
Cryptpad.whenRealtimeSyncs(store.info.realtime, function () {
|
Cryptpad.whenRealtimeSyncs(store.info.realtime, function () {
|
||||||
@@ -233,7 +238,7 @@ define([
|
|||||||
APP.$container = $('#container');
|
APP.$container = $('#container');
|
||||||
|
|
||||||
Cryptpad.ready(function () {
|
Cryptpad.ready(function () {
|
||||||
if (!Cryptpad.getUserHash()) { return redirectToMain(); }
|
//if (!Cryptpad.getUserHash()) { return redirectToMain(); }
|
||||||
|
|
||||||
var storeObj = Cryptpad.getStore().getProxy && Cryptpad.getStore().getProxy().proxy
|
var storeObj = Cryptpad.getStore().getProxy && Cryptpad.getStore().getProxy().proxy
|
||||||
? Cryptpad.getStore().getProxy() : undefined;
|
? Cryptpad.getStore().getProxy() : undefined;
|
||||||
@@ -247,8 +252,9 @@ define([
|
|||||||
if (e.key !== Cryptpad.userHashKey) { return; }
|
if (e.key !== Cryptpad.userHashKey) { return; }
|
||||||
var o = e.oldValue;
|
var o = e.oldValue;
|
||||||
var n = e.newValue;
|
var n = e.newValue;
|
||||||
|
window.location.reload();
|
||||||
if (o && !n) { // disconnect
|
if (o && !n) { // disconnect
|
||||||
redirectToMain();
|
//redirectToMain();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user