source: chrome/content/v_identity/vI_context.xul @ c4e569

ng_0.6ng_0.8ng_0.9
Last change on this file since c4e569 was c4e569, checked in by rene <just@…>, 11 years ago

changed vI_rdfDatasource into class to allow multiple instances

  • Property mode set to 100644
File size: 3.4 KB
Line 
1<?xml version="1.0"?>
2<!-- ***** BEGIN LICENSE BLOCK *****
3   - This program is free software; you can redistribute it and/or modify
4   - it under the terms of the GNU General Public License as published by
5   - the Free Software Foundation; either version 2 of the License, or
6   - (at your option) any later version.
7
8   - This program is distributed in the hope that it will be useful,
9   - but WITHOUT ANY WARRANTY; without even the implied warranty of
10   - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   - GNU General Public License for more details.
12
13   - You should have received a copy of the GNU General Public License
14   - along with this program; if not, write to the Free Software
15   - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
17   - The Original Code is the Virtual Identity Extension.
18
19   - The Initial Developer of the Original Code is Rene Ejury.
20   - Portions created by the Initial Developer are Copyright (C) 2007
21   - the Initial Developer. All Rights Reserved.
22
23   - Contributor(s):
24   - ***** END LICENSE BLOCK ***** -->
25
26<!DOCTYPE overlay [
27<!ENTITY % dataTreeDTD SYSTEM "chrome://v_identity/locale/vI_rdfDataEditor.dtd">
28%dataTreeDTD;
29<!ENTITY % vIdentDTD SYSTEM "chrome://v_identity/locale/v_identity.dtd">
30%vIdentDTD;
31<!ENTITY % abMainWindowDTD SYSTEM "chrome://messenger/locale/addressbook/abMainWindow.dtd" >
32%abMainWindowDTD;
33]>
34
35<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
36    <script type="application/x-javascript">
37    var vI_context = {
38        prefroot : Components.classes["@mozilla.org/preferences-service;1"]
39            .getService(Components.interfaces.nsIPrefService)
40            .getBranch(null),
41           
42        observe: function(subject, topic, data) {
43            document.getElementById("vI_Menu").setAttribute("hidden",
44                !vI_context.prefroot.getBoolPref("extensions.virtualIdentity.menu_entry"));
45        }
46       
47    }
48    window.addEventListener("load", function(e) {
49        vI_context.prefroot.QueryInterface(Components.interfaces.nsIPrefBranch2);
50        vI_context.prefroot.addObserver("extensions.virtualIdentity.menu_entry", vI_context, false);
51        vI_context.observe();
52    }, false);
53    window.addEventListener("unload", function(e) {
54        vI_context.prefroot.removeObserver("extensions.virtualIdentity.menu_entry", vI_context, false);
55    }, false);
56    </script>
57   
58    <menupopup id="taskPopup">
59        <menu id="vI_Menu" hidden="true" label="&vident.vI_Menu.label;">
60            <menupopup>
61                <menuitem label="&vident.vI_Menu.Settings.label;"
62                      oncommand="window.open('chrome://v_identity/content/vI_prefDialogOpener.xul', '', 'chrome, dialog, resizable=yes');" />
63                <menu label="&vident.vI_Menu.DataStorage.label;">
64                    <menupopup>                       
65                        <menuitem label="&vident.vI_Menu.DataEditor.label;"
66                            oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
67                        <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.import('virtualIdentity.rdf')"/>
68                        <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.export('virtualIdentity.rdf')"/>
69                    </menupopup>
70                </menu>
71            </menupopup>
72        </menu>
73    </menupopup>
74</overlay>
Note: See TracBrowser for help on using the repository browser.