MediaWiki:Gadget-nsShortener.js

// function nsReplace( replaceThis, withThis ) { $( 'a:contains("' + replaceThis + ':")' ).each( function {   $( this ).html( $( this ).html.replace( replaceThis + ':', withThis + ':' ) );  } ); if ( replaceThis !== 'Special' && replaceThis !== 'Talk' ) { $( 'a:contains("' + replaceThis + ' talk:")' ).each( function {     $( this ).html( $( this ).html.replace( replaceThis + ' talk:', withThis + 't:' ) );    } ); } }

/* NS-2 *//*                      *//* Media: */// Only exists in fantasies /* NS-1 *//*                    *//* Special: */ nsReplace( 'Special', 'S' ); /* NS0  *//* NS1   *//*     *//* (main) Talk: */ nsReplace( 'Talk', 't' ); /* NS2  *//* NS3   *//*     *//* User( talk): */ nsReplace( 'User', 'U' ); /* NS4  *//* NS5   *//* *//* DDO_wiki( talk): */ nsReplace( 'DDO wiki', 'DDO' ); /* NS6  *//* NS7   *//*     *//* File( talk): */ nsReplace( 'File', 'F' ); /* NS8  *//* NS9   *//**//* MediaWiki( talk): */ nsReplace( 'MediaWiki', 'MW' ); /* NS10 *//* NS11  *//* *//* Template( talk): */ nsReplace( 'Template', 'T' ); /* NS12 *//* NS13  *//*     *//* Help( talk): */ nsReplace( 'Help', 'H' ); /* NS14 *//* NS15  *//* *//* Category( talk): */ nsReplace( 'Category', 'C' ); /* NS200 *//* NS201 *//*   *//* Forum( talk): */ nsReplace( 'Forum', 'f' ); /* NS274 *//* NS275 *//*  *//* Widget( talk): */ nsReplace( 'Widget', 'W' ); /* NS500 *//* NS501 *//*           *//* Item: */ /* Do not add for Item: */ /*                          *//* Item( talk): */ nsReplace( 'Item', 'I' ); //