зеркало из https://github.com/mozilla/pjs.git
Bug 523784 - Soft blocked items are not disabled if user clicks "Cancel". r=Unfocused+Pike a=blocking+beltzner
This commit is contained in:
Родитель
f2f18b72d0
Коммит
269ad5352b
|
@ -52,6 +52,8 @@ backButton=Back
|
|||
backButton.accesskey=B
|
||||
acceptTermsButton=Accept Terms
|
||||
acceptTermsButton.accesskey=A
|
||||
# NOTE: The restartLaterButton string is also used in
|
||||
# mozapps/extensions/content/blocklist.js
|
||||
restartLaterButton=Restart Later
|
||||
restartLaterButton.accesskey=L
|
||||
restartNowButton=Restart %S
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var gArgs;
|
||||
|
||||
function init() {
|
||||
|
@ -42,6 +44,15 @@ function init() {
|
|||
var hasSoftBlocks = false;
|
||||
gArgs = window.arguments[0].wrappedJSObject;
|
||||
|
||||
// NOTE: We use strings from the "updates.properties" bundleset to change the
|
||||
// text on the "Cancel" button to "Restart Later". (bug 523784)
|
||||
let bundle = Services.strings.
|
||||
createBundle("chrome://mozapps/locale/update/updates.properties");
|
||||
let cancelButton = document.documentElement.getButton("cancel");
|
||||
cancelButton.setAttribute("label", bundle.GetStringFromName("restartLaterButton"));
|
||||
cancelButton.setAttribute("accesskey",
|
||||
bundle.GetStringFromName("restartLaterButton.accesskey"));
|
||||
|
||||
var richlist = document.getElementById("addonList");
|
||||
var list = gArgs.list;
|
||||
list.sort(function(a, b) { return String.localeCompare(a.name, b.name); });
|
||||
|
@ -75,8 +86,8 @@ function init() {
|
|||
link.setAttribute("href", url);
|
||||
}
|
||||
|
||||
function accept() {
|
||||
gArgs.restart = true;
|
||||
function finish(shouldRestartNow) {
|
||||
gArgs.restart = shouldRestartNow;
|
||||
var list = gArgs.list;
|
||||
var items = document.getElementById("addonList").childNodes;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
|
||||
<dialog windowtype="Addons:Blocklist" title="&blocklist.title;" align="stretch"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="init();" ondialogaccept="return accept()"
|
||||
onload="init();" ondialogaccept="return finish(true)"
|
||||
ondialogcancel="return finish(false)"
|
||||
buttons="accept,cancel" style="&blocklist.style;"
|
||||
buttonlabelaccept="&blocklist.accept.label;"
|
||||
buttonaccesskeyaccept="&blocklist.accept.accesskey;">
|
||||
|
|
Загрузка…
Ссылка в новой задаче