lenya-unicms/scratchpad nodes.js,NONE,1.1 output.js,NONE,1.1 sitetree.xml,NONE,1.1 test.html,NONE,1.1 tree.html,NONE,1.1 tree.js,NONE,1.1 tree.xsl,NONE,1.1 ua.js,NONE,1.1
"Gregor J. Rothfuss" <[email protected]> Wed, 21 May 2003 17:20:36 +0200
| Newsgroups | gmane.comp.cms.wyona.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /repository/lenya-unicms/scratchpad
In directory erbium:/tmp/cvs-serv1283/scratchpad
Added Files:
nodes.js output.js sitetree.xml test.html tree.html tree.js
tree.xsl ua.js
Log Message:
first cut of a tree widget for the admin area. comes with a preliminary xsl that converts a sitetree to the required javascript.
--- NEW FILE: nodes.js ---
// You can find instructions for this file at http://www.treeview.net
//Environment variables are usually set at the top of this file.
USETEXTLINKS = 1
STARTALLOPEN = 1
USEFRAMES = 1
USEICONS = 0
WRAPTEXT = 1
PERSERVESTATE = 1
HIGHLIGHT = 1
foldersTree = gFld("<b>Site</b>", "test.html")
aux2 = insFld(foldersTree, gFld("Studium", ""))
insDoc(aux2, gLnk("R", "Administration", ""))
insDoc(aux2, gLnk("R", "Zulassung", ""))
insDoc(aux2, gLnk("R", "Eurasmus", ""))
aux2 = insFld(foldersTree, gFld("Archiv", "javascript:undefined"))
insDoc(aux2, gLnk("R", "London", "test.html"))
insDoc(aux2, gLnk("R", "Lisbon", ""))
aux2 = insFld(foldersTree, gFld("Trash", "javascript:undefined"))
insDoc(aux2, gLnk("R", "Entwurf1", "test.html"))
insDoc(aux2, gLnk("R", "Versuch", ""))
//Set this string if Treeview and other configuration files may also be loaded in the same session
foldersTree.treeID = "t2"
--- NEW FILE: output.js ---
// You can find instructions for this file at http://www.treeview.net
//Environment variables are usually set at the top of this file.
USETEXTLINKS = 1
STARTALLOPEN = 1
USEFRAMES = 1
USEICONS = 0
WRAPTEXT = 1
PERSERVESTATE = 1
HIGHLIGHT = 1
foldersTree = gFld("<b>Site</b>", "test.html")
insDoc(foldersTree, gLnk("R", "Home", "index"))
aux2 = insFld(foldersTree, gFld("Tutorial", "tutorial"))
insDoc(aux2, gLnk("R", "Concepts", "concepts"))
insDoc(aux2, gLnk("R", "Features", "features"))
aux2 = insFld(foldersTree, gFld("Default Publication", "default"))
insDoc(aux2, gLnk("R", "Simple Doctype", "simple-document"))
insDoc(aux2, gLnk("R", "Simple Doctype Example", "simple-document"))
//Set this string if Treeview and other configuration files may also be loaded in the same session
foldersTree.treeID = "t2"
--- NEW FILE: sitetree.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : sitetree.xml
Created on : 11. April 2003, 11:05
Author : andreas
Description:
Purpose of the document follows.
-->
<site
xmlns="http://www.lenya.org/2003/sitetree"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.lenya.org/2003/sitetree
../../../../resources/entities/sitetree.xsd">
<node id="index">
<label>Home</label>
</node>
<node id="tutorial">
<label>Tutorial</label>
<node id="concepts">
<label>Concepts</label>
</node>
<node id="features">
<label>Features</label>
</node>
</node>
<node id="default">
<label>Default Publication</label>
<node id="simple-document">
<label>Simple Doctype</label>
</node>
</node>
<node id="simple-document">
<label>Simple Doctype Example</label>
</node>
</site>
--- NEW FILE: test.html ---
<html><head></head><body>test</body></html>
--- NEW FILE: tree.html ---
<html>
<head>
<!-- SECTION 1 -->
<style>
/* styles for the tree */
SPAN.TreeviewSpanArea A {
font-size: 8pt;
font-family: verdana,helvetica;
text-decoration: none;
color: black
}
SPAN.TreeviewSpanArea A:hover {
color: '#820082';
}
/* rest of the document */
BODY {background-color: white}
TD {
font-size: 10pt;
font-family: verdana,helvetica;
}
#navigation { border: solid #0000FF; height: 600px; width: 200px; float: left;}
#content { border: solid #0000FF; height: 600px; width: 700px; float: left;}
</style>
<!-- SECTION 2: Replace everything (HTML, JavaScript, etc.) from here until the beginning
of SECTION 3 with the pieces of the head section that are needed for your site -->
<!-- SECTION 3: These four scripts define the tree, do not remove-->
<script src="ua.js"></script>
<script src="tree.js"></script>
<script src="output.js"></script>
</head>
<!-- SECTION 4: Change the body tag to fit your site -->
<body>
<!-- SECTION 5: Replace all the HTML from here until the beginning of SECTION 6 with the pieces of the head section that are needed for your site -->
<div id="navigation">
<!-- SECTION 6: Build the tree. -->
<!-- By making any changes to this code you are violating your user agreement.
Corporate users or any others that want to remove the link should check
the online FAQ for instructions on how to obtain a version without the link -->
<!-- Removing this link will make the script stop from working -->
<table border=0><tr><td><a style="font-size:7pt;text-decoration:none;color:white" href=http://www.treemenu.net/ target=_blank>Javascript Tree Menu</a></td></table>
<span class=TreeviewSpanArea>
<script>initializeDocument()</script>
</span>
<!-- SECTION 7: Continuation of the body of the page, after the tree. Replace whole section with
your site's HTML. -->
</div><div id="content"><iframe src="" id="basefrm" name="basefrm" frameborder="0"></iframe></div>
</body>
</html>
--- NEW FILE: tree.js ---
//****************************************************************
// Keep this copyright notice:
// This copy of the script is the property of the owner of the
// particular web site you were visiting.
// Do not download the script's files from there.
// For a free download and full instructions go to:
// http://www.treeview.net
//****************************************************************
// Log of changes:
//
// 12 May 03 - Support for Safari Beta 3
// 01 Mar 03 - VERSION 4.3 - Support for checkboxes
// 21 Feb 03 - Added support for Opera 7
// 22 Sep 02 - Added maySelect member for node-by-node control
// of selection and highlight
// 21 Sep 02 - Cookie values are now separated by cookieCutter
// 12 Sep 02 - VERSION 4.2 - Can highlight Selected Nodes and
[...1089 lines suppressed...]
if (browserVersion == 2)
doc.write("<layer top=" + indexOfEntries[nEntries-1].navObj.top + "> </layer>")
if (browserVersion != 0 && !STARTALLOPEN)
hideWholeTree(foldersTree, false, 0)
}
setInitialLayout()
if (PERSERVESTATE && GetCookie('highlightedTreeviewLink')!=null && GetCookie('highlightedTreeviewLink')!="") {
var nodeObj = findObj(GetCookie('highlightedTreeviewLink'))
if (nodeObj!=null){
nodeObj.forceOpeningOfAncestorFolders()
highlightObjLink(nodeObj);
}
else
SetCookie('highlightedTreeviewLink', '')
}
}
--- NEW FILE: tree.xsl ---
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Document : sitetree2tree.xsl
Created on : 21. May 2003, 11:45
Author : gregor
Description:
Converts a sitetree into a javascript array suitable for the tree widget.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" encoding = "iso-8859-1" />
<xsl:template match="/*[local-name()='site']">
// You can find instructions for this file at http://www.treeview.net
//Environment variables are usually set at the top of this file.
USETEXTLINKS = 1
STARTALLOPEN = 1
USEFRAMES = 1
USEICONS = 0
WRAPTEXT = 1
PERSERVESTATE = 1
HIGHLIGHT = 1
foldersTree = gFld("<b>Site</b>", "test.html")
<xsl:apply-templates select="*[local-name()='node']"/>
//Set this string if Treeview and other configuration files may also be loaded in the same session
foldersTree.treeID = "t2"
</xsl:template>
<xsl:template match="*[local-name()='node']">
<xsl:choose>
<xsl:when test="descendant::*[local-name()='node']">aux2 = insFld(foldersTree, gFld("<xsl:value-of select="*[local-name()='label']"/>", "<xsl:value-of select="@id"/>"))</xsl:when>
<xsl:otherwise>insDoc(aux2, gLnk("R", "<xsl:value-of select="*[local-name()='label']"/>", "<xsl:value-of select="@id"/>"))</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*[local-name()='label']"/>
</xsl:stylesheet>
--- NEW FILE: ua.js ---
/*
* $Log: ua.js,v $
* Revision 1.1 2003/05/21 15:20:33 gregor
* first cut of a tree widget for the admin area. comes with a preliminary xsl that converts a sitetree to the required javascript.
*
* Revision 1.9 2002/07/22 14:06:21 bc6ix
* fix license path, change version reporting to use 2 digits for each level
*
* Revision 1.8 2002/07/07 08:23:07 bc6ix
* fix line endings
*
* Revision 1.7 2002/05/14 16:52:52 bc6ix
* use CVS Log for revision history
*
*
*/
/* ***** BEGIN LICENSE BLOCK *****
* Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
* Full Terms at http://bclary.com/lib/js/license/mpl-tri-license.txt
*
* 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 Netscape code.
*
* The Initial Developer of the Original Code is
* Netscape Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Bob Clary <[email protected]>
*
* ***** END LICENSE BLOCK ***** */
function xbDetectBrowser()
{
var oldOnError = window.onerror;
var element = null;
window.onerror = null;
// work around bug in xpcdom Mozilla 0.9.1
window.saveNavigator = window.navigator;
navigator.OS = '';
navigator.version = parseFloat(navigator.appVersion);
navigator.org = '';
navigator.family = '';
var platform;
if (typeof(window.navigator.platform) != 'undefined')
{
platform = window.navigator.platform.toLowerCase();
if (platform.indexOf('win') != -1)
navigator.OS = 'win';
else if (platform.indexOf('mac') != -1)
navigator.OS = 'mac';
else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)
navigator.OS = 'nix';
}
var i = 0;
var ua = window.navigator.userAgent.toLowerCase();
if (ua.indexOf('safari') != -1)
{
i = ua.indexOf('safari');
navigator.family = 'safari';
navigator.org = 'safari';
navigator.version = parseFloat('0' + ua.substr(i+7), 10);
}
else if (ua.indexOf('opera') != -1)
{
i = ua.indexOf('opera');
navigator.family = 'opera';
navigator.org = 'opera';
navigator.version = parseFloat('0' + ua.substr(i+6), 10);
}
else if ((i = ua.indexOf('msie')) != -1)
{
navigator.org = 'microsoft';
navigator.version = parseFloat('0' + ua.substr(i+5), 10);
if (navigator.version < 4)
navigator.family = 'ie3';
else
navigator.family = 'ie4'
}
else if (ua.indexOf('gecko') != -1)
{
navigator.family = 'gecko';
var rvStart = ua.indexOf('rv:');
var rvEnd = ua.indexOf(')', rvStart);
var rv = ua.substring(rvStart+3, rvEnd);
var rvParts = rv.split('.');
var rvValue = 0;
var exp = 1;
for (var i = 0; i < rvParts.length; i++)
{
var val = parseInt(rvParts[i]);
rvValue += val / exp;
exp *= 100;
}
navigator.version = rvValue;
if (ua.indexOf('netscape') != -1)
navigator.org = 'netscape';
else if (ua.indexOf('compuserve') != -1)
navigator.org = 'compuserve';
else
navigator.org = 'mozilla';
}
else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))
{
var is_major = parseFloat(navigator.appVersion);
if (is_major < 4)
navigator.version = is_major;
else
{
i = ua.lastIndexOf('/')
navigator.version = parseFloat('0' + ua.substr(i+1), 10);
}
navigator.org = 'netscape';
navigator.family = 'nn' + parseInt(navigator.appVersion);
}
else if ((i = ua.indexOf('aol')) != -1 )
{
// aol
navigator.family = 'aol';
navigator.org = 'aol';
navigator.version = parseFloat('0' + ua.substr(i+4), 10);
}
else if ((i = ua.indexOf('hotjava')) != -1 )
{
// hotjava
navigator.family = 'hotjava';
navigator.org = 'sun';
navigator.version = parseFloat(navigator.appVersion);
}
window.onerror = oldOnError;
}
xbDetectBrowser();