MediaWiki:Centralnotice-template-B1718 1114 en6C dsk p1 lg txt cnt

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search

<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: 25%;
   min-width: 300px;
   height: 100%;
   vertical-align: middle;
   padding: 0 8px;
   background: #fff;

}

/* Minimized styles */ .frb--minimized .frb-form {

   background-color: transparent;

}

.frb-form:before {

   position: absolute;
   left: 0;
   top: 50%;
   content: " ";
   margin: -10px 0 0 0;
   border: 10px solid transparent;
   border-left-color: #990000;
   pointer-events: none;

} body.rtl .frb-form:before {

   left: auto;
   right: 0;
   border-left-color: transparent;
   border-right-color: #990000;

}

.frb-form fieldset {

   width: 100%;
   border: 0;
   margin: 0 auto;
   padding: 0 0 8px 0;

}

.frb-form fieldset + fieldset legend {

   border-top: 1px solid #CCC;

}

.frb-form legend {

   position: relative;
   top: 0;
   width: calc(100% - 7px);
   margin: 0;
   padding: 14px 0 4px 0;
   font-weight: normal;
   line-height: 1.2; /*18px @15px*/
   text-align: center;
   font-size: 15px;
   color: #696969;

}

.frb-rml-form legend {

 font-size: 14px;
 font-weight: 500;
 color: #222;
 line-height: 1.3571428571; /*10px @14px*/
 padding: 0 0 8px 0;

}

@media ( max-width: 1400px) {

   fieldset.frb-frequency legend {
       padding: 14px 15px 4px;
   }

}

.frb-form fieldset:first-of-type legend {

   padding-top: 0;

}

.frb-form fieldset + fieldset legend:after, .frb-form fieldset + fieldset legend:before {

   top: -1px;
   left: 50%;
   border: solid transparent;
   content: " ";
   height: 0;
   width: 0;
   position: absolute;
   pointer-events: none;

}

.frb-form fieldset + fieldset legend:after {

   border-color: rgba(255, 255, 255, 0);
   border-top-color: #FFFFFF;
   border-width: 9px;
   margin-left: -9px;

}

.frb-form fieldset + fieldset legend:before {

   border-color: rgba(204, 204, 204, 0);
   border-top-color: #ccc;
   border-width: 10px;
   margin-left: -10px;

}

.frb-form ul {

   display: table;
   table-layout: fixed;
   width: 100%;
   margin: 0;
   padding: 0;
   list-style: none;

}

.frb-amounts ul:first-child {

   margin-bottom: 3px;

}

.frb-form li {

   display: table-cell;
   vertical-align: top;
   padding-left: 4px;

}

.frb-form li:first-child {

   padding-left: 0;

}

.frb-form .frb-methods li {

   padding: 4px !important;

}

  1. frb-form {
   margin-top: 12px;

}

/* --- Common Button Styles --- */

/* Hide radio buttons */ .frb-form .frb-methods input[type="radio"], .frb-amt-other input[type="radio"] {

   position: absolute;
   overflow: hidden;
   height: 1px;
   width: 1px;
   clip: rect(0 0 0 0);
   border: 0;
   margin: -1px;
   padding: 0;

}

.frb-btn {

   width: 100%;
   height: 48px;
   display: block;
   background-color: #f8f9fa;
   color: #222222;
   font-size: 16px;
   line-height: 1.25; /*20px @16px*/
   padding: 13px 4px 15px 4px;
   border: 1px solid #9aa0a7;
   border-radius: 2px;
   outline: 0;
   text-align: center;
   cursor: pointer;
   font-family: inherit;
   font-weight: 500;
   -webkit-transition: all .25s ease-in-out;
   -moz-transition:    all .25s ease-in-out;
   transition:         all .25s ease-in-out;

} .frb-btn:hover {

   background-color: #fff;
   color: #444;
   border-color: #a2a9b1;

} .frb-btn:active {

   background-color: #d9d9d9;
   color: #000;
   border-color: #7d8389;

} .frb-form input[type=radio]:checked + .frb-btn {

   background-color: #2a4b8d;
   color: #fff;
   border-color: #7d8389;

}

.frb-radio, .frb-radio-label {

   font-size: 16px;
   line-height: 1.375; /*22px @16px*/

}

.frb-radio {

   float: left;
   margin: 8px 6px;

}

.frb-radio-label {

   cursor: pointer;
   display: block;
   white-space: nowrap;
   font-weight: bold;
   padding: 6px 2px;

}

.frb-frequency .frb-radio-label {

   font-size: 16px;
   line-height: 1.375; /*22px @16px*/

}

/* Focus styles */

.frb-form input[type=radio]:focus {

   outline: 0;
}

.frb a:focus, .frb button:focus, .frb-radio:focus + .frb-radio-label, .frb-btn:focus, .frb-close:focus, .frb-btn-submit:focus, .frb-form input[type=radio]:focus + .frb-btn, .frb-form input[type=radio]:focus + #frb-amt-other-label,

  1. frb-amt-other-input:focus {
   outline: 0;
   border-color: #36c !important;
   box-shadow: inset 0 0 0 1px #36c;

}

.frb-form input[type=radio]:focus + .frb-btn, .frb-form input[type=radio]:focus + #frb-amt-other-label, .frb-form input[type=radio]:checked + .frb-btn:focus, .frb-form input[type=radio]:checked + #frb-amt-other-label:focus, .frb-form .frb-btn-submit:focus {

   box-shadow: inset 0 0 0 1px #36c, inset 0 0 0 2px #fff;

}

.frb-btn img {

   padding: 0 4px;
   max-width: 100%;
   max-height: 20px; /*must equal font line height of frb-btn*/

}

.frb-methods .frb-btn {

   height: 64px;
   line-height: 1.125; /*18px @16px*/

}

.frb-methods svg {

   max-width: 100%;

}

.frb-methods .frb-pm-cc .frb-btn {

   padding: 7px 4px

}

.frb-methods .frb-pm-cc svg {

   max-width: 30%;

}

.frb-country-GB .frb-methods .frb-pm-cc svg, .frb-country-IE .frb-methods .frb-pm-cc svg {

   max-width: 38%;
   max-height: 24px;

}

.frb-country-US .frb-methods .frb-pm-cc svg, .frb-country-AU .frb-methods .frb-pm-cc svg {

   max-width: 45%;
   max-height: 23px;

}

@media (min-width: 1800px) {

   .frb-country-US .frb-methods .frb-pm-cc svg,
   .frb-country-AU .frb-methods .frb-pm-cc svg {
       max-width: 22%;
   }

}

.frb-country-US .frb-logo-jcb, .frb-country-CA .frb-logo-jcb, .frb-country-NZ .frb-logo-jcb, .frb-country-AU .frb-logo-discover, .frb-country-CA .frb-logo-discover, .frb-country-GB .frb-logo-discover, .frb-country-IE .frb-logo-discover, .frb-country-NZ .frb-logo-discover { display: none; }

/* Blue text buttons */ .frb-btn.frb-btn-btxt {

   color: #3366cc;

} .frb-btn.frb-btn-btxt:active {

   color: #2a4b8d;

}

/* Submit/Continue buttons (blue background) */ .frb-btn-submit {

   width: 100%;
   display: block;
   margin-top: 8px;
   padding: 8px;
   color: #fff;
   background-color: #3366cc;
   border-color: #3366cc;
   cursor: pointer;
   border: 0;
   border-radius: 2px;
   font-size: 16px;
   -webkit-transition: all .25s ease-in-out;
   -moz-transition:    all .25s ease-in-out;
   transition:         all .25s ease-in-out;

} .frb-btn-submit:hover {

   background-color: #447ff5;
   border-color: #447ff5;

} .frb-btn-submit:active {

   background-color: #2a4b8d;
   border-color: #2a4b8d;
   box-shadow: none;

}

/* --- Other Amount --- */

.frb-amt-other-label {

   display: none;

}

