User:DannyS712 test/tools.js

mw.loader.using( 'mediawiki.util', function {	importScript('User:DannyS712 test/menu.js');    // Wait for the page to be parsed    $(document).ready( function  { addlimenu( '#p-tools', '#p-tools', '#p-tools', '#', '#p-search'); var link = mw.util.addPortletLink( 'p-tools', '#', 'Wikify', 'ca-wikify', 'Mark for wikification'); $( link ).click( function ( event ) {           event.preventDefault;            doQwikify;        } ); } ); } ); function addlimenu(tabs, name, id, href, position) { var na, mn; var li;

if (!id) id = name; if (!href) href = '#';

na = document.createElement("a"); na.appendChild(document.createTextNode(name)); na.href = href; mn = document.createElement("ul"); li = document.createElement("li"); li.appendChild(na); li.appendChild(mn); if (id) li.id = id; li.className = 'menu';

if (position) { $( tabs ).insertBefore( $( position ) ); } else { $( tabs ).appendChild(li); }

//return mn; // useful because it gives us the  to add s to }