Skip to content

Commit

Permalink
Landng boomar groups. 119599 r ben sr jag a asa
Browse files Browse the repository at this point in the history
  • Loading branch information
hyatt%netscape.com committed Mar 19, 2002
1 parent 8cc6b3c commit 5deeb90
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 25 deletions.
8 changes: 7 additions & 1 deletion content/xul/content/src/nsXULElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3641,8 +3641,14 @@ nsXULElement::EnsureContentsGenerated(void) const
if (xulele) {
nsCOMPtr<nsIXULTemplateBuilder> builder;
xulele->GetBuilder(getter_AddRefs(builder));
if (builder)
if (builder) {
if (HasAttr(kNameSpaceID_None, nsXULAtoms::xulcontentsgenerated)) {
unconstThis->ClearLazyState(nsIXULContent::eChildrenMustBeRebuilt);
return NS_OK;
}

return builder->CreateContents(NS_STATIC_CAST(nsIStyledContent*, unconstThis));
}
}

nsCOMPtr<nsIContent> parent;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion themes/classic/communicator/bookmarks/bookmarks.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
outlinerchildren:-moz-outliner-image(Name) {
padding-right: 2px;
}

.bookmark-item, outlinerchildren:-moz-outliner-image(Name) {
list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.gif");
}
Expand Down Expand Up @@ -80,3 +80,14 @@ outlinerchildren:-moz-outliner-image(Name) {
max-width: 32px; /* 32 pixel hack to get too-large favicons to show; fix when tree becomes outliner */
max-height: 16px;
}


outlinerchildren:-moz-outliner-twisty(group,hidetwisty)
{
list-style-image: none;
}

outlinerchildren:-moz-outliner-image(Name, container, group)
{
list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-group.gif");
}
4 changes: 4 additions & 0 deletions themes/classic/communicator/bookmarks/bookmarksToolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ menuitem.bookmark-item {
padding: 1px 2px;
}

