user settings: Display avatar source.

This makes it easier for users to tell how Zulip ended up with an
avatar for them without them uploading one: through the Gravatar
service used across many Wordpress blogs.

Fixes #8225.
This commit is contained in:
Rhea Parekh
2018-03-02 23:03:20 +05:30
committed by Tim Abbott
parent 9eeb1c59f6
commit 416f11030f
4 changed files with 40 additions and 3 deletions

View File

@@ -311,6 +311,8 @@ exports.set_up = function () {
form_data.append('file-'+i, file);
});
$("#user-avatar-source").hide();
var spinner = $("#upload_avatar_spinner").expectOne();
loading.make_indicator(spinner, {text: 'Uploading avatar.'});
@@ -324,6 +326,12 @@ exports.set_up = function () {
loading.destroy_indicator($("#upload_avatar_spinner"));
$("#user-settings-avatar").expectOne().attr("src", data.avatar_url);
$("#user_avatar_delete_button").show();
$("#user-avatar-source").hide();
},
error: function () {
if (page_params.avatar_source === 'G') {
$("#user-avatar-source").show();
}
},
});