whatever happened to the small explanation window?

1 view
Skip to first unread message

Bernat Agullo Rosello

unread,
Aug 21, 2008, 2:12:29 AM8/21/08
to mo...@googlegroups.com
I'm using the last version of Moji with FF3
and I just realized that the little explanation when clilcking at the (s) or (p) or (loc) doesn't come up
A window does open, but with no text

it's just me or is that general?

thnx

Gerald Vogt

unread,
Aug 21, 2008, 3:24:00 AM8/21/08
to mo...@googlegroups.com

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

Philip Chee

unread,
Aug 21, 2008, 6:17:16 AM8/21/08
to mo...@googlegroups.com
2008/8/21 Gerald Vogt <vo...@spamcop.net>:

> 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

Gerald Vogt

unread,
Aug 22, 2008, 6:57:26 PM8/22/08
to mo...@googlegroups.com
Philip Chee wrote:
> 2008/8/21 Gerald Vogt <vo...@spamcop.net>:
>
>> 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..."

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

Philip Chee

unread,
Aug 23, 2008, 12:11:41 AM8/23/08
to mo...@googlegroups.com
2008/8/23 Gerald Vogt <vo...@spamcop.net>:

> 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

Philip Chee

unread,
Aug 23, 2008, 12:37:55 AM8/23/08
to mo...@googlegroups.com
It occurs to me that since your document is html you could
just put in your msidebar.xul:

<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

Gerald Vogt

unread,
Aug 23, 2008, 1:19:33 AM8/23/08
to mo...@googlegroups.com
Philip Chee wrote:
> 2008/8/23 Gerald Vogt <vo...@spamcop.net>:
>
>> 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.

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

Philip Chee

unread,
Aug 23, 2008, 2:07:11 AM8/23/08
to mo...@googlegroups.com
2008/8/23 Gerald Vogt <vo...@spamcop.net>:

> 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

Gerald Vogt

unread,
Aug 23, 2008, 3:10:36 AM8/23/08
to moji
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.

Bernat, Phil, can you please try the following release?

http://downloads.mozdev.org/moji/moji-0.9.6.xpi

It should show the tool tips. I have also removed the code for the pop-
ups and the links. Simply move the mouse over the abbreviations in
italics and it shows what it means.

Gerald

Philip Chee

unread,
Aug 23, 2008, 4:27:51 AM8/23/08
to mo...@googlegroups.com
2008/8/23 Gerald Vogt <vo...@spamcop.net>:

> 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

Philip Chee

unread,
Aug 23, 2008, 4:46:08 AM8/23/08
to mo...@googlegroups.com
Gerald,

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

Philip Chee

unread,
Aug 23, 2008, 4:52:21 AM8/23/08
to mo...@googlegroups.com
2008/8/23 Gerald Vogt <vo...@spamcop.net>:

> 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

Gerald Vogt

unread,
Aug 27, 2008, 8:26:46 AM8/27/08
to mo...@googlegroups.com
Philip Chee wrote:
> Gerald,
>
> 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)

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

Philip Chee

unread,
Aug 27, 2008, 9:28:01 AM8/27/08
to mo...@googlegroups.com
2008/8/27 Gerald Vogt <vo...@spamcop.net>:

> 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

Gerald Vogt

unread,
Aug 29, 2008, 10:47:11 PM8/29/08
to moji


On Aug 27, 10:28 pm, "Philip Chee" <philip.c...@gmail.com> wrote:
> 2008/8/27 Gerald Vogt <v...@spamcop.net>:
>
> > 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.

tsidebar does not work in TB 3.0b1. It installs but the sidebar does
not work. Let me know when tsidebar works for further testing...

Gerald

Philip Chee

unread,
Nov 8, 2008, 10:29:18 AM11/8/08
to mo...@googlegroups.com
2008/8/30 Gerald Vogt <vo...@spamcop.net>:

> tsidebar does not work in TB 3.0b1. It installs but the sidebar does
> not work. Let me know when tsidebar works for further testing...

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

Reply all
Reply to author
Forward
0 new messages