.frb-amt-other .frb-btn {

   display: inline-block;
   width: 100%;
   padding: 2px 0 3px 0;

}

.frb-amt-other span {

   display: block;
   height: auto;
   margin-bottom: 1px;
   font-size: 10px;
   line-height: 1; /*10px @16px*/
   cursor: pointer;

}

.frb-amt-other #frb-amt-other-input {

   width: 100%;
   border: 1px solid #ccc;
   color: #555;
   font-size: 16px;
   padding: 7px 2px;
   border-radius: 0;
   direction: ltr;
   text-align: center;
   font-family: inherit;

}

/* --- 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-methods {

   padding-bottom: 0;

}

/* Only where there are 4 methods, display 2x2 */ .frb-methods ul li:first-child:nth-last-child(4), .frb-methods ul li:first-child:nth-last-child(4) ~ li {

   float: left;
   width: 50%;

} .frb-methods ul li:first-child:nth-last-child(4) .frb-btn, .frb-methods ul li:first-child:nth-last-child(4) ~ li .frb-btn {

   height: 48px;
   padding: 13px 4px 15px 4px;

}

/* --- Secure Transaction Legend --- */ .frb-secure-transaction {

   display: block;
   padding: 5px 12px;
   margin: 0 auto;
   color: #000;
   font-size: 12px;
   text-transform: uppercase;
   text-align: center;
   opacity: .7;

} .frb-secure-transaction img {

   width: 14px;
   height: 14px;
   display: inline-block;

}

/* --- 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;
   margin: 0 auto;
   width: 97%;

}

.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;

}

/* --- Maybe later --- */

.frb-rml {

   position: relative;
   width: auto;
   padding: 0;
   margin-top: 4px;

}

.frb-rml-form {

   display: none;
   position: absolute;
   width: 100%;
   padding: 16px;
   margin-top: 6px;
   text-align: center;
   background: white;
   border: 1px solid #888888;
   border-radius: 2px;
   box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.15);
   z-index: 10;

}

.frb-rml-form:after, .frb-rml-form:before {

   bottom: 100%;
   left: 50%;
   border: solid transparent;
   content: " ";
   height: 0;
   width: 0;
   position: absolute;
   pointer-events: none;

}

.frb-rml-form:after {

   border-bottom-color: #fff;
   border-width: 10px;
   margin-left: -10px;

}

.frb-rml-form:before {

   border-bottom-color: #888;
   border-width: 11px;
   margin-left: -11px;

}

.frb-rml-form input {

   width: 100%;
   padding: 8px;
   margin: 0;
   border: 1px solid #9aa0a7;
   border-radius: 2px;
   color: #000;
   direction: ltr;

}

.frb-rml-form input.error {

   border-color: #ff0000;
   box-shadow: inset 0 0 0 2px #ff0000;

}

.frb-rml-form .frb-rml-error {

   color: #ff0000;
   padding-top: 4px;

}

.frb-rml-ty {

   padding: 0 16px;
   text-align: center;
   cursor: default;

} </style>

<script>

   /* Allow overriding country */
   if( mw.util.getParamValue("country") ) {
       Geo.country = mw.util.getParamValue("country");
   }

</script>

<script> 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').addClass('frb-country-' + Geo.country);
   }

};

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.toggleMonthly = function( monthly ) {

   if( monthly.type === 'checkbox' ){
       monthly = monthly.checked;
   }
   if ( monthly ) {
       $('#frb-form').addClass('form-monthly');
   } else {
       $('#frb-form').removeClass('form-monthly');
   }

};

// TODO: Purge currencies that are no longer needed frb.amounts = frb.amounts || {};

// Hard minimum amounts that can be given frb.amounts.minimums = {

   /* From https://github.com/wikimedia/wikimedia-fundraising-SmashPig/blob/master/PaymentData/ReferenceData/CurrencyRates.php */
   'ADF' : 6.01,
   'ADP' : 152,
   'AED' : 3.67,
   'AFA' : 68,
   'AFN' : 68,
   'ALL' : 122,
   'AMD' : 468,
   'ANG' : 1.77,
   'AOA' : 165,
   'AON' : 165,
   'ATS' : 13,
   'AUD' : 1.33,
   'AWG' : 1.79,
   'AZM' : 8510,
   'AZN' : 1.7,
   'BAM' : 1.79,
   'BBD' : 2,
   'BDT' : 81,
   'BEF' : 37,
   'BGL' : 1.79,
   'BGN' : 1.79,
   'BHD' : 0.37445,
   'BIF' : 1681,
   'BMD' : 1,
   'BND' : 1.39,
   'BOB' : 6.8,
   'BRL' : 3.17,
   'BSD' : 1,
   'BTN' : 64,
   'BWP' : 10,
   'BYR' : 20020,
   'BZD' : 1.97,
   'CAD' : 1.37,
   'CDF' : 1369,
   'CHF' : 1,
   'CNY' : 6.89,
   'CRC' : 547,
   'CUC' : 1,
   'CUP' : 25,
   'CVE' : 101,
   'CYP' : 0.54,
   'CZK' : 25,
   'DEM' : 1.79,
   'DJF' : 178,
   'DKK' : 6.81,
   'DOP' : 47,
   'DZD' : 109,
   'ECS' : 25589,
   'EEK' : 14,
   'EGP' : 18,
   'ESP' : 152,
   'ETB' : 23,
   'EUR' : 0.92,
   'FIM' : 5.45,
   'FJD' : 2.08,
   'FKP' : 0.78,
   'FRF' : 6.01,
   'GBP' : 0.78,
   'GEL' : 2.43,
   'GHC' : 41911,
   'GHS' : 4.19,
   'GIP' : 0.78,
   'GMD' : 44,
   'GNF' : 9172,
   'GRD' : 312,
   'GTQ' : 7.17,
   'GYD' : 198,
   'HKD' : 7.78,
   'HNL' : 23,
   'HRK' : 6.83,
   'HTG' : 68,
   'HUF' : 286,
   'IDR' : 13316,
   'IEP' : 0.73,
   'ILS' : 3.61,
   'INR' : 64,
   'IQD' : 1149,
   'IRR' : 32438,
   'ISK' : 106,
   'ITL' : 1774,
   'JMD' : 128,
   'JOD' : 0.71,
   'JPY' : 112,
   'KES' : 101,
   'KGS' : 68,
   'KHR' : 3972,
   'KMF' : 451,
   'KPW' : 135,
   'KRW' : 1129,
   'KWD' : 0.30384,
   'KYD' : 0.81632,
   'KZT' : 314,
   'LAK' : 8068,
   'LBP' : 1491,
   'LKR' : 151,
   'LRD' : 91,
   'LSL' : 13,
   'LTL' : 3.16,
   'LUF' : 37,
   'LVL' : 0.65,
   'LYD' : 1.39,
   'MAD' : 9.85,
   'MDL' : 19,
   'MGA' : 3160,
   'MGF' : 9149,
   'MKD' : 56,
   'MMK' : 1339,
   'MNT' : 2410,
   'MOP' : 7.84,
   'MRO' : 356,
   'MTL' : 0.40,
   'MUR' : 33,
   'MVR' : 15,
   'MWK' : 721,
   'MYR' : 4.33,
   'MZM' : 70440,
   'MZN' : 70,
   'NAD' : 13,
   'NGN' : 312,
   'NIO' : 29,
   'NLG' : 2.02,
   'NOK' : 8.59,
   'NPR' : 101,
   'NZD' : 1.44,
   'OMR' : 0.38365,
   'PAB' : 1,
   'PEN' : 3.21,
   'PGK' : 3.13,
   'PHP' : 50,
   'PKR' : 104,
   'PLN' : 3.86,
   'PTE' : 184,
   'PYG' : 5467,
   'QAR' : 3.64,
   'ROL' : 41607,
   'RON' : 4.16,
   'RSD' : 112,
   'RUB' : 57,
   'RWF' : 822,
   'SAR' : 3.75,
   'SBD' : 7.69,
   'SCR' : 13,
   'SDD' : 665,
   'SDG' : 6.65,
   'SDP' : 2272,
   'SEK' : 8.83,
   'SGD' : 1.39,
   'SHP' : 0.78,
   'SIT' : 220,
   'SKK' : 28,
   'SLL' : 7451,
   'SOS' : 545,
   'SRD' : 7.48,
   'SRG' : 7480,
   'STD' : 22420,
   'SVC' : 8.54,
   'SYP' : 215,
   'SZL' : 13,
   'THB' : 34,
   'TJS' : 8.5,
   'TMM' : 17022,
   'TMT' : 3.4,
   'TND' : 2.41,
   'TOP' : 2.31,
   'TRL' : 3540300,
   'TRY' : 3.54,
   'TTD' : 6.65,
   'TWD' : 30,
   'TZS' : 2213,
   'UAH' : 26,
   'UGX' : 3612,
   'USD' : 1,
   'UZS' : 3728,
   'VEB' : 10022,
   'VEF' : 10,
   'VND' : 22484,
   'VUV' : 107,
   'WST' : 2.59,
   'XAF' : 601,
   'XCD' : 2.69,
   'XOF' : 600,
   'XPF' : 109,
   'YER' : 250,
   'YUN' : 112,
   'ZAR' : 13,
   'ZMK' : 5328,
   'ZWD' : 376,
   /* Astropay currencies have higher minimums - 1.50 USD */
   'ARS' : 22.5,
   'CLP' : 993,
   'COP' : 4380,
   'MXN' : 28.5,
   'UYU' : 42

};

frb.amounts.options7 = {

   'USD' : [3, 5, 10, 20, 30, 50, 100],
   'EUR' : {
       'default' : [2, 5, 10, 20, 30, 50, 100]
   },
   'GBP' : [2, 5, 10, 20, 30, 50, 100],
   'CAD' : [3, 5, 10, 20, 30, 50, 100],
   'AUD' : [3, 5, 10, 20, 30, 50, 100],
   'NZD' : [3, 5, 10, 20, 30, 50, 100],
   'ANG' : [5, 10, 20, 35, 50, 100, 200],
   'ARS' : [30, 50, 100, 200, 500, 750, 1000],
   'BAM' : [3, 5, 10, 25, 40, 70, 140],
   'BBD' : [5, 10, 20, 40, 60, 100, 200],
   'BDT' : [200, 400, 800, 1500, 2000, 4000, 7500],
   'BGN' : [10, 25, 50, 75, 100, 150, 200],
   'BHD' : [1, 2, 4, 8, 10, 20, 40],
   'BMD' : [3, 5, 10, 20, 30, 50, 100],
   'BOB' : [20, 30, 60, 140, 200, 300, 600],
   'BRL' : [10, 20, 30, 50, 100, 250, 500],
   'BZD' : [5, 10, 20, 40, 60, 100, 200],
   'CLP' : [1500, 2500, 5000, 10000, 15000, 25000, 50000],
   'CNY' : [50, 75, 100, 300, 500, 1000, 1500],
   'COP' : [7000, 10000, 20000, 50000, 100000, 150000, 200000],
   'CRC' : [2500, 5000, 10000, 20000, 50000, 75000, 100000],
   'CZK' : [50, 100, 200, 400, 600, 1000, 2000],
   'DKK' : [20, 100, 150, 200, 300, 500, 1000],
   'DOP' : [200, 500, 1000, 2000, 5000, 7500, 10000],
   'DZD' : [200, 400, 750, 1500, 2000, 4000, 7500],
   'FJD' : [5, 10, 20, 40, 50, 100, 200],
   'GTQ' : [20, 40, 80, 150, 200, 350, 750],
   'HKD' : [20, 50, 100, 150, 200, 500, 1000],
   'HNL' : [50, 100, 200, 400, 600, 1000, 1800],
   'HRK' : [35, 50, 100, 250, 500, 1000, 1500],
   'HUF' : [500, 1000, 2000, 4000, 5000, 7000, 10000],
   'ISK' : [300, 500, 1000, 2000, 3000, 5000, 10000],
   'ILS' : [10, 50, 100, 200, 300, 500, 1000],
   'INR' : [100, 200, 300, 500, 1000, 2000, 3000],
   'JMD' : [300, 500, 1000, 2000, 3000, 5000, 10000],
   'JPY' : [300, 1000, 1500, 2000, 3000, 5000, 10000],
   'KRW' : [5000, 10000, 20000, 30000, 50000, 75000, 100000],
   'KWD' : [2, 5, 10,15, 25, 30, 75],
   'KZT' : [750, 1500, 3000, 7500, 12000, 15000, 35000],
   'MKD' : [100, 200, 400, 800, 1200, 2000, 4000],
   'MVR' : [40, 75, 150, 300, 450, 750, 1500],
   'MXN' : [35, 50, 100, 200, 500, 750, 1000],
   'MYR' : [10, 30, 50, 100, 200, 300, 500],
   'NIO' : [100, 250, 500, 1000, 1500, 2500, 5500],
   'NOK' : [20, 100, 150, 200, 500, 750, 1000],
   'OMR' : [1, 2, 4, 8, 10, 20, 40],
   'PAB' : [3, 5, 10, 20, 30, 50, 100],
   'PEN' : [10, 30, 50, 150, 200, 275, 700],
   'PHP' : [200, 500, 750, 1000, 2000, 3000, 5000],
   'PLN' : [10, 20, 50, 100, 200, 300, 500],
   'PYG' : [10000, 20000, 40000, 80000, 120000, 200000, 400000],
   'QAR' : [20, 50, 75, 185, 250, 350, 1000],
   'RON' : [10, 50, 75, 100, 200, 300, 500],
   'SEK' : [30, 50, 100, 200, 300, 500, 1000],
   'SGD' : [3, 5, 10, 20, 30, 50, 100],
   'THB' : [50, 100, 250, 500, 750, 1000, 2000],
   'TND' : [5, 10, 15, 30, 50, 75, 150],
   'TTD' : [20, 30, 60, 120, 200, 300, 600],
   'TWD' : [150, 300, 500, 1000, 1500, 2000, 5000],
   'UAH' : [50, 75, 150, 300, 500, 750, 1000],
   'UYU' : [70, 100, 200, 400, 1000, 1500, 2000],
   'VEF' : [20, 30, 50, 100, 200, 300, 600],
   'VND' : [60000, 100000, 200000, 400000, 600000, 1000000, 2000000],
   'XCD' : [5, 10, 20, 50, 80, 120, 250],
   'XOF' : [1000, 2000, 5000, 10000, 150000, 200000, 400000],
   'XPF' : [250, 400, 800, 1600, 2500, 4000, 8000],
   'ZAR' : [30, 50, 100, 200, 300, 500, 1000],
   'CHF' : [3, 5, 10, 20, 30, 50, 100]

};

// 5 amount options. Used e.g. on mobile // Usual formula: take 1st, 3rd, 4th, 6th and 7th from asks7 */ frb.amounts.options5 = {

   'USD' : [3, 15, 20, 50, 100],
   'CAD' : [3, 15, 20, 50, 100],
   'AUD' : [3, 15, 20, 50, 100],
   'NZD' : [3, 15, 20, 50, 100],
   'GBP' : [2, 10, 20, 50, 100],
   'EUR' : [2, 10, 20, 50, 100],
   'ARS' : [30, 100, 200, 750, 1000],
   'BRL' : [10, 30, 50, 100, 250],
   'CHF' : [3, 15, 20, 50, 100],
   'CLP' : [1500, 5000, 10000, 25000, 50000],
   'CNY' : [50, 100, 300, 500, 1000],
   'COP' : [7000, 20000, 50000, 150000, 200000],
   'DKK' : [20, 100, 200, 500, 1000],
   'HKD' : [20, 100, 150, 500, 1000],
   'HUF' : [500, 2500, 4000, 7000, 10000],
   'ILS' : [10, 50, 200, 600, 1000],
   'INR' : [100, 300, 500, 2000, 3000],
   'JPY' : [300, 1500, 2000, 5000, 10000],
   'MXN' : [35, 100, 200, 750, 1000],
   'MYR' : [10, 50, 100, 300, 500],
   'NOK' : [20, 100, 200, 500, 1000],
   'PEN' : [10, 50, 150, 300, 700],
   'PLN' : [10, 50, 100, 300, 500],
   'RON' : [10, 50, 100, 200, 1000],
   'SEK' : [30, 100, 200, 500, 1000],
   'UAH' : [50, 150, 300, 750, 1000],
   'UYU' : [70, 200, 400, 1500, 2000],
   'ZAR' : [30, 100, 200, 500, 1000]

};

