<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
<!--

  The contents of this file are subject to the Netscape Public License
  Version 1.0 (the "NPL"); you may not use this file except in
  compliance with the NPL.  You may obtain a copy of the NPL at
  http://www.mozilla.org/NPL/

  Software distributed under the NPL is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  for the specific language governing rights and limitations under the
  NPL.

  The Initial Developer of this code under the NPL is Netscape
  Communications Corporation.  Portions created by Netscape are
  Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  Reserved.

-->

<?xml-stylesheet href="chrome:/global/skin/xul.css" type="text/css"?>
<?xml-stylesheet href="manage-bookmarks.css" type="text/css"?>
<?xml-stylesheet href="bookmarks.css" type="text/css"?>

<!DOCTYPE window
[
<!ENTITY menu.file.label            "File">
<!ENTITY menuitem.newWindow.label     "New Window">
<!ENTITY menuitem.newBookmark.label   "New Bookmark...">
<!ENTITY menuitem.newFolder.label     "New Folder...">
<!ENTITY menuitem.newSeparator.label  "New Separator">
<!ENTITY menuitem.close.label         "Close">
<!ENTITY menu.edit.label            "Edit">
<!ENTITY menuitem.undo.label          "Undo">
<!ENTITY menuitem.redo.label          "Redo">
<!ENTITY menuitem.cut.label           "Cut">
<!ENTITY menuitem.copy.label          "Copy">
<!ENTITY menuitem.paste.label         "Paste">
<!ENTITY menuitem.delete.label        "Delete">
<!ENTITY menuitem.selectAll.label     "Select All">
<!ENTITY menuitem.find.label          "Find in Bookmarks...">
<!ENTITY menuitem.findAgain.label     "Find Again">
<!ENTITY menuitem.properties.label    "Bookmark Properties...">
<!ENTITY tree.header.name.label           "Name">
<!ENTITY tree.header.url.label            "URL">
<!ENTITY tree.header.shortcut.label       "Shortcut URL">
<!ENTITY tree.header.addedon.label       "Added On">
<!ENTITY tree.header.lastmod.label       "Last Modified">
<!ENTITY tree.header.lastvisit.label     "Last Visit">
<!ENTITY tree.header.description.label  "Description">
<!ENTITY bookmarksWindowTitle.label	"Bookmarks">
]>

<xul:window title="&bookmarksWindowTitle.label;"
  xmlns:html="http://www.w3.org/TR/REC-html40"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:web="http://home.netscape.com/WEB-rdf#"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  width="500" height="400">

  <html:script src="bookmarks.js"/>

  <menubar>
    <menu name="&menu.file.label;">
      <menuitem name="&menuitem.newWindow.label;"
                onclick="window.open('resource:/res/samples/bookmarks.xul',
                                     'ManageBookmarks',
                                     'chrome');" />
      <menuitem name="x&menuitem.newBookmark.label;"/>
      <menuitem name="x&menuitem.newFolder.label;"/>
      <menuitem name="x&menuitem.newSeparator.label;"/>
      <separator/>
      <menuitem name="&menuitem.close.label;"
                onclick="window.close()" />
    </menu>
    <menu name="&menu.edit.label;">
      <menuitem name="x&menuitem.undo.label;"/>
      <menuitem name="x&menuitem.redo.label;"/>
      <separator/>
      <menuitem name="x&menuitem.cut.label;"/>
      <menuitem name="x&menuitem.copy.label;"/>
      <menuitem name="x&menuitem.paste.label;"/>
      <menuitem name="x&menuitem.delete.label;"/>
      <menuitem name="x&menuitem.selectAll.label;"/>
      <separator/>
      <menuitem name="x&menuitem.find.label;"/>
      <menuitem name="x&menuitem.findAgain.label;"/>
      <separator/>
      <menuitem name="&menuitem.properties.label;"
                onclick="BookmarkProperties();"/>
    </menu>
  </menubar>

<popup id="contextual" oncreate="return fillContextMenu('contextual');" >
	<menu />
</popup>

