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.

113 lines
3.3 KiB

  1. // Filename: glossary.js in NTShared.chm
  2. // Version post beta 3 (7)
  3. // version 05.27.99
  4. window.onload= resizeGloss;
  5. window.onresize= resizeGloss;
  6. document.mouseover= buttonMouseover;
  7. window.onbeforeprint= set_to_print;
  8. window.onafterprint= reset_form;
  9. function buttonMouseover(){
  10. var e= window.event.srcElement;
  11. if (e.className.toLowerCase()=="button") e.className= "buttonDown";
  12. if (e.children.tags('span')(0)=="button") e.children.tags('span')(0).className= "buttonDown";
  13. if (e.className.toLowerCase()=="buttonDown") e.className= "button";
  14. if (e.children.tags('span')(0)=="buttonDown") e.children.tags('span')(0).className= "button";
  15. }
  16. function buttonUp() {
  17. var e= window.event.srcElement;
  18. }
  19. function resizeGloss(){
  20. var oButtonMenu= document.all.item("buttonMenu");
  21. var oText= document.all.item("text");
  22. if (oText ==null) return;
  23. if (oButtonMenu != null){
  24. document.all.text.style.overflow= "auto";
  25. document.all.buttonMenu.style.width= document.body.offsetWidth;
  26. document.all.text.style.width= document.body.offsetWidth-4;
  27. document.all.text.style.top= document.all.buttonMenu.offsetHeight;
  28. if (document.body.offsetHeight > document.all.buttonMenu.offsetHeight)
  29. document.all.text.style.height= document.body.offsetHeight - document.all.buttonMenu.offsetHeight;
  30. else document.all.text.style.height=0;
  31. }
  32. }
  33. //*** callPopup ***************************************************************************************
  34. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  35. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  36. function document.onclick() {
  37. var e= window.event.srcElement;
  38. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  39. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  40. if (e.tagName == "FONT"){
  41. e = e.parentElement;
  42. }
  43. if (e.id.toLowerCase()!="wpopup") return;
  44. var eH= unescape(e.href);
  45. var eH_= eH.toLowerCase();
  46. event.returnValue = false;
  47. var iTOPIC = eH_.lastIndexOf("topic=");
  48. if (iTOPIC==-1) return;
  49. sParamTOPIC = eH.substring((iTOPIC+6),eH.length); // extracts the topic for item2
  50. var iHELP = eH_.lastIndexOf("help=");
  51. if (iHELP==-1) return;
  52. sParamHELP = eH.substring(iHELP+5,iTOPIC); // extracts the help file for item1
  53. if (document.hhPopup) document.hhPopup.outerHTML = ""; // if hhPopup object exists, clears it
  54. var h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  55. h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  56. document.body.insertAdjacentHTML("beforeEnd", h);
  57. document.hhPopup.hhclick();
  58. }
  59. function list_them(){
  60. var i;
  61. for (i=0; i < document.all.length; i++){
  62. alert (document.all[i].outerHTML);
  63. }
  64. }
  65. //** set_to_print ***************
  66. function set_to_print(){
  67. var i;
  68. if (window.text)document.all.text.style.height = "auto";
  69. for (i=0; i < document.all.length; i++){
  70. if (document.all[i].tagName == "BODY") {
  71. document.all[i].scroll = "auto";
  72. }
  73. if (document.all[i].tagName == "A") {
  74. document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  75. }
  76. }
  77. }
  78. function reset_form(){
  79. document.location.reload();
  80. }