home *** CD-ROM | disk | FTP | other *** search
/ Adephia Powerlink / AdephiaPowerlink-030102.iso / pc / Install / WorkFlow / Bin / SysInfoText.dll / GUI_INFO / 3025 < prev    next >
Encoding:
Text File  |  2002-11-15  |  13.1 KB  |  463 lines

  1.  
  2.  
  3. <html>
  4. <head>
  5. <STYLE>
  6. body{
  7.     font-size : medium;
  8.     }
  9. td    {
  10.     font-size : medium;
  11.     }
  12. </STYLE>
  13. </head>
  14.  
  15. <body bgcolor="silver" text="maroon">
  16.  
  17. $MENUITEMS$
  18. <h1><div align="center">$WORKNODENAME$</div></h1><!--<form method="POST"  action="http://">-->
  19. <br>
  20. <h1><div align="center">Display</div></h1><!--<form method="POST"  action="http://">-->
  21.  
  22.  
  23. <form method="post" name="changeDisplayInput" action="CALLBACKID-ChangeDisplayInput">
  24. <table border="0" width="600">
  25. <tr><th align="left">
  26. Display Method:</th></tr>
  27. <tr>
  28. <th align="left">
  29. <input type="radio" name="Display_Method" value="" onClick="SetDisplayMethVals();"> File:</th><th align="left"><input name="fileInputText" style="HEIGHT: 22px; WIDTH: 373px"><input type="button" name="browseButton" value="Browse..." onClick="BrowseClick();"><input type="file" name="fileInput" style="HEIGHT: 22px; WIDTH: 80px" style='display: none;'>
  30.      </th></tr>
  31. <br>
  32. <tr><th align="left"><input type="radio" name="Display_Method" value="" onclick="ProcessRBClick();"> Direct:</th><th align="left"><input type="button" name="Direct_Edit" value="Edit" onClick="ProcessRBClick();" style="HEIGHT: 24px; WIDTH: 71px"></th></tr>
  33. </table>
  34.  
  35. <input type="hidden" name="TextInput" >
  36.  
  37.  
  38. <h1><div align="center">Embedded Variables</div></h1><!--<form method="POST"  action="http://">-->
  39. <table border="0" width="600">
  40. <tr><th align="left">
  41. Embedded Variable Key:</th>
  42. <th align="left">
  43. <input name="Embedded_Var_Key" 
  44.       style="HEIGHT: 22px; WIDTH: 222px"> 
  45. </tr>
  46. <tr><th align="left">
  47. Dictionary Entry To Substitute:</th>
  48. <th align="left">
  49. <input name="Dict_Entry" 
  50.       style="HEIGHT: 22px; WIDTH: 222px"> 
  51. </th></tr>
  52. </table>
  53.  
  54. <input type="button" name="Display_ADD" value="Add" style="HEIGHT: 24px; WIDTH: 55px" onClick="Add();">
  55. <input type="button" name="Display_Option" value="Clear" style="HEIGHT: 24px; WIDTH: 55px" onClick="HandleOption();">
  56. <br><br>
  57. Current Variable Keys:<br>
  58. <SELECT id="Display_Select" name="Display_Select" size=2 style="HEIGHT: 134px; WIDTH: 293px"> 
  59. </SELECT>
  60. <input type="hidden" name="DisplayRepository" >
  61. <table><tr><th align="right">
  62. <input type="button" name="Display_REMOVE" value="Remove" onClick="Remove();"></th>
  63. <th align="left">
  64. <input type="button" name="Display_EDIT" value="Edit" style="HEIGHT: 24px; WIDTH: 63px" onClick="Edit();">
  65. </th></tr>
  66. </table>
  67. <br>
  68. <P>$MENUITEMS$
  69.  
  70. </P>
  71. <hr>
  72. <table width = "200">
  73.   <TBODY>
  74. <tr><th align="middle">
  75. <input type="hidden" name="saveState" value="0">
  76. <input type="hidden" name="WorkingDir">
  77. <input type="button" name="save" value="Save" style="HEIGHT: 28px; WIDTH: 72px" onClick="return SubmitForSave();"> 
  78. </form></TH>
  79. <th align="middle"><form method="post" name="cancel_config" action="CALLBACKID-CancelConfigure"><INPUT name="cancel" type="submit" value="Cancel" style="HEIGHT: 28px; WIDTH: 72px">
  80. </form>
  81. </th></TR></TBODY></TABLE>
  82. <hr>
  83. <BR>
  84.  
  85. <A href="ConfigHelp.html#Display" target=_blank>Click here for help</A>
  86. <P> </P>
  87. </body>
  88. </HTML>
  89.  
  90.  
  91. <SCRIPT LANGUAGE="JavaScript">
  92. //PAGE SPECIFIC
  93. var nDisplayMethod = 0;
  94. var strTextInput = "";
  95. var windowRef;
  96. var strRepository = "";
  97. var strFilePath = "";
  98.  
  99. //Status FLAG
  100. var nCurrentlyEditing = -1;
  101. var strWorkingDir = "";
  102. var strCurrentlyEditing = "";
  103.  
  104. //Do not remove the below tags, they are used for dynamic insertion of values
  105. /*VARS*/
  106.  
  107. /*ENDVARS*/
  108.  
  109. strTextInput = strTextInput.replace(":;", "'");
  110.  
  111. //Page init
  112. document.forms[0].WorkingDir.value = strWorkingDir;
  113. document.forms[0].fileInputText.value = strFilePath;
  114.  
  115. if (nDisplayMethod == 1)    //DisplayMethod is direct
  116. {
  117.     document.forms[0].Display_Method[1].checked = true;
  118. }
  119. else                        //Display Method is default(file)
  120. {
  121.     document.forms[0].Display_Method[0].checked = true
  122. }
  123.  
  124. SetDisplayMethVals();
  125.  
  126. document.forms[0].TextInput.value = strTextInput;
  127.  
  128. document.forms[0].DisplayRepository.value = strRepository;
  129.  
  130. PopulateSelectBox(strRepository, document.forms[0].Display_Select);
  131.  
  132. function BrowseClick()
  133. {
  134.     var strOld;
  135.     var strNew;
  136.     
  137.     strOld = document.forms[0].fileInput.value;
  138.     document.forms[0].fileInput.click();
  139.     strNew = document.forms[0].fileInput.value;
  140.     
  141.     if (strOld != strNew)
  142.     {
  143.         document.forms[0].fileInputText.value = strNew;
  144.     }
  145. }
  146.  
  147. function SetDisplayMethVals()
  148. {
  149.     if (document.forms[0].Display_Method[1].checked)
  150.     {
  151.         document.forms[0].Display_Method[1].value = "CheckThis";
  152.         document.forms[0].Display_Method[0].value = "";
  153.     }
  154.     else
  155.     {
  156.         document.forms[0].Display_Method[0].value = "CheckThis";
  157.         document.forms[0].Display_Method[1].value = "";
  158.     }
  159. }
  160.  
  161. function ProcessRBClick()
  162. {
  163.     document.forms[0].Display_Method[1].checked = true;
  164.     document.forms[0].Display_Method[0].checked = false;
  165.     SetDisplayMethVals();
  166.     
  167.     windowRef = window.open();    
  168.     windowRef.resizeTo(700, 600);
  169.     windowRef.document.open();
  170.     windowRef.document.write("<html> <head> <STYLE>");
  171.     windowRef.document.write("body{    font-size : medium;    }");
  172.     windowRef.document.write("td    {    font-size : medium;    }");
  173.     windowRef.document.write("</STYLE></head>");
  174.     windowRef.document.write('<body bgcolor="silver" text="maroon"> ');
  175.     windowRef.document.write('<table width = "100%"><tr><th align="center">');
  176.     windowRef.document.write('<font size="5">Enter Desired Text to Display</font></th></tr>');
  177.     windowRef.document.write('<tr><th align="center">');
  178.     windowRef.document.write('<textarea name="DisplayText" WRAP="soft" rows="35" cols="90">' + strTextInput + '</textarea>');
  179.     windowRef.document.write('</th></tr><tr><th align="center">');
  180.     windowRef.document.write('<input type="button" name="bigSubmit" value="Commit" onClick="SubmitToParent();">');
  181.     windowRef.document.write('</th></tr></table>');
  182.     windowRef.document.write('</body></html>');
  183.     windowRef.document.write('<SCRIPT LANGUAGE="JavaScript">');
  184.     windowRef.document.write('function SubmitToParent()');
  185.     windowRef.document.write('{ var strTextInput; var temp; temp = document.all.item("DisplayText");');
  186.     windowRef.document.write('strTextInput = temp.value;');
  187.     windowRef.document.write('window.opener.document.forms[0].TextInput.value = strTextInput;');
  188.     windowRef.document.write('window.opener.strTextInput = strTextInput; window.close();}');
  189.     windowRef.document.write("</");
  190.     windowRef.document.write("SCRIPT>");
  191.     windowRef.document.close();    
  192. }
  193.  
  194.  
  195. function Add()
  196. {
  197.     var strCurrentEmbedded;
  198.     var strCurrentDictEntry;
  199.     
  200.     strCurrentEmbedded = document.forms[0].Embedded_Var_Key.value;
  201.     strCurrentDictEntry = document.forms[0].Dict_Entry.value;
  202.  
  203.     if (IsValidKey(strCurrentEmbedded))
  204.     {
  205.         UpdateRepository(strCurrentEmbedded, strCurrentDictEntry);    
  206.     
  207.         document.forms[0].Embedded_Var_Key.value = "";
  208.         document.forms[0].Dict_Entry.value = "";
  209.     }
  210. }
  211.  
  212. function Remove()
  213. {
  214.     var nIndex = document.forms[0].Display_Select.selectedIndex;
  215.     var strArray;
  216.     var strTemp;
  217.     var strDisplayRepository;
  218.     var nLength;
  219.     strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
  220.     nLength = strDisplayRepository.length - 2;
  221.     strTemp = strDisplayRepository.substring(0, nLength);    //knock off trailing delimeters
  222.     strArray = strTemp.split(";~");
  223.     
  224.     if (strArray.length == 1)
  225.     {
  226.         strDisplayRepository = "";
  227.     }
  228.     else
  229.     {    
  230.         strArray = RemoveArrayElement(strArray, nIndex);
  231.         strDisplayRepository = strArray.join(";~") + ";~"; 
  232.         HandleOption();
  233.     }
  234.     
  235.     document.forms[0].DisplayRepository.value = strDisplayRepository;
  236.     
  237.     //DEBUGGING CODE
  238.     //document.forms[0].Dict_Entry.value = strDisplayRepository;
  239.     document.forms[0].Display_Select.options[nIndex] = null;
  240. }
  241.  
  242. function UpdateRepository(strNewEmbed, strNewKey)
  243. {
  244.     var strDisplayRepository;
  245.     
  246.     if (nCurrentlyEditing > -1)
  247.     {
  248.         var strArray;
  249.         var strTemp;
  250.         var nLength;
  251.         var strNewValPair;    
  252.             
  253.         strNewValPair = strNewEmbed + "=" + strNewKey;
  254.             
  255.         strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
  256.         nLength = strDisplayRepository.length - 2;
  257.         strTemp = strDisplayRepository.substring(0, nLength);    //knock off trailing delimeters
  258.         strArray = strDisplayRepository.split(";~");
  259.         strArray[nCurrentlyEditing] = strNewValPair;
  260.         strDisplayRepository = strArray.join(";~"); 
  261.             
  262.         document.forms[0].DisplayRepository.value = strDisplayRepository;
  263.         document.forms[0].Display_Select.options[nCurrentlyEditing].text = strNewEmbed;
  264.             
  265.         document.forms[0].Display_ADD.value = "Add";
  266.         document.forms[0].Display_Option.value = "Clear";
  267.         nCurrentlyEditing = -1;
  268.         strCurrentlyEditing = "";
  269.     }
  270.     else
  271.     {
  272.         var opOption = new Option;
  273.             
  274.         strDisplayRepository = document.forms[0].DisplayRepository.value + strNewEmbed + "=" + strNewKey + ";~";
  275.         document.forms[0].DisplayRepository.value = strDisplayRepository;
  276.     
  277.         //document.forms[0].Dict_Entry.value = strDisplayRepository;
  278.         opOption.text = strNewEmbed;
  279.         document.forms[0].Display_Select.options[document.forms[0].Display_Select.options.length] = opOption;
  280.     }    
  281. }
  282.  
  283. function Edit()
  284. {
  285.     var nIndex = document.forms[0].Display_Select.selectedIndex;
  286.     var strArray;
  287.     var strTemp;
  288.     var strDisplayRepository;
  289.     var nLength;
  290.     var strStringToEdit;
  291.     
  292.     strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
  293.     nLength = strDisplayRepository.length - 2;
  294.     strTemp = strDisplayRepository.substring(0, nLength);    //knock off trailing delimeters
  295.     strArray = strDisplayRepository.split(";~");
  296.     
  297.     strStringToEdit = strArray[nIndex];
  298.     strArray = strStringToEdit.split("=");
  299.     nCurrentlyEditing = nIndex;
  300.     
  301.     document.forms[0].Display_ADD.value = "Update";
  302.     document.forms[0].Display_Option.value = "Cancel";
  303.     document.forms[0].Embedded_Var_Key.value = strArray[0];
  304.     document.forms[0].Dict_Entry.value = strArray[1];
  305.     strCurrentlyEditing = strArray[0];
  306. }
  307.  
  308. function HandleOption()
  309. {
  310.     if (nCurrentlyEditing > -1)
  311.     {
  312.         nCurrentlyEditing = -1;
  313.         strCurrentlyEditing = "";
  314.         document.forms[0].Display_Option.value = "Clear";
  315.         document.forms[0].Display_ADD.value = "Add";
  316.     }
  317.     document.forms[0].Embedded_Var_Key.value = "";
  318.     document.forms[0].Dict_Entry.value = "";
  319. }
  320.  
  321. function RemoveArrayElement(strArray, nIndex)
  322. {
  323.     var tempArray = new Array();
  324.     var nCounter;
  325.     var nArrCounter;
  326.     var nLength;
  327.     
  328.     nArrCounter = 0;
  329.     nLength = strArray.length;
  330.     nCounter = 0;
  331.     while (nCounter < nLength)
  332.     {
  333.         if ((strArray[nCounter].length != 0) && (nCounter != nIndex))
  334.         {
  335.             tempArray[nArrCounter] = strArray[nCounter];
  336.             nArrCounter = nArrCounter + 1;
  337.         }
  338.         nCounter = nCounter + 1;
  339.     }
  340.     
  341.     return tempArray;
  342. }
  343.  
  344.  
  345. function PopulateSelectBox(strValues, selectBox)
  346. {
  347.     var strArray;
  348.     var strTemp;
  349.     var nLength;
  350.     var strStringToAdd;
  351.     var nCounter=0;
  352.     var aTempArray;
  353.     var tempOption;
  354.             
  355.     if (strValues == "")
  356.     {
  357.         return;
  358.     }
  359.     nLength = strValues.length - 2;
  360.     strTemp = strValues.substring(0, nLength);    //knock off trailing delimeters
  361.     strArray = strTemp.split(";~");
  362.     nLength = strArray.length;
  363.     
  364.     while (nCounter < nLength)
  365.     {
  366.         tempOption = new Option();
  367.         aTempArray = strArray[nCounter].split("=");
  368.         tempOption.text = aTempArray[0];
  369.         selectBox.options[selectBox.length] = tempOption;
  370.         nCounter = nCounter + 1;
  371.     }
  372. }
  373.  
  374. function IsValidKey(strKey)
  375. {
  376.     var nLength;
  377.     var nCounter = 0;
  378.     
  379.     nLength = document.forms[0].Display_Select.length;
  380.     while (nCounter < nLength)
  381.     {
  382.         if ((strKey == document.forms[0].Display_Select.options[nCounter].text) && (strKey != strCurrentlyEditing))
  383.         {
  384.             window.alert("Duplicate Key already exists.");
  385.             return false;
  386.         }
  387.         nCounter++;
  388.     }
  389.     
  390.     return true;
  391. }
  392.  
  393. </SCRIPT>
  394.  
  395. <SCRIPT LANGUAGE="VBScript">
  396.  
  397. Call PrepareDisplayText(" \n", vbCrLf)
  398.  
  399. Function SubmitForSave()
  400.     document.forms(0).saveState.value = "1"
  401.     if (VerifyData()) then
  402.         On Error Resume Next
  403.         if (document.forms(0).onSubmit()) then
  404.             document.forms(0).submit()
  405.             while NOT (Err.Number Eqv 0)
  406.                 Err.Clear
  407.                 document.forms(0).submit()
  408.             Wend
  409.         end if
  410.     end if
  411. End Function
  412.  
  413. Function VerifyData()
  414.     dim bMethod
  415.     dim strFilePath
  416.     dim bReturn
  417.     dim strWorkingDir
  418.  
  419.     Call PrepareDisplayText(vbCrLf, " \n")
  420.     
  421.     bReturn = True
  422.     
  423.     bMethod = document.forms(0).Display_Method(1).checked
  424.     
  425.     if (bMethod=0) then
  426.         strFilePath = document.forms(0).fileInputText.value
  427.         strFilePath = LTrim(strFilePath)
  428.         strFilePath = RTrim(strFilePath)
  429.         if (NOT strFilePath="") then    'Verify it is a valid path
  430.             dim fso
  431.             dim bRes
  432.         
  433.             Set fso = CreateObject("Scripting.FileSystemObject")
  434.             bRes = fso.FileExists(strFilePath)
  435.             if NOT bRes then
  436.                 strWorkingDir = document.forms(0).WorkingDir.value
  437.                 strFilePath = strWorkingDir & document.forms(0).fileInputText.value
  438.                 strFilePath = LTrim(strFilePath)
  439.                 strFilePath = RTrim(strFilePath)
  440.                 bRes = fso.FileExists(strFilePath)
  441.                 if NOT bRes then
  442.                     strFilePath = document.forms(0).fileInputText.value
  443.                     strFilePath = LTrim(strFilePath)
  444.                     strFilePath = RTrim(strFilePath)
  445.                     Call MsgBox(strFilePath & " does not exist.",,"Validation ERROR")
  446.                     bReturn = False
  447.                 end if
  448.             end if
  449.         end if
  450.     end if
  451.     
  452.     VerifyData = bReturn
  453. end function
  454.  
  455. Sub PrepareDisplayText(strToFind, strToUse)
  456.     dim strTemp
  457.     
  458.     strTemp = Replace(document.forms(0).TextInput.value, strToFind, strToUse)
  459.     'Call MsgBox(strTemp)
  460.     document.forms(0).TextInput.value = strTemp
  461. End Sub
  462.  
  463. </SCRIPT>