Skip to content

Commit e2001c6

Browse files
author
Mike Perry
committed
Add a disable all button.
Also rename the DTD elements to better reflect the buttons.
1 parent 612298b commit e2001c6

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/chrome/content/preferences.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ function https_prefs_save(doc) {
8080
}
8181
}
8282

83-
function https_enable_all(doc) {
84-
// "restore defaults" / enable all rules
83+
function https_set_all(doc,val) {
84+
// set all rules to val (enable/disable)
8585
var o_httpsprefs = https_everywhere.get_prefs();
8686
var rulesets = https_everywhere.https_rules.rules;
8787
var rs = doc.getElementById('https_everywhere_RuleSetList');
8888
for (var i = 0; i < rulesets.length; i++) {
8989
var ruleset = rulesets[i];
90-
ruleset.active = true;
90+
ruleset.active = val;
9191
var elem = doc.getElementById(id_prefix + ruleset.name);
92-
elem.checked = true;
92+
elem.checked = val;
9393
}
9494
}

src/chrome/content/preferences.xul

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
<dialog id="https-everywhere-prefs"
77
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
88
xmlns:html="http://www.w3.org/1999/xhtml"
9-
buttons="accept,cancel,extra1"
9+
buttons="accept,cancel,extra1,extra2"
1010
title="&https-everywhere.prefs.title;"
11-
buttonlabelextra1="&https-everywhere.prefs.restore_defaults;"
12-
ondialogextra1="https_enable_all(document);"
11+
buttonlabelextra1="&https-everywhere.prefs.enable_all;"
12+
buttonlabelextra2="&https-everywhere.prefs.disable_all;"
13+
ondialogextra1="https_set_all(document,true);"
14+
ondialogextra2="https_set_all(document,false);"
1315
persist="screenX screenY"
1416
onload="https_prefs_init(document)"
1517
ondialogaccept="https_prefs_save(document)"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<!ENTITY https-everywhere.prefs.title "HTTPS Everywhere Preferences">
2-
<!ENTITY https-everywhere.prefs.restore_defaults "Enable All">
2+
<!ENTITY https-everywhere.prefs.enable_all "Enable All">
3+
<!ENTITY https-everywhere.prefs.disable_all "Disable All">

0 commit comments

Comments
 (0)