bug 162333: remove several js warnings in the profile manager. r=timeless, sr=bz

This commit is contained in:
chanial%noos.fr 2002-11-10 21:54:21 +00:00
Родитель b9f67e3589
Коммит 27aa624605
2 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -51,15 +51,16 @@ function CreateProfile( aProfName, aProfDir )
// rename the selected profile
function RenameProfile()
{
var lString, oldName, newName;
renameButton = document.getElementById("renbutton");
if( renameButton.getAttribute("disabled") == "true" )
return;
if (renameButton.getAttribute("disabled") == "true" )
return false;
var profileList = document.getElementById( "profiles" );
var selected = profileList.selectedItems[0];
var profilename = selected.getAttribute("profile_name");
if( selected.getAttribute("rowMigrate") == "no" ) {
// migrate if the user wants to
var lString = gProfileManagerBundle.getString("migratebeforerename");
lString = gProfileManagerBundle.getString("migratebeforerename");
lString = lString.replace(/\s*<html:br\/>/g,"\n");
lString = lString.replace(/%brandShortName%/, gBrandBundle.getString("brandShortName"));
var title = gProfileManagerBundle.getString("migratetitle");
@ -82,15 +83,15 @@ function RenameProfile()
return false;
}
else {
var oldName = selected.getAttribute("rowName");
var newName = {value:oldName};
oldName = selected.getAttribute("rowName");
newName = {value:oldName};
var dialogTitle = gProfileManagerBundle.getString("renameprofiletitle");
var msg = gProfileManagerBundle.getString("renameProfilePrompt");
msg = msg.replace(/%oldProfileName%/gi, oldName);
while (1) {
var rv = promptService.prompt(window, dialogTitle, msg, newName, null, {value:0});
if (rv) {
var newName = newName.value;
newName = newName.value;
if (!newName) return false;
var invalidChars = ["/", "\\", "*", ":"];
for( var i = 0; i < invalidChars.length; i++ )
@ -99,7 +100,7 @@ function RenameProfile()
var aString = gProfileManagerBundle.getString("invalidCharA");
var bString = gProfileManagerBundle.getString("invalidCharB");
bString = bString.replace(/\s*<html:br\/>/g,"\n");
var lString = aString + invalidChars[i] + bString;
lString = aString + invalidChars[i] + bString;
alert( lString );
return false;
}
@ -113,7 +114,7 @@ function RenameProfile()
selected.setAttribute( "profile_name", newName );
}
catch(e) {
var lString = gProfileManagerBundle.getString("profileExists");
lString = gProfileManagerBundle.getString("profileExists");
var profileExistsTitle = gProfileManagerBundle.getString("profileExistsTitle");
promptService.alert(window, profileExistsTitle, lString);
continue;
@ -123,7 +124,8 @@ function RenameProfile()
}
}
// set the button state
DoEnabling();
DoEnabling();
return true;
}
@ -312,5 +314,6 @@ function HandleClickEvent( aEvent )
window.close();
return true;
}
return false;
}

Просмотреть файл

@ -217,7 +217,7 @@ function onStart()
break;
}
promptService.alert(window, null, message);
return;
return false;
}
return true;