📄 hierarchytree.jsp
字号:
<%-- * CyberTester - J2EE Web application for creating, delivering and managing tests/exams/surveys. * Copyright (C) 2004 CyberDemia Research and Services Pty Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the * Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * See the COPYING file located in the top-level-directory of * the archive of this program for complete text of license.--%><%@ page language="java" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><%@ taglib uri="/WEB-INF/c.tld" prefix="c" %><%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %><%@ taglib uri="/WEB-INF/cd_core.tld" prefix="cyberdemia" %><html:html xhtml="true"> <head> <title><fmt:message key="title.admin.hierarchyTree" /></title> <meta http-equiv="pragmas" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <link rel="stylesheet" href="<%= request.getContextPath() %>/cybertester.css" type="text/css" /> <style type="text/css" > <!-- .tNodeDiv { width: 100%; } .clickable { cursor: hand; cursor: pointer; } .unselectable { white-space: nowrap; } .selectable { font-weight: bold; cursor: hand; cursor: pointer; white-space: nowrap; } // --> </style> <script type="text/javascript"> <!-- var imagesDir = "<%= request.getContextPath() %>/images"; self.enabled = false; function setEnabled( en ) { self.enabled = en; if (en) { document.body.style.backgroundColor="#ffffff"; document.getElementById("headerMsg").innerHTML="<cyberdemia:jsString><fmt:message key="jstext.admin.hierarchyTree.headerMsg.selectNode" /></cyberdemia:jsString>"; } else { document.body.style.backgroundColor="#999999"; document.getElementById("headerMsg").innerHTML="<cyberdemia:jsString><fmt:message key="jstext.admin.hierarchyTree.headerMsg.disabled" /></cyberdemia:jsString>"; } } function indentNode( level ) { for (sp=0; sp<level; sp++) { document.writeln("<img src=\""+imagesDir+"/tree_blank.gif\" alt=\"space\" />"); } } function expand( hierId ) { if ( self.enabled ) { self.location.replace( "<cyberdemia:encodeUrl>/admin/getHierarchyTree.do?action=expand</cyberdemia:encodeUrl>&hierId="+hierId ); } } function collapse( hierId ) { if ( self.enabled ) { self.location.replace( "<cyberdemia:encodeUrl>/admin/getHierarchyTree.do?action=collapse</cyberdemia:encodeUrl>&hierId="+hierId ); } } function nodeClicked( hierId ) { if ( self.enabled ) { self.location.replace( "<cyberdemia:encodeUrl>/admin/getHierarchyTree.do?action=select</cyberdemia:encodeUrl>&hierId="+hierId ); } } function pageLoaded() { <c:if test="${sessionScope.selectedHierId != null}" > var pnodeDiv = document.getElementById("n-<c:out value="${sessionScope.selectedHierId}" />"); if (pnodeDiv) { pnodeDiv.style.backgroundColor = "#ffff88"; } parent.hierarchyNodeSelected(); </c:if> setEnabled( true ); } // --> </script> <html:base/> </head> <body onload="pageLoaded()" style="background-color:#999999;" > <p id="headerMsg" style="font-weight:bold;font-size:8pt;width:100%"><fmt:message key="text.admin.hierarchyTree.headerMsg.wait" /></p> <div id="hierarchy" style="width:100%;border:1px solid #000055;" > <c:forEach var="node" items="${treeNodes}" > <div class="tNodeDiv" id="n-<c:out value="${node.hierId}" />" > <span> <script type="text/javascript"> <!-- indentNode( <c:out value="${node.level}" /> ); // --> </script> <c:if test="${node.expandable}" > <span class="clickable" onclick="expand('<c:out value="${node.hierId}" />')"><html:img page="/images/tree_plus.gif" alt="expand" /></span> </c:if> <c:if test="${node.collapsable}" > <span class="clickable" onclick="collapse('<c:out value="${node.hierId}" />')"><html:img page="/images/tree_minus.gif" alt="collapse" /></span> </c:if> <c:choose> <c:when test="${node.selectable}" > <span class="selectable" onclick="nodeClicked( '<c:out value="${node.hierId}" />' )" > <html:img page="/images/tree_triangle.gif" alt="triangle" /> </c:when> <c:otherwise> <span class="unselectable" > </c:otherwise> </c:choose> <c:out value="${node.name}" /> </span> </span> </div> </c:forEach> </div> </body></html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -