[MediaWiki-l] How to insert internal link that opens new tab?

Al Johnson alj62888 at yahoo.com
Tue Jan 8 02:41:57 UTC 2013


Thanks for the code. /Al




________________________________
 From: Sal Quintanilla <salquint at gmail.com>
To: 'Al Johnson' <alj62888 at yahoo.com>; 'MediaWiki announcements and site admin list' <mediawiki-l at lists.wikimedia.org>; 'Geri' <gerx03 at gmail.com> 
Sent: Monday, January 7, 2013 3:43 PM
Subject: RE: [MediaWiki-l] How to insert internal link that opens new tab?
 
About this hard if you added this to MediaWiki:Common.js 

/** Popup links
* Use <span class="pops">[http://www.wikipedia.com Wikipedia]</span>
*  or <span class="pops">[[Homepage|Home]]</span>
**/
addOnloadHook( function() {
     var pops = function( elems ) {
         for (var i=0; i<elems.length; i++) {
             if ( !(' '+elems[i].className+' ').match( / pops / ) )
continue;
             var anchs = elems[i].getElementsByTagName('a');
             for (var j=0; j<anchs.length; j++) anchs[j].target = '_blank';
         }
     };
     var bc = document.getElementById('bodyContent');
     var tags = ['span', 'div', 'table', 'td', 'th'];
     for (var i=0; i<tags.length; i++) pops( bc.getElementsByTagName(
tags[i] ) );
} );

-----Original Message-----
From: mediawiki-l-bounces at lists.wikimedia.org
[mailto:mediawiki-l-bounces at lists.wikimedia.org] On Behalf Of Al Johnson
Sent: Monday, January 07, 2013 2:24 PM
To: Geri; MediaWiki announcements and site admin list
Subject: Re: [MediaWiki-l] How to insert internal link that opens new tab?

Yeah, I saw that.  How hard would it be to write a little tag extension
where I call whatever wiki code is usually used to parse "[[... ]]" to get
an HTML anchor and add the "target='_blank'" myself?

Thanks,
al




________________________________
From: Geri <gerx03 at gmail.com>
To: Al Johnson <alj62888 at yahoo.com>; MediaWiki announcements and site admin
list <mediawiki-l at lists.wikimedia.org> 
Sent: Monday, January 7, 2013 3:16 PM
Subject: Re: [MediaWiki-l] How to insert internal link that opens new tab?

Hello,

The easiest way to do it is
http://www.mediawiki.org/wiki/Manual:$wgExternalLinkTarget
Not the best solution though as it modifies every external URL.

Geri

2013.01.07. 23:01:55 dátumon Al Johnson <alj62888 at yahoo.com> írta:

> Hello,
> 
> I have a form with a link to the regular search page.  The user needs to
click the link and then later return to the form page to finish filling it
out.  I would rather them use a separate tab for the search rather than
using the browsers 'Back' button which resets some of the form fields.
> 
> Thanks,
> Al
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


More information about the MediaWiki-l mailing list