/* "Average" donation */ frb.amounts.averages = {

   'USD' : 15,
   'EUR' : 10,
   'GBP' : 10,
   'CAD' : 15,
   'AUD' : 15,
   'NZD' : 15,
   'ALL' : 1500,
   'AMD' : 5000,
   'ANG' : 25,
   'ARS' : 100,
   'AZN' : 10,
   'BAM' : 20,
   'BBD' : 30,
   'BDT' : 1000,
   'BGN' : 20,
   'BHD' : 6,
   'BMD' : 15,
   'BND' : 20,
   'BOB' : 100,
   'BRL' : 25,
   'BSD' : 15,
   'BZD' : 30,
   'CHF' : 15,
   'CLP' : 8000,
   'CNY' : 100,
   'COP' : 30000,
   'CRC' : 7500,
   'CZK' : 250,
   'DKK' : 100,
   'DOP' : 600,
   'DZD' : 1000,
   'EGP' : 100,
   'ETB' : 250,
   'FJD' : 25,
   'GEL' : 25,
   'GNF' : 100000,
   'GTQ' : 100,
   'HKD' : 100,
   'HNL' : 250,
   'HRK' : 80,
   'HUF' : 2500,
   'ILS' : 50,
   'INR' : 750,
   'ISK' : 1500,
   'JMD' : 1500,
   'JOD' : 10,
   'JPY' : 1500,
   'KES' : 1000,
   'KRW' : 15000,
   'KWD' : 5,
   'KZT' : 2000,
   'LKR' : 2000,
   'MAD' : 120,
   'MKD' : 600,
   'MOP' : 100,
   'MUR' : 500,
   'MVR' : 200,
   'MXN' : 150,
   'MYR' : 50,
   'MZN' : 50,
   'NGN' : 2500,
   'NIO' : 350,
   'NOK' : 100,
   'OMR' : 5,
   'PAB' : 15,
   'PEN' : 40,
   'PHP' : 600,
   'PKR' : 1500,
   'PLN' : 50,
   'PYG' : 60000,
   'QAR' : 50,
   'RON' : 50,
   'RSD' : 1200,
   'SBD' : 100,
   'SEK' : 100,
   'SGD' : 20,
   'THB' : 500,
   'TND' : 25,
   'TTD' : 100,
   'TWD' : 500,
   'UAH' : 150,
   'UYU' : 300,
   'VEF' : 100,
   'VND' : 300000,
   'XCD' : 40,
   'XOF' : 7000,
   'XPF' : 1000,
   'ZAR' : 150,

};

// 'If everyone gave X'. Mostly the same as first asks option. frb.amounts.ifEveryone = {

   'USD' : 3,
   'EUR' : {
       'default' : 2
   },
   'GBP' : 2,
   'CAD' : 3,
   'AUD' : 3,
   'NZD' : 3,
   'ANG' : 5,
   'ARS' : 30,
   'BAM' : 3,
   'BBD' : 5,
   'BDT' : 200,
   'BGN' : 10,
   'BHD' : 1,
   'BMD' : 3,
   'BOB' : 20,
   'BRL' : 10,
   'BZD' : 5,
   'CHF' : 3,
   'CLP' : 1500,
   'CNY' : 50,
   'COP' : 7000,
   'CRC' : 2500,
   'CZK' : 50,
   'DKK' : 20,
   'DOP' : 200,
   'DZD' : 200,
   'FJD' : 5,
   'GTQ' : 20,
   'HKD' : 20,
   'HNL' : 50,
   'HRK' : 35,
   'HUF' : 500,
   'ILS' : 10,
   'INR' : 100,
   'ISK' : 300,
   'JMD' : 300,
   'JPY' : 300,
   'KRW' : 5000,
   'KWD' : 2,
   'KZT' : 750,
   'MKD' : 100,
   'MVR' : 40,
   'MXN' : 35,
   'MYR' : 10,
   'NIO' : 100,
   'NOK' : 20,
   'OMR' : 1,
   'PAB' : 3,
   'PEN' : 10,
   'PHP' : 200,
   'PLN' : 10,
   'PYG' : 10000,
   'QAR' : 20,
   'RON' : 10,
   'SEK' : 30,
   'SGD' : 3,
   'THB' : 50,
   'TND' : 5,
   'TTD' : 20,
   'TWD' : 150,
   'UAH' : 50,
   'UYU' : 70,
   'VEF' : 20,
   'VND' : 60000,
   'XCD' : 5,
   'XOF' : 1000,
   'XPF' : 250,
   'ZAR' : 30

};

// TODO: purge unneeded currencies frb.currencyFormats = {

   'USD' : '$\t',
   'EUR' : {
       'en' : '€\t',
       'cy' : '€\t',
       'ga' : '€\t',
       'mt' : '€\t',
       'nl' : '€ \t',
       'lv' : '€ \t',
       'tr' : '€ \t',
       'default' : '\t €'
   },
   'ANG' : 'ƒ\t',
   'ARS' : '$\t',
   'AUD' : '$\t',
   'BAM' : '\t KM',
   'BBD' : 'Bcs$\t',
   'BDT' : '৳\t',
   'BGN' : 'лв\t',
   'BHD' : 'د.ب\t',
   'BMD' : 'BD$\t',
   'BOB' : '$b\t',
   'BRL' : 'R$\t',
   'BZD' : 'BZ$\t',
   'CAD' : {
       'fr' : '$\t',
       'default' : '$\t'
   },
   'CHF' : 'Fr. \t',
   'CLP' : '$\t',
   'CNY' : '\t ¥',
   'COP' : '$\t',
   'CRC' : '\t ₡',
   'CZK' : '\t Kč',
   'DKK' : '\t kr.',
   'DOP' : 'RD$\t',
   'DZD' : 'د.ج\t',
   'EGP' : {
       'en' : 'E£\t',
       'default' : '\t جنيه'
   },
   'FJD' : 'FJ$\t',
   'GBP' : '£\t',
   'GTQ' : 'Q\t',
   'HKD' : 'HK$\t',
   'HNL' : 'L\t',
   'HRK' : '\t kn',
   'HUF' : '\t Ft',
   'ILS' : {
       'he' : '\t ₪',
       'yi' : '\t ₪',
       'ar' : '\t ₪',
       'default' : '₪ \t'
   },
   'INR' : '₹ \t',
   'ISK' : '\t kr',
   'JMD' : 'J$ \t',
   'JOD' : 'دينار\t',
   'JPY' : '¥\t',
   'KES' : '\t KSh',
   'KRW' : '₩\t',
   'KWD' : 'د.ك \t',
   'KZT' : '〒 \t', // TODO: don't use the JP postal code symbol once KZT works in unicode
   'LKR' : '\t Rs.',
   'MAD' : 'د.م.\t',
   'MKD' : '\t ден',
   'MOP' : 'MOP$\t',
   'MUR' : '\t Rs',
   'MXN' : '$\t',
   'MVR' : 'Rf. \t',
   'MYR' : 'RM\t',
   'NIO' : 'C$\t',
   'NOK' : '\t kr',
   'NZD' : '$\t',
   'OMR' : 'ر.ع\t',
   'PAB' : '\t B/.',
   'PEN' : 'S/. \t',
   'PHP' : '₱\t',
   'PKR' : 'Rs \t',
   'PLN' : '\t zł',
   'PYG' : '\t ₲',
   'QAR' : 'ر.ق\t',
   'RON' : '\t lei',
   'SCR' : 'SR \t',
   'SEK' : '\t kr',
   'SGD' : 'S$ \t',
   'SVC' : '\t ₡',
   'THB' : {
       'th' : '\t บาท',
       'default' : '\t ฿'
   },
   'TND' : '\t د.ت',
   'TTD' : 'TT$\t',
   'TWD' : 'NT$\t',
   'TZS' : '\t/=',
   'UAH' : '₴\t',
   'UYU' : '$U \t',
   'UZS' : '\t сўм',
   'VEF' : 'Bs.F. \t',
   'VND' : '\t₫',
   'VUV' : 'VT\t',
   'XAF' : 'FCFA\t',
   'XCD' : 'EC$\t',
   'XOF' : 'CFA \t',
   'XPF' : '\t F',
   'ZAR' : 'R \t'

};

