473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Replace Contextmenu with new menu

Hi all,

I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html

It works nice in MSIE, but on Netscape (and probable other browsers) it
stays on the same place (does not "open'' where the mouse is). And the links
do not work when you click on them.

If anyone has sugestions on how to improve it, please let me know.

Thanks,
Wouter
Jul 20 '05 #1
52 4537
DJ WIce wrote:
Hi all,

I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html

It works nice in MSIE, but on Netscape (and probable other browsers) it
stays on the same place (does not "open'' where the mouse is). And the links
do not work when you click on them.

If anyone has sugestions on how to improve it, please let me know.


Suggestion: Trash it and stop screwing with my mouse.

--
Randy

Jul 20 '05 #2
: Suggestion: Trash it and stop screwing with my mouse.

Sugestion: look at what you see before complaining; click the option on the
bottom of the menu...
And now try to help me solve a problem that is not related with your mouse.
Help me make the code work; the stylesheet does not look equal in all
browsers. NN screws it up.
I just made it to test what's possible, you seem to love staying where you
are?

Wouter
Jul 20 '05 #3
"DJ WIce" <co*********@djwice.com> wrote:
I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html

It works nice in MSIE, but on Netscape (and probable other browsers) it
stays on the same place (does not "open'' where the mouse is). And the links
do not work when you click on them.


Which Netscape isn't it working in? It works fine in NN 7.1 and 6.23
(both WinXP).

The page doesn't even load in NN4.8 (hangs), but you weren't actually
expecting anything remotely fancy to work in that were you?

It doesn't work at all in Opera 7.23 (even when I set my preference to
allow JavaScript to access the right mouse click, which I normally
don't allow. Can any Opera users remember whether that's off or on by
default?)

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4
"DJ WIce" <co*********@djwice.com> writes:
: Suggestion: Trash it and stop screwing with my mouse.

Sugestion: look at what you see before complaining; click the option on the
bottom of the menu...
Didn't see a thing. I use Opera :) Anyway, I did check in IE and
Mozilla ...

Looks nice, but I am also in the camp who things reimplementing the
browser interface is a bad idea. And why do you call it "more nice
looking"? I like the current menu, and it fits my theme.
And now try to help me solve a problem that is not related with your mouse.
Help me make the code work; the stylesheet does not look equal in all
browsers. NN screws it up.


As a bug report, "screws it up" is pretty useless. Which NN are we
talking about (I'm pretty sure it's not Netscape Navigator 4, because
it won't even load the page).

I don't see any serious difference between Mozilla and IE 6 (not one that
would fit "screws it up" at least).

It is optimistic to assume that two browsers show a page exactly
alike. For one thing, the font will probably be different, and IE is
known for its bad CSS implementation. So, if you have any particular
CSS problems, you need to say what it is (and it would be smarter to
ask in a CSS group ... which I only now notice that you do. When
you crosspost, remember to set the Followup-To header!!!)

The color you use for the background, lightgray, is not a standard
CSS color, and is not understood by IE

Neither allows me to pop the menu down again when it is up, except by
chosing an entry.

Don't use javascript:-URIs (like "javascript:window.print()"). Use
onclick attributes instead. <URL:http://jibbering.com/faq/#FAQ4_24>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5
Hi Steve,

Since this is a posting in more that one newsgroup I did fix a bit op for
NN.
So the problem now with NN is stylesheet related. I hope you can help:

The buttons do have 2 problems:

1) in MSIE the

<a href="link" style="width:150px;border:1px solid white;"><img
src="image.gif" height="16"> text</a>

works. E.g. the link is 150 pixels in width and has a border around the 16
pixels
height of the image.

Netscape (7) says:
I ignor the width:150px and I do not care how heigh the image is;
I just draw it around the image and the link text but at the text height
(12px).

: Which Netscape isn't it working in? It works fine in NN 7.1 and 6.23
: (both WinXP).
Thanks for testing NN 6.23, I did test it on 7.0 only.

: The page doesn't even load in NN4.8 (hangs), but you weren't actually
: expecting anything remotely fancy to work in that were you?
I do not use layers probable that's the problem, right? NN4.8 does not
handle div tags?
: It doesn't work at all in Opera 7.23 (even when I set my preference to
: allow JavaScript to access the right mouse click, which I normally
: don't allow. Can any Opera users remember whether that's off or on by
: default?)
Hmm.. I assume Opera did not implement the oncontextmenu event.
I need to know how to test if it's implemented or not, then I can handle
those who do not with right-click events.
I need to separate these because Netscape 7 (and maybe lower) gives a
trigger to the click-event at the same time to the oncontextmenu event, MSIE
makes the choice only to trigger the rightclick event when both are active.
Thanks for your reply and testing!
Wouter
Jul 20 '05 #6
On Thu, 15 Jan 2004 23:20:07 +0100, DJ WIce <co*********@djwice.com> wrote:
Help me make the code work; the stylesheet does not look equal in all
browsers. NN screws it up.


