The error console shows:
Error: uncaught exception: [Exception... "Security error" code: "1000"
nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location:
"javascript:newWin=window.open("","n","menubar=no,width=300,height=150");newWin.document.write("<center>noun%20(common)%20(futsuumeishi)</center>");
Line: 1"]
I'll have to find out what the problem is...
Gerald
> Error: uncaught exception: [Exception... "Security error" code: "1000"
> nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location:
> "javascript:newWin=window.open("","n","menubar=no,width=300,height=150");newWin.document.write("<center>noun%20(common)%20(futsuumeishi)</center>");
> Line: 1"]
> I'll have to find out what the problem is...
This is Firefox 3 right? They've increased the security restrictions in
this version of Firefox. There are two things you could try:
1. newWin.document.innerHTML = "<center>noun..."
2. Use window.openDialog(..."dialog=no,menubar=no,width=300,height=150" );
Phil
This replaces the contents of the sidebar HTML window (where the
dictionary contents is shown).
> 2. Use window.openDialog(..."dialog=no,menubar=no,width=300,height=150" );
This does not work at all.
I have also tried window.open("data:...",...) putting everything into
URL of the open command. This correctly opens a window containing the
explanation. However, it also replaces the contents of the sidebar HTML
window with "[object window]".
It seems to me that "window.open" now always has side-effects on the
window on which the open function is called.
I don't understand why they still don't show tool tips in the sidebar
window. The links have a title argument set up. If you export the
results as HTML you'll see how it works. So it's is not a problem in the
HTML code. I have compared the computed style in dom inspector but both
windows are basically the same. I cannot find a place to enable or
disable the tool tips in the style sheet. I would prefer to get rid of
this pop-up window in favor of proper tool tips. But they don't work...
Gerald
> I don't understand why they still don't show tool tips in the sidebar
> window. The links have a title argument set up. If you export the
> results as HTML you'll see how it works. So it's is not a problem in the
> HTML code. I have compared the computed style in dom inspector but both
> windows are basically the same. I cannot find a place to enable or
> disable the tool tips in the style sheet. I would prefer to get rid of
> this pop-up window in favor of proper tool tips. But they don't work...
Oh, you want a "rich" tooltip right? Why didn't you say so. In your
msidebar.xul you need a <tooltip> element e.g.
<tooltip id="xsbBookmarksTooltip"
noautohide="true"
orient="vertical"
onpopupshowing="return xsbBookmarks.FillInBMTooltip(event, this)">
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row id="xsbBmTipNameBox" hidden="true">
<hbox pack="end">
<label id="xsbBmTipNameLabel"
value="&treecol.name.label;:"
class="xsb-tiplabel-left"/>
</hbox>
<label id="xsbBmTipNameValue"
value=""
class="xsb-tiplabel-right"/>
</row>
<row id="xsbBmTipLocBox" hidden="true">
<hbox pack="end">
<label id="xsbBmTipLocLabel"
value="&treecol.url.label;:"
class="xsb-tiplabel-left"/>
</hbox>
<label id="xsbBmTipLocValue"
value=""
class="xsb-tiplabel-right"/>
</row>
<row id="xsbBmTipDescBox" hidden="true">
<hbox pack="end">
<label id="xsbBmTipDescLabel"
value="&treecol.description.label;:"
class="xsb-tiplabel-left"/>
</hbox>
<label id="xsbBmTipDescValue"
value=""
class="xsb-tiplabel-right"/>
</row>
</rows>
</grid>
</tooltip>
Then you need a FillInToolTip() function e.g.
FillInBMTooltip : function (aEvent, target) {
const NCURI = "http://home.netscape.com/NC-rdf#";
var tree = gBookmarksView.tree;
var curRow = tree.treeBoxObject.getRowAt(aEvent.clientX, aEvent.clientY);
var res = tree.builderView.getResourceAtIndex(curRow);
var current = new Array;
current.type = BookmarksUtils.resolveType(res);
current.name = "";
current.location = "";
current.description = "";
gTipBox.nameBox.hidden = true;
gTipBox.locBox.hidden = true;
gTipBox.descBox.hidden = true;
gTipBox.nameLabel.value = "";
gTipBox.locLabel.value = "";
gTipBox.descLabel.value = "";
current.name = BMDS.GetTarget(res,
RDF.GetResource(NCURI + "Name"),
true);
if (current.name) {
gTipBox.nameLabel.value = current.name
.QueryInterface(Ci.nsIRDFLiteral).Value;
gTipBox.nameBox.hidden = false;
}
if (current.type == "Bookmark") {
current.location = BMDS.GetTarget(res,
RDF.GetResource(NCURI + "URL"),
true);
if (current.location) {
gTipBox.locLabel.value = current.location
.QueryInterface(Ci.nsIRDFLiteral).Value;
gTipBox.locBox.hidden = false;
}
}
if (current.type == "Bookmark" ||
current.type == "Folder" ||
current.type == "FolderGroup" ||
current.type == "PersonalToolbarFolder" ) {
current.description = BMDS.GetTarget(res,
RDF.GetResource(NCURI +
"Description"),
true);
if (current.description) {
gTipBox.descLabel.value = current.description
.QueryInterface(Ci.nsIRDFLiteral).Value;
gTipBox.descBox.hidden = false;
}
}
if (gTipBox.nameBox.hidden &&
gTipBox.locBox.hidden &&
gTipBox.descBox.hidden) {
return false;
}
return true;
},
Then you make your (n), (P) etc items have a tooltip attribute
e.g.
<menuitem tooltip="xsbBookmarksTooltip">
Mind you this is all in XUL. Since you are using a html doc,
you might have to adapt this code.
Phil
<tooltip id="aHTMLTooltip" onpopupshowing="return
FillInHTMLTooltip(document.tooltipNode);"/>
Then add the tooltip attribute to your <iframe> e.g.
<iframe ... tooltip="aHTMLTooltip"/>
You can copy the FillInHTMLTooltip() from the Firefox
browser.js file.
Phil
No. I just want a simple plain text tooltip containing what the pop-up
window would contain. I don't really like the pop-up window as it is
cumbersome to close it again. All I want is to show the explanation of
each tag, e.g. "noun" for "(n)". A tool tip would be the best in my
opinion. The problem is only that Firefox does not show tool tips for
HTML code inside an iframe element. The current A links have title
attributes set. Those are shown as tool tip in standard browser windows
but not in the XUL iframe element. The iframe HTML does not show any
tooltips.
Maybe it is necessary to convert the whole iframe into xul elements...
Gerald
> No. I just want a simple plain text tooltip containing what the pop-up
> window would contain. I don't really like the pop-up window as it is
> cumbersome to close it again. All I want is to show the explanation of
> each tag, e.g. "noun" for "(n)". A tool tip would be the best in my
> opinion. The problem is only that Firefox does not show tool tips for
> HTML code inside an iframe element. The current A links have title
> attributes set. Those are shown as tool tip in standard browser windows
> but not in the XUL iframe element. The iframe HTML does not show any
> tooltips.
Ok, try converting your <iframe> to a <browser type="content">
<browser id="kanjiframe"
src="chrome://moji/locale/welcome.html"
type="content"
flex="1"
tooltip="aHTMLTooltip"/>
<tooltip id="aHTMLTooltip"
onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
....
function FillInHTMLTooltip() { ... copy code from browser.js ... }
Phil
> http://downloads.mozdev.org/moji/moji-0.9.6.xpi
Seems to be working. Of course I can't vouch for the accuracy of the
tooltips themselves.
Phil
One other thing, if you are going to set the maxVersion to 3.0.* for
Firefox, could you increase the maxVersions too for:
Flock 2.0.* (AMO doesn't care about Flock)
Thunderbird 3.0.* (AMO: 3.0b1pre)
SeaMonkey 2.0.* (AMO: 2.0a1)
Also some (most?) of the dictionaries don't contain appversion data
for SeaMonkey.
Thanks awfully.
Phil
> Thanks Phil, now I have managed to get the tool tips shown. I have
> modified the function to simply check for the title attribute and show
> that as tool tip. If it is not present, nothing is shown. The tooltip
> is just a little bit off/too low but that does not really bother me at
> the moment.
This might help Tooltip->Attributes->position
<http://developer.mozilla.org/En/XUL/Tooltip#a-popup.position>
Phil
O.K. I have set 2.0.* for SeaMonkey and 3.0.* for Thunderbird in all
dictionaries. I have made sure that SeaMonkey and Flock are included in
all.
I have also uploaded a new moji xpi to AMO. I have used the latest TB
and SM version for that upload as they don't accept 3.0.*/2.0.*.
Gerald
> O.K. I have set 2.0.* for SeaMonkey and 3.0.* for Thunderbird in all
> dictionaries. I have made sure that SeaMonkey and Flock are included in
> all.
Thanks!
Phil
I've just updated xSidebar 0.4-unstable (0.5a) for Shredder. This
should now work in Thunderbird 3.0a3 and in current nightlies.
<http://downloads.mozdev.org/xsidebar/xsidebarTIG-0.4.unstable.xpi>
Phil