// Check in user language first, then fall back to English frb.countryNames = {

   'en' : {
       'US' : 'the U.S.',
       'CA' : 'Canada',
       'GB' : 'the UK',
       'IE' : 'Ireland',
       'AU' : 'Australia',
       'NZ' : 'New Zealand',
       'AR' : 'Argentina',
       'AT' : 'Austria',
       'BE' : 'Belgium',
       'BR' : 'Brazil',
       'CL' : 'Chile',
       'CO' : 'Colombia',
       'DK' : 'Denmark',
       'ES' : 'Spain',
       'FR' : 'France',
       'HK' : 'Hong Kong',
       'HU' : 'Hungary',
       'IL' : 'Israel',
       'IN' : 'India',
       'IT' : 'Italy',
       'JP' : 'Japan',
       'LU' : 'Luxembourg',
       'LV' : 'Latvia',
       'MX' : 'Mexico',
       'MY' : 'Malaysia',
       'NL' : 'the Netherlands',
       'NO' : 'Norway',
       'PE' : 'Peru',
       'PL' : 'Poland',
       'PT' : 'Portugal',
       'RO' : 'Romania',
       'SE' : 'Sweden',
       'SK' : 'Slovakia',
       'UA' : 'Ukraine',
       'UY' : 'Uruguay',
       'ZA' : 'South Africa'
   },
   'es' : {
       'MX' : 'México',
       'PE' : 'Perú'
   }

};

// Just in English for now, but we may want to add other languages later frb.dayNames = {

   'en' : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]

};

frb.iPadTranslations = {

   'en' : 'iPad'

}; /* MediaWiki:FundraisingBanners/CoreJS-2017.js

* Core code for banner forms
*/

var frb = frb || {};

/**

* Main function to submit to paymentswiki
* 
* @param  {Object} options
* - method (required)
* - submethod (optional)
* - gateway (optional)
* - ffname (optional)
* - skipValidation (optional boolean, for pp-usd. Not yet implemented.)
*/

frb.submitForm = function(options) {

   var form = document.getElementById('frb-form');
   var uri = new mw.Uri('https://payments.wikimedia.org/index.php/Special:GatewayFormChooser');
   var params = {};
   /* Form selection data */
   params.payment_method = options.method;
   if ( options.submethod ) {
       params.payment_submethod = options.submethod;
   }
   if ( options.gateway ) {
       params.gateway = options.gateway;
   }
   if ( options.ffname ) {
       params.ffname = options.ffname;
   }
   if ( options.variant ) {
       params.variant = options.variant;
   }
   params.recurring = frb.getRecurring(form);
   
   params.currency_code = frb.getCurrency(mw.centralNotice.data.country) || 'USD';
   params.uselang = mw.centralNotice.data.uselang || 'en';
   params.country = mw.centralNotice.data.country || 'XX';
   /* Express Checkout overrides for Japan and Big English. Remove once it's default. */
   if ( params.payment_method === 'paypal' && 
        $.inArray(params.country, ['JP']) !== -1 
   ) {
       params.gateway = 'paypal_ec';
   }
   if (params.uselang === 'pt' && params.country === 'BR') {
       params.uselang = 'pt-br';
   }
   /* Amount */
   params.amount = frb.getAmount(form);
   if (params.amount === false) {
       return false; // Amount problem, bail out of submitting
   }
   /* Tracking info */
   params.utm_medium   = 'sitenotice';
   params.utm_campaign = mw.centralNotice.data.campaign || 'test';
   params.utm_source   = frb.buildUtmSource(params);
   params.utm_key      = mw.centralNotice.bannerData.cookieCount || 0;
   /* Link to Banner History if enabled */
   var mixins = mw.centralNotice.getDataProperty( 'mixins' );
   if ( mixins && mixins.bannerHistoryLogger ) {
       params.bannerhistlog = mw.centralNotice.bannerHistoryLogger.id;
   }
   uri.extend(params);
   
   if ( mixins && mixins.bannerHistoryLogger ) {
       mw.centralNotice.bannerHistoryLogger.ensureLogSent().always(function() {
           window.location.href = uri.toString();
       });
   } else {
       window.location.href = uri.toString();
   }

};

/**

* Build the utm_source for analytics.
*
* Own function so it can be overriden for weird tests
* 
* @param  {Object} params
* @return {string} utm_source
*/

frb.buildUtmSource = function(params) {

   var utm_source;
   var fullDottedPaymentMethod = params.payment_method;
   if ( params.recurring ) {
       fullDottedPaymentMethod = 'r' + fullDottedPaymentMethod;
   }
   if ( params.payment_submethod ) {
       fullDottedPaymentMethod = fullDottedPaymentMethod + '.' + params.payment_submethod;
   }
   utm_source = mw.centralNotice.data.banner;
   // For popups test - only on Big English desktop. Remove this once testing completed.
   if ( utm_source.indexOf( 'en6C_dsk' ) !== -1 ) {
       if ( mw.popups ) {
           utm_source += '_' + ( mw.popups.isEnabled() ? 'popupsEnabled' : 'popupsDisabled' );
       } else {
           utm_source += '_' + 'popupsUnknown';
       }
   }
   utm_source += '.no-LP.' + fullDottedPaymentMethod;
   return utm_source;

};

/* Is recurring method selected?

* 
* Own function so can be overriden for different forms
*/

frb.getRecurring = function(form) {

   return form.frequency.value === 'monthly';

};

/**

* Return amount, or false if invalid (e.g. less than minimum)
*/

frb.getAmount = function(form) {

   var amount = null;
   if (form.amount) {
       // If there are some amount radio buttons, then look for the checked one
       for (var i = 0; i < form.amount.length; i++) {
           if (form.amount[i].checked) {
               amount = form.amount[i].value;
           }
       }
   }
   // Check the "other" amount box
   if (form.otherAmount.value !== ) {
       var otherAmount = form.otherAmount.value;
       otherAmount = otherAmount.replace(/[,.](\d)$/, ':$10');
       otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, ':$1$2');
       otherAmount = otherAmount.replace(/[$£€¥,.]/g, );
       otherAmount = otherAmount.replace(/:/, '.');
       form.otherAmount.value = otherAmount;
       amount = otherAmount;
   }
   var currency  = frb.getCurrency(mw.centralNotice.data.country);
   var minAmount = Math.ceil( frb.amounts.minimums[currency] ); // NOTE: Round up actual min to nearest whole number
   if ( amount === null || isNaN(amount) || amount <= 0 || amount < minAmount ) {
       alert('Please select an amount (minimum $1)'.replace('$1', minAmount + ' ' + currency));
       return false;
   } else {
       return amount;
   }

};

/**

* Shared code for amount input handling
*/

