<?xml version="1.0"?>

<!-- -*- Mode: HTML; indent-tabs-mode: nil; -*- -->
<!--

  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.org code.
 
  The Initial Developer of the Original Code is Netscape
  Communications Corporation.  Portions created by Netscape are
  Copyright (C) 1998 Netscape Communications Corporation. All
  Rights Reserved.
 
  Contributor(s): 
    Ben Goodger <ben@netscape.com> (Original Author)

-->

<?xml-stylesheet href="chrome://communicator/skin/"?>
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?>

<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % addBookmarkDTD SYSTEM "chrome://communicator/locale/bookmarks/addBookmark.dtd">
%addBookmarkDTD;
]>

<window id="newBookmarkWindow" style="width: 36em;"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        title="&newBookmark.title;" title-selectFolder="&selectFolder.label;"
        orient="vertical" class="dialog"
        onload="Startup();">
  
  <script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/>
  <script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksTree.js"/>
  <script type="application/x-javascript" src="chrome://communicator/content/bookmarks/addBookmark.js"/>

  <stringbundle id="bookmarksbundle"
                src="chrome://communicator/locale/bookmarks/bookmark.properties"/>

  
  <keyset id="keyset"/>
  
  <separator class="thin"/>
  
  <grid id="bookmarknamegrid">
    <columns>
      <column/>
      <column flex="5"/>
      <column flex="1"/>
    </columns>
    <rows>
      <row autostretch="never">
        <text class="label" value="&name.label;" accesskey="&name.accesskey;" for="name"/>
        <textfield id="name"/>
        <spring/>
      </row>
      <row>
        <separator class="thin"/>
        <separator class="thin"/>
        <spring/>
      </row>
      <row autostretch="never">
        <text class="label" value="&url.label;" accesskey="&url.accesskey;" for="url"/>
        <textfield id="url" oninput="onLocationInput();"/>
        <spring/>
      </row>
    </rows>
  </grid>

  <separator id="createinseparator"/>

  <box id="folderbox" orient="vertical" flex="1">
    <separator/>
    <grid flex="1">
      <columns>
        <column/>
        <column flex="1"/>
      </columns>
      <rows>
        <row autostretch="never" valign="top">
          <text id="createinlabel" class="label" value="&createin.label;"/>
          <box autostretch="never" valign="top" flex="1">
            <tree id="folders" flex="1" style="height: 12em; width: 0px"
                  class="inset" ref="NC:BookmarksRoot" datasources="rdf:bookmarks"
                  template="file-bookmarks-template"
                  onselect="onTreeSelect();" onkeypress="event.preventBubble();">
              <treecols>
                <treecol flex="1"/>
              </treecols>
        
              <template id="file-bookmarks-template">
                <rule iscontainer="true">
                  <treechildren>
                    <treeitem uri="rdf:*" persist="open" class="bookmark-item"
                              rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
                      <treerow>
                        <treecell value="rdf:http://home.netscape.com/NC-rdf#Name"
                                  class="treecell-indent treecell-editable" editable="true"
                                  src="rdf:http://home.netscape.com/NC-rdf#Icon"
                                  rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
                                  loading="rdf:http://home.netscape.com/NC-rdf#loading"/>
                      </treerow>
                    </treeitem>
                  </treechildren>
                </rule>
              </template>
              <treechildren id="folderKids" flex="1"/>
            </tree>
            <box orient="vertical">
              <button value="&button.newfolder.label;" accesskey="&button.newfolder.accesskey;"
                      oncommand="createNewFolder();"/>
              <button value="&button.defaultfolder.label;" 
                      accesskey="&button.defaultfolder.accesskey;"
                      oncommand="useDefaultFolder();"/>
            </box>
          </box>
        </row>
      </rows>
    </grid>
    <separator/>
  </box>

  <!-- XXX - todo - remove all the create-in code -->  
  <box valign="bottom">
    <box autostretch="never">
      <checkbox id="dontaskagain" 
                value="&alwayscreateinfolder.label;"
                accesskey="&alwayscreateinfolder.accesskey;"/>
    </box>
    <spring flex="1"/>  
    <box id="okCancelButtonsRight"/>
  </box>
  
</window>        