Fix b=170499 move visitLink() to toolkit for about dialog and thunderbird

This commit is contained in:
noririty%jcom.home.ne.jp 2003-10-19 15:18:15 +00:00
Родитель 5e08f7bdac
Коммит 5d94067160
3 изменённых файлов: 13 добавлений и 16 удалений

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

@ -54,6 +54,7 @@
title="&aboutDialog.title;"
style="width: 299px">
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript">
<![CDATA[
function onLoad() {
@ -74,11 +75,8 @@
<spacer flex="1"/>
<textbox id="userAgent" multiline="true" readonly="true" cols="60" style="height: 5.1em"/>
<spacer flex="1"/>
/* XXXBlake This is a workaround. I find that if I try to use href and I open
About as a modal dialog, a new browser window opens when I click the link
but the page doesn't load in it. */
<html:a onclick="window.openDialog('chrome://browser/content', 'Mozilla Firebird', 'chrome,all,dialog=no', '&copyrightLink;');"
href="" id="copyright"
<html:a onclick="visitLink(event);"
href="" id="copyright" link="&copyrightLink;"
style="display: block;">&copyright;</html:a>
<spacer flex="1"/>
</vbox>

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

@ -15,6 +15,7 @@
ondialogcancel="return hPrefWindow.onCancel(event);"
persist="screenX screenY">
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script>
<![CDATA[
@ -55,17 +56,6 @@
hPrefWindow.switchPage(newURL, "");
}
function visitLink(aEvent)
{
var node = aEvent.target;
while (node.nodeType != Node.ELEMENT_NODE)
node = node.parentNode;
var url = node.getAttribute("link");
if (url != "")
window.opener.openNewWindowWith(url, null, false);
}
]]>
</script>

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

@ -124,6 +124,15 @@ function goOnEvent(node, event)
}
}
function visitLink(aEvent) {
var node = aEvent.target;
while (node.nodeType != Node.ELEMENT_NODE)
node = node.parentNode;
var url = node.getAttribute("link");
if (url != "")
window.opener.openNewWindowWith(url, null, false);
}
function isValidLeftClick(aEvent, aName)
{
return (aEvent.button == 0 && aEvent.originalTarget.localName == aName);