Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Open Links in new Windows???
How to make the links be opened in the new window? CSS???
0
This discussion has been closed.
Comments
how to make this javascript thing in vanilla?
I think this option should be "user editable" in vanilla settings to let the admin decide how to make it on his forum
It contains two possible Javascript solutions. here and here.
If you want it user editable, an extension would be the way to go!
If it is the links in the comments, the Extended Text Formatter already do that I think.
function AutoLink($String) { $String = str_replace(array(""","&"),array('"','&'),$String); $String = preg_replace( "/ (?<!<a href=\") (?<!\")(?<!\">) ((https?|ftp):\/\/) ([\@a-z0-9\x21\x23-\x27\x2a-\x2e\x3a\x3b\/;\x3f-\x7a\x7e\x3d]+) /msxi", "<a href=\"$0\" target=\"_blank\" rel=\"nofollow\">$0</a>", $String); return $String; }
> Window Links
By the way, that extension lets users choose whether or not they want links to open in a window.
Open functions.js and look for the following line:
if (fileLink.href.match(/^(http|https)/) && (fileLink.href.indexOf(location.hostname) == -1)) {
and replace it with this:
if (fileLink.href.match(/^(http|https)/)) {
Hope that helps!
I have one question, is there any way to enable it by default instead of having the users individually enabling it?