In Opera I get the default menu, thank goodness.

Don't know crap about scripting, but thought you'd appreciate a little
extra info.
Jul 20 '05 #7
"DJ WIce" <co*********@djwice.com> wrote:
The buttons do have 2 problems:

1) in MSIE the

<a href="link" style="width:150px;border:1px solid white;"><img
src="image.gif" height="16"> text</a>

works. E.g. the link is 150 pixels in width and has a border around the 16
pixels height of the image.

Netscape (7) says:
I ignor the width:150px and I do not care how heigh the image is;
I just draw it around the image and the link text but at the text height
(12px).
Netscape is applying your styles correctly, IE is not.
You can not set the width property for inline elements, and the height
of an inline element is determined by the line-height property, not by
any images that it may contain. This is already well documented, see
for example: http://www.hut.fi/u/hsivonen/standar...l#lineboxmodel

Adding display: block to the styles for the <a> elements would be a
first step. Other values may need to be tweaked as a consequence.
: The page doesn't even load in NN4.8 (hangs), but you weren't actually
: expecting anything remotely fancy to work in that were you?

I do not use layers probable that's the problem, right? NN4.8 does not
handle div tags?
NN4 handles div tags just fine. It just has a totally different
document object model and so you can't manipulate them, or anything
else for that matter, in the same way as more modern browsers.
: It doesn't work at all in Opera 7.23 (even when I set my preference to
: allow JavaScript to access the right mouse click, which I normally
: don't allow. Can any Opera users remember whether that's off or on by
: default?)

Hmm.. I assume Opera did not implement the oncontextmenu event.
I need to know how to test if it's implemented or not, then I can handle
those who do not with right-click events.


Opera didn't throw up an error message, so I wouldn't bother changing
anything. Most Opera users are happy with the fact that their browser
is less open to interference like this. Leave them happy.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #8
: ... which I only now notice that you do. When
: you crosspost, remember to set the Followup-To header!!!)

Oh, sorry, how do I do that?
I though putting all in one field would do the trick (it send at once).
I use MSOE 6.

The "screw up" of Netscape 7.0 is that I link a image and a text, give the
link a border and the border goes trough the image (see the refresh option).
Next to that it does not react on the "width" I set in the style of the
link.
I prefer to have the link 150px width.
: The color you use for the background, lightgray, is not a standard
: CSS color, and is not understood by IE
Oh? I though so, it shows me lightgray in IE6. So it's not one of the 216
colors..
I'll change it to a color code, thanks. #ccc is about the same.
: Neither allows me to pop the menu down again when it is up, except by
: chosing an entry.
It does when you click next to the menu if I'm correct.
Oh.. oeps.. did disable the mousedown to get it to work in NN 7..
Thanks fixed that with onlick event.
: Don't use javascript:-URIs (like "javascript:window.print()"). Use
: onclick attributes instead. <URL:http://jibbering.com/faq/#FAQ4_24>
Thanks!
What other html tag does support hover events?
So I can put it in the stylesheet:

tag:hover{..}

How funny; MSIE 6 does not support hover for span.. and NN 7.0 does..

Thanks you did help me a lot!
Wouter
Jul 20 '05 #9
DJ WIce wrote:

I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html

If anyone has sugestions on how to improve it, please let me know.


You assume all your visitors are mouse users? The browser's inbuilt
context menus are accessible via keyboard. Yours is not.

BTW, yours is not really a context menu at all, since the menu items
don't change depending on the element (link vs image vs text). Why
would someone prefer using this when the browser context menus are so
much more functional? You are only going to annoy your visitors, you know.

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #10
DJ WIce <co*********@djwice.com> wrote:
If anyone has sugestions on how to improve it, please let me know.


Having the "Disable this" text doesn't make it okay to toy with the user's
browser. What if I wanted to copy and paste? That's not even on your menu.

My menu was made to look good with my browser, not with your site.
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com
Jul 20 '05 #11
"DJ WIce" <co*********@djwice.com> writes:
: ... which I only now notice that you do. When
: you crosspost, remember to set the Followup-To header!!!)

