home *** CD-ROM | disk | FTP | other *** search
-
-
- <html>
- <head>
- <STYLE>
- body{
- font-size : medium;
- }
- td {
- font-size : medium;
- }
- </STYLE>
- </head>
-
- <body bgcolor="silver" text="maroon">
-
- $MENUITEMS$
- <h1><div align="center">$WORKNODENAME$</div></h1>
- <br>
- <h1><div align="center">Display</div></h1>
-
-
- <form method="post" name="changeDisplayInput" action="CALLBACKID-ChangeDisplayInput">
- <table border="0" width="700">
- <tr>
- <th align="left">
- 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">
- </th></tr>
- <tr>
- <th align="left">
- Perform Action:</th><th align="left"><input name="PerformAction" style="HEIGHT: 22px; WIDTH: 373px" >
- </th></tr>
- <tr>
- <th align="left">
- Method:</th><th align="left">
- <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
- </th></tr>
- </table>
- <br><br><br><br>
- <h1><div align="center">Content Files</div></h1>
- <table border="0" width="700">
- <tr><th align="left">
- 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">
- </th></tr>
- <tr>
- <th width="20%"> </th>
- <th width="80%" align="left">
- Current Content Files:</th></tr>
- <tr>
- <th align="left" width="20%">
- <table width="100%">
- <tr><th align="right"><input type="button" name="AddPath" value="Add" style="HEIGHT: 24px; WIDTH: 71px" onClick="AddAPath();"></th></tr>
- <tr><th align="right"><input type="button" name="RemovePath" value="Remove" style="HEIGHT: 24px; WIDTH: 71px" onClick="RemoveAPath();"></th></tr>
- </table></th>
- <th align="left" width="80%">
- <SELECT id="Paths_Select" name="Paths_Select" size=2 style="HEIGHT: 134px; WIDTH: 480px">
- </SELECT>
- </th></tr>
- </table>
- <input type="hidden" name="PathsRepository">
- <input type="hidden" name="TextInput" >
-
- <br><br><br><br>
- <h1><div align="center">Embedded Flash Variables</div></h1>
- <table border="0" width="600">
- <tr><th align="left">
- Embedded Flash Variable Name:</th>
- <th align="left">
- <input name="Embedded_Var_Key"
- style="HEIGHT: 22px; WIDTH: 222px">
- </tr>
- <tr><th align="left">
- Dictionary Entry To Substitute:</th>
- <th align="left">
- <input name="Dict_Entry"
- style="HEIGHT: 22px; WIDTH: 222px">
- </th></tr>
- </table>
-
- <input type="button" name="Display_ADD" value="Add" style="HEIGHT: 24px; WIDTH: 55px" onClick="Add();">
- <input type="button" name="Display_Option" value="Clear" style="HEIGHT: 24px; WIDTH: 55px" onClick="HandleOption();">
- <br><br>
- Current Variable Keys:<br>
- <SELECT id="Display_Select" name="Display_Select" size=2 style="HEIGHT: 134px; WIDTH: 293px">
- </SELECT>
- <input type="hidden" name="DisplayRepository" >
- <table><tr><th align="right">
- <input type="button" name="Display_REMOVE" value="Remove" onClick="Remove();"></th>
- <th align="left">
- <input type="button" name="Display_EDIT" value="Edit" style="HEIGHT: 24px; WIDTH: 63px" onClick="Edit();">
- </th></tr>
- </table>
- <br>
- <P>$MENUITEMS$
-
- </P>
- <hr>
- <table width = "200">
- <TBODY>
- <tr><th align="middle">
- <input type="hidden" name="saveState" value="0">
- <input type="hidden" name="WorkingDir">
- <input type="button" name="save" value="Save" style="HEIGHT: 28px; WIDTH: 72px" onClick="return SubmitForSave();">
- </form></TH>
- <th align="middle"><form method="post" name="cancel_config" action="CALLBACKID-CancelConfigure"><INPUT name="cancel" type="submit" value="Cancel" style="HEIGHT: 28px; WIDTH: 72px">
- </form>
- </th></TR></TBODY></TABLE>
- <hr>
- <BR>
-
- <A href="ConfigHelp.html#Display" target=_blank>Click here for help</A> |
- <A href="FlashDoc.html" target=_blank>Click here for flash guidelines</A>
- <P> </P>
- </body>
- </HTML>
-
-
- <SCRIPT LANGUAGE="JavaScript">
- //Status Flags
- var nCurrentlyEditing = -1;
- var strCurrentlyEditing = "";
-
- //Imported Values: Need to be set by WorkNode code
- var strRepository = "";
- var strFilePath = "";
- //var strContentFilePath = "";
- var strWorkingDir = "";
- var strPerformAction = "";
- var nPerformActionMethod = 0;
-
- //Imported values needed for Paths handling
- var strPathsRepository = "";
-
-
- //Do not remove the below tags, they are used for dynamic insertion of values
- /*VARS*/
-
- /*ENDVARS*/
-
- //Page init
- SetBinaryRB(nPerformActionMethod, document.forms[0].PAMethod);
- SetGUIRBS(document.forms[0].PAMethod);
-
- document.forms[0].WorkingDir.value = strWorkingDir;
- document.forms[0].fileInputText.value = strFilePath;
- //document.forms[0].fileContentPathInputText.value = strContentFilePath;
- document.forms[0].PerformAction.value = strPerformAction;
-
- document.forms[0].PathsRepository.value = strPathsRepository;
- document.forms[0].DisplayRepository.value = strRepository;
-
- PopulateSelectBox(strRepository, document.forms[0].Display_Select);
- PopulateSelectBox(strPathsRepository, document.forms[0].Paths_Select);
-
-
- //Radio Button handling functions
- function SetBinaryRB(nValue, rbControl)
- {
- if (nValue != 1)
- {
- nValue = 0;
- }
- rbControl[nValue].checked = true;
- }
-
- function SetGUIRBS(rb)
- {
- if (rb[0].checked)
- {
- rb[0].value = "CheckThis";
- rb[1].value = "";
- }
- else
- {
- rb[0].value = "";
- rb[1].value = "CheckThis";
- }
- }
-
- //Begin Path Repository Functions
- function GetFileName(strFilePath)
- {
- var strRet;
- var nIndex;
-
- nIndex = strFilePath.lastIndexOf("\\");
-
- if (nIndex == -1)
- {
- nIndex = strFilePath.lastIndexOf("/");
- }
-
- if (nIndex == -1)
- {
- strRet = "";
- }
- else
- {
- strRet = strFilePath.substr(nIndex + 1);
- }
-
- return strRet;
- }
-
- function IsPathAlreadyEntered(strPath)
- {
- var strRepository;
-
- strRepository = document.forms[0].PathsRepository.value;
-
- if (strRepository.lastIndexOf(strPath) != -1)
- {
- return true;
- }
-
- return false;
- }
-
- function AddAPath()
- {
- var strPath;
- var strFileName;
-
- strPath = document.forms[0].fileContentPathInputText.value;
- strFileName = GetFileName(strPath);
-
- if (!IsPathAlreadyEntered(strPath))
- {
- UpdatePathsRepository(strFileName, strPath);
- }
- else
- {
- alert("File already included, duplicate file ignored.");
- }
- //document.forms[0].fileContentPathInputText.value = strFileName;
- }
-
- function UpdatePathsRepository(strNewFileName, strNewPath)
- {
- var strRepository;
-
- var opOption = new Option;
-
- strRepository = document.forms[0].PathsRepository.value + strNewFileName + "=" + strNewPath + ";~";
- document.forms[0].PathsRepository.value = strRepository;
-
- opOption.text = strNewFileName;
- document.forms[0].Paths_Select.options[document.forms[0].Paths_Select.options.length] = opOption;
- }
-
- function RemoveAPath()
- {
- var nIndex = document.forms[0].Paths_Select.selectedIndex;
- var strArray;
- var strTemp;
- var strRepository;
- var nLength;
-
- strRepository = new String(document.forms[0].PathsRepository.value.toString());
- nLength = strRepository.length - 2;
- strTemp = strRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strTemp.split(";~");
-
- if (strArray.length == 1)
- {
- strRepository = "";
- }
- else
- {
- strArray = RemoveArrayElement(strArray, nIndex);
- strRepository = strArray.join(";~") + ";~";
- }
-
- document.forms[0].PathsRepository.value = strRepository;
-
- //DEBUGGING CODE
- //document.forms[0].Dict_Entry.value = strDisplayRepository;
-
- document.forms[0].Paths_Select.options[nIndex] = null;
- }
-
-
- //End Path Repository Functions
-
-
- function BrowseClick(theFileInput, theOutputLocation)
- {
- var strOld;
- var strNew;
-
- strOld = theFileInput.value;
- theFileInput.click();
- strNew = theFileInput.value;
-
- if (strOld != strNew)
- {
- theOutputLocation.value = strNew;
- }
- }
-
- function Add()
- {
- var strCurrentEmbedded;
- var strCurrentDictEntry;
-
- strCurrentEmbedded = document.forms[0].Embedded_Var_Key.value;
- strCurrentDictEntry = document.forms[0].Dict_Entry.value;
-
- if (IsValidKey(strCurrentEmbedded))
- {
- UpdateRepository(strCurrentEmbedded, strCurrentDictEntry);
-
- document.forms[0].Embedded_Var_Key.value = "";
- document.forms[0].Dict_Entry.value = "";
- }
- }
-
- function Remove()
- {
- var nIndex = document.forms[0].Display_Select.selectedIndex;
- var strArray;
- var strTemp;
- var strDisplayRepository;
- var nLength;
- strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
- nLength = strDisplayRepository.length - 2;
- strTemp = strDisplayRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strTemp.split(";~");
-
- if (strArray.length == 1)
- {
- strDisplayRepository = "";
- }
- else
- {
- strArray = RemoveArrayElement(strArray, nIndex);
- strDisplayRepository = strArray.join(";~") + ";~";
- HandleOption();
- }
-
- document.forms[0].DisplayRepository.value = strDisplayRepository;
-
- //DEBUGGING CODE
- //document.forms[0].Dict_Entry.value = strDisplayRepository;
-
- document.forms[0].Display_Select.options[nIndex] = null;
- }
-
- function UpdateRepository(strNewEmbed, strNewKey)
- {
- var strDisplayRepository;
-
- if (nCurrentlyEditing > -1)
- {
- var strArray;
- var strTemp;
- var nLength;
- var strNewValPair;
-
- strNewValPair = strNewEmbed + "=" + strNewKey;
-
- strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
- nLength = strDisplayRepository.length - 2;
- strTemp = strDisplayRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strDisplayRepository.split(";~");
- strArray[nCurrentlyEditing] = strNewValPair;
- strDisplayRepository = strArray.join(";~");
-
- document.forms[0].DisplayRepository.value = strDisplayRepository;
- document.forms[0].Display_Select.options[nCurrentlyEditing].text = strNewEmbed;
-
- document.forms[0].Display_ADD.value = "Add";
- document.forms[0].Display_Option.value = "Clear";
- nCurrentlyEditing = -1;
- strCurrentlyEditing = "";
- }
- else
- {
- var opOption = new Option;
-
- strDisplayRepository = document.forms[0].DisplayRepository.value + strNewEmbed + "=" + strNewKey + ";~";
- document.forms[0].DisplayRepository.value = strDisplayRepository;
-
- opOption.text = strNewEmbed;
- document.forms[0].Display_Select.options[document.forms[0].Display_Select.options.length] = opOption;
- }
- }
-
- function Edit()
- {
- var nIndex = document.forms[0].Display_Select.selectedIndex;
- var strArray;
- var strTemp;
- var strDisplayRepository;
- var nLength;
- var strStringToEdit;
-
- strDisplayRepository = new String(document.forms[0].DisplayRepository.value.toString());
- nLength = strDisplayRepository.length - 2;
- strTemp = strDisplayRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strDisplayRepository.split(";~");
-
- strStringToEdit = strArray[nIndex];
- strArray = strStringToEdit.split("=");
- nCurrentlyEditing = nIndex;
-
- document.forms[0].Display_ADD.value = "Update";
- document.forms[0].Display_Option.value = "Cancel";
- document.forms[0].Embedded_Var_Key.value = strArray[0];
- document.forms[0].Dict_Entry.value = strArray[1];
- strCurrentlyEditing = strArray[0];
- }
-
- function HandleOption()
- {
- if (nCurrentlyEditing > -1)
- {
- nCurrentlyEditing = -1;
- strCurrentlyEditing = "";
- document.forms[0].Display_Option.value = "Clear";
- document.forms[0].Display_ADD.value = "Add";
- }
- document.forms[0].Embedded_Var_Key.value = "";
- document.forms[0].Dict_Entry.value = "";
- }
-
- function RemoveArrayElement(strArray, nIndex)
- {
- var tempArray = new Array();
- var nCounter;
- var nArrCounter;
- var nLength;
-
- nArrCounter = 0;
- nLength = strArray.length;
- nCounter = 0;
- while (nCounter < nLength)
- {
- if ((strArray[nCounter].length != 0) && (nCounter != nIndex))
- {
- tempArray[nArrCounter] = strArray[nCounter];
- nArrCounter = nArrCounter + 1;
- }
- nCounter = nCounter + 1;
- }
-
- return tempArray;
- }
-
-
- function PopulateSelectBox(strValues, selectBox)
- {
- var strArray;
- var strTemp;
- var nLength;
- var strStringToAdd;
- var nCounter=0;
- var aTempArray;
- var tempOption;
-
- if (strValues == "")
- {
- return;
- }
- nLength = strValues.length - 2;
- strTemp = strValues.substring(0, nLength); //knock off trailing delimeters
- strArray = strTemp.split(";~");
- nLength = strArray.length;
-
- while (nCounter < nLength)
- {
- tempOption = new Option();
- aTempArray = strArray[nCounter].split("=");
- tempOption.text = aTempArray[0];
- selectBox.options[selectBox.length] = tempOption;
- nCounter = nCounter + 1;
- }
- }
-
- function IsValidKey(strKey)
- {
- var nLength;
- var nCounter = 0;
-
-
- nLength = document.forms[0].Display_Select.length;
- while (nCounter < nLength)
- {
- if ((strKey == document.forms[0].Display_Select.options[nCounter].text) && (strKey != strCurrentlyEditing))
- {
- window.alert("Duplicate Key already exists.");
- return false;
- }
- nCounter++;
- }
-
- return true;
- }
-
- </SCRIPT>
-
- <SCRIPT LANGUAGE="VBScript">
- Function SubmitForSave()
- document.forms(0).saveState.value = "1"
- if (VerifyData()) then
- On Error Resume Next
- if (document.forms(0).onSubmit()) then
- document.forms(0).submit()
- while NOT (Err.Number Eqv 0)
- Err.Clear
- document.forms(0).submit()
- Wend
- end if
- end if
- End Function
-
- Function VerifyPath(strThePath)
- dim fso
- dim bRes
- dim strFilePath
- dim bReturn
-
- bReturn = True
- strFilePath = strThePath
- strFilePath = LTrim(strFilePath)
- strFilePath = RTrim(strFilePath)
-
- Set fso = CreateObject("Scripting.FileSystemObject")
- bRes = fso.FileExists(strFilePath)
-
- if (NOT strFilePath="") then 'Verify that a path was even entered
- if NOT bRes then
- strWorkingDir = document.forms(0).WorkingDir.value
- strFilePath = strWorkingDir & strThePath
- strFilePath = LTrim(strFilePath)
- strFilePath = RTrim(strFilePath)
- bRes = fso.FileExists(strFilePath)
- if NOT bRes then
- strFilePath = strThePath
- strFilePath = LTrim(strFilePath)
- strFilePath = RTrim(strFilePath)
- Call MsgBox(strFilePath & " does not exist.",,"Validation ERROR")
- bReturn = False
- end if
- end if
- end if
-
- VerifyPath = bReturn
- End Function
-
-
- Function VerifyData()
- dim strFilePath
- dim bReturn
- dim strWorkingDir
-
- bReturn = True
-
- if (NOT VerifyPath(document.forms(0).fileContentPathInputText.value)) then
- bReturn = False
- elseif (NOT VerifyPath(document.forms(0).fileInputText.value)) then
- bReturn = False
- end if
-
- VerifyData = bReturn
- end function
-
- </SCRIPT>