Ignore:
Timestamp:
Nov 18, 2011, 1:31:56 PM (10 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
dd1cbc
Parents:
a95a40
Message:

added new prefs module, not finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • content/bindings/vI_debugBox.xml

    ra95a40 rbcf746  
    1414      <constructor><![CDATA[
    1515        this.splitter = document.createElement("splitter");
    16         let prefroot = Components.classes["@mozilla.org/preferences-service;1"]
    17           .getService(Components.interfaces.nsIPrefService)
    18           .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2);
    19         prefroot.addObserver("extensions.virtualIdentity.debug_notification", this, false);
    20         this.observe();
     16        virtualIdentityExtension.vIprefs.addObserver("debug_notification", this.observe, this);
     17        this.observe(this);
    2118      ]]></constructor>
    2219      <destructor><![CDATA[
    23         let prefroot = Components.classes["@mozilla.org/preferences-service;1"]
    24           .getService(Components.interfaces.nsIPrefService)
    25           .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2);
    26         prefroot.removeObserver("extensions.virtualIdentity.debug_notification", this);
     20        virtualIdentityExtension.vIprefs.removeObserver("debug_notification", this.observe);
    2721      ]]></destructor>
    2822      <field name="_content">document.getAnonymousElementByAttribute(this, "anonid", "vI_debugBoxContent")</field>
    2923      <property name="splitter" />
    3024      <method name="observe">
     25        <parameter name="self" />
    3126        <body><![CDATA[
    32           this.clear();
    33           let showDebugArea = Components.classes["@mozilla.org/preferences-service;1"]
    34             .getService(Components.interfaces.nsIPrefService)
    35             .getBranch("extensions.virtualIdentity.")
    36             .getBoolPref("debug_notification");
    37           if (showDebugArea) {
    38             this.removeAttribute("hidden");
    39             this.parentNode.insertBefore(this.splitter, this);
     27          self.clear();
     28          if (virtualIdentityExtension.vIprefs.get("debug_notification")) {
     29            self.removeAttribute("hidden");
     30            self.parentNode.insertBefore(self.splitter, self);
    4031          }
    4132          else {
    42             this.setAttribute("hidden", "true");
     33            self.setAttribute("hidden", "true");
    4334            try {
    44               this.parentNode.removeChild(this.splitter);
     35              self.parentNode.removeChild(self.splitter);
    4536            } catch (e) { };
    4637          }
Note: See TracChangeset for help on using the changeset viewer.