Oh, sorry, how do I do that?
I though putting all in one field would do the trick (it send at once).
I use MSOE 6.
It did the trick of sending to all the groups. However, when one does that,
it is highly recommended (to the point where people get angry if you don't)
to specify which group followups should go to. Since later posters might
not notice the cross posting at all, but the author is aware of it, it is
his responsibility to prevent long threads where people doesn't realize
that they are writing to people in different groups.

As for how, I don't know how it is done in MSOE. I guess there is an
option to show more header lines. The one you need to fill in is
called "Followup-To". A good newsreader should query you for the
followup whenever you crosspost.
The "screw up" of Netscape 7.0 is that I link a image and a text, give the
link a border and the border goes trough the image (see the refresh option).
Next to that it does not react on the "width" I set in the style of the
link.
I prefer to have the link 150px width.
As other people have pointed out, Netscape is doing the right thing and IE
is failing to understand CSS 2 (as usual).
Oh? I though so, it shows me lightgray in IE6. So it's not one of the 216
colors..
It didn't before, but it does now. Curious. But still, it is not one
of the official 16 named CSS 2 colors (really HTML 4 colors, and there
are 17 in CSS 2.1 - they added "orange").
<URL:http://www.w3.org/TR/CSS21/syndata.html#value-def-color>

Some browsers allow more color names (why not) and they usually take
the standard X-windows color names (which are not all very logically
names). I guess lightgray is one of those.
I'll change it to a color code, thanks. #ccc is about the same.
You could try "silver" (#c0c0c0) if you want to use a named color.
: Don't use javascript:-URIs (like "javascript:window.print()"). Use
: onclick attributes instead. <URL:http://jibbering.com/faq/#FAQ4_24>
Thanks!
What other html tag does support hover events?
In IE, only A elements (CSS 2 allows it on all elements, but as I said
before ... IE and CSS 2 are not very compatible).
You should still use the A element, just use an onclick handler:
Instead of
<a href="javascript:somecode()"> ... </a>
do:
<a href="pageRequiresJS.html" onclick="somecode();return false"> ... </a>
Then you can use the link to tell people that your page requires
Javascript, so people without it will know why it fails instead of
just nothing happening.

Read the link I gave! It's a good FAQ.
So I can put it in the stylesheet: tag:hover{..}

How funny; MSIE 6 does not support hover for span.. and NN 7.0 does..


IE sucks. 'nuff said.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #12
kchayka <kc*********@sihope.com> writes:
You assume all your visitors are mouse users? The browser's inbuilt
context menus are accessible via keyboard. Yours is not.


Actually it is ... a little. Pressing the "context menu" button and using tab,
I can go through the links in the menu in both IE and Mozilla.

It's not great, though (I would prefer arrow keys to navigate)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #13

: It did the trick of sending to all the groups. However, when one does
that,
: it is highly recommended ... to specify which groups
: followups should go to.
I understand.

: I guess there is an option to show more header lines ..
Ah I see; View => Check "All headers".
Thanks, I did not know that I needed to search such in the header view
section!
Thanks!
: It didn't before, but it does now. Curious. But still, it is not one
: of the official 16 named CSS 2 colors (really HTML 4 colors, and there
: are 17 in CSS 2.1 - they added "orange").
: <URL:http://www.w3.org/TR/CSS21/syndata.html#value-def-color>
Thanks!
I used names to instead of colorcodes because I though it would be more
compatible...
But now I think I'll go back to RGB :-)
: > I'll change it to a color code, thanks. #ccc is about the same.
: You could try "silver" (#c0c0c0) if you want to use a named color.
Do you know why #ccc and #cccccc exists? I mean what is prefered?

: > What other html tag does support hover events?
: In IE, only A elements ...
Yeah even worse: only on A elements containing href..

: <a href="pageRequiresJS.html" onclick="somecode();return false"> ... </a>
: Then you can use the link to tell people that your page requires
: Javascript, so people without it will know why it fails instead of
: just nothing happening.
Ah, yeah, an pop up (alert) would not work and proble target="_blank" does
not make it more nice :)
I'll work on it, it's now a #, scrolling up for users without JS, right?
: Read the link I gave! It's a good FAQ.
I did partly, block worked great.. now only I have some space to remove..

Wouter
Jul 20 '05 #14
"DJ WIce" <co*********@djwice.com> writes:
Do you know why #ccc and #cccccc exists? I mean what is prefered?
They are completely equivalent, and neither is prefererred. Use
whatever you like better. The short notation is probably just to
save space.
Yeah even worse: only on A elements containing href.. Ick.
I'll work on it, it's now a #, scrolling up for users without JS, right?


Or down. Or reloading the page. That depends on the browser.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #15
: You assume all your visitors are mouse users?
No.

: The browser's inbuilt
: context menus are accessible via keyboard. Yours is not.
Thanks for the tip, I'll focus the first link.

: BTW, yours is not really a context menu at all, since the menu items
: don't change depending on the element (link vs image vs text).
Tha's just a temp. problem, after some tips in this group I tried to change
from <a href="javascrip:.."> to <a onclick="..">
But MSIE then does not support hover style. So I did put in the href="#".

: You are only going to annoy your visitors, you know.
I'll try to make it smaller than the original one (no disabled options that
do show) and add icons.
Just an other thing one can design together with the style of their site.
Like most new things it's hard for the first to change :-)

Wouter
Jul 20 '05 #16
: Having the "Disable this" text doesn't make it okay to toy with the user's
: browser. What if I wanted to copy and paste? That's not even on your menu.
I'm now just working on the scripting. And getting it to work like to normal
menu.
When selection is done I can disable the menu, that a nice suggestion!
Thanks.
: My menu was made to look good with my browser, not with your site.
Yeah, and what you are viewing is my site ;-)

