mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
Make Personal Toolbar tooltips also contain the URI of the link. b=105485, r=blake, sr=ben.
This commit is contained in:
parent
ce01bd18c0
commit
f98144cbaf
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user