home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Audio / Office2010 / ProPlus.WW / ProPsWW2.cab / FORMSVIEWFRAME.HTML3 < prev    next >
Text File  |  2007-02-04  |  5KB  |  138 lines

  1. <!-- *********************************************************************
  2.                                  Notice
  3.  
  4. You may not modify, use, copy or distribute this file or its contents. 
  5. Internal interfaces referenced in this file are nonpublic, unsupported 
  6. and subject to change without notice. These interfaces may not be 
  7. utilized in other software applications or components.
  8.  
  9.  
  10. ********************************************************************* -->
  11.  
  12. <!-- saved from url=(0025)http://www.microsoft.com/ -->
  13.  
  14. <html>
  15. <head>
  16.     <title>Main Page (preview)</title>
  17.     <script language="javascript" src="utilityfunctions.js"></script>
  18. </head>
  19.  
  20. <script language="javascript">
  21. <!--
  22.  
  23. var g_ResizeTimeoutID;
  24.  
  25. // =====================================================
  26. // ===            Document Event Handlers            ===
  27. // =====================================================
  28.  
  29. document.oncontextmenu = contextMenuEvent;
  30.  
  31. function contextMenuEvent()
  32. {
  33.     // Right-click context menu will only appear if 'Ctrl' key is held down.
  34.     if (!event.ctrlKey)
  35.         event.returnValue = false;
  36. }
  37.  
  38. // =====================================================
  39. // ===           View Frame Initialization           ===
  40. // =====================================================
  41.  
  42. var Transaction = getScriptHostQI("IGrooveFormsToolUIDelegate").OpenTransaction();
  43. try
  44. {
  45.     var ViewID = -1;
  46.     if (window.location.search != "")
  47.     {
  48.         var QueryString = String(window.location.search).substring(1);
  49.         ViewID = getValueFromQueryString("ViewID", QueryString);
  50.     }
  51.  
  52.     // If the view id in the querystring is invalid, look for a recent one.
  53.     if (ViewID == -1 || ViewID == "")
  54.     {
  55.         var CurrentViewID = getScriptHostQI("IGrooveFormsToolUIDelegateViewFramePrivate").CurrentWebViewID;
  56.         if (CurrentViewID != -1 && CurrentViewID != "" && getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DoesDesignObjectExist(CurrentViewID))
  57.         {
  58.             ViewID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ConvertDesignObjectIDToString(CurrentViewID);
  59.         }
  60.         else
  61.         {
  62.             // Check the default view from configuration options.
  63.             var DefaultViewID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DefaultViewID;
  64.             if (DefaultViewID != -1 && DefaultViewID != "" && getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DoesDesignObjectExist(DefaultViewID))
  65.                 ViewID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ConvertDesignObjectIDToString(DefaultViewID);
  66.             else
  67.                 window.location.replace("FormsHomePage.html");
  68.         }
  69.     }
  70.  
  71.     // Save the current view ID. We must convert it to a number
  72.     // here in case the user has selected a different locale.
  73.     getScriptHostQI("IGrooveFormsToolUIDelegateViewFramePrivate").CurrentWebViewID = Number(ViewID);
  74.  
  75.     if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ShowPreviewPane)
  76.     {
  77.         // Write out the frame set to display the view and the preview pane.
  78.         document.write("<frameset rows=\"" + getScriptHostQI("IGrooveFormsToolUIDelegateViewFramePrivate").ViewFrameSize + "\" id=\"FormsViewFrameset\" onload=\"verifyFrameSize();\" onunload=\"setFrameSize()\">");
  79.         document.write("    <frame src=\"FormsViewTemplate.html?ViewID=" + ViewID + "\" id=\"FormsViewPage\" scrolling=\"no\" frameborder=\"no\" onresize=\"verifyFrameSize()\">");
  80.         document.write("    <frame src=\"FormsBlankPage.html\" id=\"FormsPreviewPage\">");
  81.         document.write("</frameset>");
  82.     }
  83.     else
  84.     {
  85.         window.location.replace("FormsViewTemplate.html?ViewID=" + ViewID);
  86.     }
  87.  
  88.     Transaction.Commit();
  89. }
  90. catch (error)
  91. {
  92.     getScriptHostQI("IGrooveFormsToolUIDelegate").DisplayError(error.description);
  93.     Transaction.Abort();
  94. }
  95.  
  96. // =====================================================
  97. // ===              View Frame Utility               ===
  98. // =====================================================
  99.  
  100. function setFrameSize()
  101. {
  102.     var objViewFrame = document.getElementById("FormsViewPage");
  103.     var objPreviewFrame = document.getElementById("FormsPreviewPage");
  104.     if (objViewFrame != null && objPreviewFrame != null)
  105.     {
  106.         var intTopHeight = objViewFrame.height;
  107.         var intBotHeight = objPreviewFrame.height;
  108.         var intTotal = intTopHeight + intBotHeight;
  109.         var intTopPercent = Math.round((intTopHeight / intTotal) * 100);
  110.         getScriptHostQI("IGrooveFormsToolUIDelegateViewFramePrivate").ViewFrameSize = intTopPercent + "%,*";
  111.     }
  112. }
  113.  
  114. function verifyFrameSize()
  115. {
  116.     window.clearTimeout(g_ResizeTimeoutID);
  117.     g_ResizeTimeoutID = window.setTimeout("verifyFrameSizeDelayed()", 250);
  118. }
  119.  
  120. function verifyFrameSizeDelayed()
  121. {
  122.     var arrFrames = document.getElementsByTagName("FRAME");
  123.     if (arrFrames.length >= 2)
  124.     {
  125.         var intTopHeight = arrFrames[0].height;
  126.         if (intTopHeight <= 36)
  127.         {
  128.             var objFrameset = document.getElementById("FormsViewFrameset");
  129.             if (objFrameset != null)
  130.                 objFrameset.rows = "37,*";
  131.         }
  132.     }
  133. }
  134.  
  135. // -->
  136. </script>
  137.  
  138. </html>