MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
(Created page with "→Any JavaScript here will be loaded for all users on every page load.: ) { // Make the toggle inherit text color (Updated for T333357 2023-04-29) if ( $toggle.par...") |
(No difference)
|
Revision as of 10:57, 16 November 2023
/* Any JavaScript here will be loaded for all users on every page load. */ ) { // Make the toggle inherit text color (Updated for T333357 2023-04-29) if ( $toggle.parent()[ 0 ].style.color ) { $toggle.css( 'color', 'inherit' ); $toggle.find( '.mw-collapsible-text' ).css( 'color', 'inherit' ); } } } ); } mw.hook( 'wikipage.collapsibleContent' ).add( mwCollapsibleSetup ); /** * Magic editintros **************************************************** * * Description: Adds editintros on disambiguation pages and BLP pages. * Maintainers: [[User:RockMFR]] * * @param {string} name */ function addEditIntro( name ) { $( '.mw-editsection, #ca-edit, #ca-ve-edit' ).find( 'a' ).each( function ( i, el ) { el.href = $( this ).attr( 'href' ) + '&editintro=' + name; } ); } if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) { $( function () { if ( document.getElementById( 'disambigbox' ) ) { addEditIntro( 'Template:Disambig_editintro' ); } } ); $( function () { var cats = mw.config.get( 'wgCategories' ); if ( !cats ) { return; } if ( $.inArray( 'Living people', cats ) !== -1 || $.inArray( 'Possibly living people', cats ) !== -1 ) { addEditIntro( 'Template:BLP_editintro' ); } } ); } /* End of mw.loader.using callback */ } ); /* DO NOT ADD CODE BELOW THIS LINE */