Jump to content

User:DannyS712 test/extra menu.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.
mw.loader.using( 'mediawiki.util', function () {
    $(document).ready( function () { 
    	/** Create the menu **/
        var $html = $( '<div id="p-dstools" role="navigation" class="vectorMenu" aria-labelledby="p-dstools-label"></div>' );
		$html.append( '<h3 id="p-dstools-label"><span>Tools</span></h3>' );
		$html.append( '<ul class="menu"></ul>' );

		/** Add the menu in the right place **/
		$( '#right-navigation' ).append( $html );
		$( '#right-navigation' ).append( $( '#p-cactions' ) );
		$( '#right-navigation' ).append( $( '#p-search' ) );
		
		/** Add a blank tool to the menu for demonstration purposes **/
		var testing = mw.util.addPortletLink( 'p-dstools', '#', 'shown', 'ca-test', 'tool tip', ' access key');
    } );
} );