.bookmark-group {
list-style-image: url(chrome://communicator/skin/bookmarks/bookmark-group.gif) !important;
}

.menuitem-iconic.bookmark-item[disabled="true"] {
list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-disabled.gif");
}
Expand Down
1 change: 1 addition & 0 deletions themes/classic/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ classic.jar:
skin/classic/communicator/bookmarks/bookmark-folder-closed.gif (communicator/bookmarks/bookmark-folder-closed.gif)
skin/classic/communicator/bookmarks/bookmark-folder-disabled.gif (communicator/bookmarks/bookmark-folder-disabled.gif)
skin/classic/communicator/bookmarks/bookmark-folder-open.gif (communicator/bookmarks/bookmark-folder-open.gif)
skin/classic/communicator/bookmarks/bookmark-group.gif (communicator/bookmarks/bookmark-group.gif)
skin/classic/communicator/bookmarks/bookmark-item-disabled.gif (communicator/bookmarks/bookmark-item-disabled.gif)
skin/classic/communicator/bookmarks/bookmark-item-updated.gif (communicator/bookmarks/bookmark-item-updated.gif)
skin/classic/communicator/bookmarks/bookmark-item.gif (communicator/bookmarks/bookmark-item.gif)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions themes/modern/communicator/bookmarks/bookmarks.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ outlinerchildren:-moz-outliner-image(Name, open) {
outlinerchildren:-moz-outliner-image(Name) {
padding-right: 2px;
}

outlinerchildren:-moz-outliner-twisty(group,hidetwisty)
{
list-style-image: none;
}

outlinerchildren:-moz-outliner-image(Name, container, group)
{
list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-group.gif");
}
4 changes: 4 additions & 0 deletions themes/modern/communicator/bookmarks/bookmarksToolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ menuitem.bookmark-item {
padding: 1px 2px;
}

.bookmark-group {
list-style-image: url(chrome://communicator/skin/bookmarks/bookmark-group.gif) !important;
}

menuitem.bookmark-item[disabled="true"] {
list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-dis.gif");
}
Expand Down
1 change: 1 addition & 0 deletions themes/modern/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ modern.jar:
skin/modern/communicator/bookmarks/bookmark-folder-closed.gif (communicator/bookmarks/bookmark-folder-closed.gif)
skin/modern/communicator/bookmarks/bookmark-folder-dis.gif (communicator/bookmarks/bookmark-folder-dis.gif)
skin/modern/communicator/bookmarks/bookmark-folder-open.gif (communicator/bookmarks/bookmark-folder-open.gif)
skin/modern/communicator/bookmarks/bookmark-group.gif (communicator/bookmarks/bookmark-group.gif)
skin/modern/communicator/bookmarks/bookmark-item-dis.gif (communicator/bookmarks/bookmark-item-dis.gif)
skin/modern/communicator/bookmarks/bookmark-item.gif (communicator/bookmarks/bookmark-item.gif)
skin/modern/communicator/bookmarks/home.gif (communicator/bookmarks/home.gif)
Expand Down
48 changes: 48 additions & 0 deletions xpfe/browser/resources/content/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,56 @@ function BrowserHome()
loadURI(homePage);
}

function OpenBookmarkGroup(element, datasource)
{
if (!datasource)
return;

var id = element.getAttribute("id");
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
var resource = rdf.GetResource(id, true);
return OpenBookmarkGroupFromResource(resource, datasource, rdf);
}

function OpenBookmarkGroupFromResource(resource, datasource, rdf) {
var urlResource = rdf.GetResource("http://home.netscape.com/NC-rdf#URL");
var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);
rdfContainer.Init(datasource, resource);
var containerChildren = rdfContainer.GetElements();
var tabPanels = gBrowser.mPanelContainer.childNodes;
var tabCount = tabPanels.length;
var index = 0;
while (containerChildren.hasMoreElements()) {
var resource = containerChildren.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
var target = datasource.GetTarget(resource, urlResource, true);
if (target) {
var uri = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
if (index < tabCount)
tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE);
else
gBrowser.addTab(uri);
index++;
}
}

if (index == 0)
return; // If the bookmark group was completely invalid, just bail.

// Select the first tab in the group.
var tabs = gBrowser.mTabContainer.childNodes;
gBrowser.selectedTab = tabs[0];

// Close any remaining open tabs that are left over.
for (var i = tabCount-1; i >= index; i--)
gBrowser.removeTab(tabs[i]);
}

