|
| Javascript problem? right mouse click/context menu |
 |
Tue, 15 Apr 2008 23:16:38 +020 |
Hi,
I'm running drupal on our website, a CMS for web servers. You edit all the
stuff in the browser. Works almost great with Opera, but there are some modules
like whe webfm module (if someone knows drupal ;-)) that define context
menus for some elements in the web page editor. I.e., you should right-click
on e.g. a link and get a drupal-specific context menu, done by Javascript,
instead of the normal Opera context menu for web pages.
Now this context menu works fine with IE and Firefox, but Opera just shows
its normal context menu (with Back, Forward, View Source, Bookmark page etc.)
instead of the javascript menu. These menus are essential and the webfm
module is unusable without those menus.
I have enabled the "receive right-mouse clicks" in the Javascript
options,
but that doesn't change anything.
Anything known about this? Is that related with the fact that all those
"prevent right-mouse click to avoid image download from my webpage"
scripts don't work in Opera?
Is there any chance to make the right mouse key be passed to the script?
I thought "receive right-mouse clicks" option was exactly for that...
Doesn't work with 9.27 and 9.50, Windows and Linux.
cu,
Frank
--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
|
| Post Reply
|
| Re: Javascript problem? right mouse click/context menu |
 |
Tue, 15 Apr 2008 23:25:04 +020 |
Ok, here is a easy-to-test example:
http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm
Gives a context menu when right-clicking anywhere in the page with Firefox,
but not with Opera (cited from a nice page about menu problems in Opera:
http://www.scss.com.au/family/andrew/opera/compatibility/menus/)
So is this a bug in Opera? Just looks like the right-click is not passed
to the script but still caught from Opera itself.
cu,
Frank
--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
|
| Post Reply
|
| Re: Javascript problem? right mouse click/context menu |
 |
Wed, 16 Apr 2008 02:46:30 +020 |
Op Tue, 15 Apr 2008 23:16:38 +0200 schreef Frank Steiner
<fsteiner-news@bio.ifi.lmu.de>:
..
> I have enabled the "receive right-mouse clicks" in the Javascript
> options,
> but that doesn't change anything.
>
> Anything known about this? Is that related with the fact that all those
> "prevent right-mouse click to avoid image download from my
webpage"
> scripts don't work in Opera?
Opera doesn't support the javascript event 'oncontextmenu' which these
scripts use. Opera does support 'onrightclick', but as you see that is
disabled by default. I've been told in the past by our developers that
implementing support is not as trivial as making 'oncontextmenu' an alias
for 'onrightclick', the former apparently does a lot more.
--
Rijk van Geijtenbeek
Opera Software ASA, Documentation & QA
Tweak: http://my.opera.com/Rijk/blog/
"The most common way to get usability wrong is to listen to what users
|
| Post Reply
|
| Re: Javascript problem? right mouse click/context menu |
 |
Wed, 16 Apr 2008 09:08:17 +020 |
Rijk van Geijtenbeek wrote
> Opera doesn't support the javascript event 'oncontextmenu' which these
> scripts use. Opera does support 'onrightclick', but as you see that is
> disabled by default. I've been told in the past by our developers that
> implementing support is not as trivial as making 'oncontextmenu' an alias
> for 'onrightclick', the former apparently does a lot more.
Thanks for that hint, I will try to work with it!
--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
|
| Post Reply
|
| Re: Javascript problem? right mouse click/context menu |
 |
Wed, 16 Apr 2008 13:51:13 +020 |
Hmm, I didn't have any success with defining any action by
document.onrightclick.
The only way I was able to trigger an event by the right mouse button was by
sth. like
addEventListener('mouseup',function(e){
if( e && e.button == 2 ){
document.write('a');
return false;
}
},true);
which writes an "a" to the screen when klicking the right mouse
button.
Do you have a snippet how onrightclick is supposed to work?
cu,
Frank
--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
|
| Post Reply
|
|
|
|
|
|
|
|
|
|