97204. r=suresh sr=mscott a=asa; Made it so that edit changes can be saved for mailnews filters.

This commit is contained in:
naving%netscape.com 2001-08-28 03:33:16 +00:00
Родитель a3cffe7d98
Коммит d2beab414f
1 изменённых файлов: 21 добавлений и 11 удалений

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

@ -44,7 +44,6 @@ function filterEditorOnLoad()
initializeFilterWidgets();
gFilterBundle = document.getElementById("bundle_filter");
if ("arguments" in window && window.arguments[0]) {
var args = window.arguments[0];
if ("filter" in args) {
@ -59,19 +58,20 @@ function filterEditorOnLoad()
onMore(null);
}
}
var stub = gFilterBundle.getString("untitledFilterName");
var count = 1;
var name = stub;
// Set the default filter name to be "untitled filter"
while (duplicateFilterNameExists(name))
if (!gFilter)
{
var stub = gFilterBundle.getString("untitledFilterName");
var count = 1;
var name = stub;
// Set the default filter name to be "untitled filter"
while (duplicateFilterNameExists(name))
{
count++;
name = stub + " " + count.toString();
}
gFilterNameElement.value = name;
}
gFilterNameElement.value = name;
gFilterNameElement.focus();
doSetOKCancel(onOk, null);
moveToAlertPosition();
@ -112,7 +112,17 @@ function onOk()
function duplicateFilterNameExists(filterName)
{
return (gFilterList.getFilterNamed(filterName)) ? true : false;
var args = window.arguments[0];
var filterList;
if ("filterList" in args)
filterList = args.filterList;
if (filterList)
for (var i = 0; i < filterList.filterCount; i++)
{
if (filterName == filterList.getFilterAt(i).filterName)
return true;
}
return false;
}
function getScopeFromFilterList(filterList)