[HTTPS-Everywhere] Time to merge a listview patch into HTTPS Everywhere

Peter Eckersley pde at eff.org
Mon May 2 17:38:19 PDT 2011


I think it's definitely past time to merge either this branch from Stefan or
katmagic's activation tree code
(git://github.com/katmagic/https-everywhere.git) into the forthcoming
development release.  Here are some comparative observations:

In favour of katmagic's code:

- scrolling in the treeview is fast
- the red/green ticks/crosses are nice and legible

Against it:

- It breaks the Disable All, Reset to Defaults, and Cancel buttons in a way
  that would take me a while to fix
- Resizing is broken (but that's trivial to fix)

In favour of Stefan's patch:

- It preserves the functionality of all the buttons
- The chrome is a bit neater

Against it:

- Scrolling seems to be really slow for some reason

The showstoppers above are the button breakage (for katmagic's branch) and the
slowness (for Stefan's).  Which of these should we fix?

Once this is merged, we can get to working on the AdBlock Plus-style context
menu.

On Sun, Mar 13, 2011 at 06:46:39PM +0100, Stefan Tomanek wrote:
> Adding more and more sites to the plugin makes the grid of checkboxes
> hard to use; this patch changes it to a listbox, making it possible to
> search specific rulesets by typing the name while also handling a large
> amount of sites gracefully even on a small screen.
> 
> Signed-off-by: Stefan Tomanek <stefan.tomanek+httpse at wertarbyte.de>
> ---
>  src/chrome/content/preferences.js  |   15 +++------------
>  src/chrome/content/preferences.xul |    8 +-------
>  2 files changed, 4 insertions(+), 19 deletions(-)
> 
> diff --git a/src/chrome/content/preferences.js b/src/chrome/content/preferences.js
> index 198b645..85edf74 100644
> --- a/src/chrome/content/preferences.js
> +++ b/src/chrome/content/preferences.js
> @@ -34,27 +34,18 @@ function https_prefs_init(doc) {
>    for (var i = 0; i < rulesets.length; i++) {
>      var ruleset = rulesets[i];
>  
> -    if (i % row_width == 0) {
> -      hbox = doc.createElement("row");
> -    }
> -
> -    var newopt = doc.createElement("checkbox");
> +    var newopt = doc.createElement("listitem");
>  
>      // 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("type", "checkbox");
>      newopt.setAttribute("checked", enabled);
>      newopt.setAttribute("oncommand",
>                          "https_settings_changed(document)");
> -    hbox.appendChild(newopt);
> -    if (i % row_width == 0) {
> -      rs.appendChild(hbox);
> -    }
> -
> -    prefs_window.height = (screen.height*0.7).toString();
> -    prefs_window.width = screen.width.toString();
> +    rs.appendChild(newopt);
>    }
>    // Do this here rather than in the .xul so that it goes after all these
>    // postpendments
> diff --git a/src/chrome/content/preferences.xul b/src/chrome/content/preferences.xul
> index f49e6e1..a12f393 100644
> --- a/src/chrome/content/preferences.xul
> +++ b/src/chrome/content/preferences.xul
> @@ -24,13 +24,7 @@
>          <caption label="Which HTTPS redirection rules should apply?" 
>                 align="center"/>
>          <hbox flex="1" style="overflow:auto">
> -          <grid class="indent" align="center">
> -            <columns>
> -             <column/> <column/> <column/> <column/> <column/>
> -            </columns>
> -            <rows id="https_everywhere_RuleSetList"/>
> -          </grid>
> -          <seperator orient="vertical" width="40" flex="1"/>
> +          <listbox id="https_everywhere_RuleSetList" flex="1"/>
>          </hbox>
>          <vbox>
>              You can learn how to write your own rulesets (to add support for other web sites)
> -- 
> 1.7.2.3
> _______________________________________________
> HTTPS-everywhere mailing list
> HTTPS-everywhere at mail1.eff.org
> https://mail1.eff.org/mailman/listinfo/https-everywhere

-- 
Peter Eckersley                            pde at eff.org
Senior Staff Technologist         Tel  +1 415 436 9333 x131
Electronic Frontier Foundation    Fax  +1 415 436 9993



More information about the HTTPS-everywhere mailing list