Fixed file save bug

git-svn-id: svn://10.0.0.236/trunk@12541 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
racham%netscape.com
1998-10-11 23:45:26 +00:00
parent fa809ac509
commit f2e54cb30b
2 changed files with 10 additions and 17 deletions

View File

@@ -49,6 +49,8 @@ function refreshConfigFrame(fileName)
debug("parent.parent: " + parent.parent + " ["+parent.parent.name+"]: " + parent.parent.ias);
debug("this document: " + document.location + document.name + document.ias);
}
if (fileName != null)
setGlobal("IASFileName", fileName);
}
@@ -410,17 +412,12 @@ function askIASFileNameAndSave()
var fName = prompt("Enter the file name for this configuration (must end with .IAS)", sgName);
//if they entered an improper suffix or path, prompt again, and again
//IAS files are to be saved only in the config folder.
while ((fName != null) && pathMentioned(fName))
{
fName = prompt("Please enter file name only. This file will be saved by default to " + top.globals.getConfigFolder(top.globals), sgName);
}
//if they entered an improper suffix, prompt again, and again
while ((fName != null) && ((fName.substring(fName.length-4, fName.length) != ".IAS") && (fName.substring(fName.length-4, fName.length) != ".ias")))
while ((fName != null) && (((fName.substring(fName.length-4, fName.length) != ".IAS") && (fName.substring(fName.length-4, fName.length) != ".ias")) || pathMentioned(fName)))
{
sgName = suggestIASFileName(fName);
fName = prompt("Enter the fileName for this configuration (must end with .IAS)", sgName);
fName = prompt("Please enter file name only (must end with .IAS). This file will be saved by default to " + top.globals.getConfigFolder(top.globals), sgName);
}
// if the name exists, prompt to replace

View File

@@ -39,6 +39,8 @@ function refreshConfigFrame(fileName)
parent.parent.nci.setNCIList(fileName);
}
if (fileName != null)
setGlobal("NciFileName", fileName);
}
//THE FOLLOWING FUNCTION IS LOCATION DEPENDANT
@@ -436,17 +438,12 @@ function askNCIFileNameAndSave()
var fName = prompt("Enter the file name for this configuration (must end with .NCI)", sgName);
//if they entered an improper suffix or path, prompt again, and again
//NCI files are to be saved only in the config folder.
while ((fName != null) && pathMentioned(fName))
{
fName = prompt("Please enter file name only. This file will be saved by default to " + top.globals.getConfigFolder(top.globals), sgName);
}
//if they entered an improper suffix, prompt again, and again
while ((fName != null) && ((fName.substring(fName.length-4, fName.length) != ".NCI") && (fName.substring(fName.length-4, fName.length) != ".nci")))
while ((fName != null) && (((fName.substring(fName.length-4, fName.length) != ".NCI") && (fName.substring(fName.length-4, fName.length) != ".nci")) || (pathMentioned(fName))))
{
sgName = suggestNCIFileName(fName);
fName = prompt("Enter the fileName for this configuration (must end with .NCI)", sgName);
fName = prompt("Please enter file name only (must end with .NCI). This file will be saved by default to " + top.globals.getConfigFolder(top.globals), sgName);
}
// if the name exists, prompt to replace
@@ -495,7 +492,6 @@ function askNCIFileNameAndSave()
// Checks if user mentioned path name in the filename field.
function pathMentioned(fileName)
{
debug("In pathMentioned");
var isAPath = false;