30 lines
701 B
JavaScript
30 lines
701 B
JavaScript
function ClearList(list)
|
|
{
|
|
for( i = (list.length-1); i >= 0; i-- ) {
|
|
list.remove(i);
|
|
}
|
|
}
|
|
|
|
function AppendStringToList(list, string)
|
|
{
|
|
|
|
// THIS DOESN'T WORK! Result is a XULElement -- namespace problem
|
|
//optionNode1 = document.createElement("option");
|
|
// "Unsanctioned method from Vidur:
|
|
// createElementWithNamespace("http://... [the HTML4 URL], "option);
|
|
|
|
// This works - Thanks to Vidur! Params = name, value
|
|
optionNode = new Option(string, string);
|
|
if (optionNode) {
|
|
list.add(optionNode, null);
|
|
} else {
|
|
dump("Failed to create OPTION node. String content="+string+"\n");
|
|
}
|
|
}
|
|
|
|
// All dialogs share this simple method
|
|
function onCancel()
|
|
{
|
|
window.close();
|
|
}
|