MediaWiki:Centralnotice-template-Leichte Sprache Banner iPad

Aus Hurraki - Wörterbuch für Leichte Sprache
Wechseln zu: Navigation, Suche

<style>

 #centralNotice.collapsed #{{{banner}}}{
   display: none;
 }
 div#{{{banner}}} {
   background: transparent;
   display: none;
   font-family: Arial, Helvetica, Verdana, sans-serif;
   left: 0;
   position: fixed;
   top: 0;
   width: 100%;
   z-index: 9999;
 }
 #{{{banner}}}-form-wrapper {
   background: #eef0fc;
   box-shadow: 3px 0 5px rgba(0, 0, 0, 0.5);
   padding: 4px 8px;
 }
 #{{{banner}}}-form {
   height: 100%;
 }
 #{{{banner}}}-form table {
   border: none;
   border-collapse: collapse;
   width: 100%;
   height: 100%;
 }
 #{{{banner}}}-form td {
   font-size: 12px;
   font-weight: bold;
   min-width: 55px;
   white-space: nowrap;
   margin: 0;
   vertical-align: middle;
   padding: 2px;
 }
 #{{{banner}}}-form span label {
   margin-left: 2px;
 }
 #{{{banner}}}-form .amount-options {
   height: 20%;
 }
 #{{{banner}}}-form .paymentmethod-options td {
   text-align: center;
   padding: 4px 4px 8px 4px;
 }
 #{{{banner}}}-form button {
   cursor: pointer;
   display: inline-block;
   font-weight: bold;
   width: 110px;
   border: 3px double #ddd;
   border-radius: 8px;
   background: #ffffff; /* Old browsers */
   background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
   background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* Opera 11.10+ */
   background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
   background: linear-gradient(to bottom, #ffffff 0%,rgb(240, 240, 240) 100%);
   box-shadow: 0 1px 1px #ddd;
   margin: 0 1px;
 }
 #{{{banner}}}-form button:hover {
   color: #0645ad;
 }
 div#{{{banner}}} #{{{banner}}}-facts {
   background: #FFCC00 url(//upload.wikimedia.org/wikipedia/donate/c/c0/Information-icon.png) no-repeat 10px 8px;
   min-height: 65px;
   padding: 0;
   position: relative;
   width: 100%;
   border: none;
   border-collapse: collapse;
 }
 div#{{{banner}}} #{{{banner}}}-facts p {
   color: #000;
   font-size: 17px;
   font-weight: bold;
   line-height: 1.2em;
   margin: 0;
   margin: 4px 10px 4px 35px;
   text-align: justify;
   padding-bottom: 2px;
 }
 div#{{{banner}}} p#{{{banner}}}-legal {
   font-family: Arial, Helvetica, Verdana, sans-serif;
   position: relative;
   margin: 0;
   padding: 10px 40px 10px 40px;
   font-size: 13px;
   line-height: 16px;
   font-weight: normal;
   z-index: -10;
   background: #FFCC00;
   top: -100px;
   text-align: center;
 }
 #{{{banner}}}-close-wrapper {
   width: 20px;
 }
 div#{{{banner}}} span#{{{banner}}}-close {
   background: url(//upload.wikimedia.org/wikipedia/donate/2/27/Small-white-close.png) no-repeat center center;
   background-color: black;
   cursor: pointer;
   display: block;
   height: 21px;
   position: absolute;
   right: 0px;
   top: 0px;
   width: 21px;
 }
 div#{{{banner}}} #{{{banner}}}-facts p b {
   background: yellow;
   color: black;
   padding: 1px 0.5em;
 }
 .interval-hidden {
   display: none;
 }
 #{{{banner}}}_info {
   margin: 0 10px 0 40px;
   font-size: 13px;
   line-height: 16px;
   position: relative;
   border-top: 1px solid #988A00;
   padding-top: 2px;
 }
 #{{{banner}}}_info div#binfo-sepa-info {
   position: absolute;
   top: 2px;
   background-color: #FFCC00;
   height: 20px;
   width: 600px;
 }
 div#{{{banner}}}_info span {
   margin-right: 10px;
 }
 div#{{{banner}}}_info span.binfo-ucase {
   text-transform: uppercase;
 }
 div#{{{banner}}}_info span.binfo-lblue {
   color: #96A0AA;
 }
 div#{{{banner}}}_info span.binfo-dblue {
   color: #000000;
 }
 div#{{{banner}}}_info span.binfo-bold {
   font-weight: bold;
 }
 div#{{{banner}}}_info span.binfo-sepa-box {
   font-size: 10px;
   border-radius: 5px;
   background-color: white;
   padding: 2px 5px;
   cursor: pointer;
   color: #000000;
 }
 div#{{{banner}}} span.btext-highlight {
   background-color: yellow;
   padding: 1px 5px;
 }
 #donationMeterWrapper {
   position: relative;
   margin: 0 auto 4px auto;
   max-width: 1200px;
 }
 #donationMeter {
   margin: 0 auto;
   height: 20px;
   background: #FF6C00;
   border: 2px solid #FF6C00;
   border-radius: 8px;
 }
 #donationFill {
   position: absolute;
   top: 2px;
   left: 2px;
   width: 90px;
   height: 20px;
   background: #FFFFFF;
   border-top-left-radius: 5px;
   border-bottom-left-radius: 5px;
 }
 #donationText {
   position: absolute;
   height: 100%;
   width: 100%;	
   text-align: right;
   /*margin: 8px -16px;*/
   top: 2px;
   font-size: 14px;
   font-weight: bold;
   color: #B2B2B2;
   overflow: hidden;
 }
 #donationRemaining {
   position: absolute;
   top: 3px;
   right: 10px;
   font-size: 15px;
   color: white;
   font-weight: bold;
 }
 #daysLeft {
   display: none;
   font-size: 14px;
   color: #FF6C00;
   font-weight: bold;
   top: 2px;
   position: absolute;
   left: 5px;
 }

