Mozilla/mozilla/extensions/wallet/resources/content/walletContextOverlay.xul
morse%netscape.com fa863da1e2 bug 77073, wallet checks slows creation of edit and context menus, r=sgehani, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@109315 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 03:46:18 +00:00

88 lines
3.3 KiB
XML

<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
-->
<!DOCTYPE window SYSTEM "chrome://wallet/locale/walletContextOverlay.dtd">
<overlay id="walletContextOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://wallet/content/walletOverlay.js"/>
<script type="application/x-javascript">
<![CDATA[
function initContextItems() {
// Determine if capture/prefill should be displayed and enabled.
var state = getState(0);
showItem("context-capture", (state.capture != hide));
setDisabledAttr("context-capture", (state.capture == disable));
showItem("context-prefill", (state.prefill != hide));
setDisabledAttr("context-prefill", (state.prefill == disable));
// Display show-saved-data if either prefill or capture is being displayed
showItem("context-formshow", state.capture != hide || state.prefill != hide);
// Display separator if either prefill or capture is being displayed
showItem("context-separator", state.capture != hide || state.prefill != hide);
}
// For some unexplainable reason, this overlay is loaded twice as can be demonstrated
// by uncommenting the following "dump" statement which will get displayed twice
// dump("$$$$$$$$$$ HERE WE ARE IN walletContextOverlay.xul $$$$$$$$$$\n");
// As a consequence, the block-image item appears twice in the context menu. To
// prevent that from happening, the "display:none" was added to the menuitem below
]]>
</script>
<!-- context menu -->
<popupset id="contentAreaContextSet" onpopupshowing="initContextItems();"/>
<popup id="contentAreaContextMenu">
<menuitem id="context-formshow"
label="&formshowCmd.label;"
accesskey=""
oncommand="formShow();"
style="display:none;"
insertafter="context-copyimage"/>
<menuitem id="context-capture"
label="&captureCmd.label;"
accesskey=""
oncommand="formCapture();"
style="display:none;"
insertafter="context-copyimage"/>
<menuitem id="context-prefill"
label="&prefillCmd.label;"
accesskey=""
oncommand="formPrefill();"
style="display:none;"
insertafter="context-copyimage"/>
<menuseparator id="context-separator"
style="display:none;"
insertafter="context-copyimage"/>
</popup>
</overlay>