]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1426673 - The logout link cannot be found as what Sessions page says
authorKohei Yoshino <kohei.yoshino@gmail.com>
Tue, 2 Jan 2018 17:03:05 +0000 (12:03 -0500)
committerDylan William Hardison <dylan@hardison.net>
Tue, 2 Jan 2018 17:03:05 +0000 (12:03 -0500)
js/global.js
template/en/default/account/prefs/sessions.html.tmpl

index a590c6ac6e0d09d956cef81d456e0867372869d5..2b353a69e12cd2423adf7368a07a4698ddc895f6 100644 (file)
@@ -191,6 +191,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
@@ -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);
index 13257ef012b1de9734014a87a78f9b8502c88e4a..03d44287b82f296d99ae9a3688d3bca41575d939 100644 (file)
@@ -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>