Wouter

Jul 20 '05 #17
On Fri, 16 Jan 2004 01:24:39 +0100, Lasse Reichstein Nielsen
<lr*@hotpop.com> wrote:
"DJ WIce" <co*********@djwice.com> writes:
Do you know why #ccc and #cccccc exists? I mean what is prefered?


They are completely equivalent, and neither is prefererred. Use
whatever you like better. The short notation is probably just to
save space.


Not quite true: all #rgb codes can be represented with the #rrggbb format,
but the reverse is not true. The expanded format allows for the
specification of more colours.

There are probably two forms due to the evolution in monitor colour
capabilities[1].

Mike
[1] Obvious speculation.

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #18
DJ WIce <co*********@djwice.com> wrote:
I'm now just working on the scripting. And getting it to work like to
normal menu.


What is the point of putting in so much effort into a feature that's already
implemented in browsers?
My menu was made to look good with my browser, not with your site.

Yeah, and what you are viewing is my site ;-)


I came to your site for its content. Your job as an author is to provide
that content in an organized fashion with proper structure, both in your
code and in site navigation. It is *not* your job to alter my browser
preferences or interfere in anyway with the normal operation of my browser.
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com
Jul 20 '05 #19
DJ WIce <co*********@djwice.com> wrote:
I'll try to make it smaller than the original one (no disabled
options that do show) and add icons.
Just an other thing one can design together with the style of their
site. Like most new things it's hard for the first to change :-)


First of all, you're not changing it, you're replacing it, and doing a poor
job. Second, if the context menu was meant to accept style suggestions,
there would be a way to do so with simple CSS. Third, you don't know what's
on the user's context menu (it's not the same for all operating systems and
browsers) and you can't replicate the features they're expecting.
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com
Jul 20 '05 #20
: First of all, you're not changing it, you're replacing it, and doing a
poor
: job.
That's just a mater of opinion. If I wanted that your opinion on me
replacing the menu, I would have gone to alt.html.critique.

: Second, if the context menu was meant to accept style suggestions,
: there would be a way to do so with simple CSS.
Sorry, this is a non argument. If this argument would hold there would not
have been CSS 2 and worse: you would never ever have phoned your
wife/girlfriend/friends. Simply because a phone was not intended to use it
like that when it was designed.
: Third, you don't know what's on the user's context menu (it's not the same
for all operating systems and
: browsers) and you can't replicate the features they're expecting.
Maybe I can make features that they do not have in that menu?
Maybe this is just a test case for me, testing what is possible?

Do you know MSIE accepts that if you press key x that if tell MSIE that it
was a Q it beleves me?
Code:

document.onkeydown = function(e)
{
if (document.all)
{
var kC = event.keyCode;
switch(kC)
{
case 40 : /* down */; event.keyCode=9; return true;
default : return true;
}
}
}
Now tell me, was that inteded when you pressed the down arrow? That your
browser thinks it's a TAB?
No? Well MSIE accepts it that I define event.keyCode.
By the way do you know how I can do this for Shift+Tab, so I can replace
arrow up?
Wouter
Jul 20 '05 #21
: >> My menu was made to look good with my browser, not with your site.
: > Yeah, and what you are viewing is my site ;-)
:
: I came to your site for its content. Your job as an author is to provide
: that content in an organized fashion with proper structure, both in your
: code and in site navigation.
Yes, and here is a definition part that's your discussion point:

site navigation.

I think that includes all the things you can do with my website.
Your opinion is that your browser interface is perfect.
I'm not always convinced all people would think that after they seen some
new.

