Diferencia entre revisiones de «Usuario:Stargazer/common.js»

De La Coppermind
Ir a la navegación Ir a la búsqueda
m (Think that should fix it)
m (Hmm, can we make this display just when the page is viewed too?)
Línea 1: Línea 1:
 
function addEditIntro( name ) {
 
function addEditIntro( name ) {
$( '.mw-editsection, #ca-edit, #ca-ve-edit' ).find( 'a' ).each( function ( i, el ) {
+
$( '.mw-editsection, #ca-edit, #ca-view' ).find( 'a' ).each( function ( i, el ) {
 
el.href = $( this ).attr( 'href' ) + '?&editintro=' + name;
 
el.href = $( this ).attr( 'href' ) + '?&editintro=' + name;
 
} );
 
} );

Revisión del 18:55 28 jul 2020

function addEditIntro( name ) {
	$( '.mw-editsection, #ca-edit, #ca-view' ).find( 'a' ).each( function ( i, el ) {
		el.href = $( this ).attr( 'href' ) + '?&editintro=' + name;
	} );
}

if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) {
	$( function () {
		var cats = mw.config.get( 'wgCategories' );
		if ( !cats ) {
			return;
		}
		if ( $.inArray( 'Stormlight Archive', cats ) !== -1 || $.inArray( 'General cosmere', cats ) !== -1 ) {
			addEditIntro( 'MediaWiki:Top-notice-ns-0' );
		}
	} );
}