mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Open history items in new chromed window. Bug #11986.
This commit is contained in:
parent
c3b3d2424e
commit
08385d293e
@ -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);
|
||||
}
|
||||
|
@ -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%;">
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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%;">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user