Import from 1.9a8 tarball
[mozilla-extra.git] / extensions / wallet / resources / content / walletNavigatorOverlay.xul
blob37534d8dde38584cecf2e0f40be8d438b9f7dc9e
1 <?xml version="1.0"?>
3 <!-- ***** BEGIN LICENSE BLOCK *****
4 Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 The contents of this file are subject to the Mozilla Public License Version
7 1.1 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
9 http://www.mozilla.org/MPL/
11 Software distributed under the License is distributed on an "AS IS" basis,
12 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 for the specific language governing rights and limitations under the
14 License.
16 The Original Code is Mozilla Communicator client code, released
17 March 31, 1998.
19 The Initial Developer of the Original Code is
20 Netscape Communications Corporation.
21 Portions created by the Initial Developer are Copyright (C) 1998-1999
22 the Initial Developer. All Rights Reserved.
24 Contributor(s):
26 Alternatively, the contents of this file may be used under the terms of
27 either the GNU General Public License Version 2 or later (the "GPL"), or
28 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 in which case the provisions of the GPL or the LGPL are applicable instead
30 of those above. If you wish to allow use of your version of this file only
31 under the terms of either the GPL or the LGPL, and not to allow others to
32 use your version of this file under the terms of the MPL, indicate your
33 decision by deleting the provisions above and replace them with the notice
34 and other provisions required by the GPL or the LGPL. If you do not delete
35 the provisions above, a recipient may use your version of this file under
36 the terms of any one of the MPL, the GPL or the LGPL.
38 ***** END LICENSE BLOCK ***** -->
40 <!DOCTYPE overlay SYSTEM "chrome://wallet/locale/walletNavigatorOverlay.dtd">
42 <overlay id="walletNavigatorOverlay"
43 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
45 <script type="application/x-javascript" src="chrome://wallet/content/walletOverlay.js"/>
47 <script type="application/x-javascript">
48 <![CDATA[
50 function initWalletMenuItems() {
51 // Determine if capture/prefill should be enabled.
52 var state = getState(0);
53 setDisabledAttr("cmd_walletCapture", (state.capture != enable));
54 setDisabledAttr("cmd_walletPrefill", (state.prefill != enable));
57 /* form toolbar is out
58 // Can't use generic goToggleToolbar (see utilityOverlay.js) for form menu because
59 // form toolbar could be hidden even when the checkbox in the view menu is checked
60 function goToggleFormToolbar(id, elementID) {
61 var element = document.getElementById(elementID);
62 if (element) {
63 var checkValue = element.getAttribute("checked");
64 if (checkValue == "false") {
65 element.setAttribute("checked","true")
66 initToolbarItems();
67 } else {
68 element.setAttribute("checked","false")
69 showItem("formToolbar", false);
71 document.persist(id, 'hidden');
72 document.persist(elementID, 'checked');
76 function navObserver() {
78 navObserver.prototype.observe = function (subject, message, contextUrl) {
79 if (message == 'EndDocumentLoad') {
80 initToolbarItems()
84 function addEndDocumentLoadListener() {
85 if (window.content) {
86 var observerService = Components.classes["@mozilla.org/observer-service;1"].getService();
87 observerService = observerService.QueryInterface(Components.interfaces.nsIObserverService);
88 var observer = new navObserver();
89 if (observerService && observer) {
90 observerService.addObserver(observer, "EndDocumentLoad", PR_FALSE);
91 } else {
92 dump("FAILURE to get observer service\n");
97 window.addEventListener("load", addEndDocumentLoadListener, false);
101 </script>
103 <commandset id="commands">
104 <commandset id="walletMenuItems">
105 <command id="cmd_walletPrefill" label="&prefillCmd.label;"
106 accesskey="&prefillCmd.accesskey;" oncommand="formPrefill();"/>
107 <command id="cmd_walletCapture" label="&captureCmd.label;"
108 accesskey="&captureCmd.accesskey;" oncommand="formCapture();"/>
109 </commandset>
110 </commandset>
112 <!-- menu items -->
114 <!-- form toolbar is out
115 <broadcasterset id="broadcasterset">
116 <broadcaster id="cmd_viewformtoolbar" label="&formbarCmd.label;"
117 accesskey="&formbarCmd.accesskey;" class="menuitem-iconic"
118 type="checkbox" checked="true"
119 oncommand="goToggleFormToolbar('formToolbar','cmd_viewformtoolbar');"/>
120 </broadcasterset>
123 <!-- view menu -->
124 <!-- form toolbar is out
125 <menupopup id="view_toolbars_popup">
126 <menuitem insertafter="cmd_viewpersonaltoolbar"
127 observes="cmd_viewformtoolbar"/>
128 </menupopup>
131 <!-- edit menu -->
132 <menupopup id="menu_Edit_Popup" onpopupshowing="initWalletMenuItems();">
133 <menuseparator insertbefore="menu_PrefsSeparator"/>
134 <menuitem command="cmd_walletPrefill"
135 insertbefore="menu_PrefsSeparator"/>
136 <menuitem command="cmd_walletCapture"
137 insertbefore="menu_PrefsSeparator"/>
138 </menupopup>
140 <!-- Form toolbar items -->
142 <!-- form toolbar is out
143 <hbox id="appcontent">
144 <toolbar id="formToolbar"
145 class="chromeclass-directories"
146 insertafter="browser"
147 persist="collapsed"
148 style="display:none;">
149 <button class="button-toolbar-4"
150 id="formPrefill"
151 oncommand="formPrefill();"
152 label=" &formPrefill.label; "
153 tooltiptext="&formPrefill.tooltip;"/>
154 <toolbarseparator/>
155 <button class="button-toolbar-4"
156 id="formCapture"
157 oncommand="formCapture();"
158 label=" &formCapture.label; "
159 tooltiptext="&formCapture.tooltip;"/>
160 <toolbarseparator/>
161 <button class="button-toolbar-4"
162 id="formShow"
163 oncommand="formShow(); initToolbarItems();"
164 label=" &formView.label; "
165 tooltiptext="&formView.tooltip;"/>
166 <toolbarseparator/>
167 </toolbar>
168 </hbox>
170 <menupopup id="taskPopup">
171 <menu label="&walletFormManager.label;"
172 accesskey="&walletFormManager.accesskey;"
173 id="wallet"
174 insertbefore="navBeginGlobalItems">
175 <menupopup onpopupshowing="initWalletMenuItems();">
176 <menuitem command="cmd_walletPrefill"/>
177 <menuitem command="cmd_walletCapture"/>
178 <menuseparator/>
179 <menuitem label="&walletContentsCmd.label;"
180 accesskey="&walletContentsCmd.accesskey;"
181 id="walleteditor"
182 oncommand="WalletDialog('wallet');"/>
183 <menuitem label="&walletSitesCmd.label;"
184 accesskey="&walletSitesCmd.accesskey;"
185 id="walletsites"
186 oncommand="WalletDialog('walletsites');"/>
187 </menupopup>
188 </menu>
189 </menupopup>
191 </overlay>