<tree  id="bookmarksTree" context="contextual"
       datasources="rdf:bookmarks rdf:files rdf:ftp rdf:find rdf:internetsearch"
       onclick="return DoSingleClick(event, event.target);"
       ondblclick="return OpenURL(event,event.target.parentNode.parentNode.parentNode);"
       style="height:100%;">

  <template>
    <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator" rootcontainment="treechildren" subcontainment="treechildren">
       <treeitem uri="...">
         <treerow>
           <treecell>
             <html:hr width="75%" align="center" size="1" />
           </treecell>
         </treerow>
       </treeitem>  		
     </rule>

     <rule rootcontainment="treechildren" subcontainment="treechildren">
       <treeitem uri="...">
         <treerow>
           <treecell>
             <treeindentation />
             <titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" />
           </treecell>
           <treecell>
             <titledbutton value="rdf:http://home.netscape.com/NC-rdf#URL" align="right" style="list-style-image: none;" />
           </treecell>
           <treecell>
             <titledbutton value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" align="right" style="list-style-image: none;" />
           </treecell>
           <treecell>
             <titledbutton value="rdf:http://home.netscape.com/NC-rdf#Description" align="right" style="list-style-image: none;" />
           </treecell>
           <treecell>
             <titledbutton value="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate" align="right" style="list-style-image: none;" />
           </treecell>
           <treecell>
             <titledbutton value="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate" align="right" style="list-style-image: none;" />
           </treecell>
           <treecell>
             <titledbutton value="rdf:http://home.netscape.com/WEB-rdf#LastModifiedDate" align="right" style="list-style-image: none;" />
           </treecell>

         </treerow>
       </treeitem>
     </rule>
  </template>

  <treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
  <treecol id="URLColumn" rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
  <treecol id="ShortcutURLColumn" rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"/>
  <treecol id="DescriptionColumn" rdf:resource="http://home.netscape.com/NC-rdf#Description"/>
  <treecol id="LastVisitColumn" rdf:resource="http://home.netscape.com/WEB-rdf#LastVisitDate"/>
  <treecol id="AddedOnColumn" rdf:resource="http://home.netscape.com/NC-rdf#BookmarkAddDate"/>
  <treecol id="LastModColumn" rdf:resource="http://home.netscape.com/WEB-rdf#LastModifiedDate"/>

  <treehead>
    <treerow>
      <treecell onclick="return doSort('NameColumn');">
	<xul:observes element="NameColumn" attribute="sortActive"/>
	<xul:observes element="NameColumn" attribute="sortDirection"/>
      &tree.header.name.label;</treecell>
      <treecell onclick="return doSort('URLColumn');">
	<xul:observes element="URLColumn" attribute="sortActive"/>
	<xul:observes element="URLColumn" attribute="sortDirection"/>
      &tree.header.url.label;</treecell>
      <treecell onclick="return doSort('ShortcutURLColumn');">
	<xul:observes element="ShortcutURLColumn" attribute="sortActive"/>
	<xul:observes element="ShortcutURLColumn" attribute="sortDirection"/>
      &tree.header.shortcut.label;</treecell>
      <treecell onclick="return doSort('DescriptionColumn');">
	<xul:observes element="DescriptionColumn" attribute="sortActive"/>
	<xul:observes element="DescriptionColumn" attribute="sortDirection"/>
      &tree.header.description.label;</treecell>
      <treecell onclick="return doSort('LastVisitColumn');">
	<xul:observes element="LastVisitColumn" attribute="sortActive"/>
	<xul:observes element="LastVisitColumn" attribute="sortDirection"/>
      &tree.header.lastvisit.label;</treecell>
      <treecell onclick="return doSort('AddedOnColumn');">
	<xul:observes element="AddedOnColumn" attribute="sortActive"/>
	<xul:observes element="AddedOnColumn" attribute="sortDirection"/>
      &tree.header.addedon.label;</treecell>
      <treecell onclick="return doSort('LastModColumn');">
	<xul:observes element="LastModColumn" attribute="sortActive"/>
	<xul:observes element="LastModColumn" attribute="sortDirection"/>
      &tree.header.lastmod.label;</treecell>

    </treerow>
  </treehead>

  <treechildren ref="NC:BookmarksRoot" open="true" />
</tree>

</xul:window>
