Jump to content

User:A930913/vada/import.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(function(){
	if(mw.config.get('wgTitle').toLowerCase()=="vada/run" || mw.config.get('wgTitle')=="A930913/vada/run"){
		importScript("User:A930913/vada/vada.js");
	} else {
		var vadaLink = document.createElement('li');
		vadaLink.innerHTML = '<a target="_blank" href="'+mw.config.get('wgServer') + mw.config.get('wgArticlePath').substr(0,(mw.config.get('wgArticlePath').length - 2))+'Wikipedia:Vada/run" title="Launch Vada" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAJCAIAAABrBkF6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABCSURBVChTfYxLEgAgCEK5/4HblkZ+hqnewgFBMQNA9dg8G4yN2hos9ao2DIkvP8jx8oNBn0Y1MiC5cZFGpl+H/gIsSTrBFfEyOVkAAAAASUVORK5CYII=);background-position:0 3px;background-repeat:no-repeat;">&nbsp;&nbsp;&nbsp;&nbsp;Launch <i>Vada</i></a>';
		var parent = document.getElementById('p-tb');
		if(parent && parent.childNodes[3] && parent.childNodes[3].childNodes[1])parent.childNodes[3].childNodes[1].insertBefore(vadaLink, parent.childNodes[3].childNodes[1].firstChild);	
	}
});