Help us get to over 8,751 articles in 2024.

If you know of a magician not listed in MagicPedia, start a New Biography for them. Contact us at magicpediahelp@gmail.com

Difference between revisions of "MediaWiki:Common.js"

From Magicpedia, the free online encyclopedia for magicians by magicians.
Jump to: navigation, search
(Created page with "Any JavaScript here will be loaded for all users on every page load.: var popScript = '//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki...")
 
m
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. */
var popScript    = '//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-popups.js';
+
var popScript    = '//geniimagazine.com/wiki/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-popups.js';
var popStyleSheet = '//en.wikipedia.org/w/index.php?action=raw&ctype=text/css&title=MediaWiki:Gadget-navpop.css';
+
var popStyleSheet = '//geniimagazine.com/wiki/index.php?action=raw&ctype=text/css&title=MediaWiki:Gadget-navpop.css';
 
if ( window.localCSS ) { popStyleSheet = 'http://localhost:8080/js/navpop.css'; }
 
if ( window.localCSS ) { popStyleSheet = 'http://localhost:8080/js/navpop.css'; }
  

Revision as of 20:31, 27 March 2014

/* Any JavaScript here will be loaded for all users on every page load. */
var popScript     = '//geniimagazine.com/wiki/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-popups.js';
var popStyleSheet = '//geniimagazine.com/wiki/index.php?action=raw&ctype=text/css&title=MediaWiki:Gadget-navpop.css';
if ( window.localCSS ) { popStyleSheet = 'http://localhost:8080/js/navpop.css'; }

function popups_importScriptURI(url) {
	var s = document.createElement('script');
	s.setAttribute('src',url);
	s.setAttribute('type','text/javascript');
	document.getElementsByTagName('head')[0].appendChild(s);
	return s;
}

function popups_importStylesheetURI(url) {
	return document.createStyleSheet ? document.createStyleSheet(url) : popups_appendCSS('@import "' + url + '";');
}

function popups_appendCSS(text) {
	var s = document.createElement('style');
	s.type = 'text/css';
	s.rel = 'stylesheet';
	if (s.styleSheet) s.styleSheet.cssText = text //IE
	else s.appendChild(document.createTextNode(text + '')) //Safari sometimes borks on null
	document.getElementsByTagName('head')[0].appendChild(s);
	return s;
}

popups_importStylesheetURI(popStyleSheet);
popups_importScriptURI(popScript);