- Fix commands for bookmarks sidebar panel

r=fabian, sr=blake, a=asa
part of 82967
This commit is contained in:
ben%netscape.com 2001-06-03 05:15:27 +00:00
parent 0ddf4e6732
commit e463a8bf06
8 changed files with 41 additions and 13 deletions

View File

@ -113,8 +113,8 @@ function Startup()
document.getElementById("folderbox").setAttribute("hidden", "true");
windowNode = document.getElementById("newBookmarkWindow");
windowNode.removeAttribute("persist");
windowNode.setAttribute("height", "0");
windowNode.setAttribute("width", "0");
windowNode.removeAttribute("height");
windowNode.removeAttribute("width");
windowNode.setAttribute("style", windowNode.getAttribute("style"));
sizeToContent();
break;

View File

@ -43,6 +43,7 @@
<script type="application/x-javascript" src="chrome://global/content/nsTreeUtils.js"/>
<!-- XXX - would like to cut this dependency out -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsJSComponentManager.js"/>
<!-- Bookmarks Shell -->
@ -65,22 +66,34 @@
<stringbundleset id="stringbundleset"/>
<!-- bookmarks & edit commands -->
<commandset id="bookmarksItems"/>
<commands id="commands">
<commandset id="CommandUpdate_Bookmarks"
commandupdater="true"
events="click,focus,tree-select"
oncommandupdate="BookmarksTree.prototype.controller.onCommandUpdate()">
</commandset>
<commandset id="bookmarksItems"/>
</commands>
<box id="panel-bar" class="toolbar">
<button class="button-toolbar" label="&command.addBookmark.label;"
oncommand="gBookmarksShell.addBookmark();"/>
<button class="button-toolbar" label="&command.manageBookmarks.label;"
oncommand="gBookmarksShell.manageBookmarks();"/>
<spring flex="1"/>
<toolbarseparator/>
<button class="button-toolbar" label="&command.findBookmarks.label;"
oncommand="gBookmarksShell.findInBookmarks();"/>
</box>
<tree id="bookmarksTree" context="bmContext" ref="NC:BookmarksRoot" class="sidebarTree"
datasources="rdf:bookmarks rdf:files rdf:httpindex rdf:localsearch rdf:internetsearch"
flags="dont-test-empty"
type="http://home.netscape.com/NC-rdf#Folder"
ondragover="nsDragAndDrop.dragOver(event, bookmarksDNDObserver);"
ondraggesture="nsDragAndDrop.startDrag(event, bookmarksDNDObserver);"
ondragdrop="nsDragAndDrop.drop(event, bookmarksDNDObserver);"
onclick="gBookmarksShell.treeClicked(event);"
onclick="gBookmarksShell.hlClick(event);"
style="height:0px" flex="1">
<template>
@ -125,7 +138,7 @@
<treehead>
<treerow id="headRow">
<treecell class="treecell-header sortDirectionIndicator treecell-header-sidebarpanel"
label="&tree.header.name.label;"
label="Foopy"
onclick="return TriStateColumnSort('Name');"
observes="Name" />
</treerow>

View File

@ -68,8 +68,8 @@
<vbox class="box-padded">
<grid>
<columns>
<column />
<column flex="1"/>
<column flex="3"/>
</columns>
<rows>
<row>

View File

@ -56,8 +56,6 @@
<script type="application/x-javascript" src="chrome://global/content/treePopups.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTreeUtils.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<!-- XXX - This should SO become an XBL widget -->
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<!-- Shared Bookmarks Utility Library -->

View File

@ -547,10 +547,12 @@ BookmarksUIElement.prototype = {
kSuppString.data = flavours[i];
flavourArray.AppendElement(kSuppString);
}
var hasFlavors = clipboard.hasDataMatchingFlavors(flavourArray, kClipboardIID.kGlobalClipboard);
return hasFlavors;
var hasFlavours = clipboard.hasDataMatchingFlavors(flavourArray, kClipboardIID.kGlobalClipboard);
return hasFlavours;
},
/////////////////////////////////////////////////////////////////////////////
// aSelection is a mutable array, not a NodeList.
deleteSelection: function (aSelection)
{
const kRDFCContractID = "@mozilla.org/rdf/container;1";

View File

@ -76,7 +76,19 @@ BookmarksPanelTree.prototype = {
manageBookmarks: function ()
{
openDialog("chrome://communicator/content/bookmarks/bookmarks.xul", "", "chrome,dialog=no,resizable=yes");
}
},
/////////////////////////////////////////////////////////////////////////////
// This function only exists because we call onCommandUpdate manually in it,
// because for some reason, the commandupdate handler on the commandupdater
// is never being called. This is true of the bookmarks sidebar panel and the
// personal toolbar.
hlClick: function (aEvent)
{
// Command updater isn't working for us. Force a command update, beyotch.
this.controller.onCommandUpdate();
this.treeClicked(aEvent);
}
};

View File

@ -72,6 +72,8 @@
oncommand="gBookmarksShell.addBookmark();"/>
<button class="button-toolbar" label="&command.manageBookmarks.label;"
oncommand="gBookmarksShell.manageBookmarks();"/>
<button class="button-toolbar" label="&command.findBookmarks.label;"
oncommand="gBookmarksShell.findInBookmarks();"/>
</box>
<tree id="bookmarksTree" context="bmContext" ref="NC:BookmarksRoot" class="sidebarTree"

View File

@ -31,8 +31,9 @@
<!ENTITY command.newSeparator.accesskey "s">
<!ENTITY menuitem.import.label "Import Bookmarks...">
<!ENTITY menuitem.export.label "Export Bookmarks...">
<!ENTITY menuitem.find.label "Search Bookmarks...">
<!ENTITY menuitem.find.accesskey "s">
<!ENTITY menuitem.find.label "Find Bookmarks...">
<!ENTITY command.findBookmarks.label "Find...">
<!ENTITY menuitem.find.accesskey "f">
<!ENTITY edit.find.keybinding "f">
<!ENTITY command.properties.label "Properties">
<!ENTITY command.properties.accesskey "i">