home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / phoenix / chrome / browser.jar / content / browser / bookmarks / bookmarksToolbar.xml < prev    next >
Extensible Markup Language  |  2002-10-23  |  31KB  |  736 lines

  1. <?xml version="1.0"?>  
  2.  
  3. <!DOCTYPE window [
  4.   <!ENTITY % bookmarksDTD SYSTEM "chrome://browser/locale/bookmarks/bookmarks.dtd" >
  5.   %bookmarksDTD;
  6. ]>
  7.  
  8. <bindings xmlns="http://www.mozilla.org/xbl" 
  9.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
  10.           xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  11.           xmlns:xbl="http://www.mozilla.org/xbl">
  12.  
  13.   <binding id="bookmarks-toolbar-base">
  14.   </binding>
  15.  
  16.   <binding id="bookmarks-toolbar">
  17.  
  18.     <implementation implements="nsIRDFObserver">
  19.  
  20.       <constructor><![CDATA[
  21.         var hbox = (document.getAnonymousNodes(this))[0].firstChild;
  22.         this.toolbar.controllers.appendController(this.commandController);
  23.         var theToolbar = this;
  24.         var resizeFunc = function(event) { 
  25.           theToolbar._overflowTimerInEffect = false;
  26.           var buttons = (document.getAnonymousNodes(theToolbar))[0].firstChild;
  27.           var menu = buttons.nextSibling.childNodes[1];
  28.           var width = window.innerWidth;
  29.           menu.collapsed = true;
  30.           var overflowed = false;
  31.  
  32.           for (var i=4; i<buttons.childNodes.length; i++) {
  33.             var button = buttons.childNodes[i];
  34.             button.collapsed = overflowed;
  35.             
  36.             if (button.boxObject.x + button.boxObject.width > width) {
  37.               overflowed = true;
  38.               // This button doesn't fit. Show it in the menu. Hide it in the toolbar.
  39.               if (!button.collapsed)
  40.                 button.collapsed = true;
  41.               if (menu.collapsed) {
  42.                 menu.collapsed = false;
  43.                 var overflowPadder = document.getElementById("overflow-padder");
  44.                 overflowPadder.width = width - menu.boxObject.width - theToolbar.boxObject.x;
  45.               }
  46.             }
  47.           }
  48.         };
  49.         this.resizeFunc = resizeFunc;
  50.         window.addEventListener("resize", resizeFunc, false);
  51.         hbox.database.AddObserver(this);
  52.       ]]></constructor>
  53.  
  54.       <destructor>
  55.         var hbox = (document.getAnonymousNodes(this))[0].firstChild;
  56.         this.toolbar.controllers.removeController(this.commandController);
  57.         hbox.database.RemoveObserver(this);
  58.       </destructor>
  59.  
  60.       <property name="toolbar">
  61.         <getter><![CDATA[
  62.           return document.getAnonymousElementByAttribute(this, "anonid", "bookmarks-ptf");
  63.         ]]></getter>
  64.       </property>
  65.  
  66.       <field name="resizeFunc">null</field>
  67.       <field name="_selection">  null</field>
  68.       <field name="_target">     null</field>
  69.       <field name="_orientation">null</field>
  70.  
  71.   <!--////////////////////////////////////////////////////////////////////////////
  72.       // Fill a context menu popup with menuitems that are appropriate for the current
  73.       // selection.-->
  74.       <method name="createBTContextMenu">
  75.         <parameter name="aEvent"/>
  76.         <body><![CDATA[
  77.           var hbox = (document.getAnonymousNodes(this))[0].firstChild;
  78.           hbox.focus() <!-- buttons in the pt have -moz-user-focus: ignore -->
  79.           this._selection   = this.getBTSelection(document.popupNode);
  80.           this._orientation = this.getBTOrientation(aEvent, document.popupNode);
  81.           this._target      = this.getBTTarget(document.popupNode, this._orientation);
  82.           BookmarksCommand.createContextMenu(aEvent, this._selection);
  83.           this.onCommandUpdate();
  84.           aEvent.target.addEventListener("mousemove", this.commandController.onMouseMove, false)
  85.         ]]></body>
  86.       </method>
  87.  
  88.   <!--////////////////////////////////////////////////////////////////////////////
  89.       // Fill a context menu popup with menuitems that are appropriate for the current
  90.       // selection. -->
  91.       <method name="destroyBTContextMenu">
  92.         <parameter name="aEvent"/>
  93.         <body><![CDATA[
  94.           if (content) 
  95.             content.focus()
  96.           personalToolbarDNDObserver.onDragRemoveFeedBack(document.popupNode); // needed on cancel
  97.           aEvent.target.removeEventListener("mousemove", this.commandController.onMouseMove, false)
  98.         ]]></body>
  99.       </method>
  100.  
  101.   <!--////////////////////////////////////////////////////////////////////////////
  102.       // Fill in tooltips for the bookmark toolbar. -->
  103.       <method name="fillInBTTooltip">
  104.         <parameter name="aTipElement"/>
  105.         <body><![CDATA[
  106.           var title = aTipElement.label;
  107.           var url = aTipElement.statusText;
  108.  
  109.           if (!title && !url) {
  110.             // bail out early if there is nothing to show
  111.             return false;
  112.           }
  113.  
  114.           var tooltipTitle = document.getElementById("ptTitleText");
  115.           var tooltipUrl = document.getElementById("ptUrlText"); 
  116.           if (title && title != url) {
  117.             tooltipTitle.removeAttribute("hidden");
  118.             tooltipTitle.setAttribute("value", title);
  119.           } else  {
  120.             tooltipTitle.setAttribute("hidden", "true");
  121.           }
  122.           if (url) {
  123.             tooltipUrl.removeAttribute("hidden");
  124.             tooltipUrl.setAttribute("value", url);
  125.           } else
  126.             tooltipUrl.setAttribute("hidden", "true");
  127.  
  128.           return true; // show tooltip
  129.         ]]></body>
  130.       </method>
  131.  
  132.   <!--/////////////////////////////////////////////////////////////////////////////
  133.       // returns the formatted selection from aNode -->
  134.       <method name="getBTSelection">
  135.         <parameter name="aNode"/>
  136.         <body><![CDATA[
  137.           var item;
  138.           switch (aNode.id) {
  139.           case "bookmarks-ptf":
  140.             item = "NC:PersonalToolbarFolder";
  141.             break;
  142.           case "bookmarks-menu":
  143.             item = "NC:BookmarksRoot";
  144.             break;
  145.           default:
  146.             item = aNode.id;
  147.           }
  148.           if (!this.isBTBookmark(item))
  149.             return {length:0};
  150.           var parent           = this.getBTContainer(aNode);
  151.           var isExpanded       = aNode.hasAttribute("open") && aNode.open;
  152.           var selection        = {};
  153.           selection.item       = [RDF.GetResource(item)];
  154.           selection.parent     = [RDF.GetResource(parent)];
  155.           selection.isExpanded = [isExpanded];
  156.           selection.isRef      = false;
  157.           selection.length     = selection.item.length;
  158.           BookmarksUtils.checkSelection(selection);
  159.           return selection;
  160.         ]]></body>
  161.       </method>
  162.  
  163.   <!--/////////////////////////////////////////////////////////////////////////////
  164.       // returns the insertion target from aNode -->
  165.       <method name="getBTTarget">
  166.         <parameter name="aNode"/>
  167.         <parameter name="aOrientation"/>
  168.         <body><![CDATA[
  169.           var item, parent, index;
  170.           switch (aNode.id) {
  171.           case "bookmarks-ptf":
  172.             parent = "NC:PersonalToolbarFolder";
  173.             item = this.getLastVisibleBookmark();
  174.             break;
  175.           case "bookmarks-menu":
  176.             parent = "NC:BookmarksRoot";
  177.             break;
  178.           default:
  179.             if (aNode.getAttribute("class") == "chevron") {
  180.               parent = "NC:PersonalToolbarFolder";
  181.               break;
  182.             }
  183.             if (aOrientation == BookmarksUtils.DROP_ON)
  184.               parent = aNode.id
  185.             else {
  186.               parent = this.getBTContainer(aNode);
  187.               item = aNode;
  188.             }
  189.           }
  190.  
  191.           parent = RDF.GetResource(parent);
  192.           if (item && aOrientation != BookmarksUtils.DROP_ON) {
  193.             item = RDF.GetResource(item.id);
  194.             RDFC.Init(BMDS, parent);
  195.             index = RDFC.IndexOf(item);
  196.             if (aOrientation == BookmarksUtils.DROP_AFTER)
  197.               ++index;
  198.           } else
  199.             index = parseInt(BookmarksUtils.getProperty(parent, RDF_NS+"nextVal"));
  200.  
  201.           var target = { parent: parent, index: index };
  202.           return target;
  203.         ]]></body>
  204.       </method>
  205.  
  206.   <!--/////////////////////////////////////////////////////////////////////////////
  207.       // returns the parent resource of a node in the personal toolbar.
  208.       // This is determined by inspecting the source element and walking up the 
  209.       // DOM tree to find the appropriate containing node. -->
  210.       <method name="getBTContainer">
  211.         <parameter name="aNode"/>
  212.         <body><![CDATA[
  213.           var parent;
  214.           var item = aNode.id;
  215.           if (!this.isBTBookmark(item))
  216.             return "NC:BookmarksRoot"
  217.           parent = aNode.parentNode.parentNode;
  218.           if (parent.getAttribute("class") == "chevron")
  219.             parent = parent.parentNode.parentNode;
  220.           if (parent.localName == "stack")
  221.             parent = parent.parentNode;
  222.           parent = parent.id;
  223.           switch (parent) {
  224.           case "bookmarks-toolbar":
  225.             parent = "NC:PersonalToolbarFolder"
  226.             break;
  227.           case "bookmarks-menu":
  228.             parent = "NC:BookmarksRoot";
  229.             break;
  230.           }
  231.           return parent;
  232.         ]]></body>
  233.       </method>
  234.  
  235.   <!--/////////////////////////////////////////////////////////////////////////////
  236.       // Returns true if the node is a bookmark, a folder or a bookmark separator -->
  237.       <method name="isBTBookmark">
  238.         <parameter name="aURI"/>
  239.         <body><![CDATA[
  240.           if (!aURI)
  241.             return false;
  242.           var type = BookmarksUtils.resolveType(aURI);
  243.           return (type == "BookmarkSeparator" ||
  244.                   type == "Bookmark"          ||
  245.                   type == "Folder"            ||
  246.                   type == "FolderGroup"       ||
  247.                   type == "PersonalToolbarFolder")
  248.         ]]></body>
  249.       </method>
  250.  
  251.   <!--/////////////////////////////////////////////////////////////////////////////
  252.       // Returns true if the node is a container. -->
  253.       <method name="isBTContainer">
  254.         <parameter name="aTarget"/>
  255.         <body><![CDATA[
  256.           return  aTarget.localName == "menu" || (aTarget.localName == "toolbarbutton" &&
  257.                  (aTarget.getAttribute("container") == "true" || aTarget.getAttribute("group") == "true"));
  258.         ]]></body>
  259.       </method>
  260.  
  261.   <!--/////////////////////////////////////////////////////////////////////////////
  262.       // Returns BookmarksUtils.DROP_BEFORE, DROP_ON or DROP_AFTER accordingly
  263.       // to the event coordinates. Skin authors could break us, we'll cross that 
  264.       // bridge when they turn us 90degrees.  -->
  265.       <method name="getBTOrientation">
  266.         <parameter name="aEvent"/>
  267.         <parameter name="aTarget"/>
  268.         <body><![CDATA[
  269.           var target
  270.           if (!aTarget)
  271.             target = aEvent.originalTarget;
  272.           else
  273.             target = aTarget;
  274.           if (target.localName == "menu"                 &&
  275.               target.parentNode.localName != "menupopup" ||
  276.               target.getAttribute("class") == "chevron")
  277.             return BookmarksUtils.DROP_ON;
  278.           if (target.localName == "hbox") {
  279.             return target.childNodes.length>4?
  280.                    BookmarksUtils.DROP_AFTER:BookmarksUtils.DROP_ON;
  281.           }
  282.  
  283.           var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject);
  284.           var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject);
  285.  
  286.           var size, border;
  287.           var coordValue, clientCoordValue;
  288.           switch (target.localName) {
  289.             case "toolbarseparator":
  290.             case "toolbarbutton":
  291.               size = overButtonBoxObject.width;
  292.               coordValue = overButtonBoxObject.x;
  293.               clientCoordValue = aEvent.clientX;
  294.               break;
  295.             case "menuseparator": 
  296.             case "menu":
  297.             case "menuitem":
  298.               size = overButtonBoxObject.height;
  299.               coordValue = overButtonBoxObject.y-overParentBoxObject.y;
  300.               clientCoordValue = aEvent.clientY;
  301.               break;
  302.             default: return BookmarksUtils.DROP_ON;
  303.           }
  304.           if (this.isBTContainer(target))
  305.             if (target.localName == "toolbarbutton") {
  306.               // the DROP_BEFORE area excludes the label
  307.               var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon");
  308.               border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) +
  309.                        parseInt(document.defaultView.getComputedStyle(iconNode     ,"").getPropertyValue("width"));
  310.               border = Math.min(size/5,Math.max(border,4));
  311.             } else
  312.               border = size/5;
  313.           else
  314.             border = size/2;
  315.       
  316.           // in the first region?
  317.           if (clientCoordValue-coordValue < border)
  318.             return BookmarksUtils.DROP_BEFORE;
  319.           // in the last region?
  320.           if (clientCoordValue-coordValue >= size-border)
  321.             return BookmarksUtils.DROP_AFTER;
  322.           // must be in the middle somewhere
  323.           return BookmarksUtils.DROP_ON;
  324.         ]]></body>
  325.       </method>
  326.  
  327.   <!--/////////////////////////////////////////////////////////////////////////////
  328.       // expand the folder targeted by the context menu. -->
  329.       <method name="expandBTFolder">
  330.         <body><![CDATA[
  331.            var target = document.popupNode.lastChild;
  332.            if (document.popupNode.open)
  333.              target.hidePopup();
  334.            else
  335.              target.showPopup(document.popupNode);
  336.         ]]></body>
  337.       </method>
  338.  
  339.       <method name="onCommandUpdate">
  340.         <body><![CDATA[
  341.           var selection = this._selection;
  342.           var target    = this._target;
  343.           BookmarksController.onCommandUpdate(selection, target);
  344.           if (document.popupNode.id == "NC:PersonalToolbarFolder") {
  345.             // disabling 'copy' on the empty area of the personal toolbar
  346.             var commandNode = document.getElementById("cmd_bm_copy");
  347.             commandNode.setAttribute("disabled", "true");
  348.           }
  349.         ]]></body>
  350.       </method>
  351.  
  352.   <!--/////////////////////////////////////////////////////////////////////////////
  353.       // returns false if...
  354.       // - the parent is the bookmark menu or the chevron
  355.       // - the menupopup contains ony one bookmark -->
  356.       <method name="validOpenInTabsMenuItem">
  357.         <parameter name="aTarget"/>
  358.         <body><![CDATA[
  359.           var rParent = RDF.GetResource(aTarget.parentNode.id)
  360.           var type = BookmarksUtils.resolveType(rParent);
  361.           if (type != "Folder" && type != "FolderGroup" &&
  362.               type != "PersonalToolbarFolder")
  363.             return false;
  364.           var count = 0;
  365.           if (!aTarget.hasChildNodes())
  366.             return false;
  367.           var curr = aTarget.firstChild;
  368.           do {
  369.             type = BookmarksUtils.resolveType(curr.id);
  370.             if (type == "Bookmark" && ++count == 2)
  371.               return true;
  372.             curr = curr.nextSibling;
  373.           } while (curr)
  374.           return false;
  375.         ]]></body>
  376.       </method>
  377.  
  378.   <!--/////////////////////////////////////////////////////////////////////////////
  379.       // shows the 'Open in Tabs' menu item if validOpenInTabsMenuItem is true -->
  380.       <method name="showOpenInTabsMenuItem">
  381.         <parameter name="aTarget"/>
  382.         <body><![CDATA[
  383.           if (!this.validOpenInTabsMenuItem(aTarget) ||
  384.               aTarget.lastChild.id == "openintabs-menuitem")
  385.             return;
  386.           var element = document.createElementNS(XUL_NS, "menuseparator");
  387.           aTarget.appendChild(element);
  388.           element = document.createElementNS(XUL_NS, "menuitem");
  389.           element.setAttribute("id", "openintabs-menuitem")
  390.           element.setAttribute("label", BookmarksUtils.getLocaleString("cmd_bm_openfolder"));
  391.           //element.setAttribute("class", "groupmark-item menuitem-iconic bookmark-item");
  392.           element.setAttribute("accesskey", BookmarksUtils.getLocaleString("cmd_bm_openfolder_accesskey"));
  393.           element.setAttribute("oncommand", "BookmarksUtils.loadBookmarkBrowser(event, this.parentNode.parentNode, this.database); event.preventBubble();");
  394.           aTarget.appendChild(element);
  395.         ]]></body>
  396.       </method>
  397.  
  398.   <!--/////////////////////////////////////////////////////////////////////////////
  399.       // hides the 'Open in Tabs' on popuphidden so that we won't duplicate it -->
  400.       <method name="hideOpenInTabsMenuItem">
  401.         <parameter name="aTarget"/>
  402.         <body><![CDATA[
  403.           if (!aTarget.hasChildNodes())
  404.             return;
  405.           if (aTarget.lastChild.id == "openintabs-menuitem") {
  406.             aTarget.removeChild(aTarget.lastChild);
  407.             aTarget.removeChild(aTarget.lastChild);
  408.           }
  409.         ]]></body>
  410.       </method>
  411.  
  412.   <!--/////////////////////////////////////////////////////////////////////////////
  413.       // returns the node of the last visible bookmark on the toolbar -->
  414.       <method name="getLastVisibleBookmark">
  415.         <body><![CDATA[
  416.           var buttons = (document.getAnonymousNodes(this))[0].firstChild;
  417.           var button = buttons.childNodes[3].nextSibling;
  418.           if (!button)
  419.             return null; // empty bookmarks toolbar
  420.           do {
  421.             if (button.collapsed)
  422.               return button.previousSibling;
  423.             button = button.nextSibling;
  424.           } while (button)
  425.           return buttons.lastChild;
  426.         ]]></body>
  427.       </method>
  428.  
  429.       <method name="updateOverflowMenu">
  430.         <parameter name="menupopup"/>
  431.         <body><![CDATA[
  432.           var hbox = (document.getAnonymousNodes(this))[0].firstChild;
  433.           for (var i = 4; i < hbox.childNodes.length; i++) {
  434.             var button = hbox.childNodes[i];
  435.             var menu = menupopup.childNodes[i-4];
  436.             if (menu.collapsed == button.collapsed)
  437.               menu.collapsed = !menu.collapsed;
  438.           }
  439.         ]]></body>
  440.       </method>
  441.        
  442.   <!--Implement nsIRDFObserver so we can update our overflow state when items get added/removed from
  443.       the toolbar -->
  444.       <field name="_overflowTimerInEffect">false</field>
  445.       <method name="setOverflowTimeout">
  446.         <body><![CDATA[
  447.           if (this._overflowTimerInEffect)
  448.             return;
  449.           this._overflowTimerInEffect = true;
  450.           setTimeout("document.getElementById('bookmarks-toolbar').resizeFunc(null)", 0);
  451.         ]]>
  452.         </body>
  453.       </method>
  454.  
  455.       <method name="onAssert">
  456.         <parameter name="aDataSource"/>
  457.         <parameter name="aSource"/>
  458.         <parameter name="aProperty"/>
  459.         <parameter name="aTarget"/>
  460.         <body><![CDATA[
  461.           if (aSource.Value != "NC:PersonalToolbarFolder" || aProperty.Value == "http://home.netscape.com/WEB-rdf#LastModifiedDate")
  462.             return;
  463.           this.setOverflowTimeout();
  464.         ]]>
  465.         </body>
  466.       </method>
  467.  
  468.       <method name="onUnassert">
  469.         <parameter name="aDataSource"/>
  470.         <parameter name="aSource"/>
  471.         <parameter name="aProperty"/>
  472.         <parameter name="aTarget"/>
  473.         <body><![CDATA[
  474.           if (aSource.Value != "NC:PersonalToolbarFolder" || aProperty.Value == "http://home.netscape.com/WEB-rdf#LastModifiedDate")
  475.             return;
  476.           this.setOverflowTimeout();
  477.         ]]>
  478.         </body>
  479.       </method>
  480.  
  481.       <method name="onChange">
  482.         <parameter name="aDataSource"/>
  483.         <parameter name="aSource"/>
  484.         <parameter name="aProperty"/>
  485.         <parameter name="aOldTarget"/>
  486.         <parameter name="aNewTarget"/>
  487.         <body><![CDATA[
  488.           if (aSource.Value != "NC:PersonalToolbarFolder" || aProperty.Value == "http://home.netscape.com/WEB-rdf#LastModifiedDate")
  489.             return;
  490.           this.setOverflowTimeout();
  491.         ]]>
  492.         </body>
  493.       </method>
  494.  
  495.       <method name="onMove">
  496.         <parameter name="aDataSource"/>
  497.         <parameter name="aOldSource"/>
  498.         <parameter name="aNewSource"/>
  499.         <parameter name="aProperty"/>
  500.         <parameter name="aTarget"/>
  501.         <body><![CDATA[
  502.           if (aSource.Value != "NC:PersonalToolbarFolder")
  503.             return;
  504.           this.setOverflowTimeout();
  505.         ]]>
  506.         </body>
  507.       </method>
  508.  
  509.       <method name="beginUpdateBatch">
  510.         <parameter name="aDataSource"/>
  511.         <body><![CDATA[
  512.         ]]>
  513.         </body>
  514.       </method>
  515.  
  516.       <method name="endUpdateBatch">
  517.         <parameter name="aDataSource"/>
  518.         <body><![CDATA[
  519.         ]]>
  520.         </body>
  521.       </method>
  522.  
  523.   <!--/////////////////////////////////////////////////////////////////////////////
  524.       // Command controller -->
  525.       <field name="commandController" readonly="true"><![CDATA[
  526.       ({
  527.         mOuter: this,
  528.  
  529.         supportsCommand: BookmarksController.supportsCommand,
  530.  
  531.         isCommandEnabled: function (aCommand)
  532.         {
  533.           // warning: this is not the function called in BookmarksController.onCommandUpdate
  534.           var selection = this.mOuter._selection;
  535.           var target    = this.mOuter._target;
  536.           return BookmarksController.isCommandEnabled(aCommand, selection, target);
  537.         },
  538.  
  539.         doCommand: function (aCommand)
  540.         {
  541.           personalToolbarDNDObserver.onDragRemoveFeedBack(document.popupNode);
  542.           var selection = this.mOuter._selection;
  543.           var target    = this.mOuter._target;
  544.           switch (aCommand) {
  545.           case "cmd_bm_expandfolder":
  546.             this.mOuter.expandBTFolder();
  547.             break;
  548.           default:
  549.             BookmarksController.doCommand(aCommand, selection, target);
  550.           }
  551.         },
  552.  
  553.         onMouseMove: function (aEvent)
  554.         {
  555.           var command = aEvent.originalTarget.getAttribute("command");
  556.           var isDisabled = aEvent.originalTarget.getAttribute("disabled")
  557.           if (isDisabled != "true" && (command == "cmd_bm_newfolder" || command == "cmd_bm_paste")) {
  558.             personalToolbarDNDObserver.onDragSetFeedBack(document.popupNode, this.parentNode.parentNode.parentNode._orientation);
  559.           } else {
  560.             personalToolbarDNDObserver.onDragRemoveFeedBack(document.popupNode);
  561.           }
  562.         }
  563.  
  564.       })
  565.       ]]></field>
  566.  
  567.     </implementation>
  568.  
  569.     <content>
  570.       <xul:stack flex="1" style="min-width:0px; width:0px;">
  571.       <xul:hbox id="bookmarks-ptf" class="bookmarks-toolbar-items" anonid="bookmarks-ptf" contextmenu="_child"
  572.                 flex="1" style="min-width:0px; width:0px;margin-left: 3px;" 
  573.                 datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
  574.                 ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
  575.                 rdf:type="http://home.netscape.com/NC-rdf#Folder"
  576.                 onpopupshowing="this.parentNode.parentNode.showOpenInTabsMenuItem(event.originalTarget)"
  577.                 onpopuphidden="this.parentNode.parentNode.hideOpenInTabsMenuItem(event.originalTarget)"
  578.                 oncommand="BookmarksUtils.loadBookmarkBrowser(event, event.originalTarget, this.database)"
  579.                 onclick="BookmarksUtils.loadBookmarkBrowserMiddleClick(event, this.database)"
  580.                 ondraggesture="nsDragAndDrop.startDrag(event, personalToolbarDNDObserver)"
  581.                 ondragdrop="nsDragAndDrop.drop(event, personalToolbarDNDObserver); event.preventBubble()"
  582.                 ondragenter="nsDragAndDrop.dragEnter(event, personalToolbarDNDObserver); event.preventBubble()"
  583.                 ondragexit="nsDragAndDrop.dragExit(event, personalToolbarDNDObserver); event.preventBubble()"
  584.                 ondragover="nsDragAndDrop.dragOver(event, personalToolbarDNDObserver); event.preventBubble()">
  585.  
  586.         <!-- context menu -->
  587.         <xul:menupopup onpopupshowing="this.parentNode.parentNode.parentNode.createBTContextMenu(event);"
  588.                        onpopuphidden ="this.parentNode.parentNode.parentNode.destroyBTContextMenu(event);"/>
  589.  
  590.         <xul:tooltip id="ptTooltip" noautohide="true" 
  591.                      onpopupshowing="return this.parentNode.parentNode.parentNode.fillInBTTooltip(document.tooltipNode)">
  592.           <xul:vbox id="ptTooltipTextBox" flex="1">  
  593.             <xul:label id="ptTitleText" />
  594.             <xul:label id="ptUrlText" />
  595.           </xul:vbox>
  596.         </xul:tooltip>
  597.  
  598.         <xul:template xmlns:nc="http://home.netscape.com/NC-rdf#">
  599.  
  600.           <xul:rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
  601.             <xul:toolbarseparator uri="rdf:*"
  602.                                   rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
  603.           </xul:rule>
  604.  
  605.           <!-- yes, the type attribute is necessary otherwise all leaves are 
  606.                treated as containers for some reason -->
  607.           <xul:rule parent="hbox" iscontainer="true" isempty="true"
  608.                     rdf:type="http://home.netscape.com/NC-rdf#Folder">
  609.             <xul:toolbarbutton type="menu" editable="true" class="bookmark-item"
  610.                                rdf:type="http://home.netscape.com/NC-rdf#Folder"
  611.                                uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name">
  612.               <xul:menupopup>
  613.                 <xul:menuitem label="&emptyItem.label;" disabled="true"/>
  614.               </xul:menupopup>
  615.             </xul:toolbarbutton>
  616.           </xul:rule>
  617.  
  618.           <xul:rule parent="hbox" iscontainer="true">
  619.             <xul:toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
  620.                                rdf:type="http://home.netscape.com/NC-rdf#Folder"
  621.                                label="rdf:http://home.netscape.com/NC-rdf#Name">
  622.               <xul:menupopup/>
  623.             </xul:toolbarbutton>
  624.           </xul:rule>
  625.  
  626.           <xul:rule parent="hbox">
  627.             <xul:toolbarbutton class="bookmark-item" uri="rdf:*" editable="true" 
  628.                                status="rdf:http://home.netscape.com/WEB-rdf#status"
  629.                                rdf:type="http://home.netscape.com/NC-rdf#Bookmark"
  630.                                image="rdf:http://home.netscape.com/NC-rdf#Icon"
  631.                                statustext="rdf:http://home.netscape.com/NC-rdf#URL"
  632.                                tooltip="ptTooltip"
  633.                                label="rdf:http://home.netscape.com/NC-rdf#Name"/>
  634.           </xul:rule>
  635.  
  636.           <xul:rule iscontainer="true" isempty="true" rdf:type="http://home.netscape.com/NC-rdf#Folder">
  637.             <xul:menupopup>
  638.               <xul:menu class="menu-iconic bookmark-item" uri="rdf:*" 
  639.                         type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
  640.                         label="rdf:http://home.netscape.com/NC-rdf#Name">
  641.                 <xul:menupopup>
  642.                   <xul:menuitem label="&emptyItem.label;" disabled="true"/>
  643.                 </xul:menupopup>
  644.               </xul:menu>
  645.             </xul:menupopup>
  646.           </xul:rule>
  647.  
  648.           <xul:rule iscontainer="true">
  649.             <xul:menupopup>
  650.               <xul:menu class="menu-iconic bookmark-item" uri="rdf:*"
  651.                         type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
  652.                         label="rdf:http://home.netscape.com/NC-rdf#Name">
  653.                 <xul:menupopup/>
  654.               </xul:menu>
  655.             </xul:menupopup>
  656.           </xul:rule>
  657.  
  658.           <xul:rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
  659.             <xul:menupopup>
  660.               <xul:menuseparator uri="rdf:*"
  661.                                  type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
  662.             </xul:menupopup>
  663.           </xul:rule>
  664.  
  665.           <xul:rule>
  666.             <xul:menupopup>
  667.               <xul:menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
  668.                             label="rdf:http://home.netscape.com/NC-rdf#Name"
  669.                             image="rdf:http://home.netscape.com/NC-rdf#Icon"/>
  670.             </xul:menupopup>
  671.           </xul:rule>
  672.  
  673.         </xul:template>
  674.       </xul:hbox>
  675.       <xul:hbox class="bookmarks-toolbar-overflow-items" mousethrough="always">
  676.         <xul:hbox mousethrough="always" id="overflow-padder"/>
  677.         <xul:toolbarbutton mousethrough="never" collapsed="true" type="menu" class="chevron"
  678.               datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch" 
  679.               ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
  680.               onpopupshowing="this.parentNode.parentNode.parentNode.showOpenInTabsMenuItem(event.originalTarget)"
  681.               onpopuphidden="this.parentNode.parentNode.parentNode.hideOpenInTabsMenuItem(event.originalTarget)"
  682.               oncommand="BookmarksUtils.loadBookmarkBrowser(event, event.originalTarget, this.database)"
  683.               onclick="BookmarksUtils.loadBookmarkBrowserMiddleClick(event, this.database)"
  684.               ondraggesture="nsDragAndDrop.startDrag(event, personalToolbarDNDObserver)"
  685.               ondragdrop="nsDragAndDrop.drop(event, personalToolbarDNDObserver); event.preventBubble()"
  686.               ondragenter="nsDragAndDrop.dragEnter(event, personalToolbarDNDObserver); event.preventBubble()"
  687.               ondragexit="nsDragAndDrop.dragExit(event, personalToolbarDNDObserver); event.preventBubble()"
  688.               ondragover="nsDragAndDrop.dragOver(event, personalToolbarDNDObserver); event.preventBubble()">
  689.           <xul:template xmlns:nc="http://home.netscape.com/NC-rdf#">
  690.             <xul:rule iscontainer="true" isempty="true"
  691.                   rdf:type="http://home.netscape.com/NC-rdf#Folder">
  692.               <xul:menupopup>
  693.                 <xul:menu class="menu-iconic bookmark-item" uri="rdf:*" 
  694.                       type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
  695.                       label="rdf:http://home.netscape.com/NC-rdf#Name">
  696.                   <xul:menupopup>
  697.                     <xul:menuitem label="&emptyItem.label;" disabled="true"/>
  698.                   </xul:menupopup>
  699.                 </xul:menu>
  700.               </xul:menupopup>
  701.             </xul:rule>
  702.             <xul:rule iscontainer="true">
  703.               <xul:menupopup>
  704.                 <xul:menu class="menu-iconic bookmark-item" uri="rdf:*"
  705.                       label="rdf:http://home.netscape.com/NC-rdf#Name"
  706.                       type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
  707.                   <xul:menupopup />
  708.                 </xul:menu>
  709.               </xul:menupopup>
  710.             </xul:rule>
  711.             <xul:rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
  712.               <xul:menupopup> 
  713.                 <xul:menuseparator uri="rdf:*" />
  714.               </xul:menupopup>
  715.             </xul:rule>
  716.             <xul:rule>
  717.               <xul:menupopup>
  718.                 <xul:menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
  719.                           label="rdf:http://home.netscape.com/NC-rdf#Name" 
  720.                           image="rdf:http://home.netscape.com/NC-rdf#Icon"
  721.                           status="rdf:http://home.netscape.com/WEB-rdf#status"/>
  722.               </xul:menupopup>
  723.             </xul:rule>
  724.           </xul:template>
  725.           <xul:menupopup onpopupshowing="if (event.target != this) return; 
  726.                                          this.parentNode.parentNode.parentNode.parentNode.updateOverflowMenu(this);"/>
  727.           </xul:toolbarbutton>
  728.         </xul:hbox>
  729.         <xul:toolbarbutton class="bookmark-item bookmarks-toolbar-customize" mousethrough="never"
  730.            label="Bookmarks Toolbar Items"/>
  731.       </xul:stack>
  732.     </content>
  733.   </binding>
  734.  
  735. </bindings>
  736.