зеркало из https://github.com/mozilla/pjs.git
60245 - no tooltips for "title" attribute in sidebar. r=sgehani sr=hewitt
This commit is contained in:
Родитель
4f87041eb7
Коммит
2fa25bdbf4
|
@ -199,3 +199,47 @@ function getMarkupDocumentViewer()
|
||||||
{
|
{
|
||||||
return getBrowser().markupDocumentViewer;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -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.
|
* Use Stylesheet functions.
|
||||||
* Written by Tim Hill (bug 6782)
|
* Written by Tim Hill (bug 6782)
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
<overlay id="sidebarOverlay"
|
<overlay id="sidebarOverlay"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
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();"/>
|
<command id="toggleSidebar" oncommand="SidebarShowHide();"/>
|
||||||
<key id="showHideSidebar" keycode="VK_F9" command="toggleSidebar"/>
|
<key id="showHideSidebar" keycode="VK_F9" command="toggleSidebar"/>
|
||||||
|
@ -57,6 +59,7 @@
|
||||||
|
|
||||||
<!-- Overlay the sidebar panels -->
|
<!-- Overlay the sidebar panels -->
|
||||||
<vbox id="sidebar-box" persist="hidden width collapsed">
|
<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"
|
<splitter id="sidebar-panels-splitter" collapse="after" persist="state"
|
||||||
onmouseup="PersistHeight();" hidden="true">
|
onmouseup="PersistHeight();" hidden="true">
|
||||||
<grippy/>
|
<grippy/>
|
||||||
|
@ -156,7 +159,8 @@
|
||||||
<iframe class="iframe-panel" flex="1*" src="about:blank"
|
<iframe class="iframe-panel" flex="1*" src="about:blank"
|
||||||
hidden="true" collapsed="true" content="?content"/>
|
hidden="true" collapsed="true" content="?content"/>
|
||||||
<iframe class="iframe-panel" flex="1*" src="about:blank"
|
<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>
|
</vbox>
|
||||||
</action>
|
</action>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче