зеркало из https://github.com/mozilla/pjs.git
Fix bug # 48320: Directories displayed twice in file:/// URLs. r=me
This commit is contained in:
Родитель
f370516c1c
Коммит
48f68d69aa
|
@ -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">
|
||||
|
|
Загрузка…
Ссылка в новой задаче