Changeset ebd36a


Ignore:
Timestamp:
Jan 30, 2008, 9:38:17 AM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
d57daa
Parents:
857422
Message:

seamonkey compatibility: has no extension-Manager

Location:
chrome
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_prefDialog.js

    r857422 rebd36a  
    179179       
    180180        smartReplyHideSignature : function() {
    181             var switch_signature_ID="{2ab1b709-ba03-4361-abf9-c50b964ff75d}"
    182             var em = Components.classes["@mozilla.org/extensions/manager;1"]
    183                 .getService(Components.interfaces.nsIExtensionManager);
    184             var rdfS = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
    185             var source=rdfS.GetResource("urn:mozilla:item:"+switch_signature_ID)
    186            
    187             var item = em.getItemForID(switch_signature_ID)
    188             if (!item.installLocationKey) return;
    189 
    190             var disabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#disabled");
    191             var isDisabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#isDisabled");
    192             var disabled = em.datasource.GetTarget(source, disabledResource, true);
    193             if (!disabled) disabled = em.datasource.GetTarget(source, isDisabledResource, true);
    194             try {
    195                 disabled=disabled.QueryInterface(Components.interfaces.nsIRDFLiteral);
    196                 if (disabled.Value=="true") return;
    197             } catch (e) { }
    198            
    199             document.getElementById("VIdent_identity.HideSignature.warning").setAttribute("hidden", "true");
    200             document.getElementById("VIdent_identity.hide_signature").setAttribute("disabled", "false");
     181            // seamonkey has no extsnion-manager
     182            if (("nsIExtensionManager" in Components.interfaces) && ("@mozilla.org/extensions/manager;1" in Components.classes)) {
     183                var switch_signature_ID="{2ab1b709-ba03-4361-abf9-c50b964ff75d}"
     184                var em = Components.classes["@mozilla.org/extensions/manager;1"]
     185                    .getService(Components.interfaces.nsIExtensionManager);
     186                var rdfS = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
     187                var source=rdfS.GetResource("urn:mozilla:item:"+switch_signature_ID)
     188               
     189                var item = em.getItemForID(switch_signature_ID)
     190                if (!item.installLocationKey) return;
     191
     192                var disabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#disabled");
     193                var isDisabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#isDisabled");
     194                var disabled = em.datasource.GetTarget(source, disabledResource, true);
     195                if (!disabled) disabled = em.datasource.GetTarget(source, isDisabledResource, true);
     196                try {
     197                    disabled=disabled.QueryInterface(Components.interfaces.nsIRDFLiteral);
     198                    if (disabled.Value=="true") return;
     199                } catch (e) { }
     200               
     201                document.getElementById("VIdent_identity.HideSignature.warning").setAttribute("hidden", "true");
     202                document.getElementById("VIdent_identity.hide_signature").setAttribute("disabled", "false");
     203            }
    201204        },
    202205    },
  • chrome/content/v_identity/vI_rdfDatasource.js

    r857422 rebd36a  
    3434    rdfNSNewsgroup : "vIStorage/newsgroup/",
    3535   
    36     extensionManager : Components.classes["@mozilla.org/extensions/manager;1"]
    37             .getService(Components.interfaces.nsIExtensionManager),
     36    // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
     37    // extensionManager : Components.classes["@mozilla.org/extensions/manager;1"]
     38    //      .getService(Components.interfaces.nsIExtensionManager),
    3839   
    3940    rdfVersion : "0.0.1",   // version of current implemented RDF-schema, internal only to trigger updates
     
    6566        var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
    6667            .getService(Components.interfaces.nsIVersionComparator);
    67         var extVersion = vI_rdfDatasource.extensionManager.getItemForID(vI_rdfDatasource.virtualIdentityID).version
     68        // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
     69        // var extVersion = vI_rdfDatasource.extensionManager.getItemForID(vI_rdfDatasource.virtualIdentityID).version
     70        var extVersion = document.getElementById("extVersion").getAttribute("value");
    6871        return (!oldExtVersion || versionChecker.compare(oldExtVersion, extVersion) < 0)   
    6972    },
     
    8790   
    8891    storeExtVersion: function() {
    89         var value = vI_rdfDatasource.extensionManager.getItemForID(vI_rdfDatasource.virtualIdentityID).version
     92        // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
     93        // var extVersion = vI_rdfDatasource.extensionManager.getItemForID(vI_rdfDatasource.virtualIdentityID).version
     94        var extVersion = document.getElementById("extVersion").getAttribute("value");
    9095        vI_rdfDatasource.__setRDFValue(
    91             vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "virtualIdentity"), "version", value)
     96            vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "virtualIdentity"), "version", extVersion)
    9297        vI_rdfDatasource.flush();
    9398    },
  • chrome/content/v_identity/vI_upgrade.xul

    r857422 rebd36a  
    9898        oncommand="vI_upgrade.openURL('http://www.absorb.it/virtual-id')" tooltiptext="&vident.prefs.vidLogo.tooltiptext;" />
    9999    <spacer width="10px" />
     100    <label id="extVersion" value="&vident.version;" hidden="true" />
    100101    </hbox>
    101102</wizard>
  • chrome/content/v_identity/vI_upgradeOverlay.xul

    r857422 rebd36a  
    2525   
    2626<?xml-stylesheet href="chrome://v_identity/skin/v_identity.css" type="text/css"?>
    27 
    28 <!DOCTYPE overlay SYSTEM "chrome://v_identity/locale/v_identity.dtd">
     27<!DOCTYPE overlay [
     28<!ENTITY % versionDTD SYSTEM "chrome://v_identity/content/_version.dtd">
     29%versionDTD;
     30<!ENTITY % vIdentDTD SYSTEM "chrome://v_identity/locale/v_identity.dtd">
     31%vIdentDTD;
     32]>
    2933
    3034<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    3135    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgradeOverlay.js" />
    3236    <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
     37    <label id="extVersion" value="&vident.version;" hidden="true" />
    3338</overlay>
  • chrome/skin/classic/v_identity/v_identity.css

    r857422 rebd36a  
    44#upgradeWizard {
    55    width: 550px;
    6     height: 350px
     6    height: 370px
    77}
    88
Note: See TracChangeset for help on using the changeset viewer.