Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

245 lines
5.4 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% 'Option Explicit %>
  3. <!-- #include file="../directives.inc" -->
  4. <!--#include file="jsbrowser.str"-->
  5. <!--#include file="..\iisetfnt.inc"-->
  6. <%
  7. Dim browserobj, browser
  8. Set browserobj=Server.CreateObject("MSWC.BrowserType")
  9. if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then
  10. browser = "IE" & CStr(browserobj.MajorVer)
  11. else
  12. browser = "OTHER"
  13. end if
  14. %>
  15. <HTML>
  16. <HEAD>
  17. <TITLE></TITLE>
  18. <SCRIPT LANGUAGE = "JavaScript">
  19. var DRIVE= 0
  20. var FOLDER = 1
  21. var FILE = 2
  22. function selItem(item)
  23. {
  24. parent.head.listFunc.selIndex=item;
  25. <% if browser = "IE3" then %>
  26. self.location.href="JSBrwLs.asp#curItem";
  27. <% else %>
  28. self.location.href="JSBrwLs.asp";
  29. <% end if %>
  30. }
  31. function delve(item)
  32. {
  33. }
  34. function collapse(item)
  35. {
  36. parent.head.cachedList[item].open = false;
  37. parent.head.listFunc.loadList();
  38. }
  39. </SCRIPT>
  40. </HEAD>
  41. <BODY BGCOLOR="#FFFFFF" TEXT="black" TOPMARGIN = 1 LEFTMARGIN = 1 LINK="BLACK" VLINK="BLACK" ALINK="BLACK">
  42. <SCRIPT LANGUAGE="JavaScript">
  43. var theList = parent.head.cachedList;
  44. var listLength=theList.length;
  45. document.write("<TABLE WIDTH='100%' BORDER=0 CELLPADDING = 0 CELLSPACING = 0><TR><TD>");
  46. for (i=0; i < listLength; i++) {
  47. theParent=theList[i].parentid;
  48. if (theParent==null)
  49. {
  50. writeSelected(theList, i);
  51. }
  52. else
  53. {
  54. curParent=theParent;
  55. isOpen=true;
  56. while(isOpen){
  57. if (theList[curParent].parentid==null)
  58. {
  59. isOpen=(theList[curParent].open);
  60. break;
  61. }
  62. if (!theList[curParent].open)
  63. {
  64. isOpen=false;
  65. break;
  66. }
  67. curParent=theList[curParent].parentid;
  68. }
  69. if (isOpen)
  70. {
  71. writeSelected(theList, i);
  72. }
  73. }
  74. }
  75. document.write("</TD></TR></TABLE>");
  76. function getGrandParent(item,numLevels)
  77. {
  78. var theList = parent.head.cachedList;
  79. var theItem=item;
  80. for (z=0; z < numLevels; z++) {
  81. theItem=theList[theItem].parentid;
  82. }
  83. return theItem;
  84. }
  85. function setIcon(theList,i)
  86. {
  87. if (theList[i].open)
  88. {
  89. return theList[i].openicon;
  90. }
  91. else
  92. {
  93. return theList[i].icon;
  94. }
  95. }
  96. function writeIndent(theList, i)
  97. {
  98. var SPACE_IMG = "space.gif"
  99. var LINE_IMG = "line.gif"
  100. var dispstr = "";
  101. var theLevel=theList[i].level;
  102. for (var x=1; x < theLevel; x++)
  103. {
  104. var gParent=getGrandParent(i,theLevel-x)
  105. if (theList[gParent].lastChild)
  106. {
  107. dispstr += "<IMG SRC='" + SPACE_IMG + "' WIDTH=16>";
  108. }
  109. else
  110. {
  111. dispstr += "<IMG SRC='" + LINE_IMG + "' WIDTH=16>";
  112. }
  113. }
  114. return dispstr;
  115. }
  116. function writeSelected(theList, i)
  117. {
  118. var REDRAW = "true";
  119. var MINUS_IMG = "minus.gif"
  120. var MINUS_LAST_IMG = "minusl.gif"
  121. var PLUS_IMG = "plus.gif"
  122. var PLUS_LAST_IMG = "plusl.gif"
  123. var EMPTY_IMG = "blank.gif"
  124. var EMPTY_LAST_IMG = "blankl.gif"
  125. var isSelected = (eval(parent.head.listFunc.selIndex)== i);
  126. dispstr = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>";
  127. dispstr += writeIndent(theList, i)
  128. dispstr += "</TD><TD>";
  129. if( i < listLength )
  130. {
  131. if (theList[i].open)
  132. {
  133. dispstr += "<A HREF='javascript:collapse("+i+")'><IMG SRC='";
  134. if (!theList[i].lastChild)
  135. {
  136. dispstr += MINUS_IMG;
  137. }
  138. else
  139. {
  140. dispstr += MINUS_LAST_IMG;
  141. }
  142. dispstr += "' WIDTH=16 HEIGHT=18 Border=0 ALT='<%= L_COLLAPSE_TEXT %>'></A>";
  143. }
  144. else
  145. {
  146. dispstr += "<A HREF='javascript:parent.head.listFunc.expandItem("+i+"," + REDRAW + ")'><IMG SRC='";
  147. if (!theList[i].lastChild)
  148. {
  149. dispstr += PLUS_IMG;
  150. }
  151. else
  152. {
  153. dispstr += PLUS_LAST_IMG;
  154. }
  155. dispstr += "' WIDTH=16 HEIGHT=18 Border=0 ALT='<%= L_EXPAND_TEXT %>'></A></TD>";
  156. }
  157. }
  158. else
  159. {
  160. dispstr += "<IMG SRC='";
  161. if (!theList[i].lastChild){
  162. dispstr += EMPTY_IMG;
  163. }
  164. else{
  165. dispstr += EMPTY_LAST_IMG;
  166. }
  167. dispstr += "' WIDTH=16 HEIGHT=18 Border=0>";
  168. }
  169. dispstr += "</TD>";
  170. if (!isSelected)
  171. {
  172. dispstr += "<TD><%= sFont("","","",True) %><A HREF='javascript:selItem("+i+");'>";
  173. dispstr += "<IMG BORDER = 0 SRC='" + setIcon(theList,i) + "'></A>&nbsp;</TD>";
  174. dispstr += "<TD><%= sFont("","","",True) %><A HREF='javascript:selItem("+i+");'>";
  175. dispstr += theList[i].fname + "</A></TD></TR>";
  176. }
  177. else
  178. {
  179. if (theList[i].open)
  180. {
  181. dispstr += "<TD><A NAME='curItem'></A><%= sFont("","","",True) %><A HREF='javascript:collapse("+i+")'>";
  182. dispstr += "<IMG BORDER = 0 SRC='" + setIcon(theList,i) + "'></A>&nbsp;</TD>";
  183. dispstr += "<TD BGCOLOR='#FFCC00'><%= sFont("","","",True) %><A HREF='javascript:collapse("+i+")'>";
  184. dispstr += theList[i].fname + "</A></TD></TR>";
  185. }
  186. else
  187. {
  188. dispstr += "<TD><A NAME='curItem'></A><%= sFont("","","",True) %><A HREF='javascript:parent.head.listFunc.expandItem("+i+"," + REDRAW + ")'>";
  189. dispstr += "<IMG BORDER = 0 SRC='" + setIcon(theList,i) + "'></A>&nbsp;</TD>";
  190. dispstr += "<TD BGCOLOR='#FFCC00'><%= sFont("","","",True) %><A HREF='javascript:parent.head.listFunc.expandItem("+i+"," + REDRAW + ")'>";
  191. dispstr += theList[i].fname + "</A></TD></TR>";
  192. }
  193. }
  194. dispstr += "</TABLE>"
  195. document.write(dispstr);
  196. }
  197. <%
  198. ' Netscape and IE3 have problems refreshing the list properly.
  199. if browser <> "IE3" and browser <> "OTHER" then
  200. %>
  201. self.location.href = "JSBrwLs.asp#curItem";
  202. <% end if %>
  203. </SCRIPT>
  204. </BODY>
  205. </HTML>