Jump to content

User:Technical 13/Scripts/Gadget-listStyles.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.
var path = $( 'ul' );
function addPtLink(pID, nextnode, path){
	var listStyle = mw.util.addPortletLink(
		'p-' + pID,
		'#',
		'(list style)',
		'pt-liststyle',
		'Switch list style between bullet and numbered [alt-shift-`]',
		'`',
		'#pt-' + nextnode
	);
	$( listStyle ).click( function ( e ) {
		e.preventDefault();
		path.css( 'list-style-image', 'none' );
		path.css( 'list-style-type', function (i, val) {
			return val === "decimal" ? "disc" : "decimal";
		});
	});
}
var pageAction = mw.config.get( 'wgAction' );
if ( pageAction != 'history' ){
	var nsNumber = mw.config.get( 'wgNamespaceNumber' );
	if ( nsNumber === -1 ){
		// Special: pages
		var specialPageName = mw.config.get( 'wgCanonicalSpecialPageName' );
		if ( specialPageName == 'Whatlinkshere' ){
			// [[Special:WhatLinksHere]]
			path = $( 'ul#mw-whatlinkshere-list' );	
			addPtLink('personal', 'userpage', path);
		} 	else if ( specialPageName == 'Contributions' ){
			// [[Special:Contributions]]
			path = $('a.mw-changeslist-date').parents('ul');
			addPtLink( 'personal', 'logout', path );
		}
	} else if ( nsNumber != 14){
//		var pageNameList = mw.config.get( 'wgPageName' );
	} else {
		// [[Category:]]
		path = $( 'div.mw-content-ltr' ).find( 'ul' );
		addPtLink( 'personal', 'userpage', path);
	}
} else {
	// &action=history
	path = $( 'ul#pagehistory' );
	addPtLink( 'personal', 'userpage', path );
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy