Make Personal Toolbar tooltips also contain the URI of the link. b=105485, r=blake, sr=ben.

This commit is contained in:
ian%hixie.ch 2006-09-14 06:02:33 +00:00
Родитель 8f682a2d60
Коммит 4afd81e328
2 изменённых файлов: 41 добавлений и 1 удалений

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

@ -1512,3 +1512,34 @@ function updateToolbarStates(toolbarMenuElt)
updateComponentBarBroadcaster();
}
// Fill in tooltips for personal toolbar
function FillInPTTooltip(tipElement)
{
var title = tipElement.label;
var url = tipElement.statusText;
if (!title && !url) {
// bail out early if there is nothing to show
return false;
}
var tooltipTitle = document.getElementById("ptTitleText");
var tooltipUrl = document.getElementById("ptUrlText");
if (title && title != url) {
tooltipTitle.removeAttribute("hidden");
tooltipTitle.setAttribute("value", title);
} else {
tooltipTitle.setAttribute("hidden", "true");
}
if (url) {
tooltipUrl.removeAttribute("hidden");
tooltipUrl.setAttribute("value", url);
} else {
tooltipUrl.setAttribute("hidden", "true");
}
return true; // show tooltip
}

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

@ -268,6 +268,14 @@ 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>
<rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
<toolbarseparator uri="rdf:*"
@ -307,7 +315,8 @@ Contributor(s): ______________________________________. -->
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"
statustext="rdf:http://home.netscape.com/NC-rdf#URL"
tooltip="ptTooltip"
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
</rule>