frb.initAmountOptions = function() {

   // Reset "Other" input if user clicks a preset amount
   $('#frb-form [id^=frb-amt-ps]').click(function() {
       $('#frb-amt-other-input').val();
   });
   // Block typing non-numerics in input field, otherwise Safari allows them and then chokes
   // https://phabricator.wikimedia.org/T118741, https://phabricator.wikimedia.org/T173431
   document.getElementById('frb-amt-other-input').onkeypress = function(e) {
       // Allow special keys in Firefox
       if ((e.code == 'ArrowLeft') || (e.code == 'ArrowRight') ||
           (e.code == 'ArrowUp') || (e.code == 'ArrowDown') || 
           (e.code == 'Delete') || (e.code == 'Backspace')) {
           return;
       }
       var chr = String.fromCharCode(e.which);
       if ("0123456789., ".indexOf(chr) === -1) {
           return false;
       }
   };

};

// For popups test - only on Big English desktop. Remove this once testing completed. if ( mw.centralNotice.data.banner.indexOf('en6C_dsk') !== -1 ) {

   mw.centralNotice.requestRecordImpressionDelay(
       mw.loader.using( 'ext.popups' )
   ).done( function () {
       if ( mw.popups ) {
           mw.centralNotice.registerTest( ( mw.popups.isEnabled() ? 'popupsEnabled' : 'popupsDisabled' ) );
       } else {
           mw.centralNotice.registerTest( 'popupsUnknown' );
       }
   } );

} /* == MediaWiki:FundraisingBanners/LocalizeJS-2017.js == */

/**

* Get the currency for a given country
*
* NOTE: The following currency mapping is WMF-specific based on payment
* provider availability, NOT necessarily the official currency of the country
* 
* @param  {string} country code
* @return {string} currency code
*/

frb.getCurrency = function(country) {

   switch(country) {
       // Big 5 at the top for speed
       case 'US': return 'USD';
       case 'CA': return 'CAD';
       case 'GB': return 'GBP';
       case 'AU': return 'AUD';
       case 'NZ': return 'NZD';
       // Euro countries
       case 'AD':
       case 'AL':
       case 'AM':
       case 'AT':
       case 'AW':
       case 'AZ':
       case 'BE':
       case 'BY':
       case 'CI':
       case 'CY':
       case 'DE':
       case 'EE':
       case 'ES':
       case 'FI':
       case 'FR':
       case 'GF':
       case 'GR':
       case 'IE':
       case 'IT':
       case 'LT':
       case 'LU':
       case 'LV':
       case 'LY':
       case 'MC':
       case 'ME':
       case 'MG':
       case 'MT':
       case 'NL':
       case 'PT':
       case 'RE':
       case 'RS':
       case 'SI':
       case 'SK':
       case 'SM':
       case 'SR':
       case 'VA':
           return 'EUR';
       // The rest
       case 'AE': return 'AED';
       case 'AR': return 'ARS';
       case 'BA': return 'BAM';
       case 'BB': return 'BBD';
       case 'BD': return 'BDT';
       case 'BG': return 'BGN';
       case 'BH': return 'BHD';
       case 'BM': return 'BMD';
       case 'BO': return 'BOB';
       case 'BR': return 'BRL';
       case 'BZ': return 'BZD';
       case 'CH': return 'CHF';
       case 'CK': return 'NZD';
       case 'CL': return 'CLP';
       case 'CN': return 'CNY';
       case 'CO': return 'COP';
       case 'CR': return 'CRC';
       case 'CZ': return 'CZK';
       case 'DK': return 'DKK';
       case 'DO': return 'DOP';
       case 'DZ': return 'DZD';
       case 'EG': return 'EGP';
       case 'FJ': return 'FJD';
       case 'FO': return 'DKK';
       case 'GL': return 'DKK';
       case 'GT': return 'GTQ';
       case 'HK': return 'HKD';
       case 'HN': return 'HNL';
       case 'HR': return 'HRK';
       case 'HU': return 'HUF';
       case 'ID': return 'IDR';
       case 'IL': return 'ILS';
       case 'IN': return 'INR';
       case 'IS': return 'ISK';
       case 'JM': return 'JMD';
       case 'JO': return 'JOD';
       case 'JP': return 'JPY';
       case 'KE': return 'KES';
       case 'KI': return 'AUD';
       case 'KR': return 'KRW';
       case 'KZ': return 'KZT';
       case 'LB': return 'LBP';
       case 'LI': return 'CHF';
       case 'LK': return 'LKR';
       case 'MA': return 'MAD';
       case 'MK': return 'MKD';
       case 'MV': return 'MVR';
       case 'MW': return 'GBP';
       case 'MX': return 'MXN';
       case 'MY': return 'MYR';
       case 'NI': return 'NIO';
       case 'NO': return 'NOK';
       case 'NP': return 'INR';
       case 'NR': return 'AUD';
       case 'OM': return 'OMR';
       case 'PA': return 'PAB';
       case 'PE': return 'PEN';
       case 'PG': return 'AUD';
       case 'PH': return 'PHP';
       case 'PK': return 'PKR';
       case 'PL': return 'PLN';
       case 'PY': return 'PYG';
       case 'QA': return 'QAR';
       case 'RO': return 'RON';
       case 'RU': return 'RUB';
       case 'SA': return 'SAR';
       case 'SD': return 'GBP';
       case 'SE': return 'SEK';
       case 'SG': return 'SGD';
       case 'TH': return 'THB';
       case 'TM': return 'RUB';
       case 'TN': return 'TND';
       case 'TR': return 'TRY';
       case 'TT': return 'TTD';
       case 'TW': return 'TWD';
       case 'UA': return 'UAH';
       case 'UY': return 'UYU';
       case 'UZ': return 'RUB';
       case 'VE': return 'VEF';
       case 'VN': return 'VND';
       case 'VU': return 'AUD';
       case 'ZA': return 'ZAR';
       // small multi-country currencies
       case 'CW':
       case 'SX':
           return 'ANG';
       case 'AG':
       case 'DM':
       case 'GD':
       case 'KN':
       case 'LC':
           return 'XCD';
       case 'BJ':
       case 'BF':
       case 'CI':
       case 'GW':
       case 'ML':
       case 'NE':
       case 'SN':
       case 'TG':
           return 'XOF';
       case 'PF':
       case 'NC':
       case 'WF':
           return 'XPF';
       // fall back to USD
       default:
           return 'USD';
   }

};

/**

* Format a currency value
* 
* @param  {string} currency code. Leave undefined to get without symbol.
* @param  {number} amount
* @param  {string} language code
* @return {string} formatted string e.g. '$3', '£5', '10 €'
*/

frb.formatCurrency = function(currency, amount, language) {

   var locale, formatterOptions, formatter, fmAmount;
   if (isNaN(amount) || amount === ) {
       // Not a number, it's probably the 'other' string or box
       // TODO: better way of doing this?
       fmAmount = amount;
   } else {
       if (window.Intl && typeof window.Intl === 'object') {
           // Use this for fancy number formatting - thousands separators etc
           locale = language + '-' + Geo.country;
           if ( amount % 1 !== 0 ) { // Not a whole number
               formatterOptions = { minimumFractionDigits: 2 }
           } else {
               formatterOptions = {};
           }
           formatter = new Intl.NumberFormat(locale, formatterOptions);
       } else {
           // Bad browser. Just do the basics: 2 decimal places if needed, or none
           formatter = {};
           formatter.format = function(number) {
               if ( amount % 1 !== 0 ) { // Not a whole number
                   return number.toFixed(2);
               } else {
                   return number.toString();
               }
           };
       }
       fmAmount = formatter.format(amount);
   }
   // No symbol needed
   if ( currency === undefined ) {
       return fmAmount;
   }
   // Better dive into the formatting object
   if ( frb.currencyFormats[currency] === undefined ) {
       return currency + ' ' + fmAmount;
   }
   if ( frb.currencyFormats[currency] instanceof Object ) { // not a string
       if ( frb.currencyFormats[currency][language] !== undefined ) {
           return frb.currencyFormats[currency][language].replace('\t', fmAmount);
       }
       return frb.currencyFormats[currency]['default'].replace('\t', fmAmount);
   }
   return frb.currencyFormats[currency].replace('\t', fmAmount);

};


