MediaWiki:Mobile.js: Unterschied zwischen den Versionen

keine Bearbeitungszusammenfassung
(Die Seite wurde neu angelegt: „→‎Das folgende JavaScript wird für alle Nutzer der Mobilen Version geladen.: ( function( $, mw ) { 'use strict'; // Prefill the summary field on the U…“)
 
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
/* Das folgende JavaScript wird für alle Nutzer der Mobilen Version geladen. */
/* Das folgende JavaScript wird für alle Nutzer der Mobilen Version geladen. */
( function( $, mw ) {
'use strict';
// Prefill the summary field on the Upload page with an Information template.
// Remove this when Bug 70146 is fixed.
function loadInformationTemplate() {
var $uploadDescription = $( '#wpUploadDescription' );
// Don't show when reuploading
if ( mw.util.getParamValue( 'wpDestFile' ) !== null ) return;
if ( $uploadDescription !== null && $uploadDescription.val() === '' ) {
// Prefill with template
$uploadDescription.val( '{{Information\n|Description=\n|Source=\n|Date=\n|Author=\n|Permission=\n|other_versions=\n}}\n' );
// Hide copy & pastable template in intro, since we just prefilled it automatically
$( '#Uploadtext-template-box' ).hide();
}
}
$( function() {
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
loadInformationTemplate();
}
} );
}( jQuery, mediaWiki ) );