Browse Source

Merge pull request #822 from jitsi/removes-atarURL

Removes avatar url from UI.
master
hristoterezov 9 years ago
parent
commit
1a69fd8a49

+ 2
- 2
app.js View File

95
 function setTokenData() {
95
 function setTokenData() {
96
     let localUser = APP.tokenData.caller;
96
     let localUser = APP.tokenData.caller;
97
     if(localUser) {
97
     if(localUser) {
98
-        APP.settings.setEmail((localUser.getEmail() || "").trim());
98
+        APP.settings.setEmail((localUser.getEmail() || "").trim(), true);
99
         APP.settings.setAvatarUrl((localUser.getAvatarUrl() || "").trim());
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
     sendData(commands.EMAIL, email);
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
  * Changes the display name for the local user
320
  * Changes the display name for the local user
338
  * @param nickname {string} the new display name
321
  * @param nickname {string} the new display name
1269
             APP.UI.setUserEmail(from, data.value);
1252
             APP.UI.setUserEmail(from, data.value);
1270
         });
1253
         });
1271
 
1254
 
1272
-        APP.UI.addListener(UIEvents.AVATAR_URL_CHANGED, changeLocalAvatarUrl);
1273
-
1274
         room.addCommandListener(this.commands.defaults.AVATAR_URL,
1255
         room.addCommandListener(this.commands.defaults.AVATAR_URL,
1275
         (data, from) => {
1256
         (data, from) => {
1276
             APP.UI.setUserAvatarUrl(from, data.value);
1257
             APP.UI.setUserAvatarUrl(from, data.value);

+ 1
- 2
lang/main.json View File

119
         "selectAudioOutput": "Select audio output",
119
         "selectAudioOutput": "Select audio output",
120
         "followMe": "Enable follow me",
120
         "followMe": "Enable follow me",
121
         "noDevice": "None",
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
     "videothumbnail":
124
     "videothumbnail":
126
     {
125
     {

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

82
             emitter.emit(UIEvents.EMAIL_CHANGED, $('#setEmail').val());
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
         $('#setEmail')
85
         $('#setEmail')
91
             .val(Settings.getEmail())
86
             .val(Settings.getEmail())
92
             .keyup(function (event) {
87
             .keyup(function (event) {
95
             }
90
             }
96
         }).focusout(updateEmail);
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
         // START MUTED
93
         // START MUTED
108
         $("#startMutedOptions").change(function () {
94
         $("#startMutedOptions").change(function () {
109
             let startAudioMuted = $("#startAudioMuted").is(":checked");
95
             let startAudioMuted = $("#startAudioMuted").is(":checked");

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

35
     }
35
     }
36
 
36
 
37
     email = UIUtil.unescapeHtml(window.localStorage.email || '');
37
     email = UIUtil.unescapeHtml(window.localStorage.email || '');
38
-    avatarUrl = UIUtil.unescapeHtml(window.localStorage.avatarUrl || '');
39
     localFlipX = JSON.parse(window.localStorage.localFlipX || true);
38
     localFlipX = JSON.parse(window.localStorage.localFlipX || true);
40
     displayName = UIUtil.unescapeHtml(window.localStorage.displayname || '');
39
     displayName = UIUtil.unescapeHtml(window.localStorage.displayname || '');
41
     language = window.localStorage.language;
40
     language = window.localStorage.language;
69
      * Sets the local user display name and saves it to local storage
68
      * Sets the local user display name and saves it to local storage
70
      *
69
      *
71
      * @param {string} newDisplayName unescaped display name for the local user
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
         displayName = newDisplayName;
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
     /**
88
     /**
87
      * Sets new email for local user and saves it to the local storage.
89
      * Sets new email for local user and saves it to the local storage.
88
      * @param {string} newEmail new email for the local user
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
         email = newEmail;
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
      */
111
      */
107
     setAvatarUrl: function (newAvatarUrl) {
112
     setAvatarUrl: function (newAvatarUrl) {
108
         avatarUrl = newAvatarUrl;
113
         avatarUrl = newAvatarUrl;
109
-        window.localStorage.avatarUrl = UIUtil.escapeHtml(newAvatarUrl);
110
     },
114
     },
111
 
115
 
112
     /**
116
     /**
117
         return avatarUrl;
121
         return avatarUrl;
118
     },
122
     },
119
 
123
 
120
-
121
     getLanguage () {
124
     getLanguage () {
122
         return language;
125
         return language;
123
     },
126
     },

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

14
      * Notifies that local user changed email.
14
      * Notifies that local user changed email.
15
      */
15
      */
16
     EMAIL_CHANGED: "UI.email_changed",
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
      * Notifies that "start muted" settings changed.
18
      * Notifies that "start muted" settings changed.
23
      */
19
      */

Loading…
Cancel
Save