/*

* Select the correct amount or array of amounts from object in "source"
*
* @param {Object} source   - the amounts data object e.g. frb.amounts.options7, frb.amounts.averages
* @param {string} currency - ISO code of currency
* @param {string} country  - ISO code of country (optional)
* @return {array/number}   - depending on source
*/

frb.pickAmounts = function(source, currency, country) {

   if ( source[currency]['default'] ) { // we need to go deeper
       if ( source[currency][country] !== undefined ) {
           return source[currency][country];
       } else {
           return source[currency]['default'];
       }
   } else {
       return source[currency];
   }

};


/**

* Display the correct payment methods for current country
*
* Methods should be labeled with class 'frb-pm-xxxx'
* TODO: clean this function up more
*
* @param  {string} country
*/

frb.localizeMethods = function(country) {

   // Countries with no credit card option (currently none)
   var noCC = [];
   if ($.inArray(country, noCC) !== -1) {
       $('.frb-pm-cc').remove();
   }
   // Can't do monthly credit card in Brazil
   if (country === 'BR') {
       $('.frb-pm-cc').addClass('no-monthly');
   }
   // Remove any leftover WorldPay
   $('.frb-pm-cc-wp').remove();
   // Countries using Adyen for credit card
   if (country === 'FR' || country === 'IL' || country === 'UA') {
       $('.frb-pm-cc').remove();
       $('.frb-pm-cc-adyen').show();
   } else {
       $('.frb-pm-cc-adyen').remove();
   }
   // Countries with no PayPal option
   var noPP = ['IN', 'RU', 'SG', 'AE', 'QA', 'OM', 'BD', 'BO', 'PA',
               'PY', 'GT', 'JM', 'TT', 'DZ', 'PE'];
   if ($.inArray(country, noPP) !== -1) {
       $('.frb-pm-pp').remove();
       $('.frb-pm-pp-usd').remove();
   }
   // Countries with no PayPal for mobile only
   var noPPmobile = ['PH', 'ID', 'TH', 'KR', 'MY', 'VN'];
   var mobileRegex = /(_mob_|_ipd_)/
   if ($.inArray(country, noPPmobile) !== -1) {
       if (mw.centralNotice.data.banner.search(mobileRegex) !== -1) {
           $('.frb-pm-pp').remove();
           $('.frb-pm-pp-usd').remove();
       }
   }
   // Countries where PayPal must be in USD
   var ppUSD = ['BG', 'HR', 'LT', 'MK', 'RO', 'UA', 'SA', 'CN', 'ID', 'KR',
                'KZ', 'MY', 'VN', 'AR', 'CL', 'DO', 'CO', 'NI', 'UY', 'ZA',
                'BH', 'LB', 'VE', 'TR', 'IS', 'BA', 'MV', 'BB', 'BM', 'BZ',
                'CR', 'CW', 'SX', 'HN', 'KN', 'DM', 'AG', 'LC', 'GD', 'FJ',
                'TN', 'BJ', 'BF', 'CI', 'GW', 'ML', 'NE', 'SN', 'TG', 'BR'];
   if ($.inArray(country, ppUSD) !== -1) {
       $('.frb-pm-pp').remove();
       $('.frb-pm-pp-usd').show();
   } else {
       $('.frb-pm-pp').show();
       $('.frb-pm-pp-usd').remove();
   }
   // Show any extra local payment methods, or remove them if not needed
   var extrapaymentmethods = {
       'amazon'   : ['US'],
       'bpay'     : [],
       'ideal'    : ['NL'],
       'bt'       : ['AR', 'BR', 'CL', 'CO'],      // Bank Transfer (Astropay)
       'cash'     : ['AR', 'BR', 'CO', 'MX', 'UY'] // 'Cash' methods (Astropay)
   };
   // Methods with different labels per country
   if (country === 'AR') {
       $('.frb-pm-bt button, button.frb-pm-bt').html('Santander');
   }
   if (country === 'CO') {
       $('.frb-pm-bt button, button.frb-pm-bt').html('PSE Pagos');
   }
   if (country === 'UY') {
       $('.frb-pm-cash button, button.frb-pm-cash').html('RedPagos');
   }
   if (country === 'CL' && mw.config.get('wgUserLanguage') == 'es') {
       $('.frb-pm-bt button, button.frb-pm-bt').html('Trans. bancaria');
   }
   for (var method in extrapaymentmethods) {
       var $methodbutton = $('.frb-pm-' + method);
       if ( $.inArray(country, extrapaymentmethods[method]) !== -1 ) { // country is in the list
           $methodbutton.show();
       } else {
           $methodbutton.remove();
       }
   }

};

/**

* Check scheduled payment method outages and hide buttons if needed
*
* Data at https://meta.wikimedia.org/wiki/MediaWiki:FR2013/Resources/PaymentOutages.js
* Methods should be labeled with class 'frb-pm-xxxx'
*
* @param  {string} country code
*/

frb.checkMethodOutages = function(country) {

   // TODO - can we load this a better way?
   /* This file can be used to schedule hiding of individual payment methods from
* banners and donatewiki e.g. if they have scheduled downtime.
* Valid methods are:
* ideal, yandex, cc, dd, sofort, pp, amazon, bpay, webmoney, boletos, enets, pp-usd
* (most of the time it's 'ideal'...)
* Can also limit outage to a specific country with country: "XX" (where XX is an ISO code)
*
* Note that in JavaScript dates the months (and only the months) start at 0.
* Jan=0, Feb=1, Mar=2, Apr=3 etc. How hateful
*/

var outages = [

   {
       start:      new Date(Date.UTC(2016, 8, 18, 1)),
       end:        new Date(Date.UTC(2016, 8, 18, 7)),
       method:     "ideal"
   }

];

   var now = new Date();
   for (var i = outages.length - 1; i >= 0; i--) {
       if ( now > outages[i].start && now < outages[i].end ) {
           if (outages[i].country === undefined || outages[i].country == country) {
               $('.frb-pm-' + outages[i].method).hide();
           }
       }
   }

};

/**

* Adjust the amount options and their labels
*
* Inputs should have id frb-amt-psX where X is the index number (starting from 1)
*
* @param  {Object}  source     - object with amounts e.g. frb.amounts.options7
* @param  {string}  currency   - currency code e.g. 'USD'
* @param  {string}  country    - country code  e.g. 'FR' Some currencies can have different options per country.
* @param  {string}  language   - language code e.g. 'en' For symbol formatting
* @param  {boolean} useSymbols - use currency symbols on labels or not? (3 vs $3)
*/

frb.localizeAmountOptions = function(source, currency, country, language, useSymbols) {

   var amountOptions = frb.pickAmounts(source, currency, country);
   $('#frb-form input[name="amount"]').each(function(index) {
       var $input = $(this);
       var $label = $input.siblings('label');
       var i = $input.attr('id').replace('frb-amt-ps', );
       var amount = amountOptions[i-1]; // because IDs start from 1
       if ( amount ) {
           $input.val( amount );
           if ( useSymbols ) {
               $label.html( frb.formatCurrency( currency, amount, language) );
           } else {
               $label.html( frb.formatCurrency( undefined, amount, language) );
           }
       }
   });

};

