User:Guarapiranga/JWB on demand.js

$( function {   if( mw.config.get( "wgNamespaceNumber" ) < 0 ) return;    mw.loader.using( [ "mediawiki.util", "mediawiki.api" ] ).then( function  { var link = mw.util.addPortletLink(			'p-cactions',			'https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Script',			'JWB',			'ca-jwb',           "Open JavaScript Wiki Browser to make semi-automated edits"		); if( !link ) return; link.addEventListener( "click", function {			$( document ).ready( function { mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Joeytje50/JWB.js/load.js'); } );       } );    } ); } );