Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Gerard Copinga
Hello,

besides the warning that the link will open in a new window, also make sure 
that the pop-up will work if JavaScript is disabled or not supported by 
assistive technologies. The way to do that is:

a href=help.htm target=_blank 
onClick=javascript:openNewWindow(this.href); return false; title=opens in 
new windowHelp/a

If JavaScript is disabled the page will be opened in a normal new window ( 
href=help.htm target=_blank ). If JavaScript is enabled a custom window 
will be opened ( onClick=javascript:openNewWindow(this.href); return false; 
). You need the 'return false;' part because otherwise also the normal link 
will be executed and two new windows will open.

Hope this helps!

Gerard Copinga



Stichting Bartiméus Accessibility
Informatie, voorlichting, onderzoek en training
Utrechtseweg 84
3702 AD  Zeist (The Netherlands)
Tel: +31 (0)30 - 6982401
Fax: +31 (0)30 - 6982388
WWW: www.accessibility.nl

Zie voor disclaimer onze website:
www.accessibility.nl/algemeen/disclaimer

Read our disclaimer on the website :
www.accessibility.nl/algemeen/disclaimer

 [EMAIL PROTECTED] 22-4-2005 1:29:41 
Hello!

I am writing website develoment guidelines that will be distributed to 
vendors for conforming to the web standards. I haven't been able to get 
more information on the implementation of pop-ups and how it will be read 
by assistive technologies. Does anyone know more about this? We are 
building a complex application that will require pop-ups to appear. 
Currently, we are alerting the user that the link will open in a new 
window. Is this suffiecient to address the w3c guidlines?

Regards
LS
This message is intended for the addressee named and may contain privileged
or confidential information.  If you are not the intended recipient you must
not use, disclose, copy or distribute this communication.  If you have
received this message in error please delete the email and notify the sender.

Web Site

http://www.lawlink.nsw.gov.au
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups (I have RMIT TestLab)

2005-04-26 Thread Malcolm Raymond
I have left RMIT TestLab, and your email has been forwarded on to Steven Turvey 
([EMAIL PROTECTED]).

If you need to contact RMIT TestLab in the future, please email Steve above or 
alternatively ring him on (03) 9925 6018.
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Kornel Lesinski
On Tue, 26 Apr 2005 08:44:24 +0100, Gerard Copinga  
[EMAIL PROTECTED] wrote:

a href=help.htm target=_blank  
onClick=javascript:openNewWindow(this.href); return false;  
title=opens in new windowHelp/a
Why do you put *useless* javascript: *label* inside onclick handler?
--
regards, Kornel Lesiski
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Prabhath Sirisena
You might find this useful:

http://www.accessify.com/tutorials/the-perfect-pop-up.asp

Prabhath

http://nidahas.com
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Kornel Lesinski
On Tue, 26 Apr 2005 12:04:39 +0100, Prabhath Sirisena [EMAIL PROTECTED]
wrote:
You might find this useful:
http://www.accessify.com/tutorials/the-perfect-pop-up.asp
This popup is imperfect.
In examples there is always return false;.
It should be return !window.open(..);
It uses inline JavaScript - event handlers should be assigned via DOM.

--
regards, Kornel Lesiski
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Jeremy Keith
Kornel Lesi?ski wrote:
It uses inline JavaScript - event handlers should be assigned via DOM.
As an example, you could use a class to indicate which links should 
open in a new window:

a href=http://www.example.com/; class=popupvisit the site/a
Then in an external JavaScript file, you could have a little function 
that is triggered when the page loads:

1) Loop through the links in the document.
2) If the link has a class of popup:
1) add an onlick behaviour
2) cancel the default action
3) make onkeypress do the same thing.
function preparePopUps() {
if (!document.getElementsByTagName) return false;
var lnks = document.getElementsByTagName(a);
for (var i=0; ilnks.length; i++) {
if (lnks[i].className.indexOf(popup) == -1) continue;
lnks[i].onclick = function() {
window.open(this.href);
return false;
}
lnks[i].onkeypress = lnks[i].onclick;
}
}
window.onload = preparePopUps;
Because you're using a class to indicate which links open in a new 
window, you could use CSS to style these links differently.

HTH,
Jeremy
--
Jeremy Keith
a d a c t i o
http://adactio.com/
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


RE: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Patrick Lauke
 Jeremy Keith

 lnks[i].onkeypress = lnks[i].onclick;

