зеркало из https://github.com/mozilla/pjs.git
bug 162333: remove several js warnings in the profile manager. r=timeless, sr=bz
This commit is contained in:
Родитель
b9f67e3589
Коммит
27aa624605
|
@ -51,15 +51,16 @@ function CreateProfile( aProfName, aProfDir )
|
||||||
// rename the selected profile
|
// rename the selected profile
|
||||||
function RenameProfile()
|
function RenameProfile()
|
||||||
{
|
{
|
||||||
|
var lString, oldName, newName;
|
||||||
renameButton = document.getElementById("renbutton");
|
renameButton = document.getElementById("renbutton");
|
||||||
if( renameButton.getAttribute("disabled") == "true" )
|
if (renameButton.getAttribute("disabled") == "true" )
|
||||||
return;
|
return false;
|
||||||
var profileList = document.getElementById( "profiles" );
|
var profileList = document.getElementById( "profiles" );
|
||||||
var selected = profileList.selectedItems[0];
|
var selected = profileList.selectedItems[0];
|
||||||
var profilename = selected.getAttribute("profile_name");
|
var profilename = selected.getAttribute("profile_name");
|
||||||
if( selected.getAttribute("rowMigrate") == "no" ) {
|
if( selected.getAttribute("rowMigrate") == "no" ) {
|
||||||
// migrate if the user wants to
|
// 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(/\s*<html:br\/>/g,"\n");
|
||||||
lString = lString.replace(/%brandShortName%/, gBrandBundle.getString("brandShortName"));
|
lString = lString.replace(/%brandShortName%/, gBrandBundle.getString("brandShortName"));
|
||||||
var title = gProfileManagerBundle.getString("migratetitle");
|
var title = gProfileManagerBundle.getString("migratetitle");
|
||||||
|
@ -82,15 +83,15 @@ function RenameProfile()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var oldName = selected.getAttribute("rowName");
|
oldName = selected.getAttribute("rowName");
|
||||||
var newName = {value:oldName};
|
newName = {value:oldName};
|
||||||
var dialogTitle = gProfileManagerBundle.getString("renameprofiletitle");
|
var dialogTitle = gProfileManagerBundle.getString("renameprofiletitle");
|
||||||
var msg = gProfileManagerBundle.getString("renameProfilePrompt");
|
var msg = gProfileManagerBundle.getString("renameProfilePrompt");
|
||||||
msg = msg.replace(/%oldProfileName%/gi, oldName);
|
msg = msg.replace(/%oldProfileName%/gi, oldName);
|
||||||
while (1) {
|
while (1) {
|
||||||
var rv = promptService.prompt(window, dialogTitle, msg, newName, null, {value:0});
|
var rv = promptService.prompt(window, dialogTitle, msg, newName, null, {value:0});
|
||||||
if (rv) {
|
if (rv) {
|
||||||
var newName = newName.value;
|
newName = newName.value;
|
||||||
if (!newName) return false;
|
if (!newName) return false;
|
||||||
var invalidChars = ["/", "\\", "*", ":"];
|
var invalidChars = ["/", "\\", "*", ":"];
|
||||||
for( var i = 0; i < invalidChars.length; i++ )
|
for( var i = 0; i < invalidChars.length; i++ )
|
||||||
|
@ -99,7 +100,7 @@ function RenameProfile()
|
||||||
var aString = gProfileManagerBundle.getString("invalidCharA");
|
var aString = gProfileManagerBundle.getString("invalidCharA");
|
||||||
var bString = gProfileManagerBundle.getString("invalidCharB");
|
var bString = gProfileManagerBundle.getString("invalidCharB");
|
||||||
bString = bString.replace(/\s*<html:br\/>/g,"\n");
|
bString = bString.replace(/\s*<html:br\/>/g,"\n");
|
||||||
var lString = aString + invalidChars[i] + bString;
|
lString = aString + invalidChars[i] + bString;
|
||||||
alert( lString );
|
alert( lString );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +114,7 @@ function RenameProfile()
|
||||||
selected.setAttribute( "profile_name", newName );
|
selected.setAttribute( "profile_name", newName );
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
var lString = gProfileManagerBundle.getString("profileExists");
|
lString = gProfileManagerBundle.getString("profileExists");
|
||||||
var profileExistsTitle = gProfileManagerBundle.getString("profileExistsTitle");
|
var profileExistsTitle = gProfileManagerBundle.getString("profileExistsTitle");
|
||||||
promptService.alert(window, profileExistsTitle, lString);
|
promptService.alert(window, profileExistsTitle, lString);
|
||||||
continue;
|
continue;
|
||||||
|
@ -124,6 +125,7 @@ function RenameProfile()
|
||||||
}
|
}
|
||||||
// set the button state
|
// set the button state
|
||||||
DoEnabling();
|
DoEnabling();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,5 +314,6 @@ function HandleClickEvent( aEvent )
|
||||||
window.close();
|
window.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ function onStart()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
promptService.alert(window, null, message);
|
promptService.alert(window, null, message);
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче