Jump to content

MediaWiki:Centralnotice-template-WMDE editor campaign summer 2017 b

From Meta, a Wikimedia project coordination wiki

<style>

  1. {{{banner}}}-container {
   position: absolute;
   width: 100%;
   background-color: #a4f2d4;
   text-align: center;
   box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
   overflow: hidden;

}

@media (max-width: 1450px) {

   .{{{banner}}}-inner {
       float: right;
   }

}

.{{{banner}}}-inner {

   width: 1400px;
   margin: 0 auto;
   display: block;

}

  1. {{{banner}}}-container img {
   float: left;

}

.{{{banner}}}-close {

 position: absolute;
 right: 0.5em;
 top: 0.5em;

}

  1. {{{banner}}}-close-tracking {
   display: none;

}

</style>

<a href="#" title="Close">
Close
</a>
   <a class="{{{banner}}}-button-link" href="https://entdecke.wikipedia.de/">
           <img src="//upload.wikimedia.org/wikipedia/commons/f/f4/Wmde_summer_campaign_2017_left.gif" />
           <img src="//upload.wikimedia.org/wikipedia/commons/c/cd/Wmde_summer_campaign_2017_anim.gif" />
           <img src="//upload.wikimedia.org/wikipedia/commons/2/23/Wmde_summer_campaign_2017_right.gif" />
   </a>
   <img id="{{{banner}}}-close-tracking" src="" border="0" width="0" height="0" />

<script> $( document ).ready( function () {

 addBannerSpace();
 $( 'body' ).prepend( $( '#centralNotice' ) );
 $( '.{{{banner}}}-close' ).click( function () {
   if ( Math.random() < 0.01 ) {
     $( '#{{{banner}}}-close-tracking' ).attr( 'src', 'https://tracking.wikimedia.de/piwik/piwik.php?idsite=1&url=https://spenden.wikimedia.de/banner-closed/{{{banner}}}&rec=1' );
   }
   $( '#{{{banner}}}-container' ).hide();
   removeBannerSpace();
   return false;
 } );
 $( '#ca-ve-edit, .mw-editsection-visualeditor' ).click( function () {
   $( '#{{{banner}}}-container' ).hide();
   removeBannerSpace();
 } );

} );

function addBannerSpace() {

 var bannerHeight = 235;
 switch( mw.config.get( 'skin' ) ) {
   case 'vector':
     $( '#mw-panel' ).css( 'top', bannerHeight + 160 );
     $( '#mw-head' ).css( 'top', bannerHeight );
     $( '#mw-page-base' ).css( 'padding-top', bannerHeight );
     break;
   case 'monobook':
     $( '#globalWrapper' ).css( 'position', 'relative' );
     $( '#globalWrapper' ).css( 'top', bannerHeight );
     $( '#{{{banner}}}' ).css( 'top', '-20px' );
     $( '#{{{banner}}}' ).css( 'background', 'none' );
     break;
 }

}

function removeBannerSpace() {

 switch ( mw.config.get( 'skin' ) ) {
   case 'vector':
     $( '#mw-panel' ).css( 'top', 160 );
     $( '#mw-head' ).css( 'top', 0 );
     $( '#mw-page-base' ).css( 'padding-top', 0 );
     break;
   case 'monobook':
     $( '#globalWrapper' ).css( 'position', 'relative' );
     $( '#globalWrapper' ).css( 'top', 0 );
     break;
 }

} </script>