</style>

{{{banner-text}}}

0,0 Mio. €
Nur noch 11 Tage
               
es fehlen 6,1 Mio. €
             Spendenkonto
             Wikimedia Fördergesellschaft
             Kto
             1194700
             BLZ
             10020500
           SEPA
       <form id="{{{banner}}}-form" method="post" name="donationForm" action="https://spenden.wikimedia.de/spenden/?page={{{landing-page}}}&skin={{{page-skin}}}&piwik_campaign={{{CampaignName}}}&piwik_kwd={{{BannerName}}}">
               <input type="radio" checked="checked" class="amount-radio" id="interval_onetime" onclick="$('.interval-options').addClass('interval-hidden');$('#interval_multiple').attr('checked', false);" />
               
               <input type="radio" class="amount-radio" id="interval_multiple" onclick="$('.interval-options').removeClass('interval-hidden');$('#interval_onetime').attr('checked', false);" />
               
               <input type="radio" name="interval" class="amount-radio" id="interval1" value="1" />
               
               <input type="radio" name="interval" class="amount-radio" id="interval3" value="3" />
               
               <input type="radio" name="interval" class="amount-radio" id="interval6" value="6" />
               
               <input type="radio" name="interval" class="amount-radio" id="interval12" value="12" />
               

               <input type="radio" class="amount-radio" name="betrag_auswahl" onclick="document.donationForm.amountGiven.value = " id="amount5" value="5" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" onclick="document.donationForm.amountGiven.value = " id="amount15" value="15" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" onclick="document.donationForm.amountGiven.value = " id="amount25" value="25" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" checked="checked" onclick="document.donationForm.amountGiven.value = " id="amount50" value="50" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" onclick="document.donationForm.amountGiven.value = " id="amount75" value="75" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" onclick="document.donationForm.amountGiven.value = " id="amount100" value="100" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" onclick="document.donationForm.amountGiven.value = " id="amount250" value="250" />
               
               <input type="radio" class="amount-radio" name="betrag_auswahl" id="amount_other" value="" />
               <input type="text" onfocus="$('#amount_other').attr('checked', 'checked');" autocomplete="off" size="3" name="amountGiven" />
               <button class="send" onclick="$('#form-page').val('Formularseite2-Lastschrift');">Lastschrift</button>
               <button class="send" onclick="$('#form-page').val('Formularseite2-Überweisung');">Überweisung</button>
               <button class="send" onclick="$('#form-page').val('Formularseite2-Micropayment');">Kreditkarte</button>
               <button id="btn-ppl" class="send" onclick="$('#form-page').val('Formularseite2-PayPal');">PayPal</button>
         <input type="hidden" name="periode" id="periode" value="" />
         <input type="hidden" id="form-page" name="form" value="Formularseite2-Lastschrift" />
         <input type="hidden" id="wikilogin" name="wikilogin" value="no" />
         <input type="hidden" id="impCount" name="impCount" value="" />
         <input type="hidden" id="bImpCount" name="bImpCount" value="" />
       </form>
        


