|
modify tree view example
trying to get the performance.asp display out on same page but doesnt seem to work..
http://172.16.150.106/eass/EG1009/index.asp
http://172.16.150.106/eass/common/paper/2004s1/performance.asp
example: the picture boston is displayed on the same page. http://www.treeview.net/treeviewfiles/demoFrameless.html?pic=%22beenthere_boston%2Ejpg%2 2
look at the red color codes.
treeview.js
Code:
// 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 = 0
USEFRAMES = 0
USEICONS = 0
WRAPTEXT = 1
PRESERVESTATE = 1
function open_2004S1()
{
w=screen.width
h=screen.height
window.open("/eass/common/paper/2004s1/start_check.asp", "my_new_window", "toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width="+w+", height="+h+"")
}
foldersTree = gFld("<b>Home</b>", "index.asp")
//DC circuit tree node
aux1 = insFld(foldersTree, gFld("DC Circuit", "javascript:undefined"))
aux2 = insFld(aux1, gFld("DC Basic", "javascript:undefined"))
insDoc(aux2, gLnk("S", "Voltage Divider", "vd.asp"))
insDoc(aux2, gLnk("S", "Current Divider", "vd.asp"))
insDoc(aux2, gLnk("S", "KVL", "vd.asp"))
insDoc(aux2, gLnk("S", "KCL", "vd.asp"))
insDoc(aux2, gLnk("S", "Total Series Resistance", "vd.asp"))
insDoc(aux2, gLnk("S", "Total Parallel Resistance", "vd.asp"))
aux2 = insFld(aux1, gFld("DC Intermediate", "javascript:undefined"))
insDoc(aux2, gLnk("S", "Voltage Divider", "vd.asp"))
insDoc(aux2, gLnk("S", "Current Divider", "vd.asp"))
insDoc(aux2, gLnk("S", "KVL", "vd.asp"))
insDoc(aux2, gLnk("S", "KCL", "vd.asp"))
insDoc(aux2, gLnk("S", "Equivalent Resistance", "vd.asp"))
insDoc(aux2, gLnk("S", "Sources", "vd.asp"))
aux2 = insFld(aux1, gFld("DC Advance", "javascript:undefined"))
insDoc(aux2, gLnk("S", "Mesh Analysis", "vd.asp"))
insDoc(aux2, gLnk("S", "Nodal Analysis", "vd.asp"))
insDoc(aux2, gLnk("S", "Superposition", "vd.asp"))
insDoc(aux2, gLnk("S", "Thevenin Theorem", "vd.asp"))
// insDoc(aux1, gLnk("B", "Opens in new window", "http://www.treeview.net/treemenu/demopics/beenthere_pisa.jpg"))
//AC circuit tree node
aux1 = insFld(foldersTree, gFld("AC Circuit", "javascript:undefined"))
aux2 = insFld(aux1, gFld("AC Basic", "javascript:undefined"))
insDoc(aux2, gLnk("S", "Complex Number", "vd.asp"))
insDoc(aux2, gLnk("S", "Conversion", "vd.asp"))
aux2 = insFld(aux1, gFld("AC Intermediate", "javascript:undefined"))
insDoc(aux2, gLnk("S", "Phasor Application", "vd.asp"))
aux2 = insFld(aux1, gFld("AC Advance", "javascript:undefined"))
insDoc(aux2, gLnk("S", "Resonance", "vd.asp"))
//Common Test tree node
aux1 = insFld(foldersTree, gFld("Common Test Paper", "javascript:undefined"))
aux2 = insFld(aux1, gFld("2004 Semester 1", "javascript: open_2004S1()"))
insDoc(aux2, gLnk("S", "Performance", "index.asp?pic=%22../common/paper/2004s1/performance%e2asp%22"))
aux2 = insFld(aux1, gFld("2005 Semester 1", "javascript:undefined"))
//Exam Paper tree node
aux1 = insFld(foldersTree, gFld("Exam Paper", "javascript:undefined"))
aux2 = insFld(aux1, gFld("2004 Semester 1", "javascript: open_win()"))
aux2 = insFld(aux1, gFld("2005 Semester 1", "put link here."))
index.asp
Code:
<!--
(Please keep all copyright notices.)
This frameset document includes the Treeview script.
Script found at: http://www.treeview.net
Author: Marcelino Alves Martins
Instructions:
- Follow the steps labeled SECTION1, SECTION2, etc. in this file
-->
<html>
<head>
<title>SEG EG1009 E-Assessor</title>
<!-- SECTION 1 -->
<style>
/* styles for the tree */
SPAN.TreeviewSpanArea A {
font-size: 10pt;
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;
}
</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 -->
<script>
//This script is not related with the tree itself, just used for my example
function getQueryString(index)
{
var paramExpressions;
var param
var val
paramExpressions = window.location.search.substr(1).split("&");
if (index < paramExpressions.length)
{
param = paramExpressions[index];
if (param.length > 0) {
return eval(unescape(param));
}
}
return ""
}
</script>
<!-- SECTION 3: These four scripts define the tree, do not remove-->
<script src="../javascript/treeview/ua.js"></script>
<script src="../javascript/treeview/ftiens4.js"></script>
<script src="treeview.js"></script>
</head>
<!-- SECTION 4: Change the body tag to fit your site -->
<body bgcolor=white leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" onResize="if (navigator.family == 'nn4') window.location.reload()">
<!-- 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 -->
<MAP NAME="ButtonsMap">
<area shape="rect" alt="Home" coords="220,11,277,31" href="index.asp" target="_top">
<AREA SHAPE="rect" ALT="My Performance" COORDS="488,8,637,33" HREF="seg_performance.asp" target=_top>
<AREA SHAPE="rect" ALT="Logout" COORDS="647,9,738,32" HREF="../logout.asp" target=_top>
</MAP>
<table cellpadding=0 cellspacing=0 border=0 width=772><tr>
<td width=772> <img src=../images/buttonsmap.gif USEMAP="#ButtonsMap" border=0></td>
</tr></table>
<table cellpadding=0 cellspacing=0 border=0 width=772>
<tr>
<td width=178 valign=top>
<table cellpadding=4 cellspacing=0 border=0 width=100%><tr><td bgcolor=#ECECD9>
<img src=http://www.treeview.net/treemenu/layout/t.gif width=170 height=1><br>
<table cellspacing=0 cellpadding=2 border=0 width=100%><tr><td bgcolor=white>
<!-- 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><font size=-2><a style="font-size:7pt;text-decoration:none;color:silver" href="http://www.treemenu.net/" target=_blank></a></font></td></tr></table>
<span class=TreeviewSpanArea>
<script>initializeDocument()</script>
<noscript>
A tree for site navigation will open here if you enable JavaScript in your browser.
</noscript>
</span>
<!-- SECTION 7: Continuation of the body of the page, after the tree. Replace whole section with
your site's HTML. -->
</td></tr></table></table>
</td>
<td bgcolor=white valign=top>
<table cellpadding=10 cellspacing=0 border=0 width=100%><tr><td>
<h4>SEG EG1009 E-Assessor Home Page</h4>
<%
Response.Write "Hi, " & "<b>"
Response.write Session("StudName")
Response.Write "</b>" & " "
Response.Write Session("StudID")
%>
<script>
var picURL
picURL = getQueryString(0)
if (picURL.length > 0)
document.write("<a href src=http://172.16.150.106/eass/" + picURL + "><br><br>");
</script>
</td></tr></table></td></tr></table>
</body>
</html>
|