Internet was never intended to have banners and commercial advertisements.
But it's the one reason why it still exists in this lange scale; they pay
the high way.
(Even though I don't like them on websites or worse in e-mail).
: It is *not* your job to alter my browser preferences or
: interfere in anyway with the normal operation of my browser.
I know, and I will never do that. If you have a browser that does allow
interfearance.. why do you use it?
You just talked about your browser being exactly like you want it?
Ciao and don't be to angry, don't try to find the sence of it. I'm just
finding the limit of the technological posibilities. Nothing more, nothing
less.
Wouter
Jul 20 '05 #22
DJ WIce wrote:

<--snip-->

Do you know MSIE accepts that if you press key x that if tell MSIE that it
was a Q it beleves me?
Code:

document.onkeydown = function(e)
{
if (document.all)

<--snip-->

Just a side note, and an FYI one. MSIE is not the only browser that can
pass that test. Opera, in IE spoof mode, and several other browsers
emulate the document.all (pass the test).
if (document.all &! document.layers &! window.opera){
alert('I think you are using MSIE but I could still be wrong')
}

the !window.opera excludes Opera.
the !document.layers excludes a browser (the name eludes me, Jim Ley
named it once for me) that supports both document.all and document.layers.

--
Randy

Jul 20 '05 #23
DJ WIce <co*********@djwice.com> wrote:
I think that includes all the things you can do with my website.
Your opinion is that your browser interface is perfect.
I'm not always convinced all people would think that after they seen
some new.
And once they leave your site, will they ever see your navigation again?
Does it even matter if they like it if they can never use it?
It is *not* your job to alter my browser preferences or
interfere in anyway with the normal operation of my browser.

I know, and I will never do that.


When I right-clicked on your page and saw a menu other than my browser's and
without the features I wanted, then you interfered with my browser.
If you have a browser that does
allow interfearance.. why do you use it?
If, in this case, intereference means JavaScript, than no, I don't allow it.
I turn it off unless I'm testing a page like yours or some site was poorly
designed to require it.

JavaScript, while not necessarily a bad idea, was horribly abused by the
"developers" at Microsoft and by authors who think they should (or even can)
have ultimate control over another's browser.
You just talked about your browser being exactly like you want it?


Yep, that's what Edit > Preferences is for.
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com
Jul 20 '05 #24
DJ WIce wrote:
: First of all, you're not changing it, you're replacing it, and doing a
: poor job.
That's just a mater of opinion. If I wanted that your opinion on me
replacing the menu, I would have gone to alt.html.critique.
Here's a heads-up for ya - you'll most likely get roasted in
alt.html.critique for trying to mess with the user's browser. ;)
: you can't replicate the features they're expecting.
Maybe I can make features that they do not have in that menu?
A user is accustomed to having their context menus work the same
regardless of what web site they are on. You are trying to make it
different. This does not help the user at all, but will only confuse or
annoy them.
Maybe this is just a test case for me, testing what is possible?
Just because you can, doesn't mean you should. If you care about your
users, you won't mess around with their UI.
Do you know MSIE accepts that if you press key x that if tell MSIE that it
was a Q it beleves me?


And what if the visitor isn't using IE?

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #25
DJ WIce wrote:

I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html
One which fails to work as advertised in Mozilla. "Add to favorites"
does exactly nothing. And how could it, since "favorites" is
Microsoft-specific. So what good is the script?
It works nice in MSIE
....for which it was obviously designed...
but on Netscape (and probable other browsers) it
stays on the same place (does not "open'' where the mouse is).
I'm not sure what you mean. Using Mozilla 1.3/Win2k, the context menu
pops up where the normal one would, and looks all pretty and everything.
And the links do not work when you click on them.
back, forward, refresh, view source, and use standard menu all work in
Mozilla. I didn't try print, so I cannot say what happens with that
one. Add to favorites does not work (as I said above). Neither does
"make home page."

Trying to make HTML a programming interface (target="_new" anyone?) is
fraught with problems. Using javascript as an end run to hijack the
browser is only going to introduce the same issues.
If anyone has sugestions on how to improve it, please let me know.


For Mozilla? You cannot make it fully functional, that's for sure.

The menu looks quite nice, and may have some very elegant code behind
it. But I'm afraid there's no way to improve it for my preferred
browser. And even in MSIE, it's terrible in terms of usability for the
context menu to change from site to site, just like it's terrible for
the fixed menus to change. The best thing you could do for the web is
drop the idea.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #26
"Randy Webb" <hi************@aol.com> wrote in message
news:K-********************@comcast.com...
<snip>
Do you know MSIE accepts that if you press key x that if tell
MSIE that it was a Q it beleves me?
Code:

document.onkeydown = function(e)
{
if (document.all)<--snip-->
Just a side note, and an FYI one. MSIE is not the only browser
that can pass that test. ...

<snip>if (document.all &! document.layers &! window.opera){
alert('I think you are using MSIE but I could still be wrong')
Konqueror 3 (Safari), IceBrowser 5, iCab and NetFront (at least) all
also make it in here. I think that they all support a - keyCode -
property on a global - event - object but I doubt that they will behave
consistently in response to having that - keyCode - property
re-assigned.
}
There are objects for which their existence would currently allow the
inference that the browser in use was IE (5.0+). But given the extent to
which, for example, IceBrowser actively spoofs the IE DOM (global
ActiveXObject constructor, filters collections on elements, etc.) it is
unlikely that any test that attempts to infer the browser make or
version from the existence of objects in its DOM is going to stay valid
for long. Even IE's conditional comments could be implemented by another
browser if they were seen to be being employed as a mechanism to exclude
it from a significant number of sites.

In principal[1] the safe test for the availability of the required
feature would be:-

if((typeof event != 'undefined')&&
(typeof event.keyCode == 'number')){
... // safe to access event.keyCode
}

- but the only way of seeing if assigning a new value to - keyCode - had
the desired result would be to try it and then monitor the browser to
see if it was possible to work out what the result was.
the !window.opera excludes Opera.
the !document.layers excludes a browser (the name eludes me,
Jim Ley named it once for me) that supports both document.all
and document.layers.


It was Omniweb.

Richard.

[1] The principal being: testing the browser for the existence of the
features most closely associated with the code that may be executed if
they exist.
Jul 20 '05 #27
"DJ WIce" <co*********@djwice.com> wrote in message
news:bu**********@news.tudelft.nl...
: First of all, you're not changing it, you're replacing it,
: and doing a poor job. That's just a mater of opinion.
You are (at least attempting to) replace the context menu, so that
cannot be opinion.

You are doing a poor job, because you are failing to replace it at all
on Opera versions (for example). Your replacement can only be an
impoverished version of the original at best because you have no way of
telling what features were in the original and are incapable of
reproducing (at all, or fully) many of the features that you know would
have existed on the context menus of common browsers.
If I wanted that your opinion on me replacing the
menu, I would have gone to alt.html.critique.
If it is scripted and you post it to comp.lang.javascript you are
inviting opinions on how viable/sensible the script is.

<snip>Maybe I can make features that they do not have in that menu?
When a user activates the context menu of their browser it is not a
speculative activity intended to give them the opportunity to see what
new features may have been provided. It is an action taken with the
expectation that a known set of features will be available to them. If
you take any of those features away, or break them with a bad
implementations (and especially the one they intended to use), it
doesn't matter how spectacular what you put in its place may be, the
user will still be frustrated.
Maybe this is just a test case for me, testing what is possible?

<snip>

Then you should want to be told if you are wasting your efforts on
something with no viable Internet applications.

Richard.
Jul 20 '05 #28
On Thu, 15 Jan 2004 22:56:32 +0000, Steve Pugh <st***@pugh.net> wrote:
It doesn't work at all in Opera 7.23 (even when I set my preference to
allow JavaScript to access the right mouse click, which I normally
don't allow. Can any Opera users remember whether that's off or on by
default?)


I've never changed that setting as far as I can rememember; it's off in
my 7.23.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #29
: One which fails to work as advertised in Mozilla. "Add to favorites"
: does exactly nothing.
Thanks I did disable it (I think) in Mozilla.

Wouter
Jul 20 '05 #30
: do:
: <a href="pageRequiresJS.html" onclick="somecode();return false"> ... </a>
: Then you can use the link to tell people that your page requires
: Javascript, so people without it will know why it fails instead of
: just nothing happening.

I did this exept the "pageRequiresJS.html" part.
Do people even see my menu if JS is off?
I mean oncontextmenu is a JS event right?
And I write it via JS on their page.

But I'm not shure how browsers react on a onclick event and a link in one
anchor tag.
I mean if the onclick returns false, do all browsers never load the link?

Wouter
Jul 20 '05 #31
DJ WIce hu kiteb:
Having the "Disable this" text doesn't make it okay to toy with the
user's browser. What if I wanted to copy and paste? That's not even
on your menu.

I'm now just working on the scripting. And getting it to work like to
normal menu.
When selection is done I can disable the menu, that a nice suggestion!
Thanks.

My menu was made to look good with my browser, not with your site.

Yeah, and what you are viewing is my site ;-)


If I find that the site navigation tools, such as the user interface,
have been manipulated, my first thought is that the webpage contains
potentially hostile content, and my instinctive reaction is to close the
window.

Oops, you lost another viewer.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #32
On Fri, 16 Jan 2004 12:05:15 +0100, DJ WIce <co*********@djwice.com> wrote:

<snip>
But I'm not shure how browsers react on a onclick event and a link in one
anchor tag.
I mean if the onclick returns false, do all browsers never load the link?
Consider:

<a href="pageRequiresJS.html" onclick="somecode();return false"...</a>


If the browser understand intrinsic events and JavaScript is enabled,
somecode() will be executed and the event (the navigation to
pageRequiresJS.html) will be cancelled, due to the 'return false'
statement.

If the browser doesn't implement intrinsic events, or JavaScript is
disabled, the entire onclick event is ignored and the browser navigates to
pageRequiresJS.html.

JavaScript-enabled pages should use this behaviour to provide alternative
content to users who choose not to use JavaScript, or have browsers that
don't support it.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #33
DJ WIce wrote:
: One which fails to work as advertised in Mozilla. "Add to favorites"
: does exactly nothing.
Thanks I did disable it (I think) in Mozilla.


So you're making it even less useful than it was before? How is a
seriously limited-function context menu supposed to be a good thing for
the user? Please, just throw the whole idea away right now.

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #34
: > : One which fails to work as advertised in Mozilla. "Add to favorites"
: > : does exactly nothing.
: > Thanks I did disable it (I think) in Mozilla.
: So you're making it even less useful than it was before?
?? No the functions that had no function in some browsers, I did remove for
people using those browsers.

: How is a seriously limited-function context menu supposed to be
: a good thing for the user?
Never read: "Less is more"?
So it can be, just need to seach the right less version ;-) LOL.

: Please, just throw the whole idea away right now.
It seem to me that you do not understand that someone can just playa round
and try what's possible before one thinks of the usefullness. If people
would always pre-consider that, then for example SMS would never have been
"invented".

Wouter
Jul 20 '05 #35

: Consider:
:
: <a href="pageRequiresJS.html" onclick="somecode();return false"
: >...</a>
:
: If the browser understand intrinsic events and JavaScript is enabled,
: somecode() will be executed and the event (the navigation to
: pageRequiresJS.html) will be cancelled, due to the 'return false'
: statement.
:
: If the browser doesn't implement intrinsic events, or JavaScript is
: disabled, the entire onclick event is ignored and the browser navigates to
: pageRequiresJS.html.

Thanks.

Btw. why do you leave out the ; after false?

Wouter
Jul 20 '05 #36
On Fri, 16 Jan 2004 15:19:06 +0100, DJ WIce <co*********@djwice.com> wrote:
: <a href="pageRequiresJS.html" onclick="somecode();return false"
: >...</a>
<snip>
Btw. why do you leave out the ; after false?


No particular reason (though sometimes, it makes the difference between
wrapping, or not wrapping, a line of HTML). There are times when leaving
out the terminating semi-colon is valid (syntactically). Unless someone
tells me otherwise after I make this post, this is one of those times.
When I write scripts, rather than event handlers, I always include the
semi-colon at the end of every statement.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #37
"DJ WIce" <co*********@djwice.com> wrote in message
news:bu**********@news.tudelft.nl...
.....
| So it can be, just need to seach the right less version ;-)
LOL.

