home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Misc / showHtml.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  1.3 KB  |  66 lines

  1. !!Script
  2. // Copyright ⌐ 2000 - Modelworks Software
  3. // @Created: build 349 cm20000510
  4.  
  5. /*
  6. To have the html access the IDE objects, add the following to your html 
  7. page before any other scripts:
  8.  
  9.         <script language="jscript">        
  10.         
  11.         var gHost = window.external.Host;
  12.         var gApplication = window.external.Application;
  13.         var 
  14.         if (gHost)
  15.         {
  16.             gOutput = gHost.getOutput();
  17.         }
  18.     
  19.         </script>
  20. */
  21.  
  22. var gOutput = getOutput();
  23.  
  24. function DoCommand()
  25. {
  26.     var file = chooseFile("Choose HTML file to open",  "HTML file", "*.htm*");
  27.  
  28.     if (file)
  29.     {
  30.         var size = Application.getScreenSize();
  31.         var windowRect = Application.getWindowRect();
  32.         var windowRectRestored = Application.getWindowRect();
  33.         Host.setGlobal("oldRect",windowRectRestored);
  34.         
  35.         var rect = newRect();
  36.         rect.top = 0;
  37.         rect.bottom = size.y;
  38.         rect.left = 0;
  39.         rect.right = size.x/3;
  40.     
  41.         windowRect.left = rect.right;
  42.         windowRect.right = size.x;
  43.         windowRect.top = 0;
  44.         windowRect.bottom = size.y;
  45.         
  46.         Application.setWindowRect(windowRect);
  47.         
  48.         var callbackPath = File.getToolsPath;
  49.         callbackPath += "\\Misc\\showHtml.script";
  50.  
  51.         showHtmlPopup(file.path, "Title", rect, callbackPath);
  52.     }
  53. }
  54.  
  55. function OnNotify(document)
  56. {
  57.     var oldRect = Host.getGlobal("oldRect");
  58.     if (oldRect)
  59.     {
  60.         Application.setWindowRect(oldRect);
  61.     }
  62. }
  63.  
  64. !!/Script
  65.  
  66.