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><!--<form method="POST" action="http://">-->
- <br>
- <h1><div align="center">Display</div></h1><!--<form method="POST" action="http://">-->
-
-
- <form method="post" name="changeDisplayInput" action="CALLBACKID-ChangeDisplayInput">
- <table border="0" width="600">
- <tr><th align="left">
- Display Method:</th></tr>
- <tr>
- <th align="left">
- <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;'>
- </th></tr>
- <br>
- <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>
- </table>
-
- <input type="hidden" name="TextInput" >
-
-
- <h1><div align="center">Embedded Variables</div></h1><!--<form method="POST" action="http://">-->
- <table border="0" width="600">
- <tr><th align="left">
- Embedded Variable Key:</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>
- <P> </P>
- </body>
- </HTML>
-
-
- <SCRIPT LANGUAGE="JavaScript">
- //PAGE SPECIFIC
- var nDisplayMethod = 0;
- var strTextInput = "";
- var windowRef;
- var strRepository = "";
- var strFilePath = "";
-
- //Status FLAG
- var nCurrentlyEditing = -1;
- var strWorkingDir = "";
- var strCurrentlyEditing = "";
-
- //Do not remove the below tags, they are used for dynamic insertion of values
- /*VARS*/
-
- /*ENDVARS*/
-
- strTextInput = strTextInput.replace(":;", "'");
-
- //Page init
- document.forms[0].WorkingDir.value = strWorkingDir;
- document.forms[0].fileInputText.value = strFilePath;
-
- if (nDisplayMethod == 1) //DisplayMethod is direct
- {
- document.forms[0].Display_Method[1].checked = true;
- }
- else //Display Method is default(file)
- {
- document.forms[0].Display_Method[0].checked = true
- }
-
- SetDisplayMethVals();
-
- document.forms[0].TextInput.value = strTextInput;
-
- document.forms[0].DisplayRepository.value = strRepository;
-
- PopulateSelectBox(strRepository, document.forms[0].Display_Select);
-
- function BrowseClick()
- {
- var strOld;
- var strNew;
-
- strOld = document.forms[0].fileInput.value;
- document.forms[0].fileInput.click();
- strNew = document.forms[0].fileInput.value;
-
- if (strOld != strNew)
- {
- document.forms[0].fileInputText.value = strNew;
- }
- }
-
- function SetDisplayMethVals()
- {
- if (document.forms[0].Display_Method[1].checked)
- {
- document.forms[0].Display_Method[1].value = "CheckThis";
- document.forms[0].Display_Method[0].value = "";
- }
- else
- {
- document.forms[0].Display_Method[0].value = "CheckThis";
- document.forms[0].Display_Method[1].value = "";
- }
- }
-
- function ProcessRBClick()
- {
- document.forms[0].Display_Method[1].checked = true;
- document.forms[0].Display_Method[0].checked = false;
- SetDisplayMethVals();
-
- windowRef = window.open();
- windowRef.resizeTo(700, 600);
- windowRef.document.open();
- windowRef.document.write("<html> <head> <STYLE>");
- windowRef.document.write("body{ font-size : medium; }");
- windowRef.document.write("td { font-size : medium; }");
- windowRef.document.write("</STYLE></head>");
- windowRef.document.write('<body bgcolor="silver" text="maroon"> ');
- windowRef.document.write('<table width = "100%"><tr><th align="center">');
- windowRef.document.write('<font size="5">Enter Desired Text to Display</font></th></tr>');
- windowRef.document.write('<tr><th align="center">');
- windowRef.document.write('<textarea name="DisplayText" WRAP="soft" rows="35" cols="90">' + strTextInput + '</textarea>');
- windowRef.document.write('</th></tr><tr><th align="center">');
- windowRef.document.write('<input type="button" name="bigSubmit" value="Commit" onClick="SubmitToParent();">');
- windowRef.document.write('</th></tr></table>');
- windowRef.document.write('</body></html>');
- windowRef.document.write('<SCRIPT LANGUAGE="JavaScript">');
- windowRef.document.write('function SubmitToParent()');
- windowRef.document.write('{ var strTextInput; var temp; temp = document.all.item("DisplayText");');
- windowRef.document.write('strTextInput = temp.value;');
- windowRef.document.write('window.opener.document.forms[0].TextInput.value = strTextInput;');
- windowRef.document.write('window.opener.strTextInput = strTextInput; window.close();}');
- windowRef.document.write("</");
- windowRef.document.write("SCRIPT>");
- windowRef.document.close();
- }
-
-
- 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;
-
- //document.forms[0].Dict_Entry.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">
-
- Call PrepareDisplayText(" \n", vbCrLf)
-
- 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 VerifyData()
- dim bMethod
- dim strFilePath
- dim bReturn
- dim strWorkingDir
-
- Call PrepareDisplayText(vbCrLf, " \n")
-
- bReturn = True
-
- bMethod = document.forms(0).Display_Method(1).checked
-
- if (bMethod=0) then
- strFilePath = document.forms(0).fileInputText.value
- strFilePath = LTrim(strFilePath)
- strFilePath = RTrim(strFilePath)
- if (NOT strFilePath="") then 'Verify it is a valid path
- dim fso
- dim bRes
-
- Set fso = CreateObject("Scripting.FileSystemObject")
- bRes = fso.FileExists(strFilePath)
- if NOT bRes then
- strWorkingDir = document.forms(0).WorkingDir.value
- strFilePath = strWorkingDir & document.forms(0).fileInputText.value
- strFilePath = LTrim(strFilePath)
- strFilePath = RTrim(strFilePath)
- bRes = fso.FileExists(strFilePath)
- if NOT bRes then
- strFilePath = document.forms(0).fileInputText.value
- strFilePath = LTrim(strFilePath)
- strFilePath = RTrim(strFilePath)
- Call MsgBox(strFilePath & " does not exist.",,"Validation ERROR")
- bReturn = False
- end if
- end if
- end if
- end if
-
- VerifyData = bReturn
- end function
-
- Sub PrepareDisplayText(strToFind, strToUse)
- dim strTemp
-
- strTemp = Replace(document.forms(0).TextInput.value, strToFind, strToUse)
- 'Call MsgBox(strTemp)
- document.forms(0).TextInput.value = strTemp
- End Sub
-
- </SCRIPT>