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.

151 lines
4.7 KiB

  1. function DoNothing()
  2. {
  3. // Stub
  4. }
  5. //**********************
  6. // TASK/LINK FUNCTIONS
  7. //**********************
  8. function LoadLinks()
  9. {
  10. // Define start of table
  11. var szNewTable = '<table id=\"tblLinks\" align=\"center\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" frame=\"void\" rules=\"none\">';
  12. // Dynamically load table rows and table cells
  13. for( var i = 0; i <= giTotalButtons; i++ ) {
  14. // Add new table row if i mod 3 = 0
  15. if( i % 3 == 0 ) {
  16. szNewTable += '<tr>\n';
  17. szNewTable += '<td id=\"tdLinks_' + i + '\" width=\"30%\" valign=\"top\" class=\"tdLinks\"></td>\n';
  18. szNewTable += '<td width=\"5%\"></td>\n';
  19. szNewTable += '<td id=\"tdLinks_' + ( i + 1 ) + '\" width=\"30%\" valign=\"top\" class=\"tdLinks\"></td>\n';
  20. szNewTable += '<td width=\"5%\"></td>\n';
  21. szNewTable += '<td id=\"tdLinks_' + ( i + 2 ) + '\" width=\"30%\" valign=\"top\" class=\"tdLinks\"></td>\n';
  22. szNewTable += '</tr>\n';
  23. }
  24. }
  25. // Define end of table
  26. szNewTable += '</table>\n';
  27. // Add new table to div container
  28. divLinks.insertAdjacentHTML('BeforeEnd', szNewTable );
  29. for( var i = 0; i <= giTotalButtons; i++ ) {
  30. // Add anchor link to table cells
  31. var szAnchor = '<a href=\"\" id=\"anchorLink_' + i + '\" class=\"anchorLink\">';
  32. // DEBUG NOTE: Where is the end anchor tag? </a>
  33. document.all('tdLinks_' + i).insertAdjacentHTML ( 'BeforeEnd', szAnchor );
  34. // Add caption to anchor
  35. var szAnchorCaption = gaszBtnCaptions[i];
  36. document.all('anchorLink_' + i).insertAdjacentHTML ( 'BeforeEnd', szAnchorCaption );
  37. }
  38. }
  39. //****************
  40. // RESIZE FUNCTION
  41. //****************
  42. function ResizeLinkElements()
  43. {
  44. var iSmallerDimension = GetSmallerDimension();
  45. // Apply custom multipliers
  46. divLinksCaption.style.fontSize = iSmallerDimension * L_ConstCaptionText_Number;
  47. tdBranding.style.fontSize = iSmallerDimension * L_ConstBrandingText_Number;
  48. tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkHomeText_Number;
  49. // Anchor links
  50. for( var i = 0; i <= giTotalButtons; i++ ) {
  51. document.all('anchorLink_' + i ).style.fontSize = iSmallerDimension * L_ConstAnchorLinkText_Number;
  52. }
  53. // Tooltips
  54. tblTooltip.style.fontSize = iSmallerDimension * L_ConstTooltipText_Number;
  55. divTooltipPointer.style.fontSize = iSmallerDimension * L_ConstTooltipPointerText_Number;
  56. }
  57. //******************
  58. // TOOLTIP FUNCTIONS
  59. //******************
  60. function LoadTooltipPointer()
  61. {
  62. divTooltipPointer.innerText = L_gszTooltipPointer_StaticText;
  63. }
  64. function LinksTooltipShow()
  65. {
  66. // Load in appropriate tooltip text from the module-level string array
  67. tdTooltip.innerHTML = gaszBtnTooltips[giTooltipIndex];
  68. //***************************
  69. // Calc Y (vertical) location
  70. //***************************
  71. // Get offsetTop of parent div element
  72. iYLoc = divLinks.offsetTop;
  73. // Get offsetTop from parent element
  74. iYLoc += document.all('tdLinks_' + giTooltipIndex).parentElement.offsetTop;
  75. // Get height of element
  76. iYLoc += document.all('anchorLink_' + giTooltipIndex).offsetHeight;
  77. // Add a % offset
  78. iYLoc += Math.floor( document.body.clientHeight * L_ConstLinkTooltipOffsetTop_Number );
  79. // Subtract parent div scrollTop to account for container div scrolling (if any)
  80. iYLoc -= divLinks.scrollTop;
  81. // Position the tooltip vertically
  82. divTooltip.style.pixelTop = iYLoc;
  83. iYLoc -= (GetPixelSize(divTooltipPointer.style.fontSize) / L_ConstLinkTooltipPointerOffsetTop_Number);
  84. // Position the tooltip pointer vertically
  85. divTooltipPointer.style.pixelTop = iYLoc;
  86. //*****************************
  87. // Calc X (horizontal) location
  88. //*****************************
  89. // Get offsetWidth of anchor element
  90. var iAnchorWidth = document.all('anchorLink_' + giTooltipIndex).offsetWidth;
  91. // Get offsetLeft of parent element
  92. var iTDOffset = document.all('anchorLink_' + giTooltipIndex).parentElement.offsetLeft;
  93. // Get width of tooltip
  94. var iTooltipWidth = document.all('divTooltip').offsetWidth;
  95. // Center the tooltip horizontally w/ respect to its anchor
  96. var iXLoc = iTDOffset + ( Math.floor( iAnchorWidth / 2 ) ) - ( Math.floor( iTooltipWidth / 2 ) );
  97. // Get offsetLeft of parent div element
  98. iXLoc += divLinks.offsetLeft;
  99. // Position the tooltip horizontally
  100. divTooltip.style.left = iXLoc;
  101. iXLoc += (iTooltipWidth / 2) - ( GetPixelSize(divTooltipPointer.style.fontSize) / 2 );
  102. // Position the tooltip pointer horizontally
  103. divTooltipPointer.style.pixelLeft = iXLoc;
  104. // Show the tooltip & pointer
  105. divTooltip.style.visibility = 'visible';
  106. divTooltipPointer.style.visibility = 'visible';
  107. }
  108. function LinksTooltipHide()
  109. {
  110. divTooltip.style.visibility = 'hidden';
  111. divTooltipPointer.style.visibility = 'hidden';
  112. window.clearTimeout(gTooltipTimer);
  113. //Empty the innerHTML, which causes the height to collapse
  114. tdTooltip.innerHTML = '';
  115. }