Open history items in new chromed window. Bug #11986.

This commit is contained in:
slamm%netscape.com 1999-08-19 22:02:40 +00:00
parent c3b3d2424e
commit 08385d293e
4 changed files with 124 additions and 2 deletions

View File

@ -34,3 +34,64 @@ function doSort(sortColName)
rdfCore.doSort(node, sortResource, sortDirection);
return(false);
}
// lifted from bookmarks.js
var htmlInput = null;
var saveNode = null;
var newValue = "";
var timerID = null;
var gEditNode = null;
function OpenURL(event, node)
{
// clear any single-click/edit timeouts
if (timerID != null)
{
gEditNode = null;
clearTimeout(timerID);
timerID = null;
}
if (node.getAttribute('container') == "true")
{
return(false);
}
var url = node.getAttribute('id');
// Ignore "NC:" urls.
if (url.substring(0, 3) == "NC:")
{
return(false);
}
try
{
// add support for IE favorites under Win32, and NetPositive URLs under BeOS
if (url.indexOf("file://") == 0)
{
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
if (rdf)
{
var fileSys = rdf.GetDataSource("rdf:files");
if (fileSys)
{
var src = rdf.GetResource(url, true);
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
var target = fileSys.GetTarget(src, prop, true);
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (target) target = target.Value;
if (target) url = target;
}
}
}
}
catch(ex)
{
}
window.open(url,'history');
return(true);
}

View File

@ -58,7 +58,7 @@
</menubar>
<tree rdf:datasources="rdf:history rdf:find"
ondblclick="OpenURL(event.target.parentNode.parentNode);"
ondblclick="OpenURL(event,event.target.parentNode.parentNode);"
ref="NC:HistoryRoot"
style="height:100%;">

View File

@ -34,3 +34,64 @@ function doSort(sortColName)
rdfCore.doSort(node, sortResource, sortDirection);
return(false);
}
// lifted from bookmarks.js
var htmlInput = null;
var saveNode = null;
var newValue = "";
var timerID = null;
var gEditNode = null;
function OpenURL(event, node)
{
// clear any single-click/edit timeouts
if (timerID != null)
{
gEditNode = null;
clearTimeout(timerID);
timerID = null;
}
if (node.getAttribute('container') == "true")
{
return(false);
}
var url = node.getAttribute('id');
// Ignore "NC:" urls.
if (url.substring(0, 3) == "NC:")
{
return(false);
}
try
{
// add support for IE favorites under Win32, and NetPositive URLs under BeOS
if (url.indexOf("file://") == 0)
{
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
if (rdf)
{
var fileSys = rdf.GetDataSource("rdf:files");
if (fileSys)
{
var src = rdf.GetResource(url, true);
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
var target = fileSys.GetTarget(src, prop, true);
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (target) target = target.Value;
if (target) url = target;
}
}
}
}
catch(ex)
{
}
window.open(url,'history');
return(true);
}

View File

@ -58,7 +58,7 @@
</menubar>
<tree rdf:datasources="rdf:history rdf:find"
ondblclick="OpenURL(event.target.parentNode.parentNode);"
ondblclick="OpenURL(event,event.target.parentNode.parentNode);"
ref="NC:HistoryRoot"
style="height:100%;">