home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 March / PCWorld_2005-03_cd.bin / komunikace / kmeleon / kmeleon09.exe / comm.jar / content / wallet / walletNavigatorOverlay.xul < prev    next >
Extensible Markup Language  |  2004-02-29  |  6KB  |  178 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!--
  4.    The contents of this file are subject to the Netscape Public
  5.    License Version 1.1 (the "License"); you may not use this file
  6.    except in compliance with the License. You may obtain a copy of
  7.    the License at http://www.mozilla.org/NPL/
  8.     
  9.    Software distributed under the License is distributed on an "AS
  10.    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11.    implied. See the License for the specific language governing
  12.    rights and limitations under the License.
  13.     
  14.    The Original Code is Mozilla Communicator client code, released
  15.    March 31, 1998.
  16.    
  17.    The Initial Developer of the Original Code is Netscape
  18.    Communications Corporation. Portions created by Netscape are
  19.    Copyright (C) 1998-1999 Netscape Communications Corporation. All
  20.    Rights Reserved.
  21.    
  22.    Contributor(s): 
  23.   -->
  24.  
  25. <!DOCTYPE overlay SYSTEM "chrome://wallet/locale/walletNavigatorOverlay.dtd">
  26.  
  27. <overlay id="walletNavigatorOverlay"
  28.          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  29.  
  30.   <script type="application/x-javascript" src="chrome://wallet/content/walletOverlay.js"/>
  31.  
  32.   <script type="application/x-javascript">
  33.   <![CDATA[
  34.  
  35.     function initWalletMenuItems() {
  36.       // Determine if capture/prefill should be enabled.
  37.       var state = getState(0);
  38.       setDisabledAttr("cmd_walletCapture", (state.capture != enable));
  39.       setDisabledAttr("cmd_walletPrefill", (state.prefill != enable));
  40.     }
  41.  
  42. /* form toolbar is out
  43.     // Can't use generic goToggleToolbar (see utilityOverlay.js) for form menu because
  44.     // form toolbar could be hidden even when the checkbox in the view menu is checked
  45.     function goToggleFormToolbar(id, elementID) {
  46.       var element = document.getElementById(elementID);
  47.       if (element) {
  48.         var checkValue = element.getAttribute("checked");
  49.         if (checkValue == "false") {
  50.           element.setAttribute("checked","true")
  51.           initToolbarItems();
  52.         } else {
  53.           element.setAttribute("checked","false")
  54.           showItem("formToolbar", false);
  55.         }
  56.         document.persist(id, 'hidden');
  57.         document.persist(elementID, 'checked');
  58.       }
  59.     }
  60.  
  61.     function navObserver() {
  62.     }
  63.     navObserver.prototype.observe = function (subject, message, contextUrl) {
  64.       if (message == 'EndDocumentLoad') {
  65.         initToolbarItems()
  66.       }
  67.     }
  68.  
  69.     function addEndDocumentLoadListener() {
  70.       if (window._content) {
  71.         var observerService = Components.classes["@mozilla.org/observer-service;1"].getService();
  72.         observerService = observerService.QueryInterface(Components.interfaces.nsIObserverService);
  73.         var observer = new navObserver();
  74.         if (observerService && observer) {
  75.           observerService.addObserver(observer, "EndDocumentLoad", PR_FALSE);
  76.         } else {
  77.           dump("FAILURE to get observer service\n");
  78.         }
  79.       }
  80.     }
  81.  
  82.     window.addEventListener("load", addEndDocumentLoadListener, false);
  83. */
  84.  
  85.   ]]>
  86.   </script>         
  87.  
  88.   <commandset id="commands">
  89.     <commandset id="walletMenuItems">
  90.       <command id="cmd_walletPrefill" label="&prefillCmd.label;" 
  91.                accesskey="&prefillCmd.accesskey;" oncommand="formPrefill();"/>
  92.       <command id="cmd_walletCapture" label="&captureCmd.label;" 
  93.                accesskey="&captureCmd.accesskey;" oncommand="formCapture();"/>
  94.     </commandset>
  95.   </commandset>
  96.  
  97.   <!-- menu items -->
  98.  
  99. <!-- form toolbar is out
  100.   <broadcasterset id="broadcasterset">
  101.     <broadcaster id="cmd_viewformtoolbar" label="&formbarCmd.label;"
  102.                  accesskey="&formbarCmd.accesskey;" class="menuitem-iconic"
  103.                  type="checkbox" checked="true"
  104.                  oncommand="goToggleFormToolbar('formToolbar','cmd_viewformtoolbar');"/>
  105.   </broadcasterset>
  106. -->
  107.  
  108.   <!-- view menu -->
  109. <!-- form toolbar is out
  110.   <menupopup id="view_toolbars_popup">
  111.     <menuitem insertafter="cmd_viewpersonaltoolbar"
  112.               observes="cmd_viewformtoolbar"/>
  113.   </menupopup>
  114. -->
  115.  
  116.   <!-- edit menu -->
  117.   <menupopup id="menu_Edit_Popup" onpopupshowing="initWalletMenuItems();">
  118.     <menuseparator insertbefore="menu_PrefsSeparator"/> 
  119.     <menuitem command="cmd_walletPrefill"
  120.               insertbefore="menu_PrefsSeparator"/>
  121.     <menuitem command="cmd_walletCapture"
  122.               insertbefore="menu_PrefsSeparator"/>
  123.   </menupopup>
  124.  
  125.   <!-- Form toolbar items -->
  126.  
  127. <!-- form toolbar is out
  128.   <hbox id="appcontent">
  129.     <toolbar id="formToolbar"
  130.              class="chromeclass-directories"
  131.              tbautostretch="always"
  132.              insertafter="browser"
  133.              persist="collapsed"
  134.              style="display:none;">
  135.       <button class="button-toolbar-4"
  136.               id="formPrefill"
  137.               oncommand="formPrefill();"
  138.               label="  &formPrefill.label;  "
  139.               tooltiptext="&formPrefill.tooltip;"/>
  140.       <toolbarseparator/>
  141.       <button class="button-toolbar-4"
  142.               id="formCapture"
  143.               oncommand="formCapture();"
  144.               label="  &formCapture.label;  "
  145.               tooltiptext="&formCapture.tooltip;"/>
  146.       <toolbarseparator/>
  147.       <button class="button-toolbar-4"
  148.               id="formShow"
  149.               oncommand="formShow(); initToolbarItems();"
  150.               label="  &formView.label;  "
  151.               tooltiptext="&formView.tooltip;"/>
  152.       <toolbarseparator/>
  153.     </toolbar>
  154.   </hbox>
  155. -->
  156.   <menupopup id="taskPopup">
  157.     <menu label="&walletFormManager.label;"
  158.           accesskey="&walletFormManager.accesskey;"
  159.           id="wallet"
  160.           insertbefore="navBeginGlobalItems">
  161.       <menupopup onpopupshowing="initWalletMenuItems();">
  162.         <menuitem command="cmd_walletPrefill"/>
  163.         <menuitem command="cmd_walletCapture"/>
  164.         <menuseparator/>
  165.         <menuitem label="&walletContentsCmd.label;"
  166.                   accesskey="&walletContentsCmd.accesskey;"
  167.                   id="walleteditor"
  168.                   oncommand="WalletDialog('wallet');"/> 
  169.         <menuitem label="&walletSitesCmd.label;"
  170.                   accesskey="&walletSitesCmd.accesskey;"
  171.                   id="walletsites"
  172.                   oncommand="WalletDialog('walletsites');"/> 
  173.       </menupopup>
  174.     </menu>
  175.   </menupopup>
  176.  
  177. </overlay>
  178.