home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mozil06.zip / bin / res / rdf / dom-test-8.xul < prev    next >
Extensible Markup Language  |  2001-02-14  |  4KB  |  152 lines

  1. <?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
  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.org code.
  15.  
  16.   The Initial Developer of the Original Code is Netscape
  17.   Communications Corporation.  Portions created by Netscape are
  18.   Copyright (C) 1998 Netscape Communications Corporation. All
  19.   Rights Reserved.
  20.  
  21.   Contributor(s): 
  22.  
  23. -->
  24.  
  25. <!--
  26.  
  27.    This test tries mixing it up a bit. It mingles XUL content with
  28.    RDF content for a change of pace.
  29.  
  30. -->
  31.  
  32. <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
  33.  
  34. <window
  35.   xmlns:html="http://www.w3.org/1999/xhtml"
  36.   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  37.   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  38.   align="vertical"
  39.   onload="ToBeetle();">
  40.  
  41.   <html:script>
  42.   var cursor;
  43.  
  44.   function CursorText()
  45.   {
  46.     if (cursor)
  47.       return "<" + cursor.nodeName + ">";
  48.     else
  49.       return "(null)";
  50.   }
  51.  
  52.   function ToBeetle()
  53.   {
  54.     cursor = document.getElementById('beetle');
  55.     dump('cursor = ' + CursorText() + '\n');
  56.   }
  57.  
  58.   function ToPrev()
  59.   {
  60.     cursor = cursor.previousSibling;
  61.     dump('cursor = ' + CursorText() + '\n');
  62.   }
  63.  
  64.   function ToNext()
  65.   {
  66.     cursor = cursor.nextSibling;
  67.     dump('cursor = ' + CursorText() + '\n');
  68.   }
  69.  
  70.   function ToParent()
  71.   {
  72.     cursor = cursor.parentNode;
  73.     dump('cursor = ' + CursorText() + '\n');
  74.   }
  75.  
  76.   function ToFirstChild()
  77.   {
  78.     cursor = cursor.firstChild;
  79.     dump('cursor = ' + CursorText() + '\n');
  80.   }
  81.  
  82.   function ToLastChild()
  83.   {
  84.     cursor = cursor.lastChild;
  85.     dump('cursor = ' + CursorText() + '\n');
  86.   }
  87.   </html:script>
  88.  
  89.   <box align="horizontal">
  90.     <titledbutton onclick="ToBeetle();" value="To Beetle" />
  91.     <titledbutton onclick="ToPrev();" value="To Previous Sibling" />
  92.     <titledbutton onclick="ToNext();" value="To Next Sibling" />
  93.     <titledbutton onclick="ToParent();" value="To Parent" />
  94.     <titledbutton onclick="ToFirstChild();" value="To First Child" />
  95.     <titledbutton onclick="ToLastChild();" value="To Last Child" />
  96.   </box>
  97.  
  98. <!--  <tree id="tree" flex="100%" datasources="rdf:bookmarks rdf:mailnewsfolders rdf:msgaccountmanager" style="height:100%;"> -->
  99.   <html:div style="width:100px;height:100px">
  100.   <tree id="tree" style="width:100%;height:100%;">
  101.     <treehead>
  102.       <treerow>
  103.         <treecell>Name</treecell>
  104.         <treecell>URL</treecell>
  105.       </treerow>
  106.     </treehead>
  107.  
  108.     <treechildren id="1" flex="1">
  109.       <treeitem id="treeroot" ref="NC:BookmarksRoot" open="true">
  110.         <treerow>
  111.           <treecell value="Bookmarks" />
  112.           <treecell />
  113.         </treerow>
  114.  
  115.         <treechildren id="2" open="true">
  116.           <treeitem id="beetle">
  117.             <treerow>
  118.               <treecell value="XUL Child #1 (Beetle)" />
  119.               <treecell />
  120.             </treerow>
  121.  
  122.             <treechildren id="3" open="true">
  123.               <treeitem id="4">
  124.                 <treerow id="4_1">
  125.                   <treecell id="4_1_1" value="XUL Child #1.1" />
  126.                   <treecell id="4_1_2" />
  127.                 </treerow>
  128.               </treeitem>
  129.  
  130.               <treeitem id="5">
  131.                 <treerow id="5_1">
  132.                   <treecell id="5_1_1" value="XUL Child #1.2" />
  133.                   <treecell id="5_1_2" />
  134.                 </treerow>
  135.               </treeitem>
  136.             </treechildren>
  137.           </treeitem>
  138.  
  139.           <treeitem id="6">
  140.             <treerow id="6_1">
  141.               <treecell id="6_1_1" value="XUL Child #2" />
  142.               <treecell id="6_1_2" />
  143.             </treerow>
  144.           </treeitem>
  145.  
  146.         </treechildren>
  147.       </treeitem>
  148.     </treechildren>
  149.   </tree>
  150. </html:div>
  151. </window>
  152.