<script type="text/javascript"> $( document ).ready( function() {

 $('body').prepend($('#centralNotice'));
 var impCount = increaseImpCount();
 $("#impCount").val(impCount);
 var bannerImpCount = increaseBannerImpCount();
 $("#bImpCount").val(bannerImpCount);
 if ( wgAction === "view" ) {
   setTimeout( addBannerSpace, 7500 );
 }
 if(wgUserName !== null) $('#wikilogin').val('yes');
 $(window).resize(function() {
   animateProgressBar();
 });
 $( ".send" ).click( function( e ) {
   return validateForm();
 });
 $('#{{{banner}}}-close').click(function() {
   hideBanner();
   removeBannerSpace();
   return false;
 });
 $('span.binfo-sepa-box').click( function() {
   if ( $( 'div#binfo-sepa-info' ).is( ':visible' ) ) {
     $( 'div#binfo-sepa-info' ).slideUp();
   } else {
     $( 'div#binfo-sepa-info' ).slideDown();
   }
 });
 $('span#numDaysLeft').text( getDaysRemaining() );

});

function getDaysRemaining() {

 daysRemaining = Math.floor( new Date( new Date( 2014, 0, 1, 5, 0, 0 ) - new Date() ) / 1000 / 60 / 60 / 24 );
 return ( daysRemaining > 1 ) ? daysRemaining + " Tage" : "1 Tag";

}

function animateProgressBar() {

 $("#donationFill").clearQueue();
 $("#donationFill").stop();
 $('#daysLeft').hide();
 $('#donationFill').width('90px');
 var barWidth = $('#donationMeter').width();
 var dTarget = {{{donation-target}}};
 var dCollected = {{{donations-collected}}};
 var dRemaining = dTarget - dCollected;
 var fWidth = dCollected / dTarget * barWidth;
 var maxFillWidth = barWidth - $('#donationRemaining').width() - 16;
 widthToFill = (fWidth > maxFillWidth) ? maxFillWidth : fWidth;
 $("#donationFill").animate( { width: widthToFill + 'px' }, {
   duration: 2500, 
   progress: function() {
     var dFill = $("#donationFill").width() / widthToFill * fWidth;
     var pFill = dFill / barWidth;
     var dColl = dTarget * pFill / 1000000;
     var vRem = ( dTarget - ( dTarget * pFill ) ) / 1000000;
     dColl = dColl.toFixed( 1 );
     dColl = dColl.replace( ".", "," );
     vRem = vRem.toFixed( 1 );
     vRem = vRem.replace( ".", "," );
     $("#donationValue").html( dColl );
     $("#valRem").html( vRem );
   },
   complete: function() {
     $('div#daysLeft').show();
   }
 });

}

