Difference between revisions of "MediaWiki:Common.js"

From Tycoon Gaming
Line 18: Line 18:
 
window.element = document.getElementById("bodyContent");
 
window.element = document.getElementById("bodyContent");
 
var save = window.element.innerHTML;
 
var save = window.element.innerHTML;
output = '<button class="LastPage" onclick="LastPage()">Return to Last Page</button><script>function LastPage(){var oldURL = document.referrer; console.log(oldURL); window.location.href = oldURL;}</script>'
+
output = '<button class="LastPage" onclick="LastPage()">Return to Last Page</button><script>function LastPage() {var oldURL = document.referrer; console.log(oldURL); window.location.href = oldURL;}</script>'
 
window.element.innerHTML = save + output;
 
window.element.innerHTML = save + output;
 
}
 
}

Revision as of 21:30, 10 October 2019

mw.loader.load( '/wiki/index.php?title=MediaWiki:ServerList.js&action=raw&ctype=text/javascript');
mw.loader.load( '/wiki/index.php?title=MediaWiki:ReplaceWordWithLink.js&action=raw&ctype=text/javascript');

var path = window.location.href;
var path1 = 'https://dash.tycoon.community/wiki/index.php/User:Donald'
function iniFrame() { 
	if ( window.location !== window.parent.location ) 
	{ 
			var output;
			window.element = document.getElementById("bodyContent");
			var save = window.element.innerHTML;
			var oldURL = document.referrer;
			output = '<p>' + oldURL + '</p>'
			window.element.innerHTML = save + output;
	} else { 
		if (path == path1) {
			var output;
			window.element = document.getElementById("bodyContent");
			var save = window.element.innerHTML;
			output = '<button class="LastPage" onclick="LastPage()">Return to Last Page</button><script>function LastPage() {var oldURL = document.referrer; console.log(oldURL); window.location.href = oldURL;}</script>'
			window.element.innerHTML = save + output;
		}
	}
}
iniFrame();