display microsummaries in the bookmarks sidebar and bookmarks manager; bug=338429; r=myk; a=mconnor for 1.8.1 branch

This commit is contained in:
myk%mozilla.org 2006-06-22 06:26:39 +00:00
Родитель f00d33fd20
Коммит 26d3386808
2 изменённых файлов: 49 добавлений и 5 удалений

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

@ -892,6 +892,22 @@
</treeitem>
</treechildren>
</rule>
<rule rdf:type="http://home.netscape.com/NC-rdf#MicsumBookmark">
<treechildren>
<treeitem uri="rdf:*">
<treerow 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">
<treecell src="rdf:http://home.netscape.com/NC-rdf#Icon"
label="rdf:http://home.netscape.com/NC-rdf#GeneratedTitle"/>
<treecell label="rdf:http://home.netscape.com/NC-rdf#URL" />
<treecell label="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" />
<treecell label="rdf:http://home.netscape.com/NC-rdf#Description" />
<treecell label="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate" />
<treecell label="rdf:http://home.netscape.com/WEB-rdf#LastModifiedDate" />
<treecell label="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate"/>
</treerow>
</treeitem>
</treechildren>
</rule>
<rule>
<treechildren>
<treeitem uri="rdf:*">
@ -988,6 +1004,16 @@
</treeitem>
</treechildren>
</rule>
<rule rdf:type="http://home.netscape.com/NC-rdf#MicsumBookmark">
<treechildren>
<treeitem uri="rdf:*">
<treerow 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">
<treecell src="rdf:http://home.netscape.com/NC-rdf#Icon"
label="rdf:http://home.netscape.com/NC-rdf#GeneratedTitle"/>
</treerow>
</treeitem>
</treechildren>
</rule>
<rule>
<treechildren>
<treeitem uri="rdf:*">

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

@ -629,10 +629,10 @@ MicrosummaryService.prototype = {
}
}
// If we're setting a field that could affect this bookmark's label
// in bookmarks toolbars, then force toolbars to rebuild from scratch.
// If we're setting a field that could affect this bookmark's label,
// then force all bookmark trees to rebuild from scratch.
if (fieldName == FIELD_MICSUM_GEN_URI || fieldName == FIELD_GENERATED_TITLE)
this._forceToolbarRebuild();
this._forceBookmarkTreesRebuild();
},
_clearField: function MSS__clearField(bookmarkID, fieldName) {
@ -667,21 +667,39 @@ MicrosummaryService.prototype = {
},
/**
* Oy vey, a hack! Force the bookmarks toolbars to rebuild, since they don't
* Oy vey, a hack! Force the bookmark trees to rebuild, since they don't
* seem to be able to do it correctly on their own right after we twiddle
* something microsummaryish (but they rebuild fine otherwise, incorporating
* all the microsummary changes upon next full rebuild, f.e. if you open
* a new window or shut down and restart your browser).
*
*/
_forceToolbarRebuild: function MSS__forceToolbarRebuild() {
_forceBookmarkTreesRebuild: function MSS__forceBookmarkTreesRebuild() {
var mediator = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var windows = mediator.getEnumerator("navigator:browser");
while (windows.hasMoreElements()) {
var win = windows.getNext();
// rebuild the bookmarks toolbar
var bookmarksToolbar = win.document.getElementById("bookmarks-ptf");
bookmarksToolbar.builder.rebuild();
// rebuild the bookmarks sidebar
var sidebar = win.document.getElementById("sidebar");
if (sidebar.contentWindow && sidebar.contentWindow.location ==
"chrome://browser/content/bookmarks/bookmarksPanel.xul") {
var treeElement = sidebar.contentDocument.getElementById("bookmarks-view");
treeElement.tree.builder.rebuild();
}
}
windows = mediator.getEnumerator("bookmarks:manager");
while (windows.hasMoreElements()) {
win = windows.getNext();
// rebuild the Bookmarks Manager's view
treeElement = win.document.getElementById("bookmarks-view");
treeElement.tree.builder.rebuild();
}
},