MediaWiki:Centralnotice-template-B1718 1205 WMCH dsk lg clone
<style> /* Hide when editing */ .action-edit #centralNotice, .ve-activated #centralNotice {
display: none !important;
}
/* Border-Box */
.frb *, .frb *:before, .frb *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
/* Banner wide settings */
.frb input, .frb button {
font-size: inherit; font-family: inherit;
}
.frb button {
cursor: pointer; outline: 0; text-align: center;
}
/* --- Main banner wrapper --- */
.frb {
display: none; position: absolute; top: 0; left: 0; right: 0; z-index: 110; background: transparent;
}
.frb {
border-bottom: 1px solid #c8ccd1; background-color: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.1); color: #222; font-size: 16px; line-height: 1.1875; /*19px @16px*/ font-family: "Helvetica Neue", "Helvetica", "Nimbus Sans L", "Arial", "Liberation Sans", sans-serif; font-weight: 500;
}
.frb.frb--minimized {
position: fixed;
}
/* --- Window Styles --- */
.frb-main {
position: relative; display: table; width: 100%; padding: 16px 0 16px 8px; background-color: #FFFFFF; transition: background-color 0.5s ease;
}
body.rtl .frb-main {
padding: 16px 8px 16px 0;
}
/* Minimized styles */ .frb--minimized {
cursor: pointer;
}
.frb--minimized .frb-main:hover {
background-color: #eaf3ff;
}
/* --- Close button --- */
.frb-controls {
display: inline-block; position: absolute; right: 0; top: 0; z-index: 999; font-size: 12px; text-transform: uppercase; cursor: pointer; padding: 8px 16px; color: #72777d;
} body.rtl .frb-controls {
right: auto; left: 0;
}
.frb-close:hover {
color: #000000;
} .frb-close:hover .frb-icon g {
stroke: #000000;
}
/* -------------- Message -------------- */
.frb-message {
position: relative; display: table-cell; width: auto; vertical-align: top; border: 8px solid #990000; border-radius: 12px; background-color: #f8f9fa; padding: 16px 30px; color: #000; font-family: "Linux Libertine", Georgia, Times, serif; font-size: 16px; line-height: 1.4; /*22.4px @16px*/ transition: background-color 0.5s ease;
}
@media (min-width: 900px) {
.frb-message { font-size: 19px; }
}
@media (min-width: 1100px) {
.frb-message { font-size: 22px; }
}
@media (min-width: 1300px) {
html[lang="en"] .frb-message { font-size: 24px; }
}
@media (min-width: 1500px) {
.frb-message { font-size: 24px; }
}
.frb-message-icon {
float: left; margin-top: 0.07368421053em; /*1.4px @19px*/ margin-left: calc(-1em + -0.05263157895em); /*-19px + -1px @19px*/ height: 1em; width: 1em;
}
body.rtl .frb-message-icon {
float: right; margin-right: calc(-1em + -0.2105263158em); /*-19px + -4px @19px*/
}
.frb-message p {
margin: 0;
}
.frb-highlight {
border-bottom: 3px solid #990000;
}
/* Minimized styles */ .frb--minimized .frb-message {
padding: 16px 10px 16px 30px; cursor: pointer; font-size: 16px; background-color: transparent;
} body.rtl .frb--minimized .frb-message {
padding: 16px 30px 16px 10px;
}
@media (min-width: 900px) {
.frb--minimized .frb-message { font-size: 14px; }
}
@media (min-width: 1050px) {
.frb--minimized .frb-message { font-size: 16px; }
}
@media (min-width: 1200px) {
.frb--minimized .frb-message { font-size: 18px; }
}
@media (min-width: 1300px) {
.frb--minimized .frb-message { font-size: 22px; }
}
/* -------------- Form -------------- */
.frb-form {
display: table-cell; position: relative; width: 30%; height: 100%; vertical-align: top; padding: 1.5em 1em .5em 1em; background: #fff;
}
/* .frb-form:before {
position: absolute; left: 0; top: 50%; content: " "; margin: 0; border: 10px solid transparent; border-left-color: #040931; pointer-events: none;
}
- /
@media (min-width : 960px) {
.frb-form { width: 25%; padding: 1.8em 1.8em .5em 1.8em; }
}
.frb-form h2 {
font-size: 1.1em; border-bottom: 0; text-align: center;
}
.frb-form fieldset {
width: 100%; border: 0; margin: 0 auto; padding: 0 0 1em 0;
}
.frb-form ul {
display: table; width: 100%; height: 100%; margin: 0 0 .3em; padding: 0; list-style: none;
}
.frb-form legend {
width: 100%; margin: 0; padding: 0 0 0.3em 0; text-align: center; font-size: .9em; color: #222;
}
/* --- Common Button Styles --- */
.frb-btn, #frb-rml {
display: block; padding: .8em .2em; background: #f8f9fa; border: 1px solid #9aa0a7; text-align: center; text-transform: uppercase; cursor: pointer; text-decoration: none !important;
}
.frb-btn:hover {
background-color: #fff;
}
.frb-btn.checked {
box-shadow: inset 0 1px 3px rgba(0,0,0,.5); color: #fff;
}
.frb-btn:active {
background-color: #d9d9d9 !important; color: #000 !important; border-color: #7d8389;
}
/* --- Amount Buttons --- */
.frb-amounts li {
display: table-cell; width: 33%; height: 100%; clear: none; padding: 0 2% 0 0; vertical-align: top;
}
/* Chrome specific - need to be floated for height 100% to work */ @media screen and (-webkit-min-device-pixel-ratio:0) {
.frb-amounts li { float: left; }
}
.frb-amounts li input[type="radio"] {
position: absolute; overflow: hidden; height: 1px; width: 1px; clip: rect(0 0 0 0); border: 0; margin: -1px; padding: 0;
}
.frb-amounts label {
height: 100%; font-size: .9em; text-transform: none;
}
.frb-amounts li input[type="radio"]:checked + label, .frb-amounts li input[type="radio"].checked + label {
background-color: #2a4b8d; color: #fff; border-color: #7d8389;
}
@media (min-width : 800px) { .frb-amounts .predefined_amount { font-size: 1em; } } @media (min-width : 1100px) { .frb-amounts .predefined_amount { font-size: 1.1em; } }
.frb-amounts li input[type="radio"]:checked + label #input_amount_other_box {
background: #fff;
}
.frb-btn-submit:focus, .frb-amounts input[type="radio"]:checked + label:focus, .frb-amounts input[type="radio"]:checked + .frb-btn:focus, .frb-amounts input[type="radio"]:checked:focus + label, .frb-amounts input[type="radio"]:checked:focus + .frb-btn, .frb-amt-other.is-focused .frb-btn {
border-color: #36c; box-shadow: inset 0 0 0 1px #36c, inset 0 0 0 2px #fff;
}
.frb-btn:focus, .frb-amounts input[type="radio"]:focus + label, .frb-amounts input[type="radio"]:focus + .frb-btn {
border-color: #36c !important; box-shadow: inset 0 0 0 1px #36c;
}
.frb-form input[type=radio]:checked + .frb-btn {
background-color: #2a4b8d; color: #fff; border-color: #7d8389;
}
/* --- Other Amount --- */
- amount_other .frb-btn {
display: inline-block; width: 100%; height: 100%; padding: 0.2em 0 0.4em 0;
}
- amount_other label {
display: block; height: auto; margin-bottom: 0.2em; font-size: .7em; line-height: 1; cursor: pointer;
}
- amount_other input {
width: 80%; background: #e7e7e7; border: 0; color: #807f7f; font-size: .9em; padding: .3em; border-radius: .3em; direction: ltr; text-align: center;
}
- amount_other .checked input {
background: #fff; color: #163348;
}
/* --- Payment method Buttons --- */
/* hide methods which aren't monthly capable when monthly option is selected */ .form-monthly .no-monthly {
display: none !important;
}
.frb-form .frb-submit {
padding-bottom: 0;
}
.frb-submit ul {
display: block;
} .frb-submit ul li {
width: 100%; display: block; margin-bottom: .4em;
}
.frb-submit .frb-btn {
border: 1px solid #9aa0a7; border-radius: 4px; color: #36c; background-color: #f8f9fa; background-size: auto 50%; background-repeat: no-repeat; background-position: center center;
}
.frb-submit .frb-btn:hover {
background-color: #fff; color: #36c;
}
.frb-submit .frb-btn {
width: 100%; height: 100%; font-size: .85em; float: none; font-family: inherit;
}
/* Payment logos */
- frb-window .paymentmethod-pp {
text-indent: -99999px; background-image: url('//upload.wikimedia.org/wikipedia/donate/thumb/8/8d/Paypal-color.svg/320px-Paypal-color.svg.png');
}
@media (min-width: 960px) { .frb-submit .frb-btn { font-size: .9em; } } @media (min-width: 1200px) { .frb-submit .frb-btn { font-size: .95em; } }
.frb-bankinfo {
color: #7c7c7c; margin-top: .5em; font-size: .9em; text-align: center;
}
/* --- Footer / Small Print --- */ .frb-footer {
padding: 0 24px 6px; font-size: 12px; color: #555; text-align: center; display: none; font-weight: normal;
}
.frb:hover .frb-footer {
display: block;
}
/* Minimized styles */ .frb.frb--minimized:hover .frb-footer {
display: none;
}
/* --- Show and Hiding (Minimize and Maximize) --- */ .frb-btn-toggle-size {
display: none; /*shows when minimized*/ width: 100%; font-size: 16px; background-color: #2a4b8d; color: #fff; border-color: #2a4b8c; transition: color 0.5s ease; text-transform: uppercase; font-weight: bold; letter-spacing: 0.0375em; /*0.6px @16px*/
}
.frb-btn-toggle-size:hover, .frb-btn-toggle-size:focus {
background-color: #2a4b8d; border-color: #2a4b8c; color: #eaf3ff;
}
/*Minimized styles*/ .frb--minimized .frb-btn-toggle-size {
display: block;
}
.frb--minimized:hover .frb-btn-toggle-size {
color: #eaf3ff;
}
/* Messages */ .frb-message__minimized {
display: none;
} .frb-message__maximized {
display: block;
} .frb-greeting {
display: block; margin-bottom: 4px;
}
/* Minimized styles */ .frb--minimized .frb-message__minimized {
display: block;
} .frb--minimized .frb-message__maximized, .frb--minimized #frb-form, .frb--minimized .frb-rml {
display: none;
} </style>
<script> /* Allow overriding country */ if( mw.util.getParamValue("country") ) {
Geo.country = mw.util.getParamValue("country");
}
/** Provides alterImpressionData hook for CentralNotice
* This info will be sent back with Special:RecordImpression */
mediaWiki.centralNotice.bannerData.alterImpressionData = function( impressionData ) {
// Returning true from this function indicates the banner was shown if (mediaWiki.centralNotice.bannerData.hideReason) { impressionData.reason = mediaWiki.centralNotice.bannerData.hideReason; } if (mediaWiki.centralNotice.bannerData.cookieCount) { impressionData.banner_count = mediaWiki.centralNotice.bannerData.cookieCount; } return !mediaWiki.centralNotice.bannerData.hideResult;
};
var frb = frb || {};
frb.addSpace = function() {
if ( $('.frb').is(':visible') ) { /* Add space for the banner, and extra px if given below. called on load and window resize */ var extra = 32; var bannerHeight = $('.frb-main').height(); $('#mw-panel').css('top', bannerHeight+extra); $('#mw-head').css('top', bannerHeight+extra); $('#mw-page-base').css('margin-top', bannerHeight+extra); }
};
frb.show = function() {
$('body').prepend($('#centralNotice')); $('.frb').css('display', 'block'); frb.addSpace(); $(window).resize(function() { frb.addSpace(); });
};
frb.resetMw = function() {
$('#mw-panel').css('top', '0px'); $('#mw-head').css('top', '0px'); $('#mw-page-base').css('margin-top', '0');
}
frb.hide = function() {
/* Hide the banner, and remove the extra space which was added for it */ /* Don't set a cookie: this is a large banner and only shown on first view anyway */ $('.frb').hide(); frb.resetMw();
};
frb.validateForm = function() {
var form = document.donationForm; var error = false;
// Get amount selection var amount = $('input[name=amount]:checked').val(); if( amount === 'Other' ) { amount = $('#input_amount_other_box').val(); } // 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 ) { return false; } else if ( amount > 99999 ) { return false; }
// make sure the right field form has the amount $('input[name=amount]:checked').val( amount );
return !error;
};
$(document).ready(function() {
var donationForm = document.donationForm;
$( '.paymentmethod-cc' ).click( function() { if( frb.validateForm() ) { donationForm.action = 'https://www.wikimedia.ch/donate/'; $( '#frb-donation-form > input.paypal-field' ).attr( 'disabled', 'disabled' ); donationForm.submit(); } else { alert( "Please select an amount to donate (at least Fr. 1.-)" ); return false; } });
$( '.paymentmethod-pp' ).click( function() { if( frb.validateForm() ) { donationForm.action = 'https://www.paypal.com/cgi-bin/webscr'; $( '#frb-donation-form > input.paypal-field' ).attr( 'disabled', false ); donationForm.lc.value = mw.config.get('wgUserLanguage'); // set to correct language donationForm.submit(); } else { alert( "Please select an amount to donate (at least Fr. 1.-)" ); return false; } });
$( '.paymentmethod-slip' ).click( function() { donationForm.action = 'https://www.wikimedia.ch/donate/payment-slip-85-359089-1/'; $( '#frb-donation-form > input.paypal-field' ).attr( 'disabled', 'disabled' ); donationForm.submit(); });
$(".frb-amounts .frb-btn").click(function() { $(".frb-amounts .frb-btn").removeClass("checked"); $(this).addClass("checked"); $('#input_amount_other_box').val(); // Clear "other" box });
$("#amount_other").click(function() { document.getElementById("input_amount_other").checked = true; $("#input_amount_other_box").focus(); });
$('.frb-close').click(function() { frb.hide(); });
/* Hide banner outside of main namespace (and Main Page, for sites where that isn't in main namespace) */ if ( mw.config.get('wgNamespaceNumber') > 0 && !mw.config.get('wgIsMainPage') ) { mw.centralNotice.bannerData.hideResult = true; mw.centralNotice.bannerData.hideReason = 'namespace'; }
if (!mw.centralNotice.bannerData.hideResult) { frb.show(); }
}); </script>