Browse Source

Merge pull request #822 from jitsi/removes-atarURL

Removes avatar url from UI.
master
hristoterezov 9 years ago
parent
commit
1a69fd8a49
6 changed files with 13 additions and 48 deletions
  1. 2
    2
      app.js
  2. 0
    19
      conference.js
  3. 1
    2
      lang/main.json
  4. 0
    14
      modules/UI/side_pannels/settings/SettingsMenu.js
  5. 10
    7
      modules/settings/Settings.js
  6. 0
    4
      service/UI/UIEvents.js

+ 2
- 2
app.js View File

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

+ 0
- 19
conference.js View File

@@ -316,23 +316,6 @@ function changeLocalEmail(email = '') {
316 316
     sendData(commands.EMAIL, email);
317 317
 }
318 318
 
319
-
320
-/**
321
- * Changes the local avatar url for the local user
322
- * @param avatarUrl {string} the new avatar url
323
- */
324
-function changeLocalAvatarUrl(avatarUrl = '') {
325
-    avatarUrl = avatarUrl.trim();
326
-
327
-    if (avatarUrl === APP.settings.getAvatarUrl()) {
328
-        return;
329
-    }
330
-
331
-    APP.settings.setAvatarUrl(avatarUrl);
332
-    APP.UI.setUserAvatarUrl(room.myUserId(), avatarUrl);
333
-    sendData(commands.AVATAR_URL, avatarUrl);
334
-}
335
-
336 319
 /**
337 320
  * Changes the display name for the local user
338 321
  * @param nickname {string} the new display name
@@ -1269,8 +1252,6 @@ export default {
1269 1252
             APP.UI.setUserEmail(from, data.value);
1270 1253
         });
1271 1254
 
1272
-        APP.UI.addListener(UIEvents.AVATAR_URL_CHANGED, changeLocalAvatarUrl);
1273
-
1274 1255
         room.addCommandListener(this.commands.defaults.AVATAR_URL,
1275 1256
         (data, from) => {
1276 1257
             APP.UI.setUserAvatarUrl(from, data.value);

+ 1
- 2
lang/main.json View File

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

+ 0
- 14
modules/UI/side_pannels/settings/SettingsMenu.js View File

@@ -82,11 +82,6 @@ export default {
82 82
             emitter.emit(UIEvents.EMAIL_CHANGED, $('#setEmail').val());
83 83
         }
84 84
 
85
-        // AVATAR URL CHANGED
86
-        function updateAvatarUrl () {
87
-            emitter.emit(UIEvents.AVATAR_URL_CHANGED, $('#setAvatarUrl').val());
88
-        }
89
-
90 85
         $('#setEmail')
91 86
             .val(Settings.getEmail())
92 87
             .keyup(function (event) {
@@ -95,15 +90,6 @@ export default {
95 90
             }
96 91
         }).focusout(updateEmail);
97 92
 
98
-        $('#setAvatarUrl')
99
-            .val(Settings.getAvatarUrl())
100
-            .keyup(function (event) {
101
-            if (event.keyCode === 13) { // enter
102
-                updateAvatarUrl();
103
-            }
104
-        }).focusout(updateAvatarUrl);
105
-
106
-
107 93
         // START MUTED
108 94
         $("#startMutedOptions").change(function () {
109 95
             let startAudioMuted = $("#startAudioMuted").is(":checked");

+ 10
- 7
modules/settings/Settings.js View File

@@ -35,7 +35,6 @@ if (supportsLocalStorage()) {
35 35
     }
36 36
 
37 37
     email = UIUtil.unescapeHtml(window.localStorage.email || '');
38
-    avatarUrl = UIUtil.unescapeHtml(window.localStorage.avatarUrl || '');
39 38
     localFlipX = JSON.parse(window.localStorage.localFlipX || true);
40 39
     displayName = UIUtil.unescapeHtml(window.localStorage.displayname || '');
41 40
     language = window.localStorage.language;
@@ -69,10 +68,13 @@ export default {
69 68
      * Sets the local user display name and saves it to local storage
70 69
      *
71 70
      * @param {string} newDisplayName unescaped display name for the local user
71
+     * @param {boolean} disableLocalStore disables local store the display name
72 72
      */
73
-    setDisplayName (newDisplayName) {
73
+    setDisplayName (newDisplayName, disableLocalStore) {
74 74
         displayName = newDisplayName;
75
-        window.localStorage.displayname = UIUtil.escapeHtml(displayName);
75
+
76
+        if (!disableLocalStore)
77
+            window.localStorage.displayname = UIUtil.escapeHtml(displayName);
76 78
     },
77 79
 
78 80
     /**
@@ -86,10 +88,13 @@ export default {
86 88
     /**
87 89
      * Sets new email for local user and saves it to the local storage.
88 90
      * @param {string} newEmail new email for the local user
91
+     * @param {boolean} disableLocalStore disables local store the email
89 92
      */
90
-    setEmail: function (newEmail) {
93
+    setEmail: function (newEmail, disableLocalStore) {
91 94
         email = newEmail;
92
-        window.localStorage.email = UIUtil.escapeHtml(newEmail);
95
+
96
+        if (!disableLocalStore)
97
+            window.localStorage.email = UIUtil.escapeHtml(newEmail);
93 98
     },
94 99
 
95 100
     /**
@@ -106,7 +111,6 @@ export default {
106 111
      */
107 112
     setAvatarUrl: function (newAvatarUrl) {
108 113
         avatarUrl = newAvatarUrl;
109
-        window.localStorage.avatarUrl = UIUtil.escapeHtml(newAvatarUrl);
110 114
     },
111 115
 
112 116
     /**
@@ -117,7 +121,6 @@ export default {
117 121
         return avatarUrl;
118 122
     },
119 123
 
120
-
121 124
     getLanguage () {
122 125
         return language;
123 126
     },

+ 0
- 4
service/UI/UIEvents.js View File

@@ -14,10 +14,6 @@ export default {
14 14
      * Notifies that local user changed email.
15 15
      */
16 16
     EMAIL_CHANGED: "UI.email_changed",
17
-    /**
18
-     * Notifies that local user changed avatar url.
19
-     */
20
-    AVATAR_URL_CHANGED: "UI.avatar_url_changed",
21 17
     /**
22 18
      * Notifies that "start muted" settings changed.
23 19
      */

Loading…
Cancel
Save