function OpenBookmarkURL(node, datasources)
{
if (node.getAttribute("group") == "true")
OpenBookmarkGroup(node, datasources);

if (node.getAttribute("container") == "true")
return;

Expand Down
12 changes: 9 additions & 3 deletions xpfe/browser/resources/content/navigator.xul
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,28 @@ Contributor(s): ______________________________________. -->
ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
rdf:type="http://home.netscape.com/NC-rdf#Folder"
oncommand="OpenBookmarkURL(event.target, document.getElementById('innermostBox').database)">

<tooltip id="ptTooltip" noautohide="true" onpopupshowing="return FillInPTTooltip(document.tooltipNode)">
<vbox id="ptTooltipTextBox" flex="1">
<label id="ptTitleText" />
<label id="ptUrlText" />
</vbox>
</tooltip>

<template>
<template xmlns:nc="http://home.netscape.com/NC-rdf#">
<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>

<!-- yes, the type attribute is necessary otherwise all leaves are
treated as containers for some reason -->
<rule parent="hbox" iscontainer="true"
nc:FolderGroup="true">
<toolbarbutton class="bookmark-item bookmark-group" uri="rdf:*" xulcontentsgenerated="true"
group="true"
container="false"
rdf:type="http://home.netscape.com/NC-rdf#Folder"
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
</rule>
<rule parent="hbox" iscontainer="true" isempty="true"
rdf:type="http://home.netscape.com/NC-rdf#Folder">
<toolbarbutton type="menu" editable="true" class="bookmark-item"
Expand Down
11 changes: 10 additions & 1 deletion xpfe/browser/resources/content/navigatorOverlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,16 @@
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
ref="NC:BookmarksRoot" flags="dont-test-empty" template="bookmarksMenuTemplate"
oncommand="OpenBookmarkURL(event.target, document.getElementById('BookmarksMenu').database)">
<template id="bookmarksMenuTemplate">
<template id="bookmarksMenuTemplate" xmlns:nc="http://home.netscape.com/NC-rdf#">
<rule nc:FolderGroup="true" iscontainer="true">
<menupopup>
<menuitem class="menuitem-iconic bookmark-group"
label="rdf:http://home.netscape.com/NC-rdf#Name"
group="true"
uri="rdf:*"
xulcontentsgenerated="true"/>
</menupopup>
</rule>
<rule iscontainer="true" isempty="true"
rdf:type="http://home.netscape.com/NC-rdf#Folder">
<menupopup>
Expand Down
95 changes: 76 additions & 19 deletions xpfe/components/bookmarks/resources/bookmarks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
this.mOuter.selectAll();
break;
case "cmd_bm_open":
this.mOuter.openItem(null, false);
this.mOuter.openItem(null, false, false);
break;
case "cmd_bm_openfolder":
this.mOuter.outlinerBoxObject.view.toggleOpenState(this.mOuter.currentIndex);
Expand All @@ -671,7 +671,7 @@
if (type == this.mOuter.NC_NS + "Folder")
this.mOuter.openFolderInNewWindow();
else
this.mOuter.openItem(null, true);
this.mOuter.openItem(null, true, false);
break;
case "cmd_bm_newbookmark":
this.mOuter.addBookmark();
Expand Down Expand Up @@ -1801,8 +1801,16 @@
<method name="openItem">
<parameter name="aEvent"/>
<parameter name="aInNewWindow"/>
<parameter name="aOpenGroups"/>
<body><![CDATA[
if (this.outlinerBoxObject.view.isContainer(this.outlinerBoxObject.selection.currentIndex)) {
var groupRes = this.rdf.GetResource(this.NC_NS + "FolderGroup");
var groupTarget = this.db.GetTarget(this.outlinerBuilder.getResourceAtIndex(this.outlinerBoxObject.selection.currentIndex),
groupRes, true);

if (groupTarget && !aOpenGroups)
return;

if (!groupTarget && this.outlinerBoxObject.view.isContainer(this.outlinerBoxObject.selection.currentIndex)) {
if (this.clickCount == 1) {
var row = { };
var col = { };
Expand All @@ -1825,20 +1833,39 @@
var rangeMax = { };
seln.getRangeAt(i, rangeMin, rangeMax);
for (var k = rangeMax.value; k >= rangeMin.value; --k) {
urlRes = this.rdf.GetResource(this.NC_NS + "URL");
urlValue = this.db.GetTarget(this.outlinerBuilder.getResourceAtIndex(k), urlRes, true).QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
// Ignore "NC:" and empty urls
if (!urlValue || urlValue.substring(0,3) == "NC:") return;
openDialog (this._browserURL, "_blank", "chrome,all,dialog=no", urlValue);
groupTarget = this.db.GetTarget(this.outlinerBuilder.getResourceAtIndex(k),
groupRes, true);

if (!groupTarget) {
urlRes = this.rdf.GetResource(this.NC_NS + "URL");
urlValue = this.db.GetTarget(this.outlinerBuilder.getResourceAtIndex(k), urlRes, true).QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
// Ignore "NC:" and empty urls
if (!urlValue || urlValue.substring(0,3) == "NC:") return;
}
else
urlValue = "about:blank";

var w = openDialog (this._browserURL, "_blank", "chrome,all,dialog=no", urlValue);
if (groupTarget)
w.OpenBookmarkGroupFromResource(this.outlinerBuilder.getResourceAtIndex(k),
this.db, this.rdf);
}
}
}
else {
urlRes = this.rdf.GetResource(this.NC_NS + "URL");
urlValue = this.db.GetTarget(this.currentRes, urlRes, true).QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
// Ignore "NC:" and empty urls
if (!urlValue || urlValue.substring(0,3) == "NC:") return;
openTopWin(urlValue);
groupTarget = this.db.GetTarget(this.currentRes, groupRes, true);
if (!groupTarget) {
urlRes = this.rdf.GetResource(this.NC_NS + "URL");
urlValue = this.db.GetTarget(this.currentRes, urlRes, true).QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
// Ignore "NC:" and empty urls
if (!urlValue || urlValue.substring(0,3) == "NC:") return;
}
else
urlValue = "about:blank";

var w = openTopWin(urlValue);
if (groupTarget)
w.OpenBookmarkGroupFromResource(this.currentRes, this.db, this.rdf);
}
if (aEvent)
aEvent.preventBubble();
Expand All @@ -1863,18 +1890,33 @@
<vbox flex="1">
<outliner anonid="bookmarks-outliner" flex="1" class="plain" enableColumnDrag="true"
datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" ref="NC:BookmarksRoot" flags="dont-build-content"
onkeypress="if (event.keyCode == 13) this.parentNode.parentNode.openItem(event, false);"
ondblclick="if (this.parentNode.parentNode.validOpenClickConditions(event)) this.parentNode.parentNode.openItem(event, false);"
onkeypress="if (event.keyCode == 13) this.parentNode.parentNode.openItem(event, false, false);"
ondblclick="if (this.parentNode.parentNode.validOpenClickConditions(event)) this.parentNode.parentNode.openItem(event, false, false);"
ondraggesture="if (event.originalTarget.localName == 'outlinerchildren') nsDragAndDrop.startDrag(event, this.parentNode.parentNode.DNDObserver);"
onselect="this.outlinerBoxObject.view.selectionChanged();">
<template>
<template xmlns:nc="http://home.netscape.com/NC-rdf#">
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
<outlinerchildren>
<outlineritem uri="rdf:*">
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator"/>
</outlineritem>
</outlinerchildren>
</rule>
<rule nc:FolderGroup="true">
<outlinerchildren>
<outlineritem uri="rdf:*">
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
<outlinercell properties="group" label="rdf:http://home.netscape.com/NC-rdf#Name" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#URL" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Description" />
<outlinercell label="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate"/>
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#LastModifiedDate" />
</outlinerrow>
</outlineritem>
</outlinerchildren>
</rule>
<rule>
<outlinerchildren>
<outlineritem uri="rdf:*">
Expand Down Expand Up @@ -1946,18 +1988,33 @@
onpopupshowing="this.parentNode.createContextMenu(event);"/>
<outliner anonid="bookmarks-outliner" flex="1" hidecolumnpicker="true" class="plain"
datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" ref="NC:BookmarksRoot" flags="dont-build-content"
onkeypress="if (event.keyCode == 13) this.parentNode.openItem(event, false);"
onkeypress="if (event.keyCode == 13) this.parentNode.openItem(event, false, true);"
ondraggesture="if (event.originalTarget.localName == 'outlinerchildren') nsDragAndDrop.startDrag(event, this.parentNode.DNDObserver);"
onclick="if (this.parentNode.validOpenClickConditions(event)) this.parentNode.openItem(event, false);"
onclick="if (this.parentNode.validOpenClickConditions(event)) this.parentNode.openItem(event, false, true);"
onselect="this.parentNode.outlinerBoxObject.view.selectionChanged();">
<template>
<template xmlns:nc="http://home.netscape.com/NC-rdf#">
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
<outlinerchildren>
<outlineritem uri="rdf:*">
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator" />
</outlineritem>
</outlinerchildren>
</rule>
<rule nc:FolderGroup="true">
<outlinerchildren>
<outlineritem uri="rdf:*">
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
<outlinercell properties="group hidetwisty" label="rdf:http://home.netscape.com/NC-rdf#Name" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#URL" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Description" />
<outlinercell label="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate"/>
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate" />
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#LastModifiedDate" />
</outlinerrow>
</outlineritem>
</outlinerchildren>
</rule>
<rule>
<outlinerchildren>
<outlineritem uri="rdf:*">
Expand Down
Loading

0 comments on commit 5deeb90

Please sign in to comment.