From ae48428aa3f5e45db068106e825e23e80f1a1a55 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Fri, 16 Nov 2018 21:40:17 +0800 Subject: Issue #638 - Part 2: Add tooltip to mute/unmute buttons --- application/palemoon/base/content/tabbrowser.xml | 22 +++++++++++++++++++--- .../en-US/chrome/browser/tabbrowser.properties | 4 ++++ 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'application/palemoon') diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 0a2a1c3f5..d73f87bd6 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -3084,9 +3084,25 @@ event.preventDefault(); return; } - event.target.setAttribute("label", tab.mOverCloseButton ? - tab.getAttribute("closetabtext") : - tab.getAttribute("label")); + + var stringID, label; + if (tab.mOverCloseButton) { + stringID = "tabs.closeTab"; + } else if (tab._overPlayingIcon) { + if (tab.linkedBrowser.audioBlocked) { + stringID = "tabs.unblockAudio.tooltip"; + } else { + stringID = tab.linkedBrowser.audioMuted ? + "tabs.unmuteAudio.tooltip" : + "tabs.muteAudio.tooltip"; + } + } else { + label = tab.getAttribute("label"); + } + if (stringID && !label) { + label = this.mStringBundle.getString(stringID); + } + event.target.setAttribute("label", label); ]]> diff --git a/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties b/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties index 0d21d4d14..a4a0be0a0 100644 --- a/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties +++ b/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties @@ -24,3 +24,7 @@ tabs.closeWarningTitle=Confirm close tabs.closeWarningMultipleTabs=You are about to close %S tabs. Are you sure you want to continue? tabs.closeButtonMultiple=Close tabs tabs.closeWarningPromptMe=Warn me when I attempt to close multiple tabs + +tabs.muteAudio.tooltip=Mute tab +tabs.unmuteAudio.tooltip=Unmute tab +tabs.unblockAudio.tooltip=Play tab -- cgit v1.2.3