I'd advise against assigning an onkeypress. In some
browsers (Moz), even a TAB is (rightly) seen as a keypress.
An onkeypress on a link makes it effectively impossible to
tab past the link without triggering the behaviour.
All major current browsers rightly interpret a keyboard
activation (via enter/return key) as a click (on Windows
at least...from what I recall, some Mac browsers can be a
bit difficult in that regard).
Again, this goes back to a long discussion on whether or
not onclick is device independent; the usual advice to
double up behaviours (mouseover with focus, mouseout with
blur) can't be applied directly to onclick, as onkeypress is
not really device independent either. What's missing from the
spec is a really device independent onactivate (which,
interestingly, IS present in the DOM spec).
So, long story short: onkeypress should, in my humble opinion,
be avoided.

Patrick

Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Kornel Lesinski
On Tue, 26 Apr 2005 13:16:12 +0100, Jeremy Keith [EMAIL PROTECTED]  
wrote:

2) If the link has a class of popup:
1) add an onlick behaviour
2) cancel the default action
3) make onkeypress do the same thing.
No, don't use onkeypress.
lnks[i].onclick = function() {
window.open(this.href);
return false;
		}
Wrong. You're not testing if window has been opened.
return !window.open(this.href);
--
regards, Kornel Lesiski
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Thierry Koblentz
Gerard Copinga wrote:
 Hello,
 a href=help.htm target=_blank
 onClick=javascript:openNewWindow(this.href); return false;
 title=opens in new windowHelp/a

As a side note: using _blank as the value of the target attribute is not a
good idea unless the designer wants a *new* window to open each time the
event is triggered. To make sure the link(s) open(s) in the *same* window,
the best is to use ThisCanBeAnyName for value.

HTH,
Thierry | http://www.TJKDesign.com

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Kornel Lesinski
On Tue, 26 Apr 2005 15:24:28 +0100, Thierry Koblentz [EMAIL PROTECTED]  
wrote:

a href=help.htm target=_blank
onClick=javascript:openNewWindow(this.href); return false;
title=opens in new windowHelp/a
As a side note: using _blank as the value of the target attribute is  
not a good idea unless the designer wants a *new* window
And what about what _user_ wants?
For me there is nothing more annoying that page with links to screenshots  
or faq entries that all stubbornly open in the same window and don't let  
me see more than one of them at once.

--
regards, Kornel Lesiski
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


RE: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Patrick Lauke
 Kornel Lesinski

 And what about what _user_ wants?
 
 For me there is nothing more annoying that page with links to 
 screenshots  
 or faq entries that all stubbornly open in the same window 
 and don't let  
 me see more than one of them at once.

But for every user that thinks like you there's an equal amount of users
who would be annoyed by dozens of separate popups appearing.

There is no one solution that will match the preference of all users,
and to a certain extent the onus is on the user to get their browsing
environment set up how they want it (use a browser that gives them
control over such things, set up its preferences - single window modes,
or open in tabs, etc).

Patrick

Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Thierry Koblentz
Kornel Lesinski wrote:
 And what about what _user_ wants?
 For me there is nothing more annoying that page with links to
 screenshots or faq entries that all stubbornly open in the same
 window and don't let me see more than one of them at once.

IMHO, this technique gives some control to the user since it is still
possible for her to open such links in new windows (i.e. Right-click  Open
Link in New Window (or Tab)).
Using _blank leaves her with no choice.

Thierry | http://www.TJKDesign.com

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Patrick H. Lauke
Thierry Koblentz wrote:
IMHO, this technique gives some control to the user since it is still
possible for her to open such links in new windows (i.e. Right-click  Open
Link in New Window (or Tab)).
Using _blank leaves her with no choice.
Even if a link *has* _blank, you can use the right click option.
--
Patrick H. Lauke
_
redux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Thierry Koblentz
Patrick H. Lauke wrote:
 Even if a link *has* _blank, you can use the right click option.

I know that ;-)
My point is that setting the target attribute's value to WhatEverName
gives the user a *choice*.
It allows him to either open these links in new windows or in the *original
new one*. With _blank, each link clicked would create a new window, and
AFAIK, there is no right-click option to change this behavior.

Thierry | http://www.TJKDesign.com

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: Betr.: [WSG] Window Pop-ups

2005-04-26 Thread Patrick H. Lauke
Thierry Koblentz wrote:
Even if a link *has* _blank, you can use the right click option.

I know that ;-)
My point is 
Ah ... oops ... I see what you mean now (makes mental note to read a 
message first before replying).

P :)
--
Patrick H. Lauke
_
redux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**