Merge pull request #822 from jitsi/removes-atarURL

Removes avatar url from UI.
This commit is contained in:
hristoterezov 2016-08-31 15:39:00 -05:00 committed by GitHub
commit 1a69fd8a49
6 changed files with 13 additions and 48 deletions

4
app.js
View File

@ -95,9 +95,9 @@ const APP = {
function setTokenData() { function setTokenData() {
let localUser = APP.tokenData.caller; let localUser = APP.tokenData.caller;
if(localUser) { if(localUser) {
APP.settings.setEmail((localUser.getEmail() || "").trim()); APP.settings.setEmail((localUser.getEmail() || "").trim(), true);
APP.settings.setAvatarUrl((localUser.getAvatarUrl() || "").trim()); APP.settings.setAvatarUrl((localUser.getAvatarUrl() || "").trim());
APP.settings.setDisplayName((localUser.getName() || "").trim()); APP.settings.setDisplayName((localUser.getName() || "").trim(), true);
} }
} }

View File

@ -316,23 +316,6 @@ function changeLocalEmail(email = '') {
sendData(commands.EMAIL, email); sendData(commands.EMAIL, email);
} }
/**
* Changes the local avatar url for the local user
* @param avatarUrl {string} the new avatar url
*/
function changeLocalAvatarUrl(avatarUrl = '') {
avatarUrl = avatarUrl.trim();
if (avatarUrl === APP.settings.getAvatarUrl()) {
return;
}
APP.settings.setAvatarUrl(avatarUrl);
APP.UI.setUserAvatarUrl(room.myUserId(), avatarUrl);
sendData(commands.AVATAR_URL, avatarUrl);
}
/** /**
* Changes the display name for the local user * Changes the display name for the local user
* @param nickname {string} the new display name * @param nickname {string} the new display name
@ -1269,8 +1252,6 @@ export default {
APP.UI.setUserEmail(from, data.value); APP.UI.setUserEmail(from, data.value);
}); });
APP.UI.addListener(UIEvents.AVATAR_URL_CHANGED, changeLocalAvatarUrl);
room.addCommandListener(this.commands.defaults.AVATAR_URL, room.addCommandListener(this.commands.defaults.AVATAR_URL,
(data, from) => { (data, from) => {
APP.UI.setUserAvatarUrl(from, data.value); APP.UI.setUserAvatarUrl(from, data.value);

View File

@ -119,8 +119,7 @@
"selectAudioOutput": "Select audio output", "selectAudioOutput": "Select audio output",
"followMe": "Enable follow me", "followMe": "Enable follow me",
"noDevice": "None", "noDevice": "None",
"noPermission": "Permission to use device is not granted", "noPermission": "Permission to use device is not granted"
"avatarUrl": "Avatar URL"
}, },
"videothumbnail": "videothumbnail":
{ {

View File

@ -82,11 +82,6 @@ export default {
emitter.emit(UIEvents.EMAIL_CHANGED, $('#setEmail').val()); emitter.emit(UIEvents.EMAIL_CHANGED, $('#setEmail').val());
} }
// AVATAR URL CHANGED
function updateAvatarUrl () {
emitter.emit(UIEvents.AVATAR_URL_CHANGED, $('#setAvatarUrl').val());
}
$('#setEmail') $('#setEmail')
.val(Settings.getEmail()) .val(Settings.getEmail())
.keyup(function (event) { .keyup(function (event) {
@ -95,15 +90,6 @@ export default {
} }
}).focusout(updateEmail); }).focusout(updateEmail);
$('#setAvatarUrl')
.val(Settings.getAvatarUrl())
.keyup(function (event) {
if (event.keyCode === 13) { // enter
updateAvatarUrl();
}
}).focusout(updateAvatarUrl);
// START MUTED // START MUTED
$("#startMutedOptions").change(function () { $("#startMutedOptions").change(function () {
let startAudioMuted = $("#startAudioMuted").is(":checked"); let startAudioMuted = $("#startAudioMuted").is(":checked");

View File

@ -35,7 +35,6 @@ if (supportsLocalStorage()) {
} }
email = UIUtil.unescapeHtml(window.localStorage.email || ''); email = UIUtil.unescapeHtml(window.localStorage.email || '');
avatarUrl = UIUtil.unescapeHtml(window.localStorage.avatarUrl || '');
localFlipX = JSON.parse(window.localStorage.localFlipX || true); localFlipX = JSON.parse(window.localStorage.localFlipX || true);
displayName = UIUtil.unescapeHtml(window.localStorage.displayname || ''); displayName = UIUtil.unescapeHtml(window.localStorage.displayname || '');
language = window.localStorage.language; language = window.localStorage.language;
@ -69,9 +68,12 @@ export default {
* Sets the local user display name and saves it to local storage * Sets the local user display name and saves it to local storage
* *
* @param {string} newDisplayName unescaped display name for the local user * @param {string} newDisplayName unescaped display name for the local user
* @param {boolean} disableLocalStore disables local store the display name
*/ */
setDisplayName (newDisplayName) { setDisplayName (newDisplayName, disableLocalStore) {
displayName = newDisplayName; displayName = newDisplayName;
if (!disableLocalStore)
window.localStorage.displayname = UIUtil.escapeHtml(displayName); window.localStorage.displayname = UIUtil.escapeHtml(displayName);
}, },
@ -86,9 +88,12 @@ export default {
/** /**
* Sets new email for local user and saves it to the local storage. * Sets new email for local user and saves it to the local storage.
* @param {string} newEmail new email for the local user * @param {string} newEmail new email for the local user
* @param {boolean} disableLocalStore disables local store the email
*/ */
setEmail: function (newEmail) { setEmail: function (newEmail, disableLocalStore) {
email = newEmail; email = newEmail;
if (!disableLocalStore)
window.localStorage.email = UIUtil.escapeHtml(newEmail); window.localStorage.email = UIUtil.escapeHtml(newEmail);
}, },
@ -106,7 +111,6 @@ export default {
*/ */
setAvatarUrl: function (newAvatarUrl) { setAvatarUrl: function (newAvatarUrl) {
avatarUrl = newAvatarUrl; avatarUrl = newAvatarUrl;
window.localStorage.avatarUrl = UIUtil.escapeHtml(newAvatarUrl);
}, },
/** /**
@ -117,7 +121,6 @@ export default {
return avatarUrl; return avatarUrl;
}, },
getLanguage () { getLanguage () {
return language; return language;
}, },

View File

@ -14,10 +14,6 @@ export default {
* Notifies that local user changed email. * Notifies that local user changed email.
*/ */
EMAIL_CHANGED: "UI.email_changed", EMAIL_CHANGED: "UI.email_changed",
/**
* Notifies that local user changed avatar url.
*/
AVATAR_URL_CHANGED: "UI.avatar_url_changed",
/** /**
* Notifies that "start muted" settings changed. * Notifies that "start muted" settings changed.
*/ */