This commit is contained in:
rjc%netscape.com 2006-09-14 06:01:34 +00:00
Родитель 4a2e0875e9
Коммит d02d08c92d
4 изменённых файлов: 30 добавлений и 3 удалений

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

@ -121,6 +121,19 @@ function UpdateBookmarksLastVisitedDate(event)
}
}
function HandleBookmarkIcon(iconURL, addFlag)
{
var url = _content.location.href;
if (url) {
// update URL with new icon reference
if (!gBookmarksService)
gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
.getService(Components.interfaces.nsIBookmarksService);
if (addFlag) gBookmarksService.UpdateBookmarkIcon(url, iconURL);
else gBookmarksService.RemoveBookmarkIcon(url, iconURL);
}
}
function UpdateInternetSearchResults(event)
{
// XXX This somehow causes a big leak, back to the old way

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

@ -189,8 +189,8 @@ Contributor(s): ______________________________________. -->
ondraggesture="PageProxyDragGesture(event);"/>
<image id="page-proxy-favicon" validate="never"
ondraggesture="PageProxyDragGesture(event);"
onload="this.parentNode.selectedIndex = 1; event.stopPropagation(); event.preventBubble();"
onerror="gBrowser.addToMissedIconCache(this.src);"/>
onload="this.parentNode.selectedIndex = 1; event.stopPropagation(); event.preventBubble(); HandleBookmarkIcon(this.src, true);"
onerror="gBrowser.addToMissedIconCache(this.src); HandleBookmarkIcon(this.src, false);"/>
</deck>
<menupopup id="ubhist-popup" class="autocomplete-history-popup"
popupalign="topleft" popupanchor="bottomleft"
@ -312,6 +312,8 @@ Contributor(s): ______________________________________. -->
<rule parent="hbox">
<toolbarbutton class="bookmark-item" uri="rdf:*" editable="true"
image="rdf:http://home.netscape.com/NC-rdf#Icon"
validate="never"
status="rdf:http://home.netscape.com/WEB-rdf#status"
rdf:type="http://home.netscape.com/NC-rdf#Bookmark"
tooltiptext="rdf:http://home.netscape.com/NC-rdf#URL"
@ -349,6 +351,8 @@ Contributor(s): ______________________________________. -->
<rule>
<menupopup>
<menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
src="rdf:http://home.netscape.com/NC-rdf#Icon"
validate="never"
status="rdf:http://home.netscape.com/WEB-rdf#status"
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
</menupopup>

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

@ -329,7 +329,9 @@
</rule>
<rule>
<menupopup>
<menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
<menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
src="rdf:http://home.netscape.com/NC-rdf#Icon"
validate="never"
label="rdf:http://home.netscape.com/NC-rdf#Name"
status="rdf:http://home.netscape.com/WEB-rdf#status"/>
</menupopup>

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

@ -166,7 +166,15 @@ nsBrowserStatusHandler.prototype =
onLinkIconAvailable : function(aHref) {
if (gProxyFavIcon && pref.getBoolPref("browser.chrome.site_icons"))
{
gProxyFavIcon.setAttribute("src", aHref);
// update any bookmarks with new icon reference
if (!gBookmarksService)
gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
.getService(Components.interfaces.nsIBookmarksService);
gBookmarksService.UpdateBookmarkIcon(this.urlBar.value, aHref);
}
},
onProgressChange : function (aWebProgress, aRequest,