What ..does that sentence mean?
Jul 20 '05 #38
On Fri, 16 Jan 2004 15:15:12 +0100, "DJ WIce" <co*********@djwice.com>
wrote:
: Please, just throw the whole idea away right now.
It seem to me that you do not understand that someone can just playa round
and try what's possible before one thinks of the usefullness. If people
would always pre-consider that, then for example SMS would never have been
"invented".


If you want to extend the possibilities of a context menu, makes much
more sense to demonstrate to your visitors how to do it efficiently.

e.g. http://www.mattkruse.com/contextmenu/

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #39
Andrew Thompson wrote:
"DJ WIce" <co*********@djwice.com> wrote in message
news:bu**********@news.tudelft.nl... .... | So it can be, just need
to seach the right less version ;-) LOL.

What ..does that sentence mean?


If you're familiar with the expression "less is more" & you're aware
that 'more' is a utility to page output to the screen (*nix & dos), &
that 'less' is an extension of 'more' (allows scrolling back up through
the output), which no doubt comes in many flavours, you should then
understand.

BTW FWIIW I also think the menu, as anything other than a coding
exercise, is horrible from an HCI point of view.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 20 '05 #40
: If you want to extend the possibilities of a context menu, makes much
: more sense to demonstrate to your visitors how to do it efficiently.
:
: e.g. http://www.mattkruse.com/contextmenu/

