From 0e27f471f13b0344babb22c78fb12ccbbf6384d7 Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 30 Aug 2016 14:09:07 -0500 Subject: [PATCH 1/2] 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. */ From 5ab6c551df4bd665e5a879856abf20e2cf7c2dae Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 30 Aug 2016 14:10:20 -0500 Subject: [PATCH 2/2] Disables storing display name and email when using overlay ring. --- app.js | 4 ++-- modules/settings/Settings.js | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 155d941c7..895508e01 100644 --- a/app.js +++ b/app.js @@ -95,9 +95,9 @@ const APP = { function setTokenData() { let localUser = APP.tokenData.caller; if(localUser) { - APP.settings.setEmail((localUser.getEmail() || "").trim()); + APP.settings.setEmail((localUser.getEmail() || "").trim(), true); APP.settings.setAvatarUrl((localUser.getAvatarUrl() || "").trim()); - APP.settings.setDisplayName((localUser.getName() || "").trim()); + APP.settings.setDisplayName((localUser.getName() || "").trim(), true); } } diff --git a/modules/settings/Settings.js b/modules/settings/Settings.js index ce9a2d6fc..ebd7ab52a 100644 --- a/modules/settings/Settings.js +++ b/modules/settings/Settings.js @@ -68,10 +68,13 @@ export default { * Sets the local user display name and saves it to local storage * * @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; - window.localStorage.displayname = UIUtil.escapeHtml(displayName); + + if (!disableLocalStore) + window.localStorage.displayname = UIUtil.escapeHtml(displayName); }, /** @@ -85,10 +88,13 @@ export default { /** * Sets new email for local user and saves it to the local storage. * @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; - window.localStorage.email = UIUtil.escapeHtml(newEmail); + + if (!disableLocalStore) + window.localStorage.email = UIUtil.escapeHtml(newEmail); }, /**