$sessionKey = $this->mUpload->stashSession();
+ // Add styles for the warning, reused from the live preview
+ $this->getOutput()->addModuleStyles( 'mediawiki.special.upload' );
+
$warningHtml = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n"
- . '<div class="warningbox"><ul>';
+ . '<div class="mw-destfile-warning"><ul>';
foreach ( $warnings as $warning => $args ) {
if ( $warning == 'badfilename' ) {
$this->mDesiredDestName = Title::makeTitle( NS_FILE, $args )->getText();
'thumbnail.html' => 'resources/src/mediawiki.special/templates/thumbnail.html',
],
'scripts' => 'resources/src/mediawiki.special/mediawiki.special.upload.js',
+ 'styles' => 'resources/src/mediawiki.special/mediawiki.special.upload.css',
'messages' => [
'widthheight',
'size-bytes',
--- /dev/null
+/*!
+ * Styling for Special:Upload
+ */
+.mw-destfile-warning {
+ border: 1px solid #fde29b;
+ padding: .5em 1em;
+ margin-bottom: 1em;
+ color: #705000;
+ background-color: #fdf1d1;
+}
},
setWarning: function ( warning ) {
- var $warning = $( $.parseHTML( warning ) );
+ var $warningBox = $( '#wpDestFile-warning' ),
+ $warning = $( $.parseHTML( warning ) );
mw.hook( 'wikipage.content' ).fire( $warning );
- $( '#wpDestFile-warning' ).empty().append( $warning );
+ $warningBox.empty().append( $warning );
// Set a value in the form indicating that the warning is acknowledged and
// doesn't need to be redisplayed post-upload
if ( !warning ) {
$( '#wpDestFileWarningAck' ).val( '' );
+ $warningBox.removeAttr( 'class' );
} else {
$( '#wpDestFileWarningAck' ).val( '1' );
+ $warningBox.attr( 'class', 'mw-destfile-warning' );
}
}