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.

287 lines
9.3 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. var oObject = document.all.tags("SPAN"); //get the collection of all hyperlinks on the page.
  85. var str = "";
  86. var thisObject;
  87. var selectionmenu = null;
  88. var scopemenu = null;
  89. var menuItem = null;
  90. var selection = external.Selection;
  91. var enabled = false;
  92. var count = selection.count;
  93. // get the scope node menu
  94. scopemenu = external.ScopeNodeContextMenu;
  95. // get the selection menu
  96. if(selection.Count != 0) // there is a selection
  97. {
  98. selectionmenu = external.SelectionContextMenu;
  99. }
  100. if(oObject != null)
  101. {
  102. for(i = 0; i!= oObject.length; i++)
  103. {
  104. thisObject = oObject(i);
  105. enabled = false;
  106. // set the state of result items
  107. if(thisObject.id == "ResultTask")
  108. {
  109. menuItem = null;
  110. if(selectionmenu != null)
  111. menuItem = selectionmenu(thisObject.parameter); // see if the object exists
  112. if(menuItem != null)
  113. if(menuItem.Enabled)
  114. enabled = true;
  115. }
  116. else if(thisObject.id == "TargetTask") // set the state of target item tasks
  117. {
  118. menuItem = null;
  119. if(scopemenu != null)
  120. menuItem = scopemenu(thisObject.parameter); // see if the object exists
  121. if(menuItem != null)
  122. if(menuItem.Enabled)
  123. enabled = true;
  124. }
  125. else if(thisObject.id == "CommandLineTask") // set the state of target item tasks
  126. {
  127. enabled = GetCommandLineTaskState(thisObject.parameter);
  128. }
  129. else // all other tasks are always available.
  130. enabled = true;
  131. // enable/disable the task based on the enabled state - the cInline object is displayed or hidden
  132. thisObject.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = enabled ? "" : "none" ;
  133. }
  134. }
  135. }
  136. </script>
  137. <script language="JavaScript">
  138. function GetNthParent(nNode)
  139. {
  140. var curNode = external.ActiveScopeNode;
  141. for(i = 0; i != nNode; i++) // get the nth parent
  142. curNode = external.Document.ScopeNamespace.GetParent(curNode);
  143. return curNode;
  144. }
  145. /*+-------------------------------------------------------------------------*
  146. *
  147. * ParseParameters
  148. *
  149. * PURPOSE: Performs parameter substitution. Substitute parameters are
  150. * specified as follows:
  151. * $COL[columnName]: Substitutes the entry under the column
  152. * labelled columnName for the currently selected item.
  153. * $NAME[scopeNodeIndex]: Substitutes the name of the nth parent
  154. * of the currently selected scope node. n=0 is the currently
  155. * selected scope node itself.
  156. * $CLIPFMT_DATA[node,fmt]: Substitutes the clipboard format specified
  157. * by fmt of the object specified by node, where node =
  158. * r or R: The currently selected result item
  159. * 0, 1, 2...: The nth parent of the currently selected
  160. * scope node
  161. *
  162. *
  163. * NOTE: The actual incoming parameters use angle braces, not square braces.
  164. * These are converted in a pre-process step to square braces because
  165. * jscript-xml interaction makes it difficult to use them here.
  166. *
  167. * RETURNS:
  168. * function
  169. *
  170. *+-------------------------------------------------------------------------*/
  171. function ParseParameters(s)
  172. {
  173. var t;
  174. var strRep;
  175. var strTemp = "";
  176. var re=/>/;
  177. var iCol, iName, iClip, nName, nCol;
  178. while (true) // search for COL tags
  179. {
  180. iCol = s.search(reColumnPattern);
  181. if(iCol==-1) // no more $COL tags
  182. break;
  183. // Replace the column tags
  184. nCol = parseInt(RegExp.$1) + 1; // in console taskpads, the column is zero based. Convert it to one-based here.
  185. strRep = external.CellContents(external.Selection(1), nCol);
  186. strTemp = s.substr(0, iCol) + strRep;
  187. // move past the closing ">"
  188. s = s.substr(iCol);
  189. t = s.search(re);
  190. s = strTemp + s.substr(t+1);
  191. }
  192. while (true) // search for NAME tags
  193. {
  194. iName = s.search(reNamePattern);
  195. if(iName==-1) // no more $NAME tags
  196. break;
  197. // Replace the Name tags
  198. curNode = GetNthParent(RegExp.$1);
  199. strRep = curNode.Name;
  200. strTemp = s.substr(0, iName) + strRep;
  201. // move past the closing ">"
  202. s = s.substr(iName);
  203. t = s.search(re);
  204. s = strTemp + s.substr(t+1);
  205. }
  206. while (true) // search for CLIPFMT tags
  207. {
  208. iClip = s.search(reClipFmtPattern);
  209. if(iClip==-1) // no more $CLIPFMT tags
  210. break;
  211. // Replace the clipfmt tags
  212. 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.
  213. strRep.search(regExpClipFmt);
  214. curItem = RegExp.$1; // item
  215. clipfmt = RegExp.$2; // format
  216. if(curItem=='r' || curItem=='R')
  217. Node = external.Selection(1);
  218. else
  219. Node = GetNthParent(curItem);
  220. strRep = Node.Property(clipfmt); // get the clipboard format
  221. strTemp = s.substr(0, iClip) + strRep;
  222. // move past the closing ">"
  223. s = s.substr(iClip);
  224. t = s.search(re);
  225. s = strTemp + s.substr(t+1);
  226. }
  227. return s;
  228. }
  229. </script>
  230. @@ORIENTATIONSPECIFICHTML@@
  231. </HTML>