Inlude 'img' filetype for Open file dialogs when creating links, b=98567, r=akkana, sr=hewitt

This commit is contained in:
cmanske%netscape.com 2001-09-22 18:44:59 +00:00
Родитель b9adcbb3b9
Коммит fd84979910
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -957,7 +957,9 @@ function GetLocalFileURL(filterType)
fp.init(window, GetString("SelectImageFile"), nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterImages);
}
else if (filterType == "html")
// Current usage of this is in Link dialog,
// where we always want HTML first
else if (filterType.indexOf("html") == 0)
{
fp.init(window, GetString("OpenHTMLFile"), nsIFilePicker.modeOpen);
@ -965,6 +967,11 @@ function GetLocalFileURL(filterType)
// so we call separately to control the order of the filter list
fp.appendFilters(nsIFilePicker.filterHTML);
fp.appendFilters(nsIFilePicker.filterText);
// Link dialog also allows linking to images
if (filterType.indexOf("img") > 0)
fp.appendFilters(nsIFilePicker.filterImages);
}
// Default or last filter is "All Files"
fp.appendFilters(nsIFilePicker.filterAll);

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

@ -254,7 +254,7 @@ function InitDialog()
function chooseFile()
{
// Get a local file, converted into URL format
var fileName = GetLocalFileURL("html");
var fileName = GetLocalFileURL("html,img");
if (fileName)
{
// Always try to relativize local file URLs