MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
m (Replaced content with "// install Wikipedia:User:Cacycle/wikEd in-browser text editor importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
/ | /* install [[Wikipedia:User:Cacycle/wikEd]] in-browser text editor */ | ||
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' | importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' | ||
+ '&action=raw&ctype=text/javascript'); | + '&action=raw&ctype=text/javascript'); | ||
/* addOnloadHook pops - Creates a popup window from a link (_blank), if desired */ | |||
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] ) ); | |||
} ); |
Revision as of 15:16, 6 February 2014
/* install [[Wikipedia:User:Cacycle/wikEd]] in-browser text editor */
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript');
/* addOnloadHook pops - Creates a popup window from a link (_blank), if desired */
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] ) );
} );