Forum closed. New forum available at http://community.wymeditor.org/

wym stripping out target="_blank"

Support forum for WYMeditor.

wym stripping out target="_blank"

Postby alfrombrum on Wed Oct 10, 2007 8:59 am

Hi,

Great work on wym. One problem I've found is that if I try to add target="_blank" to a link tag, wym strips it out, even though this is valid XHTML.

Is there a way to stop this happening, or to make a link open in a new window?

Thanks,
Al
alfrombrum
 
Posts: 3
Joined: Thu Jul 12, 2007 1:18 pm

Postby jfh on Mon Oct 15, 2007 10:57 am

Using target attribute is not valid XHTML strict.
Anyway, you can for example use jQuery in your live web pages to add the attribute.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

try this

Postby Al on Fri Dec 14, 2007 9:11 pm

Sorry for my english,
this my solution :

you need to add/insert :
- line 366 :
Code: Select all
targetSelector:    ".wym_target",

- insert after line 457 : (dialog link)
Code: Select all
+ "<div class='row'>"
+ "<label>Target</label>"
+ "<input type='checkbox' class='wym_target' size='40' /> New window"
+ "</div>"

- insert after line 1325 (into : if(link){...) if the checkbox is checked :
Code: Select all
if(jQuery(wym._options.targetSelector).attr("checked")==true){
   link.attr("onclick", "window.open(this.href);return false;");
}else {
   link.removeAttr("onclick");
}

- insert after line 1294 (into : if(selected){... to check the checkox into the link dialog when the target exist

Code: Select all
if(jQuery(selected).attr("onclick")){
   jQuery(wym._options.targetSelector).attr("checked","checked");
}


_____
Pour que l'attribut target="_blank" passe le W3C, il faut remplacer par un onclick="window.open(this.href);return false;"
Al
 
Posts: 4
Joined: Fri Dec 14, 2007 8:32 pm
Location: Orléans (France)

Re: wym stripping out target="_blank"

Postby Esie on Fri Oct 15, 2010 7:56 am

Hi,.guys...i am new in this site,..can you please sent me,..
some info and detail??
thanks in advance,...



cheers,
how to deal with depression
Esie
 
Posts: 1
Joined: Fri Oct 15, 2010 7:46 am


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron