<?xml version="1.0" ?>
<kupu:feature
    name="drawers"
    implementation="default"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:kupu="http://kupu.oscom.org/namespaces/dist"
    xmlns:i18n="http://xml.zope.org/namespaces/i18n"
    >

  <kupu:part name="styles">
    <link href="kupudrawerstyles.css" rel="stylesheet" type="text/css" />
  </kupu:part>

  <kupu:part name="jsincludes">
    <script type="text/javascript" src="kupudrawers.js"> </script>
  </kupu:part>

  <kupu:part name="buttons">
    <span class="kupu-tb-buttongroup">
      <button type="button" class="kupu-image" id="kupu-imagelibdrawer-button"
              title="Insert image" i18n:attributes="title">&#160;</button>
      <button type="button" class="kupu-hyperlink" id="kupu-linklibdrawer-button"
              title="Insert link" i18n:attributes="title">&#160;</button>
      <button type="button" class="kupu-hyperlink" id="kupu-linkdrawer-button"
              title="Insert external link" i18n:attributes="title">&#160;</button>
      <button type="button" class="kupu-table" id="kupu-tabledrawer-button"
              title="Insert table"  i18n:attributes="title">&#160;</button>
    </span>
  </kupu:part>

  <kupu:part name="drawers">
    <kupu:define-slot name="drawers" />
  </kupu:part>

  <kupu:part name="librarydrawer">
    <div style="display:block;">
      <div id="kupu-librarydrawer" class="kupu-drawer">
      </div>
    </div>
  </kupu:part>

  <kupu:part name="linkdrawer">
    <div id="kupu-linkdrawer" class="kupu-drawer">
      <h1 i18n:translate="links">Links</h1>

      <div id="kupu-linkdrawer-addlink">
        <div class="kupu-toolbox-label">
          <!-- Link to items matching the keyword  -->
          <span i18n:translate="items-matching-keyword">
            Link the highlighted text to this URL
          </span>:
        </div>

        <input
            id="kupu-linkdrawer-input"
            class="kupu-toolbox-st" 
            type="text"
            size="14"
            />

        <div style="text-align: center">
          <button type="button" onclick="drawertool.closeDrawer()">Cancel</button>
          <button type="button" onclick="drawertool.current_drawer.save()">Save</button>
        </div>

      </div>
    </div>
  </kupu:part>

  <kupu:part name="tabledrawer">
    <div id="kupu-tabledrawer" class="kupu-drawer">
    <table width="100%">
      <tbody>
        <tr>
          <td class="kupu-toolbox-label">Table Class</td>
          <td width="1%">
            <select id="kupu-tabledrawer-classchooser"
                    onchange="drawertool.current_drawer.tool.setTableClass(this.options[this.selectedIndex].value)">
              <option value="plain">Plain</option>
              <option value="listing">Listing</option>
              <option value="grid">Grid</option>
              <option value="data">Data</option>
            </select>
          </td>
        </tr>

        <tr>
          <td colspan="2">

          <!-- this gets displayed when not in a table -->
          <div id="kupu-tabledrawer-addtable">
            <table width="100%">
              <tr>
                <td class="kupu-toolbox-label" width="50%">Rows</td>
                <td><input type="text" id="kupu-tabledrawer-newrows" /></td>
              </tr>
              <tr>
                <td class="kupu-toolbox-label">Columns</td>
                <td><input type="text" id="kupu-tabledrawer-newcols" /></td>
              </tr>
              <tr>
                <td class="kupu-toolbox-label">Headings</td>
                <td class="kupu-toolbox-label">
                  <input name="kupu-tabledrawer-makeheader"
                         id="kupu-tabledrawer-makeheader"
                         type="checkbox"
                         />
                  <label for="kupu-tabledrawer-makeheader">Create</label>
                </td>
              </tr>
              <tr>
                <td colspan="2" style="text-align: center">
                  <br />
                  <button type="button" onclick="drawertool.current_drawer.createTable()">Add Table</button>
                  <button type="button" onclick="drawertool.closeDrawer()">Close</button>
                </td>
              </tr>
            </table>
          </div>

          <!-- this gets displayed when in a table -->
          <div id="kupu-tabledrawer-edittable">
            <table width="100%">
              <tr>
                <td width="50%">Col Align</td>
                <td>
                  <select id="kupu-table-alignchooser"
                          onchange="drawertool.current_drawer.tool.setColumnAlign(this.options[this.selectedIndex].value)">
                    <option value="left">Left</option>
                    <option value="center">Center</option>
                    <option value="right">Right</option>
                    </select>
                </td>
              </tr>
              <tr>
                <td>Column</td>
                <td>
                  <button type="button" id="kupu-table-addcolumn-button"
                          onclick="drawertool.current_drawer.tool.addTableColumn">Add</button>
                  <button type="button" id="kupu-table-delcolumn-button"
                          onclick="drawertool.current_drawer.tool.delTableColumn">Remove</button>
                </td>
              </tr>
              <tr>
                <td>Row</td>
                <td>
                  <button type="button" id="kupu-table-addrow-button"
                          onclick="drawertool.current_drawer.addTableRow">Add</button> 
                  <button type="button" id="kupu-table-delrow-button"
                          onclick="drawertool.current_drawer.delTableRow">Remove</button>
                </td>
              </tr>
              <tr>
                <td colspan="2" style="text-align: center">
                  <br />
                  <button type="button" onclick="drawertool.closeDrawer()">Close</button>
                </td>
              </tr>
            </table>
          </div>

          </td>
        </tr>
      </tbody>
    </table>
    </div>

  </kupu:part>

  <kupu:part name="xmlconfig">
    <image_xsl_uri>kupudrawers/imagedrawer.xsl</image_xsl_uri>
    <link_xsl_uri>kupudrawers/linkdrawer.xsl</link_xsl_uri>
    <image_libraries_uri>kupudrawers/demolibraries.xml</image_libraries_uri>
    <link_libraries_uri>kupudrawers/demolibraries.xml</link_libraries_uri>
    <search_images_uri> </search_images_uri>
    <search_links_uri> </search_links_uri>
  </kupu:part>

</kupu:feature>
