No context menus with Opera

Frank Steiner - April 15, 2008 - 14:26
Project:Web File Manager
Version:6.x-2.9-alpha2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed
Description

Hi,

with Opera 9.27 and Linux (cannot test in Windows) right-clicking on files or directories in the file browser doesn't show the webfm menu but the normal context menu from Opera. I have Javascript enabled, including "allow script to receive right mouse clicks", but it doesn't work. It does work with Firefox 2.0.0.13 in Linux.

Is this just my Opera, or is it a general problem with Opera in Linux? Can someone tell if it works with Opera in Windows?

This is quite bad, because Opera is our main browser here and so far we could use all drupal features with Opera. Just with webfm we stepped on this.
Unfortunately, the javascript debug box doesn't work either (pops up for a second, then disappears again), so I can't provide useful debugging output.

cu,
Frank

#1

Frank Steiner - April 18, 2008 - 13:23

Ok, I've done a little work myself after I realized that it is not just a bug but a conceptual issue. Opera doesn't support the oncontextmenu event, but this can be done by catching the mouseup event.
This page has an example where you can even bind your own context menu to the right mouse key, but unfortunately, there is a bug in Opera as you can test here. As soon as you scroll down the page with the mouse or pgdn or down arrow key, the Opera context menu appears again, together with the self-made menu.

Therefore I change the patch to open the context menu with Alt+left mouse button in (only) Opera. I just added a isOP in the browser detection and in e.g. Webfm.filerow I replace

var listener = Webfm.eventListenerAdd(eventListenerArr, this.element, "contextmenu", function(e) { if(Webfm.renameActive == false)Webfm.contextMenuObj.showContextMenu(e, dr);Webfm.stopEvent(e); });

by
if(Webfm.browser.isOP) {
   var listener = Webfm.eventListenerAdd(eventListenerArr, this.element, "mouseup", function(e) { if( e && e.button == 0 && e.altKey == true ) { if(Webfm.renameActive == false)Webfm.contextMenuObj.showContextMenu(e, dr);Webfm.stopEvent(e); }; });
  } else {
  var listener = Webfm.eventListenerAdd(eventListenerArr, this.element, "contextmenu", function(e) { if(Webfm.renameActive == false)Webfm.contextMenuObj.showContextMenu(e, dr);Webfm.stopEvent(e); });
}

To avoid the dragp&drop popup appear when Alt+left-clicking, I also added   if(!rightclick && event.altKey == false ) in Webfm.draggable.prototype.mouseButton.

Note that one should not click on the filename directly because this will open the linked file itself, so click anywhere else with Alt + left mouse button (on the symbol, above/below/left/right of the file name) to get the context menu.

I'd be glad if you would consider adding this patch because webfm without a context menu is useless for people using Opera...

AttachmentSize
contextmenu_opera.diff 3.52 KB

#2

robmilne - April 18, 2008 - 18:59

Hey thanks! I've known about the context button issue with Opera for a long time, but you know the old adage about squeeky wheels. My testing so far looks good.

#3

robmilne - April 18, 2008 - 20:09
Status:active» fixed

fixed in 5 branch only at this time

#4

Anonymous (not verified) - May 2, 2008 - 20:11
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#5

Niels Hackius - January 28, 2009 - 18:07
Title:No context menus for files with Opera/Linux» No context menus with Opera
Version:6.x-2.9-alpha1» 6.x-2.9-alpha2
Status:closed» active

Hmm, the patch works in Opera 9.63 and current version, well partly, because it also triggers the action that the link is actually supposed to do, e.g. you try to rename a folder also opens the folder.

There aren't any context menus in Opera, also in windows

#6

robmilne - January 30, 2009 - 18:56

I've got Opera 9.27 and all seems fine. Unfortunately you cannot click directly on the link when pressing the alt key or you will kick off the 'click' event. You have to click on the shaded area beside the link.

#7

Frank Steiner - January 31, 2009 - 12:32

It works with 9.63, too, but as Rob said, only when you click next to the link, not onto it. This can't be changed as far as I see because you cannot prevent Opera from taking the click on a link, just like you can't prevent it from catching the right-click...

#8

Niels Hackius - January 31, 2009 - 19:29

Lol, okay, uhm maybe there should be an option in WebFm to have links(buttons) for this?

#9

robmilne - February 1, 2009 - 15:20
Category:bug report» feature request
Status:active» postponed

That is a feature request that is down in the stack. My support of Opera is simply the application of Frank's patch.

 
 

Drupal is a registered trademark of Dries Buytaert.