Fix bug # 48320: Directories displayed twice in file:/// URLs. r=me

This commit is contained in:
rjc%netscape.com 2006-07-27 14:51:43 +00:00
Родитель fc4471722f
Коммит 8903d6188d
2 изменённых файлов: 16 добавлений и 12 удалений

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

@ -48,22 +48,26 @@ function Init()
{
debug("directory.js: Init()\n");
var tree = document.getElementById('tree');
// Initialize the tree's base URL to whatever the HTTPIndex is rooted at
var baseURI = HTTPIndex.BaseURL;
// fix bug # 37102: if its a FTP directory
// ensure it ends with a trailing slash
if (baseURI && (baseURI.indexOf("ftp://") == 0) &&
(baseURI.substr(baseURI.length - 1) != "/"))
if (baseURI && (baseURI.indexOf("ftp://") == 0))
{
debug("append traiing slash to FTP directory URL\n");
baseURI += "/";
}
debug("base URL = " + baseURI + "\n");
// fix bug # 37102: if its a FTP directory
// ensure it ends with a trailing slash
if (baseURI.substr(baseURI.length - 1) != "/")
{
debug("append traiing slash to FTP directory URL\n");
baseURI += "/";
}
// Note: Add the HTTPIndex datasource into the tree
var tree = document.getElementById('tree');
tree.database.AddDataSource(HTTPIndex.DataSource);
// Note: DON'T add the HTTPIndex datasource into the tree
// for file URLs, only do it for FTP URLs; the "rdf:files"
// datasources handles file URLs
tree.database.AddDataSource(HTTPIndex.DataSource);
}
// Note: set encoding BEFORE setting "ref" (important!)
var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService();

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

@ -37,7 +37,7 @@
<script src="chrome://communicator/content/directory/directory.js"></script>
<tree id="tree" datasources="rdf:files" flex="1" style="height:0px;"
container="true" open="true"
container="true" open="true" flags="dont-test-empty"
ondraggesture="return BeginDragTree(event);">
<template>
<treechildren flex="1">