Ah you want me to trick visitors to download a .reg and so have my menu :-)
Well, it's just coding for fun :)
Like you must have noticed when the color of the page in NN is like the
default color of NN 7. And in IE it's that of the classic theme.
I did "even" remove the small black line from your browser window ;-)
For that you need not to specify the dtd else it won't work :)

Wouter
Jul 20 '05 #41
DJ WIce wrote:
Hi all,

I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html

It works nice in MSIE, but on Netscape (and probable other browsers) it
stays on the same place (does not "open'' where the mouse is). And the links
do not work when you click on them.

If anyone has sugestions on how to improve it, please let me know.

Thanks,
Wouter

BTW, it works fine in Mozilla 1.5b

--
Bill Drescher
william {at} TechServSys {dot} com

Jul 20 '05 #42
bill drescher wrote:
DJ WIce wrote:

I did make a script/css thing to replace the contextmenu on the website with
a new one: http://www.djwice.com/contextmenu.html

BTW, it works fine in Mozilla 1.5b


No, it does not. "Works fine" is more than just the absence of
JavaScript errors. The scripted context menu neither has the same
options as mozilla, nor do the options change depending on which page
element has focus, nor is it accessible via keyboard.

Functionally, it is vastly inferior to the browser's context menus, so
it does not "work" at all as a replacement.

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #43
On Fri, 16 Jan 2004 21:08:03 +0100, "DJ WIce" <co*********@djwice.com>
wrote:
: If you want to extend the possibilities of a context menu, makes much
: more sense to demonstrate to your visitors how to do it efficiently.
:
: e.g. http://www.mattkruse.com/contextmenu/

Ah you want me to trick visitors to download a .reg and so have my menu :-)
No, you stated your reason for doing this was in that innovation in
contextmenu was good, and you're right it is, which is why Mozilla, IE
and others allow it to be modified easily.
Like you must have noticed when the color of the page in NN is like the
default color of NN 7.
Who knows what you're talking about?
And in IE it's that of the classic theme.