frb.noRecurringCountries = ['AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'BR'];

/* These countries use potentially ambiguous $ sign. Use ISO code instead in text (but still $ for buttons) */ frb.textAmountIsoCountries = ['AR', 'CL', 'CO', 'MX'];

$(function() {

   var language = mw.centralNotice.data.uselang;
   var country  = mw.centralNotice.data.country;
   var currency = frb.getCurrency(country);
   // Payment methods
   frb.localizeMethods(country);
   frb.checkMethodOutages(country);
   // Hide recurring for some countries
   if ( frb.noRecurringCountries.indexOf(country) !== -1 ) { // country is in the list
       $('.frb-frequency, .recurring-details').hide();
   }
   // Basic replacements
   $('.frb-replace-currencysymbol').html( frb.formatCurrency( currency, , language ).replace(' ', ) );
   $('.frb-replace-currencycode').html( currency );
   // Country name
   var countryName;
   if ( frb.countryNames[language] ) {
       countryName = frb.countryNames[language][country] || frb.countryNames.en[country];
   } else {
       countryName = frb.countryNames.en[country];
   }
   $('.frb-replace-countryname').html( countryName );
   // Day of week
   var dayName;
   var now = new Date();
   var dayNumber = now.getDay();
   if ( frb.dayNames[language] ) {
       dayName = frb.dayNames[language][dayNumber] || frb.dayNames.en[dayNumber];
   } else {
       dayName = frb.dayNames.en[dayNumber];
   }
   $('.frb-replace-dayofweek').html( dayName );
   // Replace device with iPad if needed
   var ua = navigator.userAgent;
   if ( ua.match( /ipad/i ) ) {
       $('.frb-replace-device').html( frb.iPadTranslations[language] || frb.iPadTranslations.en );
   }
   // Replace %AVERAGE% with formatted "average" amount
   var average = frb.pickAmounts(frb.amounts.averages, currency, country);
   if ( frb.textAmountIsoCountries.indexOf(country) !== -1 ) {
       var avgString = average + ' ' + currency;
   } else {
       var avgString = frb.formatCurrency(currency, average, language).replace(/\.$/, ); // strip any period from end for use in running text
   }
   $('.frb').each(function(index){
       var newHtml = $(this).html().replace(/%AVERAGE%/g, '' + avgString + '');
       $(this).html(newHtml);
   });
   // Replace %MINIMUM% with formatted "if everyone" amount
   var ifEveryone = frb.pickAmounts(frb.amounts.ifEveryone, currency, country);
   if ( frb.textAmountIsoCountries.indexOf(country) !== -1 ) {
       var ifString = ifEveryone + ' ' + currency;
   } else {
       var ifString = frb.formatCurrency(currency, ifEveryone, language).replace(/\.$/, ); // strip any period from end for use in running text
   }
   $('.frb').each(function(index){
       var newHtml = $(this).html().replace(/%MINIMUM%/g, '' + ifString + '');
       $(this).html(newHtml);
   });
   /* Links (in smallprint) */
   $('.frb-localize-links a').each(function() {
       // Add parameters for LandingCheck
       var uri = new mw.Uri( $(this).attr('href') );
       uri.extend({
           country:      country,
           language:     language,
           uselang:      language,
           utm_medium:   'sitenotice',
           utm_campaign: mw.centralNotice.data.campaign || 'test',
           utm_source:   mw.centralNotice.data.banner
       });
       $(this).attr('href', uri.toString());
       $(this).attr('target', '_blank'); // Make links open in new tab
   });
   // Legal text variants
   if (country === 'US') {
       $('.frb-legal-US').show();
       $('.frb-legal-nonUS, .frb-legal-NL').hide();
   } else if (country === 'NL') {
       $('.frb-legal-NL').show();
       $('.frb-legal-US, .frb-legal-nonUS').hide();
   } else {
       $('.frb-legal-nonUS').show();
       $('.frb-legal-US, .frb-legal-NL').hide();
   }

});

/* == end of MediaWiki:FundraisingBanners/LocalizeJS-2017.js == */ frb.rml = {

   post: function() {
       /* Create the iframe for the form and use it as the form's target */
       var frameName = 'remindFrame';
       var $form = $('#frb-rml-form');
       if ( $("iframe[name=" + frameName + "]").length === 0 ) {
           var $iframe = $('<iframe style="display: none;" name="' + frameName + '"></iframe>');
           $form.attr("target", $iframe.attr("name"));
           $form.after($iframe);
       }
       $form[0].submit();
   },
   getCurrentDate: function() {
       /* Get current date in correct format for Silverpop */
       var today = new Date();
       var dd = today.getDate();
       var mm = today.getMonth()+1; // January is 0!
       var yyyy = today.getFullYear();
       if( dd < 10 ) {
           dd = '0' + dd;
       }
       if( mm < 10 ) {
           mm = '0' + mm;
       }
       return mm+'/'+dd+'/'+yyyy;
   },
   init: function() {
       /* Prep the reminder form */
       var form = document.getElementById('frb-rml-form');
       form.rml_country.value    = mw.centralNotice.data.country;
       form.rml_language.value   = mw.centralNotice.data.uselang;
       form.rml_submitDate.value = frb.rml.getCurrentDate();
       form.rml_segment.value    = Math.floor((Math.random() * 100) + 1);
       $('.frb-rml-link').click(function() {
           $('.frb-rml-form').toggle();
           $('#frb-rml-email').focus();
       });
       $('#frb-rml-submit').click(function() {
           if ( mw.util.validateEmail( form.Email.value ) ) {
               frb.rml.post();
               $('.frb-rml-form, .frb-rml-link').hide();
               $('.frb-rml-ty').show();
               mw.centralNotice.internal.hide.setHideWithCloseButtonCookies(); // Hide future banners for 7 days
               return false;
           } else {
               $('#frb-rml-email').addClass('error').focus();
               $('.frb-rml-error').show();
               return false;
           }
       });
   }

};

$(function() {

   mw.loader.using(['mediawiki.util']).then(function() {
       frb.rml.init();
   });

});

/** 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;

};

$(function() {

   var language = mw.centralNotice.data.uselang;
   var country  = mw.centralNotice.data.country;
   var currency = frb.getCurrency(country);
   frb.initAmountOptions();
   frb.localizeAmountOptions(frb.amounts.options7, currency, country, language, true);
   var currencySymbol = frb.formatCurrency( currency, , language ).replace(' ', );
   // Hide Banner when on click and enter when focused
   $('.frb-close').on('click keypress', function(e){
       if (e.which === 13 || e.type === 'click') {
           frb.hide();
           e.stopPropagation();
       }
   });
   // Show RML form on Enter
   $('.frb-rml-link').keyup(function(event){
       if (event.keyCode == 13) {
           $('.frb-rml-form').toggle();
           $('#frb-rml-email').focus();
       }
   });
   // Focus for #input_amount_other
   $('.frb-amt-other').click(function() {
       document.getElementById('input_amount_other').checked = true;
       $('#frb-amt-other-input').focus();
   });
   // Activate #input_amount_other radio when tabbing into #frb-amt-other-input
   $('#frb-amt-other-input').focus(function() {
       document.getElementById('input_amount_other').checked = true;
   });
   // Minimize on scroll
   var stickyHeaderTop = $('.frb').height();
   function minimizeScrollFunction() {
       if( $(window).scrollTop() > stickyHeaderTop ) {
           $('.frb').css({position: 'fixed', top: '0px'}).addClass('frb--minimized');
       } else {
           $('.frb').css({position: 'absolute', top: '0px'}).removeClass('frb--minimized');
           frb.addSpace();
       }
   }
   var scrollPos;
   $(window).on('scroll resize', function() {
       scrollPos = $(window).scrollTop();
       // Keep frb minimized until clicked or the user scrolls to the top of the page.
       if ( frb.clicked === false ) {
           minimizeScrollFunction();
       }
       // Restore default state
       if ( scrollPos === 0 ) {
           $('.frb').css({position: 'absolute', top: '0px'}).removeClass('frb--minimized');
           frb.addSpace();
           frb.clicked = false;
       }
   });
   frb.clicked = false;
   $('.frb').click(function() {
       if ( $(this).hasClass('frb--minimized') ) {
           $(this).css({position: 'fixed', top: '0px'}).removeClass('frb--minimized');
           frb.clicked = true;
       }
   });
   /* 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>