[Pkg-mozext-commits] [perspectives-extension] 08/22: Pers_pref - Add preferences UI to enable/disable 'show permission box'

David Prévot taffit at moszumanska.debian.org
Wed Feb 26 22:23:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch debian
in repository perspectives-extension.

commit 2d46ffb463fa725d04dee5073a64230ba6bd0596
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date:   Mon Feb 10 20:08:48 2014 -0700

    Pers_pref - Add preferences UI to enable/disable 'show permission box'
---
 plugin/chrome/content/preferences_dialog.js  |  7 +++++++
 plugin/chrome/content/preferences_dialog.xul | 19 ++++++++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/plugin/chrome/content/preferences_dialog.js b/plugin/chrome/content/preferences_dialog.js
index be7f19e..fb6c89c 100644
--- a/plugin/chrome/content/preferences_dialog.js
+++ b/plugin/chrome/content/preferences_dialog.js
@@ -25,6 +25,12 @@ var Pers_pref = {
 		document.getElementById("quorum-duration-text").disabled=is_disabled; 
 	}, 
 
+	disable_reminder_box: function() {
+		// enable or disable the sub-checkbox based on the value of the parent
+		var checked = document.getElementById("require-user-permission-checkbox").checked;
+		document.getElementById("show-permission-reminder-checkbox").disabled=!checked;
+	},
+
 	menuset: function(qu, du){
 		Pers_pref.disable_quorum_text(true); 
 		document.getElementById("quorum-thresh").value = qu;
@@ -105,6 +111,7 @@ var Pers_pref = {
 	load_preferences: function(){
 		try {
 			Pers_pref.security_class_change(); 
+			Pers_pref.disable_reminder_box();
 			var default_notary_text = this.root_prefs.getCharPref("perspectives.default_notary_list");
 			document.getElementById("default_notary_list").value = default_notary_text;
 		} catch(e) { 
diff --git a/plugin/chrome/content/preferences_dialog.xul b/plugin/chrome/content/preferences_dialog.xul
index c9889bd..6b0aac0 100644
--- a/plugin/chrome/content/preferences_dialog.xul
+++ b/plugin/chrome/content/preferences_dialog.xul
@@ -39,6 +39,10 @@
     id="require-user-permission"
     name="perspectives.require_user_permission"
     type="bool"/>
+  <preference
+    id="show-permission-reminder"
+    name="extensions.perspectives.show_permission_reminder"
+    type="bool"/>
   <preference 
     id="whitelist"
     name="perspectives.whitelist"
@@ -116,9 +120,18 @@
       <radio label="&ContactNotariesforallHTTPSsites;" value="true"/>
      <radio label="&ContactNotariesonlywhenawebsitescertificatecausesasecurityerror;" value="false"/>
     </radiogroup>
-   <checkbox
-      label="&AlwaysasktheuserbeforecontactingNotaries;" 
-      preference="require-user-permission"/> 
+     <checkbox id="require-user-permission-checkbox"
+        label="&AlwaysasktheuserbeforecontactingNotaries;"
+        preference="require-user-permission"
+        oncommand="Pers_pref.disable_reminder_box()"/>
+        <hbox>
+          <!-- just use a blank label to indent the sub-checkbox,
+          so it's obvious that it belongs to the parent -->
+          <label value="   "/>
+          <checkbox id="show-permission-reminder-checkbox"
+            label="&DisplayPermissionReminder;"
+            preference="show-permission-reminder"/>
+        </hbox>
   </groupbox>
 
   <groupbox> 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git



More information about the Pkg-mozext-commits mailing list