function autoGo() { /*----------------------------------------------------------------------- Purpose: Redirect the Enter key to the Open or Save button. Parameters: Notes: -------------------------------------------------------------------------*/ var btnOKObj = (isIE4up ? (document.form1.btnOpen != null ? document.form1.btnOpen : document.form1.btnSave) : (document.form1.elements['btnOpen'] != null ? document.form1.elements['btnOpen'] : document.form1.elements['btnSave'])); btnClick(btnOKObj); return false; } function btnClick(e) { var btnId = getBtnId(e); var cFullPath; var cString = new String(hFileName.value); var iPos = cString.indexOf("(DIR)"); var isDir = ((iPos != -1) || hFileName.value == ".."); if (hFileName.value == "" && (btnId == "btnOpen" || btnId == "btnSave")) { alert("Please select a file to `get-field('mode')`."); return false; } if (btnId == "btnOpen" || btnId == "btnSave") { if (parent.OS_flist.cNewDir == getUnknown()) { alert("The destination directory is unknown." + cNewLine + cNewLine + "Please wait until the file list has" + cNewLine + "finished loading and try again."); return false; } cFullPath = parent.OS_flist.cNewDir + hFileName.value; if (isDir) { parent.OS_flist.location.href = '../webutil/_weblist.w' + '?directory=' + (getDir(iPos)) + '&filter=' + (getFilter()) + '&options=editor'; setFileName(""); // don't do for fileSaveAs or changing dir } else { if (isIE4up) /* 19990724-004 parent.returnValue = parent.OS_flist.cNewDir + "|" + hFileName.value; */ parent.returnValue = cFullPath; else if (isNav4up) { if (btnId == "btnOpen") parent.opener.fileOpen(cFullPath); else if (btnId == "btnSave") parent.opener.fileSaveAs(cFullPath, "fileSaveAs", cTarget); } parent.close(); } } else parent.close(); } function getBtnCancel() { if (isIE4up) return document.all.btnCancel; else if (isNav4up) return document.form1.elements["btnCancel"]; } function getBtnId(e) { if (isIE4up) return e.id; else if (isNav4up) return e.name; } function getBtnOpen() { if (isIE4up) { if (document.all.btnOpen != null) return document.all.btnOpen; } else if (isNav4up) { if (document.form1.elements["btnOpen"] != undefined) return document.form1.elements["btnOpen"]; } } function getBtnSave() { if (isIE4up) { if (document.all.btnSave != null) return document.all.btnSave; } else if (isNav4up) { if (document.form1.elements["btnSave"] != undefined) return document.form1.elements["btnSave"]; } } function getDir(iPos) { var cSubDir; if (hFileName.value == "..") cSubDir = ".."; else { cSubDir = new String(hFileName.value); cSubDir = cSubDir.substr(0, (iPos - 1)); } return (parent.OS_flist.cNewDir + cSubDir); } function getFileName() { if (isIE4up) return document.all.fileName; else if (isNav4up) return document.form1.elements["fileName"]; } function getFileType() { if (isIE4up) return document.all.fileType; else if (isNav4up) return document.form1.elements["fileType"]; } function getFilter() { return (hFileType.options[hFileType.selectedIndex].value); } function highlight(e) { if (isIE4up) { e.style.color = "white"; e.style.background = "navy"; } } function init() { getBrowser(); hBtnCancel = getBtnCancel(); hFileName = getFileName(); hFileType = getFileType(); hBtnOpen = getBtnOpen(); hBtnSave = getBtnSave(); if (isIE4up) { if (hBtnOpen != null) { defaultBtn = hBtnOpen; hBtnOpen.style.pixelWidth = document.all.tdCancel.clientWidth - 10; setTimeout('hBtnOpen.focus()',1); } if (hBtnSave != null) { defaultBtn = hBtnSave; hBtnSave.style.pixelWidth = document.all.tdCancel.clientWidth - 10; setTimeout('hBtnSave.focus()',1); } hBtnCancel.style.pixelWidth = document.all.tdCancel.clientWidth - 10; hFileName.style.pixelWidth = hFileType.clientWidth; } else if (isNav4up) { if (hBtnOpen != undefined) { defaultBtn = hBtnOpen; setTimeout('hBtnOpen.focus()',1); } if (hBtnSave != undefined) { defaultBtn = hBtnSave; setTimeout('hBtnSave.focus()',1); } } if (cMode.toLowerCase() == "save") { if (isIE4up) { if (parent.window.dialogArguments != "") hFileName.value = parent.window.dialogArguments; } else if (isNav4up) { if (!parent.opener.parent.WS_edit.lUntitled) hFileName.value = parent.opener.parent.WS_edit.cFileName; setTimeout('hFileName.focus()', 1); } hFileName.select(); } } function normal(e) { if (isIE4up) { e.style.color = "black"; e.style.background = "white"; } else if (isNav4up) { e.bgColor = "white"; } } function resetCell(e) { if (oldCell != null) normal(oldCell); oldCell = e; } function setFileName(cFile) { if (isIE4up) document.all.fileName.value = cFile; else if (isNav4up) document.form1.elements["fileName"].value = cFile; } function setImage(e, fName) { e.src = "`RootURL`/images/" + fName + ".gif"; } function typeChange() { parent.OS_flist.location.href = '../webutil/_weblist.w' + '?directory=' + parent.OS_flist.cNewDir + '&filter=' + (getFilter()) + '&options=editor'; } function updateName(e) { resetCell(e); highlight(e); hFileName.value = e.innerText; } //-->