b=192624, empty bookmark folder should show (Empty), r=mconnor
git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@158966 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -301,8 +301,8 @@
|
||||
datasources="rdf:bookmarks rdf:files rdf:localsearch"
|
||||
ref="NC:BookmarksRoot" flags="dont-test-empty"
|
||||
template='bookmarks-template'
|
||||
onpopupshowing="BookmarksMenu.showOpenInTabsMenuItem(event.target)"
|
||||
onpopuphidden="BookmarksMenu.hideOpenInTabsMenuItem(event.target)"
|
||||
onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
|
||||
onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
|
||||
oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
|
||||
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
|
||||
@@ -420,28 +420,10 @@
|
||||
|
||||
|
||||
<template id='bookmarks-template' xmlns:nc="http://home.netscape.com/NC-rdf#">
|
||||
<!-- this Livemark rule can die once the template builder is fixed;
|
||||
it's here only to block the Empty item from appearing (bug 248015, 192624) -->
|
||||
<rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#Livemark">
|
||||
<toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
|
||||
rdf:type="http://home.netscape.com/NC-rdf#Folder"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name">
|
||||
<menupopup contextmenu="bookmarks-context-menu"/>
|
||||
</toolbarbutton>
|
||||
</rule>
|
||||
<rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<toolbarseparator uri="rdf:*"
|
||||
rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
|
||||
</rule>
|
||||
<rule parent="hbox" iscontainer="true" isempty="true">
|
||||
<toolbarbutton type="menu" editable="true" class="bookmark-item"
|
||||
rdf:type="http://home.netscape.com/NC-rdf#Folder"
|
||||
uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name">
|
||||
<menupopup>
|
||||
<menuitem label="&emptyItem.label;" disabled="true"/>
|
||||
</menupopup>
|
||||
</toolbarbutton>
|
||||
</rule>
|
||||
<rule parent="hbox" iscontainer="true">
|
||||
<toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
|
||||
rdf:type="http://home.netscape.com/NC-rdf#Folder"
|
||||
@@ -458,31 +440,11 @@
|
||||
tooltip="btTooltip"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
</rule>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#Livemark">
|
||||
<menupopup>
|
||||
<menu class="menu-iconic bookmark-item" uri="rdf:*"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<menupopup contextmenu="bookmarks-context-menu"/>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</rule>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<menupopup>
|
||||
<menuseparator uri="rdf:*" />
|
||||
</menupopup>
|
||||
</rule>
|
||||
<rule iscontainer="true" isempty="true">
|
||||
<menupopup>
|
||||
<menu class="menu-iconic bookmark-item" uri="rdf:*"
|
||||
type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name">
|
||||
<menupopup>
|
||||
<menuitem label="&emptyItem.label;" disabled="true"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</rule>
|
||||
<rule iscontainer="true">
|
||||
<menupopup>
|
||||
<menu class="menu-iconic bookmark-item" uri="rdf:*"
|
||||
|
||||
@@ -261,8 +261,8 @@
|
||||
datasources="rdf:bookmarks rdf:files rdf:localsearch"
|
||||
template="bookmarks-template" flags="dont-test-empty"
|
||||
rdf:type="http://home.netscape.com/NC-rdf#Folder"
|
||||
onpopupshowing="BookmarksMenu.showOpenInTabsMenuItem(event.target)"
|
||||
onpopuphidden="BookmarksMenu.hideOpenInTabsMenuItem(event.target)"
|
||||
onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
|
||||
onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
|
||||
oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
|
||||
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
|
||||
@@ -277,8 +277,8 @@
|
||||
mousethrough="never" collapsed="true"
|
||||
datasources="rdf:bookmarks rdf:files rdf:localsearch"
|
||||
template="bookmarks-template" flags="dont-test-empty"
|
||||
onpopupshowing="BookmarksMenu.showOpenInTabsMenuItem(event.target)"
|
||||
onpopuphidden="BookmarksMenu.hideOpenInTabsMenuItem(event.target)"
|
||||
onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
|
||||
onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
|
||||
oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
|
||||
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
|
||||
|
||||
@@ -38,7 +38,23 @@ var BookmarksMenu = {
|
||||
_selection:null,
|
||||
_target:null,
|
||||
_orientation:null,
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// prepare the bookmarks menu for display
|
||||
onShowMenu: function (aTarget)
|
||||
{
|
||||
this.showOpenInTabsMenuItem(aTarget);
|
||||
this.showEmptyItem(aTarget);
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// remove arbitary elements created in this.onShowMenu()
|
||||
onHideMenu: function (aTarget)
|
||||
{
|
||||
this.hideOpenInTabsMenuItem(aTarget);
|
||||
this.hideEmptyItem(aTarget);
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// shows the 'Open in Tabs' menu item if validOpenInTabsMenuItem is true -->
|
||||
showOpenInTabsMenuItem: function (aTarget)
|
||||
@@ -114,6 +130,33 @@ var BookmarksMenu = {
|
||||
return false;
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// show an empty item if the menu is empty
|
||||
showEmptyItem: function (aTarget)
|
||||
{
|
||||
if(aTarget.hasChildNodes())
|
||||
return;
|
||||
|
||||
var EmptyMsg = BookmarksUtils.getLocaleString("emptyFolder");
|
||||
var emptyElement = document.createElementNS(XUL_NS, "menuitem");
|
||||
emptyElement.setAttribute("id", "empty-menuitem");
|
||||
emptyElement.setAttribute("label", EmptyMsg);
|
||||
emptyElement.setAttribute("disabled", "true");
|
||||
|
||||
aTarget.appendChild(emptyElement);
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// remove the empty element
|
||||
hideEmptyItem: function (aTarget)
|
||||
{
|
||||
if (!aTarget.hasChildNodes())
|
||||
return;
|
||||
|
||||
if (aTarget.lastChild.id == "empty-menuitem")
|
||||
aTarget.removeChild(aTarget.lastChild);
|
||||
},
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Fill a context menu popup with menuitems appropriate for the current
|
||||
// selection.
|
||||
|
||||
@@ -91,9 +91,6 @@
|
||||
<!ENTITY search.label "Search:">
|
||||
<!ENTITY search.accesskey "S">
|
||||
|
||||
<!-- bookmarksToolbar.xml -->
|
||||
<!ENTITY emptyItem.label "(Empty)">
|
||||
|
||||
<!-- selectBookmark.xul -->
|
||||
<!ENTITY selectBookmark.title "Set Home Page">
|
||||
<!ENTITY selectBookmark.label "Choose a Bookmark to be your Home Page. If you choose a folder, the Bookmarks in that folder will be opened in Tabs.">
|
||||
|
||||
@@ -108,6 +108,8 @@ EnterExport = Export bookmark file:
|
||||
|
||||
search_button_label = Find
|
||||
|
||||
emptyFolder = (Empty)
|
||||
|
||||
addBookmarkPromptTitle=Add Bookmark?
|
||||
addBookmarkPromptMessage=Add Bookmark to "%S" (%S)?
|
||||
addBookmarkPromptButton=Add Bookmark
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
<!ENTITY manBookmarksCmd.accesskey "M">
|
||||
<!ENTITY manBookmarksCmd.commandkey "b">
|
||||
<!ENTITY manBookmarksWinCmd.commandkey "i">
|
||||
<!ENTITY emptyItem.label "(Empty)">
|
||||
|
||||
<!ENTITY backCmd.label "Back">
|
||||
<!ENTITY backCmd.accesskey "B">
|
||||
|
||||
Reference in New Issue
Block a user