Why, why not use the colour of my contextmenu if you're wanting to be
consistent?

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #44
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:n0**********@hotpop.com...
"DJ WIce" <co*********@djwice.com> writes:
: Suggestion: Trash it and stop screwing with my mouse.

Sugestion: look at what you see before complaining; click the option on the bottom of the menu...


Didn't see a thing. I use Opera :) Anyway, I did check in IE and
Mozilla ...

Neither allows me to pop the menu down again when it is up, except by
chosing an entry.


I checked in IE and Mozilla as well (versions 6.0 and 1.6 respectively) and
had no problems with the menu. Right-clicking showed the menu, and clicking
outside of it hid it again.

Christopher Finke
Jul 20 '05 #45
: > And in IE it's that of the classic theme.
:
: Why, why not use the colour of my contextmenu if you're wanting to be
: consistent?

If you can tell me how I could get that information from every IE (or NN)
visitor I would. I did not know that it was possible.

Wouter
Jul 20 '05 #46
in post: <news:bu**********@news.tudelft.nl>
"DJ WIce" <co*********@djwice.com> said:
: Why, why not use the colour of my contextmenu if you're wanting to be
: consistent? If you can tell me how I could get that information from every IE (or NN)
visitor I would. I did not know that it was possible.


http://www.w3.org/TR/REC-CSS2/ui.html#system-colors

--
brucie - i usenet nude
Jul 20 '05 #47
: The scripted context menu neither has the same options as mozilla
True.

: nor do the options change depending on which page
: element has focus
I'm working on that. Checking if there is a selection or a field focus.

: nor is it accessible via keyboard.
False, use your contextmenu key, use your arrow down if you use MSIE or elke
tab (I do not yet know how to enable arrow keys in NN.
I just think focus the next element of the <a href=""> array and with the
final (just check the name) the x elements before the current).

: Functionally, it is vastly inferior to the browser's context menus
That's just a mather of tast, but of cause, it's just a test case to script
some, so don't worry.

Thanks, :-)
Wouter
Jul 20 '05 #48
: http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
: --
: brucie - i usenet nude

!THANKS!
Wow! Just didn't know!

Wouter
Jul 20 '05 #49
in post: <news:bu**********@news.tudelft.nl>
"DJ WIce" <co*********@djwice.com> said:
: brucie - i usenet nude !THANKS!
Wow! Just didn't know!


i can send you pictures if you like
--
brucie - i usenet nude
Jul 20 '05 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: DJ WIce | last post by:
Hi all, I did make a script/css thing to replace the contextmenu on the website with a new one: http://www.djwice.com/contextmenu.html It works nice in MSIE, but on Netscape (and probable...
1
by: Brian Martel | last post by:
I am trying to create a dynamic flyout submenu off of a contextmenu. I can right click and get the base contextmenu ok. On the Popup event I add MenuItem's to the collection of one of the items so...
2
by: Derrick | last post by:
I've been working on an application which has a NotifyIcon (system tray icon), and a corresponding ContextMenu. I want to be able to update this menu dynamically. However, when I make changes to...
10
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal...
7
by: TryingLikeHeck | last post by:
I have a usercontrol on which I've generated a context menu in designer. The properties of the control lists for ContextMenu (none) The menu shows up in the designer window and I can edit it To...
3
by: asharda | last post by:
Hi, I am trying to create a context menu in my application. The context menu takes menu otems from an XML file. In XAML the code is <Grid.ContextMenu> <ContextMenu Name="cm" StaysOpen="true"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.