Fix bug # 45444: option-clicking on a bookmark should open Properties dialog; cmd-clicking on a bookmark should open URL in a new browser window. r=me

This commit is contained in:
rjc%netscape.com 2000-07-27 10:55:47 +00:00
Родитель a0b342e3b8
Коммит 7972e949ba
3 изменённых файлов: 25 добавлений и 6 удалений

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

@ -29,21 +29,30 @@
// get handle to the BrowserAppCore in the content area. // get handle to the BrowserAppCore in the content area.
var appCore = window._content.appCore; var appCore = window._content.appCore;
function clicked(event, target) function clicked(event, target)
{ {
if ((event.button != 1) || (event.detail != 2) || (target.nodeName != "treeitem")) if ((event.button != 1) || (event.detail != 2) || (target.nodeName != "treeitem"))
return(false); return(false);
if (event.altKey)
{
// if altKey is down then just open the Bookmark Properties dialog
BookmarkProperties();
return(true);
}
if (target.getAttribute("container") == "true") if (target.getAttribute("container") == "true")
return(false); return(false);
OpenBookmarkURL(target, document.getElementById('bookmarksTree').database); OpenBookmarkURL(event, target, document.getElementById('bookmarksTree').database);
return(true); return(true);
} }
function OpenBookmarkURL(node, datasources) function OpenBookmarkURL(event, node, datasources)
{ {
if (node.getAttribute("container") == "true") if (node.getAttribute("container") == "true")
{ {
@ -75,8 +84,10 @@ function OpenBookmarkURL(node, datasources)
return(false); return(false);
} }
// Check if we have a browser window // If we don't have a browser window or metaKey is down,
if (window._content == null) // then open a new browser window
if ((window._content == null) || (event.metaKey))
{ {
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
} }

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

@ -24,6 +24,7 @@
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?> <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?> <?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd"> <!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd">

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

@ -623,8 +623,15 @@ function OpenURL(event, node, root)
if (url.substring(0, 3) == "NC:") if (url.substring(0, 3) == "NC:")
return false; return false;
// get right sized window if (event.altKey)
window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url); {
BookmarkProperties();
}
else
{
// get right sized window
window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url);
}
return true; return true;
} }