- 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
Родитель 068a1a08c5
Коммит 6733155814
8 изменённых файлов: 41 добавлений и 13 удалений

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

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

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

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

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

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

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

@ -56,8 +56,6 @@
<script type="application/x-javascript" src="chrome://global/content/treePopups.js"/> <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/nsTreeUtils.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.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"/> <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<!-- Shared Bookmarks Utility Library --> <!-- Shared Bookmarks Utility Library -->

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

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

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

@ -76,7 +76,19 @@ BookmarksPanelTree.prototype = {
manageBookmarks: function () manageBookmarks: function ()
{ {
openDialog("chrome://communicator/content/bookmarks/bookmarks.xul", "", "chrome,dialog=no,resizable=yes"); 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);
}
}; };

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

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

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

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