diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-26 16:46:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-26 16:46:59 +0200 |
commit | 9a97c58feb8f14bb8be720e2cac5db017b4523d3 (patch) | |
tree | 8239115c3d04da51a628f166c9896cba3bb6dde6 /application/palemoon/components/preferences | |
parent | 698b659ee29fd84b02ac2632085d31caaef081e9 (diff) | |
parent | f506d6fcaad26464b75338630a7d3a0078029eba (diff) | |
download | UXP-9a97c58feb8f14bb8be720e2cac5db017b4523d3.tar UXP-9a97c58feb8f14bb8be720e2cac5db017b4523d3.tar.gz UXP-9a97c58feb8f14bb8be720e2cac5db017b4523d3.tar.lz UXP-9a97c58feb8f14bb8be720e2cac5db017b4523d3.tar.xz UXP-9a97c58feb8f14bb8be720e2cac5db017b4523d3.zip |
Merge pull request #269 from adeshkp/button_messages
Improve some button labels in preferences
Diffstat (limited to 'application/palemoon/components/preferences')
-rw-r--r-- | application/palemoon/components/preferences/cookies.js | 29 | ||||
-rw-r--r-- | application/palemoon/components/preferences/cookies.xul | 11 |
2 files changed, 25 insertions, 15 deletions
diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js index ea7e7d4e2..543aeb186 100644 --- a/application/palemoon/components/preferences/cookies.js +++ b/application/palemoon/components/preferences/cookies.js @@ -5,6 +5,8 @@ const nsICookie = Components.interfaces.nsICookie; +Components.utils.import("resource://gre/modules/PluralForm.jsm"); + var gCookiesWindow = { _cm : Components.classes["@mozilla.org/cookiemanager;1"] .getService(Components.interfaces.nsICookieManager), @@ -24,6 +26,11 @@ var gCookiesWindow = { this._bundle = document.getElementById("bundlePreferences"); this._tree = document.getElementById("cookiesList"); + let removeAllCookies = document.getElementById("removeAllCookies"); + removeAllCookies.setAttribute("accesskey", this._bundle.getString("removeAllCookies.accesskey")); + let removeSelectedCookies = document.getElementById("removeSelectedCookies"); + removeSelectedCookies.setAttribute("accesskey", this._bundle.getString("removeSelectedCookies.accesskey")); + this._populateList(true); document.getElementById("filter").focus(); @@ -558,12 +565,12 @@ var gCookiesWindow = { if (item && seln.count == 1 && item.container && item.open) selectedCookieCount += 2; - var removeCookie = document.getElementById("removeCookie"); - var removeCookies = document.getElementById("removeCookies"); - removeCookie.parentNode.selectedPanel = - selectedCookieCount == 1 ? removeCookie : removeCookies; + let buttonLabel = this._bundle.getString("removeSelectedCookies.label"); + let removeSelectedCookies = document.getElementById("removeSelectedCookies"); + removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel) + .replace("#1", selectedCookieCount); - removeCookie.disabled = removeCookies.disabled = !(seln.count > 0); + removeSelectedCookies.disabled = !(seln.count > 0); }, performDeletion: function gCookiesWindow_performDeletion(deleteItems) { @@ -868,7 +875,17 @@ var gCookiesWindow = { }, _updateRemoveAllButton: function gCookiesWindow__updateRemoveAllButton() { - document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0; + let removeAllCookies = document.getElementById("removeAllCookies"); + removeAllCookies.disabled = this._view._rowCount == 0; + + let labelStringID = "removeAllCookies.label"; + let accessKeyStringID = "removeAllCookies.accesskey"; + if (this._view._filtered) { + labelStringID = "removeAllShownCookies.label"; + accessKeyStringID = "removeAllShownCookies.accesskey"; + } + removeAllCookies.setAttribute("label", this._bundle.getString(labelStringID)); + removeAllCookies.setAttribute("accesskey", this._bundle.getString(accessKeyStringID)); }, filter: function () { diff --git a/application/palemoon/components/preferences/cookies.xul b/application/palemoon/components/preferences/cookies.xul index 8ff0d90ec..60725e9d8 100644 --- a/application/palemoon/components/preferences/cookies.xul +++ b/application/palemoon/components/preferences/cookies.xul @@ -91,16 +91,9 @@ </vbox> <hbox align="end"> <hbox class="actionButtons" flex="1"> - <deck oncommand="gCookiesWindow.deleteCookie();"> - <button id="removeCookie" disabled="true" icon="remove" - label="&button.removecookie.label;" - accesskey="&button.removecookie.accesskey;"/> - <button id="removeCookies" disabled="true" icon="remove" - label="&button.removecookies.label;" - accesskey="&button.removecookie.accesskey;"/> - </deck> + <button id="removeSelectedCookies" disabled="true" icon="clear" + oncommand="gCookiesWindow.deleteCookie();"/> <button id="removeAllCookies" disabled="true" icon="clear" - label="&button.removeallcookies.label;" accesskey="&button.removeallcookies.accesskey;" oncommand="gCookiesWindow.deleteAllCookies();"/> <spacer flex="1"/> #ifndef XP_MACOSX |