|
|
@ -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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|