MediaWiki:Common.js: verschil tussen versies
Uit NeBelEx Wiki
(correctie) |
(recente wijzigingen staan niet meer op de voorpagina, filter code kan weg) |
||
Regel 4: | Regel 4: | ||
$(function () { | $(function () { | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Versie van 16 mei 2010 om 21:21
/* JavaScript die hier wordt geplaatst heeft invloed op alle pagina's voor alle gebruikers */ // Extend functionality Main_page#recentchanges-include $(function () { }); // Extend functionality External-Links (open in new window) function getXterlinks() // By Thong Nguyen nkthong@yahoo.com // This code just VIRTUALLY add a target="_Blank" to any external link in the wiki document! // NOTE: YOU DON"T Need to modify any of your text document! { var Xterlinks = document.getElementsByTagName('A'); for (var i=0;i<Xterlinks.length;i++) { var eachLink = Xterlinks[i]; var regexp_isYourdomain="nebelex"; var regexp_ishttp=/(http(.)*:\/\/)/; //Check if the link is valid and is external link if( (eachLink.href != null) && (eachLink.href.match(regexp_isYourdomain) == null) && eachLink.href.match(regexp_ishttp)!=null ) { eachLink.target ="_blank";//make the target for this external link } } } getXterlinks();