[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [https-everywhere/master 2/9] Listbox version.



Author: Mike Perry <mikeperry-git fscked org>
Date: Wed, 10 Nov 2010 15:52:17 -0800
Subject: Listbox version.
Commit: 0960a57e31b8b065cf7ae81d48e17ba4a3fa8ffc

Doesn't seem to properly update the checkboxes..
---
 src/chrome/content/preferences.js  |   24 +++++++++++++++---------
 src/chrome/content/preferences.xul |    8 +++++---
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/src/chrome/content/preferences.js b/src/chrome/content/preferences.js
index edbac58..9db6c66 100644
--- a/src/chrome/content/preferences.js
+++ b/src/chrome/content/preferences.js
@@ -29,31 +29,37 @@ function https_prefs_init(doc) {
   var rulesets = https_everywhere.https_rules.rules;
   var hbox;
 
-
   for (var i = 0; i < rulesets.length; i++) {
     var ruleset = rulesets[i];
 
     if (i % row_width == 0) {
-      hbox = doc.createElement("richlistitem");
-      rs.insertBefore(hbox,null);
+      hbox = doc.createElement("listitem");
+      //hbox.setAttribute("type", "checkbox");
+      //hbox.setAttribute("style", "listitem-checkbox");
     }
 
-    var newopt = doc.createElement("checkbox");
+    var newopt = doc.createElement("listcell");
+    newopt.setAttribute("type", "checkbox");
+    //newopt.setAttribute("style", "listcell-checkbox");
+
     // This pref should always have been created by the RuleSet constructor
     var enabled = o_httpsprefs.getBoolPref(ruleset.name);
     newopt.setAttribute("id", id_prefix + ruleset.name);
     newopt.setAttribute("label",ruleset.name);
     newopt.setAttribute("preference",null);
     newopt.setAttribute("checked", enabled);
-    newopt.setAttribute("oncommand", 
+    newopt.setAttribute("oncommand",
                         "https_settings_changed(document)");
-    hbox.insertBefore(newopt,null);
+    hbox.appendChild(newopt);
+    if (i % row_width == 0) {
+      rs.appendChild(hbox);
+    }
   }
   // Do this here rather than in the .xul so that it goes after all these
   // postpendments
-  var spacer=doc.createElement("separator");
-  spacer.setAttribute("class", "groove");
-  rs.insertBefore(spacer,null);
+  //var spacer=doc.createElement("separator");
+  //spacer.setAttribute("class", "groove");
+  //rs.insertBefore(spacer,null);
 }
 
 function https_prefs_cancel(doc) {
diff --git a/src/chrome/content/preferences.xul b/src/chrome/content/preferences.xul
index 1a78731..be71bf5 100644
--- a/src/chrome/content/preferences.xul
+++ b/src/chrome/content/preferences.xul
@@ -20,9 +20,11 @@
       <caption label="Which HTTPS redirection rules should apply?" 
                align="center"/>
         <vbox>
-          <richlistbox rows="3" class="indent" align="center" id="https_everywhere_RuleSetList">
-            <separator class="groove" />
-          </richlistbox>
+          <listbox class="indent" align="center" id="https_everywhere_RuleSetList">
+            <listcols>
+             <listcol/> <listcol/> <listcol/> <listcol/> <listcol/>
+            </listcols>
+          </listbox>
           <vbox>
             You can learn how to write your own rulesets
             <label id="ruleset link" 
-- 
1.7.1