MediaWiki:Common.js: Unterschied zwischen den Versionen

KKeine Bearbeitungszusammenfassung
Markierung: Zurückgesetzt
KKeine Bearbeitungszusammenfassung
Markierung: Manuelle Zurücksetzung
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 23: Zeile 23:
*/
*/
mw.log.deprecate( window, 'addPortletLink', mw.util.addPortletLink, 'Use mw.util.addPortletLink instead' );
mw.log.deprecate( window, 'addPortletLink', mw.util.addPortletLink, 'Use mw.util.addPortletLink instead' );
/**
* Test if an element has a certain class
* @deprecated:  Use $(element).hasClass() instead.
*/
mw.log.deprecate( window, 'hasClass', function ( element, className ) {
return $( element ).hasClass( className );
}, 'Use jQuery.hasClass() instead' );


/**
/**
Zeile 67: Zeile 59:
var requireWikiminiatlas = $( 'a.external.text[href*="geohack"]' ).length || $( 'div.kmldata' ).length;
var requireWikiminiatlas = $( 'a.external.text[href*="geohack"]' ).length || $( 'div.kmldata' ).length;
if ( requireWikiminiatlas ) {
if ( requireWikiminiatlas ) {
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript' );
mw.loader.load( 'ext.gadget.WikiMiniAtlas' );
}
}
} );
} );
Zeile 131: Zeile 123:
$toggle = $element.find( '.mw-collapsible-toggle' );
$toggle = $element.find( '.mw-collapsible-toggle' );
if ( $toggle.length ) {
if ( $toggle.length ) {
// Make the toggle inherit text color
// Make the toggle inherit text color (Updated for T333357 2023-04-29)
if ( $toggle.parent()[ 0 ].style.color ) {
if ( $toggle.parent()[ 0 ].style.color ) {
$toggle.find( 'a' ).css( 'color', 'inherit' );
$toggle.css( 'color', 'inherit' );
$toggle.find( '.mw-collapsible-text' ).css( 'color', 'inherit' );
}
}
}
}
Zeile 140: Zeile 133:


mw.hook( 'wikipage.collapsibleContent' ).add( mwCollapsibleSetup );
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' );
}
} );
}
/* Actions specific to the edit page */
if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' ) {
/**
* Fix edit summary prompt for undo
*
*  Fixes the fact that the undo function combined with the "no edit summary prompter"
*  complains about missing editsummary, if leaving the edit summary unchanged.
*  Added by [[User:Deskana]], code by [[User:Tra]].
*  See also [[phab:T10912]].
*/
$( function () {
if ( document.location.search.indexOf( 'undo=' ) !== -1 && document.getElementsByName( 'wpAutoSummary' )[ 0 ] ) {
document.getElementsByName( 'wpAutoSummary' )[ 0 ].value = '1';
}
} );
}


/* End of mw.loader.using callback */
/* End of mw.loader.using callback */
} );
} );
/* DO NOT ADD CODE BELOW THIS LINE */
/* DO NOT ADD CODE BELOW THIS LINE */