summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshino <kohei.yoshino@gmail.com>2018-01-02 18:03:05 +0100
committerDylan William Hardison <dylan@hardison.net>2018-01-02 18:03:05 +0100
commit7b8975d8f53e882ad74f0c11b20beae4efebaafc (patch)
treea63626d6621fbf547a4157277f9e1b0275b0b625
parent9a8f8232509ec61f798f4872ab38741762725a49 (diff)
downloadbugzilla-7b8975d8f53e882ad74f0c11b20beae4efebaafc.tar.gz
bugzilla-7b8975d8f53e882ad74f0c11b20beae4efebaafc.tar.xz
Bug 1426673 - The logout link cannot be found as what Sessions page says
-rw-r--r--js/global.js13
-rw-r--r--template/en/default/account/prefs/sessions.html.tmpl2
2 files changed, 14 insertions, 1 deletions
diff --git a/js/global.js b/js/global.js
index a590c6ac6..2b353a69e 100644
--- a/js/global.js
+++ b/js/global.js
@@ -192,6 +192,18 @@ $().ready(function() {
});
/**
+ * Check if Gravatar images on the page are successfully loaded, and if blocked
+ * (by any content blocker), replace them with the default/fallback image.
+ */
+const detect_blocked_gravatars = () => {
+ document.querySelectorAll('img[src^="https://secure.gravatar.com/avatar/"]').forEach($img => {
+ if (!$img.complete || !$img.naturalHeight) {
+ $img.src = 'extensions/Gravatar/web/default.jpg';
+ }
+ });
+}
+
+/**
* If the URL contains a hash like #c10, scroll down the page to show the
* element below the fixed global header. This workaround is required for
* comments on show_bug.cgi, components on describecomponents.cgi, etc.
@@ -209,5 +221,6 @@ const scroll_element_into_view = () => {
}
}
+window.addEventListener('load', detect_blocked_gravatars, { once: true });
window.addEventListener('load', scroll_element_into_view, { once: true });
window.addEventListener('hashchange', scroll_element_into_view);
diff --git a/template/en/default/account/prefs/sessions.html.tmpl b/template/en/default/account/prefs/sessions.html.tmpl
index 13257ef01..03d44287b 100644
--- a/template/en/default/account/prefs/sessions.html.tmpl
+++ b/template/en/default/account/prefs/sessions.html.tmpl
@@ -18,7 +18,7 @@
from that location again you will have to log back in.</p>
<p>Note that you may not logout your current session from this page.
- You can use the "Logout" link from the top right menu for that.</p>
+ You can use the "Log out" link from the top right Account menu for that.</p>
<h3>Active Sessions</h3>