home *** CD-ROM | disk | FTP | other *** search
/ Adephia Powerlink / AdephiaPowerlink-030102.iso / pc / Install / WorkFlow / Bin / FlashFIn.dll / GUI_INFO / 3013 < prev    next >
Encoding:
Text File  |  2002-11-15  |  14.7 KB  |  568 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>
  19. <br>
  20. <h1><div align="center">Display</div></h1>
  21.  
  22.  
  23. <form method="post" name="changeDisplayInput" action="CALLBACKID-ChangeDisplayInput">
  24. <table border="0" width="700">
  25. <tr>
  26. <th align="left">
  27. Flash Swiff File Path:</th><th align="left"><input name="fileInputText" style="HEIGHT: 22px; WIDTH: 373px"><input type="button" name="browseButton" value="Browse..." onClick="BrowseClick(fileInput, fileInputText);"><input type="file" name="fileInput" style="DISPLAY: none; HEIGHT: 22px; WIDTH: 80px">
  28. </th></tr>
  29. <tr>
  30. <th align="left">
  31. Perform Action:</th><th align="left"><input name="PerformAction" style="HEIGHT: 22px; WIDTH: 373px" >
  32. </th></tr>
  33. <tr>
  34. <th align="left">
  35. Method:</th><th align="left">
  36. <input type="radio" name="PAMethod" value="" onClick="SetGUIRBS(document.forms[0].PAMethod);">Perform Action <input type="radio" name="PAMethod" value="" onClick="SetGUIRBS(document.forms[0].PAMethod);">Perform ActionEx
  37. </th></tr>
  38. </table>
  39. <br><br><br><br>
  40. <h1><div align="center">Content Files</div></h1>
  41. <table border="0" width="700">
  42. <tr><th align="left">
  43. Flash Content File Path:</th><th align="left"><input name="fileContentPathInputText" style="HEIGHT: 22px; WIDTH: 373px"><input type="button" name="browseContentButton" value="Browse..." onClick="BrowseClick(fileContentPathInput, fileContentPathInputText);"><input type="file" name="fileContentPathInput" style="DISPLAY: none; HEIGHT: 22px; WIDTH: 80px">
  44. </th></tr>
  45. <tr>
  46. <th width="20%"> </th>
  47. <th width="80%" align="left">
  48. Current Content Files:</th></tr>
  49. <tr>
  50. <th align="left" width="20%">
  51. <table width="100%">
  52. <tr><th align="right"><input type="button" name="AddPath" value="Add" style="HEIGHT: 24px; WIDTH: 71px" onClick="AddAPath();"></th></tr>
  53. <tr><th align="right"><input type="button" name="RemovePath" value="Remove" style="HEIGHT: 24px; WIDTH: 71px" onClick="RemoveAPath();"></th></tr>
  54. </table></th>
  55. <th align="left" width="80%">
  56. <SELECT id="Paths_Select" name="Paths_Select" size=2 style="HEIGHT: 134px; WIDTH: 480px"> 
  57. </SELECT>
  58. </th></tr>
  59. </table>
  60. <input type="hidden" name="PathsRepository">
  61. <input type="hidden" name="TextInput" >
  62.  
  63. <br><br><br><br>
  64. <h1><div align="center">Embedded Flash Variables</div></h1>
  65. <table border="0" width="600">
  66. <tr><th align="left">
  67. Embedded Flash Variable Name:</th>
  68. <th align="left">
  69. <input name="Embedded_Var_Key" 
  70.       style="HEIGHT: 22px; WIDTH: 222px"> 
  71. </tr>
  72. <tr><th align="left">
  73. Dictionary Entry To Substitute:</th>
  74. <th align="left">
  75. <input name="Dict_Entry" 
  76.       style="HEIGHT: 22px; WIDTH: 222px"> 
  77. </th></tr>
  78. </table>
  79.  
  80. <input type="button" name="Display_ADD" value="Add" style="HEIGHT: 24px; WIDTH: 55px" onClick="Add();">
  81. <input type="button" name="Display_Option" value="Clear" style="HEIGHT: 24px; WIDTH: 55px" onClick="HandleOption();">
  82. <br><br>
  83. Current Variable Keys:<br>
  84. <SELECT id="Display_Select" name="Display_Select" size=2 style="HEIGHT: 134px; WIDTH: 293px"> 
  85. </SELECT>
  86. <input type="hidden" name="DisplayRepository" >
  87. <table><tr><th align="right">
  88. <input type="button" name="Display_REMOVE" value="Remove" onClick="Remove();"></th>
  89. <th align="left">
  90. <input type="button" name="Display_EDIT" value="Edit" style="HEIGHT: 24px; WIDTH: 63px" onClick="Edit();">
  91. </th></tr>
  92. </table>
  93. <br>
  94. <P>$MENUITEMS$
  95.  
  96. </P>
  97. <hr>
  98. <table width = "200">
  99.   <TBODY>
  100. <tr><th align="middle">
  101. <input type="hidden" name="saveState" value="0">
  102. <input type="hidden" name="WorkingDir">
  103. <input type="button" name="save" value="Save" style="HEIGHT: 28px; WIDTH: 72px" onClick="return SubmitForSave();"> 
  104. </form></TH>
  105. <th align="middle"><form method="post" name="cancel_config" action="CALLBACKID-CancelConfigure"><INPUT name="cancel" type="submit" value="Cancel" style="HEIGHT: 28px; WIDTH: 72px">
  106. </form>
  107. </th></TR></TBODY></TABLE>
  108. <hr>
  109. <BR>
  110.  
  111. <A href="ConfigHelp.html#Display" target=_blank>Click here for help</A> | 
  112. <A href="FlashDoc.html" target=_blank>Click here for flash guidelines</A>
  113. <P> </P>
  114. </body>
  115. </HTML>
  116.  
  117.  
  118. <SCRIPT LANGUAGE="JavaScript">
  119. //Status Flags
  120. var nCurrentlyEditing = -1;
  121. var strCurrentlyEditing = "";
  122.  
  123. //Imported Values:  Need to be set by WorkNode code
  124. var strRepository = "";
  125. var strFilePath = "";
  126. //var strContentFilePath = "";
  127. var strWorkingDir = "";
  128. var strPerformAction = "";
  129. var nPerformActionMethod = 0;
  130.  
  131. //Imported values needed for Paths handling
  132. var strPathsRepository = "";
  133.  
  134.  
  135. //Do not remove the below tags, they are used for dynamic insertion of values
  136. /*VARS*/
  137.  
  138. /*ENDVARS*/
  139.  
  140. //Page init
  141. SetBinaryRB(nPerformActionMethod, document.forms[0].PAMethod);
  142. SetGUIRBS(document.forms[0].PAMethod);
  143.  
  144. document.forms[0].WorkingDir.value = strWorkingDir;
  145. document.forms[0].fileInputText.value = strFilePath;
  146. //document.forms[0].fileContentPathInputText.value = strContentFilePath;
  147. document.forms[0].PerformAction.value = strPerformAction;
  148.  
  149. document.forms[0].PathsRepository.value = strPathsRepository;
  150. document.forms[0].DisplayRepository.value = strRepository;
  151.  
  152. PopulateSelectBox(strRepository, document.forms[0].Display_Select);
  153. PopulateSelectBox(strPathsRepository, document.forms[0].Paths_Select);
  154.  
  155.  
  156. //Radio Button handling functions
  157. function SetBinaryRB(nValue, rbControl)
  158. {
  159.     if (nValue != 1)
  160.     {
  161.         nValue = 0;
  162.     }
  163.     rbControl[nValue].checked = true;
  164. }
  165.  
  166. function SetGUIRBS(rb)
  167. {
  168.     if (rb[0].checked)
  169.     {
  170.         rb[0].value = "CheckThis";
  171.         rb[1].value = "";
  172.     }
  173.     else
  174.     {
  175.         rb[0].value = "";
  176.         rb[1].value = "CheckThis";
  177.     }
  178. }
  179.  
  180. //Begin Path Repository Functions
  181. function GetFileName(strFilePath)
  182. {
  183.     var strRet;
  184.     var nIndex;
  185.     
  186.     nIndex = strFilePath.lastIndexOf("\\");
  187.     
  188.     if (nIndex == -1)
  189.     {
  190.         nIndex = strFilePath.lastIndexOf("/");
  191.     }
  192.     
  193.     if (nIndex == -1)
  194.     {
  195.         strRet = "";
  196.     }
  197.     else
  198.     {
  199.         strRet = strFilePath.substr(nIndex + 1);
  200.     }
  201.     
  202.     return strRet;
  203. }
  204.  
  205. function IsPathAlreadyEntered(strPath)
  206. {
  207.     var strRepository;
  208.     
  209.     strRepository = document.forms[0].PathsRepository.value;
  210.     
  211.     if (strRepository.lastIndexOf(strPath) != -1)
  212.     {
  213.         return true;
  214.     }
  215.     
  216.     return false;
  217. }
  218.  
  219. function AddAPath()
  220. {
  221.     var strPath;
  222.     var strFileName;
  223.     
  224.     strPath = document.forms[0].fileContentPathInputText.value;
  225.     strFileName = GetFileName(strPath);
  226.     
  227.     if (!IsPathAlreadyEntered(strPath))
  228.     {
  229.         UpdatePathsRepository(strFileName, strPath);
  230.     }
  231.     else
  232.     {
  233.         alert("File already included, duplicate file ignored.");
  234.     }
  235.     //document.forms[0].fileContentPathInputText.value = strFileName;
  236. }
  237.  
  238. function UpdatePathsRepository(strNewFileName, strNewPath)
  239. {
  240.     var strRepository;
  241.     
  242.     var opOption = new Option;
  243.             
  244.     strRepository = document.forms[0].PathsRepository.value + strNewFileName + "=" + strNewPath + ";~";
  245.     document.forms[0].PathsRepository.value = strRepository;
  246.     
  247.     opOption.text = strNewFileName;
  248.     document.forms[0].Paths_Select.options[document.forms[0].Paths_Select.options.length] = opOption;    
  249. }
  250.  
  251. function RemoveAPath()
  252. {
  253.     var nIndex = document.forms[0].Paths_Select.selectedIndex;
  254.     var strArray;
  255.     var strTemp;
  256.     var strRepository;
  257.     var nLength;
  258.     
  259.     strRepository = new String(document.forms[0].PathsRepository.value.toString());
  260.     nLength = strRepository.length - 2;
  261.     strTemp = strRepository.substring(0, nLength);    //knock off trailing delimeters
  262.     strArray = strTemp.split(";~");
  263.     
  264.     if (strArray.length == 1)
  265.     {
  266.         strRepository = "";
  267.     }
  268.     else
  269.     {    
  270.         strArray = RemoveArrayElement(strArray, nIndex);
  271.         strRepository = strArray.join(";~") + ";~"; 
  272.     }
  273.     
  274.     document.forms[0].PathsRepository.value = strRepository;
  275.     
  276.     //DEBUGGING CODE
  277.     //document.forms[0].Dict_Entry.value = strDisplayRepository;
  278.     
  279.     document.forms[0].Paths_Select.options[nIndex] = null;
  280. }
  281.  
  282.  
  283. //End Path Repository Functions
  284.  
  285.  
  286. function BrowseClick(theFileInput, theOutputLocation)
  287. {
  288.     var strOld;
  289.     var strNew;
  290.     
  291.     strOld = theFileInput.value;
  292.     theFileInput.click();
  293.     strNew = theFileInput.value;
  294.     
  295.     if (strOld != strNew)
  296.     {
  297.         theOutputLocation.value = strNew;
  298.     }
  299. }
  300.  
  301. function Add()
  302. {
  303.     var strCurrentEmbedded;
  304.     var strCurrentDictEntry;
  305.     
  306.     strCurrentEmbedded = document.forms[0].Embedded_Var_Key.value;
  307.     strCurrentDictEntry = document.forms[0].Dict_Entry.value;
  308.  
  309.     if (IsValidKey(strCurrentEmbedded))
  310.     {
  311.         UpdateRepository(strCurrentEmbedded, strCurrentDictEntry);    
  312.     
  313.         document.forms[0].Embedded_Var_Key.value = "";
  314.         document.forms[0].Dict_Entry.value = "";
  315.     }
  316. }
  317.  
  318. function Remove()
  319. {
  320.     var nIndex = document.forms[0].Display_Select.selectedIndex;
  321.     var strArray;
  322.     var strTemp;
  323.     var strDisplayRepository;
  324.     var nLength;
  325.     strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
  326.     nLength = strDisplayRepository.length - 2;
  327.     strTemp = strDisplayRepository.substring(0, nLength);    //knock off trailing delimeters
  328.     strArray = strTemp.split(";~");
  329.     
  330.     if (strArray.length == 1)
  331.     {
  332.         strDisplayRepository = "";
  333.     }
  334.     else
  335.     {    
  336.         strArray = RemoveArrayElement(strArray, nIndex);
  337.         strDisplayRepository = strArray.join(";~") + ";~"; 
  338.         HandleOption();
  339.     }
  340.     
  341.     document.forms[0].DisplayRepository.value = strDisplayRepository;
  342.     
  343.     //DEBUGGING CODE
  344.     //document.forms[0].Dict_Entry.value = strDisplayRepository;
  345.     
  346.     document.forms[0].Display_Select.options[nIndex] = null;
  347. }
  348.  
  349. function UpdateRepository(strNewEmbed, strNewKey)
  350. {
  351.     var strDisplayRepository;
  352.     
  353.     if (nCurrentlyEditing > -1)
  354.     {
  355.         var strArray;
  356.         var strTemp;
  357.         var nLength;
  358.         var strNewValPair;    
  359.             
  360.         strNewValPair = strNewEmbed + "=" + strNewKey;
  361.             
  362.         strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
  363.         nLength = strDisplayRepository.length - 2;
  364.         strTemp = strDisplayRepository.substring(0, nLength);    //knock off trailing delimeters
  365.         strArray = strDisplayRepository.split(";~");
  366.         strArray[nCurrentlyEditing] = strNewValPair;
  367.         strDisplayRepository = strArray.join(";~"); 
  368.             
  369.         document.forms[0].DisplayRepository.value = strDisplayRepository;
  370.         document.forms[0].Display_Select.options[nCurrentlyEditing].text = strNewEmbed;
  371.             
  372.         document.forms[0].Display_ADD.value = "Add";
  373.         document.forms[0].Display_Option.value = "Clear";
  374.         nCurrentlyEditing = -1;
  375.         strCurrentlyEditing = "";
  376.     }
  377.     else
  378.     {
  379.         var opOption = new Option;
  380.             
  381.         strDisplayRepository = document.forms[0].DisplayRepository.value + strNewEmbed + "=" + strNewKey + ";~";
  382.         document.forms[0].DisplayRepository.value = strDisplayRepository;
  383.     
  384.         opOption.text = strNewEmbed;
  385.         document.forms[0].Display_Select.options[document.forms[0].Display_Select.options.length] = opOption;
  386.     }    
  387. }
  388.  
  389. function Edit()
  390. {
  391.     var nIndex = document.forms[0].Display_Select.selectedIndex;
  392.     var strArray;
  393.     var strTemp;
  394.     var strDisplayRepository;
  395.     var nLength;
  396.     var strStringToEdit;
  397.     
  398.     strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
  399.     nLength = strDisplayRepository.length - 2;
  400.     strTemp = strDisplayRepository.substring(0, nLength);    //knock off trailing delimeters
  401.     strArray = strDisplayRepository.split(";~");
  402.     
  403.     strStringToEdit = strArray[nIndex];
  404.     strArray = strStringToEdit.split("=");
  405.     nCurrentlyEditing = nIndex;
  406.     
  407.     document.forms[0].Display_ADD.value = "Update";
  408.     document.forms[0].Display_Option.value = "Cancel";
  409.     document.forms[0].Embedded_Var_Key.value = strArray[0];
  410.     document.forms[0].Dict_Entry.value = strArray[1];
  411.     strCurrentlyEditing = strArray[0];
  412. }
  413.  
  414. function HandleOption()
  415. {
  416.     if (nCurrentlyEditing > -1)
  417.     {
  418.         nCurrentlyEditing = -1;
  419.         strCurrentlyEditing = "";
  420.         document.forms[0].Display_Option.value = "Clear";
  421.         document.forms[0].Display_ADD.value = "Add";
  422.     }
  423.     document.forms[0].Embedded_Var_Key.value = "";
  424.     document.forms[0].Dict_Entry.value = "";
  425. }
  426.  
  427. function RemoveArrayElement(strArray, nIndex)
  428. {
  429.     var tempArray = new Array();
  430.     var nCounter;
  431.     var nArrCounter;
  432.     var nLength;
  433.     
  434.     nArrCounter = 0;
  435.     nLength = strArray.length;
  436.     nCounter = 0;
  437.     while (nCounter < nLength)
  438.     {
  439.         if ((strArray[nCounter].length != 0) && (nCounter != nIndex))
  440.         {
  441.             tempArray[nArrCounter] = strArray[nCounter];
  442.             nArrCounter = nArrCounter + 1;
  443.         }
  444.         nCounter = nCounter + 1;
  445.     }
  446.     
  447.     return tempArray;
  448. }
  449.  
  450.  
  451. function PopulateSelectBox(strValues, selectBox)
  452. {
  453.     var strArray;
  454.     var strTemp;
  455.     var nLength;
  456.     var strStringToAdd;
  457.     var nCounter=0;
  458.     var aTempArray;
  459.     var tempOption;
  460.             
  461.     if (strValues == "")
  462.     {
  463.         return;
  464.     }
  465.     nLength = strValues.length - 2;
  466.     strTemp = strValues.substring(0, nLength);    //knock off trailing delimeters
  467.     strArray = strTemp.split(";~");
  468.     nLength = strArray.length;
  469.     
  470.     while (nCounter < nLength)
  471.     {
  472.         tempOption = new Option();
  473.         aTempArray = strArray[nCounter].split("=");
  474.         tempOption.text = aTempArray[0];
  475.         selectBox.options[selectBox.length] = tempOption;
  476.         nCounter = nCounter + 1;
  477.     }
  478. }
  479.  
  480. function IsValidKey(strKey)
  481. {
  482.     var nLength;
  483.     var nCounter = 0;
  484.     
  485.     
  486.     nLength = document.forms[0].Display_Select.length;
  487.     while (nCounter < nLength)
  488.     {
  489.         if ((strKey == document.forms[0].Display_Select.options[nCounter].text) && (strKey != strCurrentlyEditing))
  490.         {
  491.             window.alert("Duplicate Key already exists.");
  492.             return false;
  493.         }
  494.         nCounter++;
  495.     }
  496.     
  497.     return true;
  498. }
  499.  
  500. </SCRIPT>
  501.  
  502. <SCRIPT LANGUAGE="VBScript">
  503. Function SubmitForSave()
  504.     document.forms(0).saveState.value = "1"
  505.     if (VerifyData()) then
  506.         On Error Resume Next
  507.         if (document.forms(0).onSubmit()) then
  508.             document.forms(0).submit()
  509.             while NOT (Err.Number Eqv 0)
  510.                 Err.Clear
  511.                 document.forms(0).submit()
  512.             Wend
  513.         end if
  514.     end if
  515. End Function
  516.  
  517. Function VerifyPath(strThePath)
  518.     dim fso
  519.     dim bRes
  520.     dim strFilePath
  521.     dim bReturn
  522.     
  523.     bReturn = True
  524.     strFilePath = strThePath
  525.     strFilePath = LTrim(strFilePath)
  526.     strFilePath = RTrim(strFilePath)
  527.         
  528.     Set fso = CreateObject("Scripting.FileSystemObject")
  529.     bRes = fso.FileExists(strFilePath)
  530.     
  531.     if (NOT strFilePath="") then    'Verify that a path was even entered
  532.         if NOT bRes then
  533.             strWorkingDir = document.forms(0).WorkingDir.value
  534.             strFilePath = strWorkingDir & strThePath
  535.             strFilePath = LTrim(strFilePath)
  536.             strFilePath = RTrim(strFilePath)
  537.             bRes = fso.FileExists(strFilePath)
  538.             if NOT bRes then
  539.                 strFilePath = strThePath
  540.                 strFilePath = LTrim(strFilePath)
  541.                 strFilePath = RTrim(strFilePath)
  542.                 Call MsgBox(strFilePath & " does not exist.",,"Validation ERROR")
  543.                 bReturn = False
  544.             end if
  545.         end if
  546.     end if
  547.     
  548.     VerifyPath = bReturn
  549. End Function
  550.  
  551.  
  552. Function VerifyData()
  553.     dim strFilePath
  554.     dim bReturn
  555.     dim strWorkingDir
  556.     
  557.     bReturn = True
  558.     
  559.     if (NOT VerifyPath(document.forms(0).fileContentPathInputText.value)) then
  560.         bReturn = False
  561.     elseif (NOT VerifyPath(document.forms(0).fileInputText.value)) then
  562.         bReturn = False
  563.     end if
  564.     
  565.     VerifyData = bReturn
  566. end function
  567.  
  568. </SCRIPT>