MediaWiki:Common.js

From LostRing

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:30, 19 March 2008 (edit)
Thebruce (Talk | contribs)
m
← Previous diff
Current revision (14:42, 19 March 2008) (edit) (undo)
Thebruce (Talk | contribs)
m
 
(4 intermediate revisions not shown.)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */ /* Any JavaScript here will be loaded for all users on every page load. */
-if (wgUserName=='thebruce') alert(0);+if (wgUserName=='Thebruce')
 +importScript('MediaWiki:ContentFormatter.js');
 + 
 + 
 +function importScript(page){
 + var url=wgScriptPath + '/index.php?title=' + escape(page.replace(' ','_'))
 + + '&action=raw&ctype=text/javascript&dontcountme=s';
 + var scriptElem = document.createElement('script');
 + scriptElem.setAttribute('src',url);
 + scriptElem.setAttribute('type','text/javascript');
 + document.getElementsByTagName('head')[0].appendChild(scriptElem);
 +}

Current revision

/* Any JavaScript here will be loaded for all users on every page load. */

if (wgUserName=='Thebruce') importScript('MediaWiki:ContentFormatter.js');


function importScript(page){

var url=wgScriptPath + '/index.php?title=' + escape(page.replace(' ','_'))
                     + '&action=raw&ctype=text/javascript&dontcountme=s';
var scriptElem = document.createElement('script');
scriptElem.setAttribute('src',url);
scriptElem.setAttribute('type','text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem);

}

Personal tools
[Support Wikibruce]
Wikibruce