User:Cuddles/common.js

/* ONLY I AND ADMINS CAN EDIT THIS CODE */

if ( $.isArray( window.mwCustomEditButtons ) ) {

// Add button to strike text mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png', 'speedTip': 'Strike text', 'tagOpen': ' ', 'tagClose': " ", 'sampleText': "text here" };

// Add button to underline text mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/f/fd/Button_underline.png', 'speedTip': 'Underline text', 'tagOpen': ' ', 'tagClose': " ", 'sampleText': "text here" };

// Add button to insert a new wikitable mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/0/04/Button_array.png', 'speedTip': 'Insert new wikitable', 'tagOpen': '{| class="wikitable"\n|-\n', 'tagClose': "\n|}", 'sampleText': "! head 1\n! head 2\n! head 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3" };

// Add button to mark an image as copyrighted mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/1/16/Button_fairuse.png', 'speedTip': 'Mark this image as copyrighted', 'tagOpen': '', 'tagClose': "", };

// Add button to request deletion of a page/image mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/5/50/Button_tidyman.png', 'speedTip': 'Nominate for deletion', 'tagOpen': '', 'tagClose': "", };

// Add button to add citation to a page mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png', 'speedTip': 'Add reference', 'tagOpen': ' ", 'sampleText': "Lorem ipsum dolor sit amet, consectetur adipiscing elit." };

// Add button to render text as noinclude mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/c/ce/Button_no_include.png', 'speedTip': 'Suppress text from template transclusions and embeds', 'tagOpen': ' ', 'tagClose': " ", 'sampleText': "Text here" };

// Add button to render text as includeonly mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/7/79/Button_include.png', 'speedTip': 'Make text only visible in template transclusions and embeds', 'tagOpen': ' ', 'tagClose': " ", 'sampleText': "Text here" };

// Add button to create galleries mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/1/12/Button_gallery.png', 'speedTip': 'Create a gallery', 'tagOpen': '", 'sampleText': " " };

// Add button to create comments mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/3/38/Button_comment_vote.png', 'speedTip': 'Add a comment', 'tagOpen': '", 'sampleText': "Insert text here" };

// Add button to create line breaks mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/c/c5/Button_br.png', 'speedTip': 'Create a line break', 'tagOpen': '', 'tagClose': "", 'sampleText': " " };

// Add button to create redirects mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png', 'speedTip': 'Create a redirect', 'tagOpen': '#REDIRECT ', 'tagClose': "", 'sampleText': "Page name" };

// Add button to insert templates mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_templatelink.png', 'speedTip': 'Insert a template', 'tagOpen': '", 'sampleText': "Template" };

// Add button to insert mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/6/60/Button_support.png', 'speedTip': 'Add template', 'tagOpen': '', 'tagClose': "", 'sampleText': "" };

// Add button to insert mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/9/98/Button_oppose.png', 'speedTip': 'Add template', 'tagOpen': '', 'tagClose': "", 'sampleText': "" };

// Add button to insert mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/4/4f/Button_neutral.png', 'speedTip': 'Add template', 'tagOpen': '', 'tagClose': "", 'sampleText': "" };

// Add button to insert mwCustomEditButtons[mwCustomEditButtons.length] = { 'imageFile': 'http://upload.wikimedia.org/wikipedia/commons/1/13/Button_delete.png', 'speedTip': 'Add template', 'tagOpen': '', 'tagClose': "", 'sampleText': "" };

};

addOnloadHook( function {       var NSWithoutSubpages = new Array( -1, 6, 8, 12, 13, 14, 15, 104, 105);        if ( document.getElementById( 'p-tb' ) && NSWithoutSubpages.indexOf( wgNamespaceNumber ) == -1 ) {                var subpagesLink = '/Special:PrefixIndex/' + wgPageName + '/';                addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' );        } });

addOnloadHook( function {       var purgePage = '/' + wgPageName + '?action=purge';        addPortletLink( 'p-tb', purgePage, 'Purge this page', 't-purgepage', 'Purge the cache of this page' ); });

$( document ).ready( function { mw.util.addPortletLink( 'p-personal', mw.util.wikiGetlink( 'Special:ChangePassword' ), 'My password', 'pt-mypassword', 'Change your password', null, '#pt-preferences' ); });

$( document ).ready( function { mw.util.addPortletLink( 'p-personal', mw.util.wikiGetlink( 'Special:MyPage/common.css' ), 'My CSS', 'pt-mycss', 'View and edit your CSS', null, '#pt-preferences' ); });

$( document ).ready( function { mw.util.addPortletLink( 'p-personal', mw.util.wikiGetlink( 'Special:MyPage/common.js' ), 'My JavaScript', 'pt-myjs', 'View and edit your JavaScript', null, '#pt-preferences' ); });