Editor bug fixes. List Properties dialog work. Fixed menu access keys in DTD file. Fixed using selection->Clear() cases

git-svn-id: svn://10.0.0.236/trunk@48474 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cmanske%netscape.com
1999-09-21 01:36:30 +00:00
parent ac92447f0c
commit 03e7911d12
18 changed files with 449 additions and 354 deletions

View File

@@ -63,6 +63,7 @@ function StringExists(string)
function ClearList(list)
{
list.selectedIndex = -1;
for( i = (list.length-1); i >= 0; i-- ) {
list.remove(i);
}
@@ -99,8 +100,14 @@ function ReplaceStringInList(list, index, string)
}
}
function AppendStringToListByID(list, stringID)
{
AppendStringToList(list, editorShell.GetString(stringID));
}
function AppendStringToList(list, string)
{
dump("**** Append String = "+string+"\n");
// THIS DOESN'T WORK! Result is a XULElement -- namespace problem
//optionNode1 = document.createElement("option");
@@ -117,6 +124,11 @@ function AppendStringToList(list, string)
}
}
/*
It would be better to add method to Select object, but what is its name?
SELECT and HTMLSELECT don't work!
*/
// "value" may be a number or string type
function ValidateNumberString(value, minValue, maxValue)
@@ -133,7 +145,7 @@ function ValidateNumberString(value, minValue, maxValue)
return number + "";
}
}
message = GetString("ValidateNumber1")+number+GetString("ValidateNumber2")+" "+minValue+" "+GetString("ValidateNumber3")+" "+maxValue;
message = editorShell.GetString("ValidateNumber1")+number+editorShell.GetString("ValidateNumber2")+" "+minValue+" "+editorShell.GetString("ValidateNumber3")+" "+maxValue;
ShowInputErrorMessage(message);
// Return an empty string to indicate error
@@ -143,7 +155,8 @@ function ValidateNumberString(value, minValue, maxValue)
function ShowInputErrorMessage(message)
{
window.openDialog("chrome://editor/content/EdMessage.xul", "MsgDlg", "chrome,close,titlebar,modal", "", message, "Input Error");
dump("ShowInputErrorMessage:"+message+"[end]\n");
window.openDialog("chrome://editor/content/EdMessage.xul", "_blank", "chrome,close,titlebar,modal", "", message, "Input Error");
}
function GetString(name)
@@ -174,12 +187,9 @@ String.prototype.trimString = function() {
return this.replace(/(^\s+)|(\s+$)/g, '')
}
function IsWhitespace(character)
function IsWhitespace(string)
{
var result = character.match(/\s/);
if (result == null)
return false;
return true;
return /^\s/.test(string);
}
function TruncateStringAtWordEnd(string, maxLength, addEllipses)