60245 - no tooltips for "title" attribute in sidebar. r=sgehani sr=hewitt

This commit is contained in:
blakeross%telocity.com 2002-02-08 22:30:17 +00:00
parent 7725472e68
commit 3b51580793
3 changed files with 49 additions and 48 deletions

View File

@ -199,3 +199,47 @@ function getMarkupDocumentViewer()
{
return getBrowser().markupDocumentViewer;
}
/**
* Content area tooltip.
* XXX - this must move into XBL binding/equiv! Do not want to pollute
* navigator.js with functionality that can be encapsulated into
* browser widget. TEMPORARY!
*
* NOTE: Any changes to this routine need to be mirrored in ChromeListener::FindTitleText()
* (located in mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp)
* which performs the same function, but for embedded clients that
* don't use a XUL/JS layer. It is important that the logic of
* these two routines be kept more or less in sync.
* (pinkerton)
**/
function FillInHTMLTooltip(tipElement)
{
const XLinkNS = "http://www.w3.org/1999/xlink";
var retVal = false;
var titleText = null;
var XLinkTitleText = null;
while (!titleText && !XLinkTitleText && tipElement) {
if (tipElement.nodeType == Node.ELEMENT_NODE) {
titleText = tipElement.getAttribute("title");
XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title");
}
tipElement = tipElement.parentNode;
}
var texts = [titleText, XLinkTitleText];
var tipNode = document.getElementById("aHTMLTooltip");
for (var i = 0; i < texts.length; ++i) {
var t = texts[i];
if (t && t.search(/\S/) >= 0) {
tipNode.setAttribute("label", t);
retVal = true;
}
}
return retVal;
}

View File

@ -1179,53 +1179,6 @@ function checkForDirectoryListing()
}
}
/**
* Content area tooltip.
* XXX - this must move into XBL binding/equiv! Do not want to pollute
* navigator.js with functionality that can be encapsulated into
* browser widget. TEMPORARY!
*
* NOTE: Any changes to this routine need to be mirrored in ChromeListener::FindTitleText()
* (located in mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp)
* which performs the same function, but for embedded clients that
* don't use a XUL/JS layer. It is important that the logic of
* these two routines be kept more or less in sync.
* (pinkerton)
**/
function FillInHTMLTooltip(tipElement)
{
var retVal = false;
if (tipElement.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul")
return retVal;
const XLinkNS = "http://www.w3.org/1999/xlink";
var titleText = null;
var XLinkTitleText = null;
while (!titleText && !XLinkTitleText && tipElement) {
if (tipElement.nodeType == Node.ELEMENT_NODE) {
titleText = tipElement.getAttribute("title");
XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title");
}
tipElement = tipElement.parentNode;
}
var texts = [titleText, XLinkTitleText];
var tipNode = document.getElementById("aHTMLTooltip");
for (var i = 0; i < texts.length; ++i) {
var t = texts[i];
if (t && t.search(/\S/) >= 0) {
tipNode.setAttribute("label", t);
retVal = true;
}
}
return retVal;
}
/**
* Use Stylesheet functions.
* Written by Tim Hill (bug 6782)

View File

@ -31,6 +31,8 @@
<overlay id="sidebarOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://navigator/content/browser.js"/>
<command id="toggleSidebar" oncommand="SidebarShowHide();"/>
<key id="showHideSidebar" keycode="VK_F9" command="toggleSidebar"/>
@ -57,6 +59,7 @@
<!-- Overlay the sidebar panels -->
<vbox id="sidebar-box" persist="hidden width collapsed">
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
<splitter id="sidebar-panels-splitter" collapse="after" persist="state"
onmouseup="PersistHeight();" hidden="true">
<grippy/>
@ -156,7 +159,8 @@
<iframe class="iframe-panel" flex="1*" src="about:blank"
hidden="true" collapsed="true" content="?content"/>
<iframe class="iframe-panel" flex="1*" src="about:blank"
hidden="true" collapsed="true" content="?content" type="content" context="contentAreaContextMenu"/>
hidden="true" collapsed="true" content="?content" type="content" context="contentAreaContextMenu"
tooltip="aHTMLTooltip"/>
</vbox>
</action>
</rule>