function addBannerSpace() {

 var expandableBannerHeight = $('div#{{{banner}}}').height() + 44;
 switch(skin) {
   case 'vector':
     $('#{{{banner}}}').css( 'top', 0 - expandableBannerHeight );
     $('#mw-panel').animate({top: expandableBannerHeight + 160}, 1000);
     $('#mw-head').animate({top: expandableBannerHeight}, 1000);
     $('#mw-page-base').animate({paddingTop: expandableBannerHeight}, 1000);
     break;
   case 'monobook':
     $('#globalWrapper').css('position', 'relative');
     $('#globalWrapper').css('top', expandableBannerHeight);
     $('#{{{banner}}}').css('top', '-20px');
     $('#{{{banner}}}').css('background', 'none');
     break;
 }
 $('#{{{banner}}}').css('display', 'block');
 $('#{{{banner}}}').animate({top: 0}, 1000);
 setTimeout(animateProgressBar, 1000);

} function removeBannerSpace() {

 switch(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;
 }

}

function increaseImpCount() {

 impCount = parseInt($.cookie('centralnotice_banner_impression_count')) | 0;
 $.cookie('centralnotice_banner_impression_count', impCount + 1, { expires: 7, path: '/' });
 return impCount + 1;

}

function increaseBannerImpCount() {

 var impCount = 0;
 if($.cookie('centralnotice_single_banner_impression_count')) {
   var impCountCookie = $.cookie('centralnotice_single_banner_impression_count');
   var bannerImpCount = impCountCookie.split("|");
   if(bannerImpCount[0] === '{{{banner}}}') {
     impCount = parseInt(bannerImpCount[1]);
   }
 }
 $.cookie('centralnotice_single_banner_impression_count', '{{{banner}}}|' + (impCount + 1), { expires: 7, path: '/' });
 return (impCount + 1);

}

function validateForm() {

 var chkdPayment = $( 'input[name=pay]:checked', '#{{{banner}}}-form' ).val();
 switch( chkdPayment ) {
   case "BEZ":
     $( '#form-page' ).val( 'Formularseite2-Lastschrift' );
     break;
   case "UEB":
     $( '#form-page' ).val( 'Formularseite2-Überweisung' );
     break;
   case "PPL":
     $( '#form-page' ).val( 'Formularseite2-PayPal' );
     break;
   case "MCP":
     $( '#form-page' ).val( 'Formularseite2-Micropayment' );
     break;
 }
 var form = document.donationForm;
 var error = false;
 
 if($('#interval_multiple').attr('checked') === 'checked') {
   if($('input[name=interval]:checked', form).length !== 1) {
     alert("Es wurde kein Zahlungsintervall ausgewählt.");
     return false;
   } else {
     $('#intervalType').val( "1" );
     $('#periode').val($('input[name=interval]:checked', form).val());
   }
 } else {
   $('#periode').val("0");
 }
 // Get amount selection
 var amount = null;
 for ( var i = 0; i < form.betrag_auswahl.length; i++ ) {
   if ( form.betrag_auswahl[i].checked ) {
     amount = form.betrag_auswahl[i].value;
     break;
   }
 }
 if ( form.amountGiven.value != "" ) {
   var otherAmount = form.amountGiven.value;
   otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
   otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
   otherAmount = otherAmount.replace(/[\$,.]/g, );
   otherAmount = otherAmount.replace(/:/, '.');
   form.amountGiven.value = otherAmount;
   amount = otherAmount;
   $('#input_amount_other').val( otherAmount );
 }
 // Check amount is a real number
 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
 // Check amount is at least the minimum
 if ( amount < 1 || error ) {
   alert( 'Der Mindestbetrag beträgt 1 Euro.');
   return false;
 } else if ( amount > 99999 ) {
   alert( 'Der Spendenbetrag ist zu hoch.' );
   return false;
 }
 return !error;

} </script>