Leaked source code of windows server 2003
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.

293 lines
9.8 KiB

  1. <!--NOTE: this file is expected to be ANSI - do not add any localizable strings to it !!! -->
  2. <HTML>
  3. <head>
  4. <style>
  5. body {margin:0; font: clientTop:0; icon; color: windowtext; background:window; overflow:none}
  6. .cInline {
  7. display:inline; width:@@TASKWIDTH@@;
  8. margin-right:5px;
  9. vertical-align:top;
  10. }
  11. BottomPanel {overflow:auto}
  12. #FolderIcon {height:expression(TaskpadName.clientHeight + 10); width:100%;}
  13. #TaskpadName {font: caption; color:captiontext; margin-left:0; margin-right:0; margin-top: 0; width:100%; border:0; padding-left:3; padding-top:5; padding-bottom:7;}
  14. #TaskpadDescription {font:icon; padding-left:5px; padding-top:5px; padding-bottom:3px; padding-right:5px}
  15. p {font-weight:normal; border:0; margin-top:0}
  16. table {font:icon; border:0 solid; padding:0; margin:0;} <!--cellpadding and cellspacing only apply to table, but are NOT CSS attributes. Set them on a per-tag basis -->
  17. tr {margin:0; border:0; padding:0}
  18. td {margin:0; border:0 solid; padding:0}
  19. div {border:0; margin:0; padding:0; }
  20. .Task {color:expression(document.linkColor); text-decoration:underline; cursor:hand;}
  21. .TaskHover {color:expression(document.linkColor); text-decoration:underline; cursor:hand;} <!-- Cannot use the user's hover color because once a link has been visited, the hover color never appears. So it is better
  22. to be consistent than correct only part of the time -->
  23. </style>
  24. </head>
  25. <!--update the task states for all appropriate events -->
  26. <script language="JavaScript" for="MMCEvents" EVENT="OnSelectionChange(V, N)">UpdateState();</script>
  27. <script language="JavaScript" for="MMCEvents" EVENT="OnContextMenuExecuted(MI)">UpdateState();</script>
  28. <script language="JavaScript" for="MMCEvents" EVENT="OnViewChange(V, N)">UpdateState();</script>
  29. <script language="JavaScript" for="MMCEvents" EVENT="OnToolbarButtonClicked()">UpdateState();</script>
  30. <script language="JavaScript" for="MMCEvents" EVENT="OnListUpdated(V)">UpdateState();</script>
  31. <script language = "JavaScript">
  32. // Prevent text from being selected and messing up the UI.
  33. function document.onselectstart()
  34. {
  35. event.returnValue = false;
  36. }
  37. var reColumnPattern=/\$COL<([^>]+)>/;
  38. var reNamePattern=/\$NAME<([^>]+)>/;
  39. var reClipFmtPattern=/\$CLIPFMT_DATA<([^>]+)>/;
  40. var regExpClipFmt = /(.*),(.*)/;
  41. function GetCommandLineTaskState(s)
  42. {
  43. var iCol, iName, iClip, nName, nCol, cCol;
  44. var Columns = external.Columns;
  45. var bEnabled = true; // enabled by default
  46. while (true) // search for COL tags
  47. {
  48. iCol = s.search(reColumnPattern);
  49. if(iCol==-1) // no more $COL tags
  50. break;
  51. nCol=parseInt(RegExp.$1) + 1; // in console taskpads, the column is zero based. Convert it to one-based here.
  52. cCol = Columns.count;
  53. // make sure the column exists
  54. if(cCol < nCol)
  55. return false;
  56. // make sure the column is visible
  57. if(external.Columns(nCol).Hidden)
  58. return false;
  59. // must have exactly one item selected for command line tasks that contain column information
  60. if(external.Selection.count != 1)
  61. return false;
  62. s = s.substr(iCol+1); // skip to the next occurrence
  63. }
  64. while (true) // search for CLIPFMT tags
  65. {
  66. iClip = s.search(reClipFmtPattern);
  67. if(iClip==-1) // no more $CLIPFMT tags
  68. break;
  69. // Replace the clipfmt tags
  70. strRep = RegExp.$1; // the format at this point is item,format where item = r Or R for the current result item, 0 for the current scope item, 1 for the parent, and so on.
  71. strRep.search(regExpClipFmt);
  72. curItem = RegExp.$1; // item
  73. if(curItem=='r' || curItem=='R')
  74. {
  75. if(external.Selection.count != 1)
  76. return false;
  77. }
  78. s = s.substr(iClip+1); // skip to the next occurrence
  79. }
  80. return true;
  81. }
  82. function UpdateState()
  83. {
  84. try
  85. {
  86. var oObject = document.all.tags("SPAN"); //get the collection of all hyperlinks on the page.
  87. var str = "";
  88. var thisObject;
  89. var selectionmenu = null;
  90. var scopemenu = null;
  91. var menuItem = null;
  92. var selection = external.Selection;
  93. var enabled = false;
  94. var count = selection.count;
  95. // get the scope node menu
  96. scopemenu = external.ScopeNodeContextMenu;
  97. // get the selection menu
  98. if(selection.Count != 0) // there is a selection
  99. {
  100. selectionmenu = external.SelectionContextMenu;
  101. }
  102. if(oObject != null)
  103. {
  104. for(i = 0; i!= oObject.length; i++)
  105. {
  106. thisObject = oObject(i);
  107. enabled = false;
  108. // set the state of result items
  109. if(thisObject.id == "ResultTask")
  110. {
  111. menuItem = null;
  112. if(selectionmenu != null)
  113. menuItem = selectionmenu(thisObject.parameter); // see if the object exists
  114. if(menuItem != null)
  115. if(menuItem.Enabled)
  116. enabled = true;
  117. }
  118. else if(thisObject.id == "TargetTask") // set the state of target item tasks
  119. {
  120. menuItem = null;
  121. if(scopemenu != null)
  122. menuItem = scopemenu(thisObject.parameter); // see if the object exists
  123. if(menuItem != null)
  124. if(menuItem.Enabled)
  125. enabled = true;
  126. }
  127. else if(thisObject.id == "CommandLineTask") // set the state of target item tasks
  128. {
  129. enabled = GetCommandLineTaskState(thisObject.parameter);
  130. }
  131. else // all other tasks are always available.
  132. enabled = true;
  133. // enable/disable the task based on the enabled state - the cInline object is displayed or hidden
  134. thisObject.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = enabled ? "" : "none" ;
  135. }
  136. }
  137. }
  138. catch(err)
  139. {
  140. }
  141. }
  142. </script>
  143. <script language="JavaScript">
  144. function GetNthParent(nNode)
  145. {
  146. var curNode = external.ActiveScopeNode;
  147. for(i = 0; i != nNode; i++) // get the nth parent
  148. curNode = external.Document.ScopeNamespace.GetParent(curNode);
  149. return curNode;
  150. }
  151. /*+-------------------------------------------------------------------------*
  152. *
  153. * ParseParameters
  154. *
  155. * PURPOSE: Performs parameter substitution. Substitute parameters are
  156. * specified as follows:
  157. * $COL[columnName]: Substitutes the entry under the column
  158. * labelled columnName for the currently selected item.
  159. * $NAME[scopeNodeIndex]: Substitutes the name of the nth parent
  160. * of the currently selected scope node. n=0 is the currently
  161. * selected scope node itself.
  162. * $CLIPFMT_DATA[node,fmt]: Substitutes the clipboard format specified
  163. * by fmt of the object specified by node, where node =
  164. * r or R: The currently selected result item
  165. * 0, 1, 2...: The nth parent of the currently selected
  166. * scope node
  167. *
  168. *
  169. * NOTE: The actual incoming parameters use angle braces, not square braces.
  170. * These are converted in a pre-process step to square braces because
  171. * jscript-xml interaction makes it difficult to use them here.
  172. *
  173. * RETURNS:
  174. * function
  175. *
  176. *+-------------------------------------------------------------------------*/
  177. function ParseParameters(s)
  178. {
  179. var t;
  180. var strRep;
  181. var strTemp = "";
  182. var re=/>/;
  183. var iCol, iName, iClip, nName, nCol;
  184. while (true) // search for COL tags
  185. {
  186. iCol = s.search(reColumnPattern);
  187. if(iCol==-1) // no more $COL tags
  188. break;
  189. // Replace the column tags
  190. nCol = parseInt(RegExp.$1) + 1; // in console taskpads, the column is zero based. Convert it to one-based here.
  191. strRep = external.CellContents(external.Selection(1), nCol);
  192. strTemp = s.substr(0, iCol) + strRep;
  193. // move past the closing ">"
  194. s = s.substr(iCol);
  195. t = s.search(re);
  196. s = strTemp + s.substr(t+1);
  197. }
  198. while (true) // search for NAME tags
  199. {
  200. iName = s.search(reNamePattern);
  201. if(iName==-1) // no more $NAME tags
  202. break;
  203. // Replace the Name tags
  204. curNode = GetNthParent(RegExp.$1);
  205. strRep = curNode.Name;
  206. strTemp = s.substr(0, iName) + strRep;
  207. // move past the closing ">"
  208. s = s.substr(iName);
  209. t = s.search(re);
  210. s = strTemp + s.substr(t+1);
  211. }
  212. while (true) // search for CLIPFMT tags
  213. {
  214. iClip = s.search(reClipFmtPattern);
  215. if(iClip==-1) // no more $CLIPFMT tags
  216. break;
  217. // Replace the clipfmt tags
  218. strRep = RegExp.$1; // the format at this point is item,format where item = r Or R for the current result item, 0 for the current scope item, 1 for the parent, and so on.
  219. strRep.search(regExpClipFmt);
  220. curItem = RegExp.$1; // item
  221. clipfmt = RegExp.$2; // format
  222. if(curItem=='r' || curItem=='R')
  223. Node = external.Selection(1);
  224. else
  225. Node = GetNthParent(curItem);
  226. strRep = Node.Property(clipfmt); // get the clipboard format
  227. strTemp = s.substr(0, iClip) + strRep;
  228. // move past the closing ">"
  229. s = s.substr(iClip);
  230. t = s.search(re);
  231. s = strTemp + s.substr(t+1);
  232. }
  233. return s;
  234. }
  235. </script>
  236. @@ORIENTATIONSPECIFICHTML@@
  237. </HTML>