home *** CD-ROM | disk | FTP | other *** search
/ Venus 7000 / darktronics.iso / Software / Service Packs / WinXPSP1.exe / appwiz.cp_ / appwiz.cpl / HTML / REMOVE.JS < prev    next >
Encoding:
Text File  |  2002-08-29  |  6.0 KB  |  216 lines

  1. function Remove_Activate()
  2. {
  3. LoadScriptFile("idScriptUtil", "util.js");
  4. LoadScriptFile("idScriptBplate", "bplate.js");
  5. InitBoilerPlateClass();
  6. g_docAll.idTrHeadMargin_Remove.style.display = 'block';
  7. g_docAll.idTrHead_Remove.style.display = 'block';
  8. g_docAll.idTrBody_Remove.style.display = 'block';
  9. if (g_bIsAlpha)
  10. {
  11. g_docAll.idTrFoot_Remove.style.display = 'block';
  12. g_docAll.idChkRemoveForcex86.attachEvent("onclick", new Function ("idCtlAppsDso.Forcex86 = idChkRemoveForcex86.checked"));
  13. }
  14. if (false == g_bRemovePageLoaded)
  15. {
  16. if (Dso_IsRestricted("NoSupportInfo"))
  17. g_bShowSupportInfo = false;
  18. g_docAll.idSelSortBy.onchange = _SortDataSource;
  19. g_docAll.idRemoveListbox.dataSource = "idCtlAppsDso.Remove";
  20. Dso_GetCtl("Remove").attachEvent("ondatasetcomplete", Remove_OnDatasetComplete);
  21. g_docAll.idRemoveListbox.Refresh();
  22. g_bRemovePageLoaded = true;
  23. }
  24. g_bReenumAddList = false;
  25. Remove_SetFocus();
  26. }
  27. function Remove_SetFocus()
  28. {
  29. g_docAll.idRemoveListbox.focus();
  30. }
  31. function Remove_Deactivate()
  32. {
  33. g_docAll.idTrHeadMargin_Remove.style.display = 'none';
  34. g_docAll.idTrHead_Remove.style.display = 'none';
  35. g_docAll.idTrFoot_Remove.style.display = 'none';
  36. g_docAll.idTrBody_Remove.style.display = 'none';
  37. if (g_bReenumAddList)
  38. {
  39. Dso_Refresh("Add");
  40. }
  41. }
  42. function Remove_OnSetFocus()
  43. {
  44. var evt = window.event;
  45. ApplyExtraStyles(evt.srcChild, evt.bFocus);
  46. }
  47. function Remove_OnCustomDraw()
  48. {
  49. var evt = window.event;
  50. var tblElem = evt.srcChild; 
  51. if (evt.bSelected)
  52. {
  53. var dwCapability = evt.Recordset("capability");
  54. if ('prepaint' == evt.drawStage)
  55. {
  56. if (dwCapability & APPCAP_MODIFYREMOVE)
  57. {
  58. evt.srcElement.EnableTemplate('idTrMultiBtns', false);
  59. evt.srcElement.EnableTemplate('idTrSingleBtns', true);
  60. }
  61. else
  62. {
  63. evt.srcElement.EnableTemplate('idTrMultiBtns', true);
  64. evt.srcElement.EnableTemplate('idTrSingleBtns', false);
  65. }
  66. }
  67. else
  68. {
  69. var bplate = new BoilerPlate();
  70. bplate.Parse(evt.Recordset("supportinfo"));
  71. if (!g_bShowSupportInfo ||
  72. !(dwCapability & APPCAP_REPAIR) && 
  73. (1 > bplate.Length() || 
  74. 1 == bplate.Length() && null != bplate.Get("displayname")))
  75. {
  76. tblElem.all('idTdInfoDesc').style.visibility = 'hidden';
  77. }
  78. if (dwCapability & APPCAP_MODIFYREMOVE)
  79. {
  80. tblElem.all('idBtnBoth').onclick = _ModifyOrRemove;
  81. if ( !(dwCapability & APPCAP_UNINSTALL) )
  82. tblElem.all('idBtnBoth').disabled = true;
  83. }
  84. else
  85. {
  86. tblElem.all('idBtnModify').onclick = _ModifyOrRemove;
  87. tblElem.all('idBtnRemove').onclick = _ModifyOrRemove;
  88. if ( !(dwCapability & APPCAP_MODIFY) )
  89. tblElem.all('idBtnModify').disabled = true;
  90. if ( !(dwCapability & APPCAP_UNINSTALL) )
  91. tblElem.all('idBtnRemove').disabled = true;
  92. }
  93. var szSort = g_docAll.idSelSortBy.options(g_docAll.idSelSortBy.selectedIndex).value;
  94. if ("displayname" == szSort || "size" == szSort || "timesused" == szSort)
  95. {
  96. var spnValue = evt.srcRow.all("idSpnIndexValue");
  97. var tdValue = spnValue.parentElement;
  98. var tdId = ("timesused" == szSort ? "idAFrequency" : "idASize");
  99. tdValue._szInner = tdValue.innerHTML;
  100. if (tdValue.innerText != "")
  101. {
  102. tdValue.innerHTML = 
  103. "<SPAN id=" +
  104. tdId +
  105. " class='FakeAnchor' tabIndex=0 onKeyDown='_OnKeyDownFakeAnchor()' onClick='_OpenDefinition();'> " +
  106. " <U>" +
  107. tdValue._szInner + 
  108. "</U></SPAN>";
  109. }
  110. }
  111. ApplyExtraStyles(tblElem, evt.bFocus);
  112. }
  113. }
  114. else
  115. {
  116. if ('prepaint' == evt.drawStage)
  117. {
  118. var spnValue = evt.srcRow.all("idSpnIndexValue");
  119. var tdValue = spnValue.parentElement.parentElement.parentElement;
  120. if (null != tdValue._szInner)
  121. {
  122. tdValue.innerHTML = tdValue._szInner;
  123. tdValue._szInner = null;
  124. }
  125. ApplyExtraStyles(tblElem, false);
  126. }
  127. }
  128. }
  129. function _OpenSupportInfo()
  130. {
  131. var szFeatures = g_szSupportInfoSize + "; resizable:no; help:no";
  132. window.showModalDialog("support.htm", window, szFeatures);
  133. window.event.returnValue = false;
  134. window.event.cancelBubble = true;
  135. }
  136. function _OpenDefinition()
  137. {
  138. var elemSrc = window.event.srcElement;
  139. if (("idSpnIndexValue" == elemSrc.id) && ("" != elemSrc.parentElement.parentElement.id))
  140. {
  141. elemSrc = elemSrc.parentElement.parentElement;
  142. }
  143. if ("" == elemSrc.id)
  144. {
  145. elemSrc = elemSrc.parentElement;
  146. }
  147. if ("idAFrequency" == elemSrc.id)
  148. {
  149. var szFeatures = "dialogWidth:20em; dialogHeight:16em; resizable:no; help:no";
  150. window.showModalDialog("def_freq.htm", window, szFeatures);
  151. }
  152. else if ("idASize" == elemSrc.id || "idSpnIndexValue" == elemSrc.id)
  153. {
  154. var szFeatures = "dialogWidth:20em; dialogHeight:10.7em; resizable:no; help:no";
  155. window.showModalDialog("def_size.htm", window, szFeatures);
  156. }
  157. window.event.returnValue = false;
  158. window.event.cancelBubble = true;
  159. }
  160. function _SortDataSource()
  161. {
  162. var selElem = window.event.srcElement;
  163. var optCur = selElem.options(selElem.selectedIndex);
  164. Dso_Sort("Remove", optCur.value);
  165. }
  166. function _ModifyOrRemove()
  167. {
  168. var rsCur = Dso_GetRecordset("Remove");
  169. var nRec = rsCur.AbsolutePosition;
  170. switch(event.srcElement.id)
  171. {
  172. case "idBtnBoth":
  173. g_docAll.idCtlAppsDso.Exec("Remove", "uninstall", nRec);
  174. break;
  175. case "idBtnModify":
  176. g_docAll.idCtlAppsDso.Exec("Remove", "modify", nRec);
  177. break;
  178. case "idBtnRemove":
  179. g_docAll.idCtlAppsDso.Exec("Remove", "uninstall", nRec);
  180. break;
  181. }
  182. if ("idBtnRemove" == event.srcElement.id)
  183. {
  184. g_bReenumAddList = true;
  185. }
  186. }
  187. function SupportInfo_Repair(nRecordNumber)
  188. {
  189. var rsCur = Dso_GetRecordset("Remove");
  190. var nRecordSav = rsCur.AbsolutePosition;
  191. window.focus();
  192. rsCur.AbsolutePosition = nRecordNumber;
  193. g_docAll.idCtlAppsDso.Exec("Remove", "repair", nRecordNumber);
  194. rsCur.AbsolutePosition = nRecordSav;
  195. }
  196. function SupportInfo_Query()
  197. {
  198. var rsCur = Dso_GetRecordset("Remove");
  199. var szRecord = "<recordnumber " + rsCur.AbsolutePosition + ">";
  200. szRecord += rsCur("supportinfo");
  201. szRecord += "<capability " + rsCur("capability") + ">";
  202. return szRecord;
  203. }
  204. function SupportInfo_GetDlgSize()
  205. {
  206. return g_szSupportInfoSize;
  207. }
  208. function Remove_OnDatasetComplete()
  209. {
  210. if (window.event.qualifier == "Remove")
  211. {
  212. var L_RemoveNoneAvailable_Text = "There are no programs installed on this computer";
  213. Dso_FeedbackIfEmpty("Remove", g_docAll.idRemoveListbox, L_RemoveNoneAvailable_Text);
  214. }
  215. }
  216.