From 0e27f471f13b0344babb22c78fb12ccbbf6384d7 Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 30 Aug 2016 14:09:07 -0500 Subject: [PATCH] Removes avatarURL from settings UI. Removes storing avatarURL in localstorage and retrieving it. --- conference.js | 19 ------------------- lang/main.json | 3 +-- .../UI/side_pannels/settings/SettingsMenu.js | 14 -------------- modules/settings/Settings.js | 3 --- service/UI/UIEvents.js | 4 ---- 5 files changed, 1 insertion(+), 42 deletions(-) diff --git a/conference.js b/conference.js index a7c7693fe..0e3a50d16 100644 --- a/conference.js +++ b/conference.js @@ -316,23 +316,6 @@ function changeLocalEmail(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 * @param nickname {string} the new display name @@ -1269,8 +1252,6 @@ export default { APP.UI.setUserEmail(from, data.value); }); - APP.UI.addListener(UIEvents.AVATAR_URL_CHANGED, changeLocalAvatarUrl); - room.addCommandListener(this.commands.defaults.AVATAR_URL, (data, from) => { APP.UI.setUserAvatarUrl(from, data.value); diff --git a/lang/main.json b/lang/main.json index 4ba9329d3..3eadf80cf 100644 --- a/lang/main.json +++ b/lang/main.json @@ -119,8 +119,7 @@ "selectAudioOutput": "Select audio output", "followMe": "Enable follow me", "noDevice": "None", - "noPermission": "Permission to use device is not granted", - "avatarUrl": "Avatar URL" + "noPermission": "Permission to use device is not granted" }, "videothumbnail": { diff --git a/modules/UI/side_pannels/settings/SettingsMenu.js b/modules/UI/side_pannels/settings/SettingsMenu.js index 271b942fe..35b5ae1a0 100644 --- a/modules/UI/side_pannels/settings/SettingsMenu.js +++ b/modules/UI/side_pannels/settings/SettingsMenu.js @@ -82,11 +82,6 @@ export default { emitter.emit(UIEvents.EMAIL_CHANGED, $('#setEmail').val()); } - // AVATAR URL CHANGED - function updateAvatarUrl () { - emitter.emit(UIEvents.AVATAR_URL_CHANGED, $('#setAvatarUrl').val()); - } - $('#setEmail') .val(Settings.getEmail()) .keyup(function (event) { @@ -95,15 +90,6 @@ export default { } }).focusout(updateEmail); - $('#setAvatarUrl') - .val(Settings.getAvatarUrl()) - .keyup(function (event) { - if (event.keyCode === 13) { // enter - updateAvatarUrl(); - } - }).focusout(updateAvatarUrl); - - // START MUTED $("#startMutedOptions").change(function () { let startAudioMuted = $("#startAudioMuted").is(":checked"); diff --git a/modules/settings/Settings.js b/modules/settings/Settings.js index 389f4db92..ce9a2d6fc 100644 --- a/modules/settings/Settings.js +++ b/modules/settings/Settings.js @@ -35,7 +35,6 @@ if (supportsLocalStorage()) { } email = UIUtil.unescapeHtml(window.localStorage.email || ''); - avatarUrl = UIUtil.unescapeHtml(window.localStorage.avatarUrl || ''); localFlipX = JSON.parse(window.localStorage.localFlipX || true); displayName = UIUtil.unescapeHtml(window.localStorage.displayname || ''); language = window.localStorage.language; @@ -106,7 +105,6 @@ export default { */ setAvatarUrl: function (newAvatarUrl) { avatarUrl = newAvatarUrl; - window.localStorage.avatarUrl = UIUtil.escapeHtml(newAvatarUrl); }, /** @@ -117,7 +115,6 @@ export default { return avatarUrl; }, - getLanguage () { return language; }, diff --git a/service/UI/UIEvents.js b/service/UI/UIEvents.js index cbd1bea6d..e0fe92a1a 100644 --- a/service/UI/UIEvents.js +++ b/service/UI/UIEvents.js @@ -14,10 +14,6 @@ export default { * Notifies that local user changed email. */ 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. */