MediaWiki:Centralnotice-template-B1718 0112 en6C all thanks stayupdated signupwhatsnew

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

<style> /* Hide when editing */ .action-edit .frb, .ve-activated .frb {

   display: none !important;

}

  1. centralNotice.collapsed .frb {
   display: none;

}

/* z-index override for #siteNotice now having .mw-body-content class [1] */

  1. siteNotice {
   z-index: auto;

}

/* z-index override for German Wikipedia */ .mw-body {

   z-index: auto;

}

/* Box-sizing */ .frb, .frb *, .frb *:before, .frb *:after {

   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
   box-sizing: border-box;

}

/* Inline banner styles


*/

/*Reset focus outlines*/ .frb-inline-main:focus, .frb-inline-close:focus, .frb-rml-email:focus, .frb-btn-submit:focus {

   outline: 0;

}

.frb {

   position: relative;
   text-align: left;
   margin-bottom: 24px;

}

/*Default style is grey*/ .frb-inline-main, .frb-inline-main:visited {

   color: #222;

}

.frb-inline-main {

   font-family: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
   width: 100%;
   padding: 16px;
   background-color: #f8f9fA;
   border: 1px solid #72777d;
   border-radius: 2px;

}

@media all and (min-width: 640px) {

   .frb-inline-main {
       padding: 20px;
   }

}

.frb-inline-table {

   display: block;

}

@media all and (min-width: 640px) {

   .frb-inline-table {
       display: table;
   }

}


.frb-inline-main:hover, .frb-inline-main:focus {

   color: #222;
   border-color: #36c;
   box-shadow: inset 0 0 0 1px #36c;
   text-decoration: none;

}

.frb-inline-main--yellow {

   background-color: #fEf6e7;
   border-color: #ac6600;

}

.frb-inline-main--blue {

   background-color: #eaf3ff;
   border-color: #2a4b8d;

}

.frb-inline-main--green {

   background-color: #d5fdf4;
   border-color: #14866d;

}

.frb-inline-main--red {

   background-color: #fee7e6;
   border-color: #b32424;

}

.frb-inline-main--violet {

   background-color: #ece9f1;
   border-color: #604c8d;

}

.frb-inline-visual, .frb-inline-message {

   display: block;

}

@media all and (min-width: 640px) {

   .frb-inline-visual,
   .frb-inline-message {
       display: table-cell;
   }

}

.frb-inline-visual {

   float: left;
   vertical-align: middle;
   text-align: center;

}

@media all and (min-width: 640px) {

   .frb-inline-visual {
       float: none;
   }

}

/*Responsive SVG’s*/ .frb-inline-visual svg {

   margin: 5px 10px 0 0;

}

@media all and (min-width: 640px) {

   .frb-inline-visual svg {
       margin: 0 16px 0 0;
   }

}

.frb-inline-message {

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

}

@media all and (min-width: 960px) {

   .frb-inline-message {
       font-size: 16px;
       line-height: 1.3125; /*21px @16px*/
   }

}

@media all and (min-width: 1440px) {

   .frb-inline-message {
       font-size: 20px;
       line-height: 1.3; /*26px @21px*/
   }

}

.frb-inline-main .cta {

   color: #222;
   font-weight: 600;
   text-decoration: underline;

}

.frb-inline-main .cta:focus, .frb-inline-main .cta:hover {

   color: #36c;

}

/* --- Close button --- */

.frb-inline-close {

   position: absolute;
   top: 0;
   right: 0;
   padding: 8px;
   cursor: pointer;

}

@media all and (min-width: 640px) {

   .frb-inline-close {
       padding: 12px;
   }

}

.frb-inline-close .frb-icon-close path {

   stroke: #222;

}

.frb-inline-close .frb-icon-close circle {

   fill: #fff;

}

.frb-inline-close:hover .frb-icon-close circle, .frb-inline-close:focus .frb-icon-close circle {

   stroke: #36c;

}

.frb-inline-close:hover .frb-icon-close path, .frb-inline-close:focus .frb-icon-close path {

   stroke: #36c;

}

.frb-icon-close {

   width: 28px;
   height: 28px;

}

/*RML*/

.frb-rml, .frb-rml-done {

   display: none;

}

.frb-rml {

   border: 0;
   padding: 0;
   margin: 0;
   text-align: center;

}

.frb-rml:before {

   display: block;
   margin: 8px 0;
   content: "* * *";
   color: #db3539;
   font-weight: bold;
   font-size: 16px;
   line-height: 1;

}

.frb-rml-email, .frb-btn-submit, .frb-rml-error, .frb-rml-done {

   font-size: 16px;
   line-height: 1.1875; /*19px @16px*/
   text-align: center;

}

.frb-rml-email, .frb-btn-submit {

   padding: 12px 24px;
   border-radius: 2px;

}

.frb-rml-email {

   width: 100%;
   padding: 12px;
   background-color: #fff;
   color: #222;
   border: 1px solid #72777d;

}

@media all and (min-width: 640px) {

   .frb-rml-email {
       width: auto;
       min-width: 320px;
       padding: 12px 24px;
   }

}

.error {

   border: 1px solid #d33;
   box-shadow: inset 0 0 0 1px #d33;

}

.frb-rml-email:hover, .frb-rml-email:focus {

   border: 1px solid #447ff5;
   box-shadow: inset 0 0 0 1px #447ff5;

}

.error:hover, .error:focus {

   border: 1px solid #447ff5;
   box-shadow: inset 0 0 0 1px #447ff5, inset 0 0 0 2px #fff, inset 0 0 0 4px #d33;

}

.frb-rml-error {

   margin: 12px 0 6px;
   color: #d33;
   font-weight: bold;

}

.frb-btn-submit {

   cursor: pointer;
   color: #fff;
   font-weight: bold;
   margin-top: 8px;
   background-color: #36c;
   border: 1px solid #36c;

}

.frb-rml-done {

   padding-top: 12px;
   font-weight: bold;
   color: #14866d;

}

.frb-btn-submit:hover, .frb-btn-submit:focus {

   background-color: #447ff5;
   border: 1px solid #447ff5;

}

.frb-btn-submit:focus {

   box-shadow: inset 0 0 0 1px #447ff5, inset 0 0 0 2px #FFFFFF;

}

.frb-rml-trigger {

   cursor: pointer;

}

.frb-rml-disclaimer {

   margin-top: 16px;
   text-align: center;
   font-size: 12px;
   line-height: 1.3333333333; /*16px @12px*/

}

.frb-rml-disclaimer a {

   text-decoration: underline;
   color: #222;

}

.frb-rml-disclaimer a:hover {

   color: #36c;

}

</style>

<script> var frb = frb || {};

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

};

// Minimum "fee" amounts. Default is 1. frb.amounts.feeMinimums = {

   'SEK' : 10,
   'NOK' : 10,
   'DKK' : 6

};

// 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ú'
   }

};

frb.dayNames = {

   'en' : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
   'sv' : [ 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag' ],
   'da' : [ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag' ],
   'nb' : [ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag' ],
   'it' : [ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato' ]

};

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 */
   var amount = frb.getAmount(form);
   // See if "Pay the fee" is checked
   if ( $('#frb-ptf-checkbox').prop('checked') ) {
       amount = amount + frb.calculateFee(amount);
   }
   if ( !frb.validateAmount(amount) ) {
       return false; // Amount problem, bail out of submitting
   }
   params.amount = amount;
   /* 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;
   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 selected
*/

frb.getAmount = function(form) {

   var amount = null;
   // If there are some amount radio buttons, then look for the checked one
   if (form.amount) {
       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(/:/, '.');
       amount = otherAmount;
   }
   amount = parseFloat(amount);
   if ( isNaN(amount) ) {
       return 0;
   } else {
       return amount;
   }

};

/**

* Check if given amount is valid i.e. a positive number and at least minimum.
* If not, show an error and return false.
*
* @param  {number}  amount [description]
* @return {boolean}        [description]
*/

frb.validateAmount = function(amount) {

   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 true;
   }

};

/**

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

}; /* End of MediaWiki:FundraisingBanners/CoreJS-2017.js */ /* == 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];
   }

};

/* Credit card types so we can show the correct logos */ frb.cardTypes = {

   'US' : 'vmad',
   'CA' : 'vma',
   'GB' : 'vmaj',
   'IE' : 'vmaj',
   'AU' : 'vmaj',
   'NZ' : 'vma',
   'SE' : 'vma',
   'NO' : 'vma',
   'DK' : 'vma',
   'IT' : 'vmaj'

};

/**

* 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 - https://phabricator.wikimedia.org/T173001
   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();
       }
   }
   /* Add card types class to credit card button, so we can show correct logos */
   if ( frb.cardTypes[country] ) {
       $('.frb-pm-cc').addClass('frb-cctypes-' + frb.cardTypes[country] );
   }

};

/**

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

};

frb.getCurrentDate = function() {

   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;
   }
   today = mm+'/'+dd+'/'+yyyy;
   return today;

};

frb.insertInlineBanner = function() {

   var $inlineBanner = $('#frb-inline');
   if ( window.location.href.indexOf('m.wikipedia') > -1 ) {
       $('.pre-content').prepend( $inlineBanner );
   } else {
       $('#siteNotice').prepend($('#centralNotice'));
   }
   $inlineBanner.css('display', 'block');

};

$(function() {

   // Close top banner on click or return
   $('.frb-inline-close').on('click keypress', function(e) {
       if (e.which === 13 || e.type === 'click') {
           $('#frb-inline').hide();
           mw.centralNotice.hideBanner();
           e.stopPropagation();
       }
   });
   /* 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.insertInlineBanner();
   }
   // Adjustments for mobile
   if ( window.location.href.indexOf('m.wikipedia') > -1 ) {
       $('.frb').addClass('frb--is-mobile');
   }
   /* Remind me later (RML) form */
   $('.frb-rml-trigger').on('click keypress', function(event){
       if ( event.which === 13 || event.type === 'click' ) {
           event.stopPropagation();
           if ( $('.frb-rml').css('display') == 'none' ) {
               $('.frb-rml').slideDown(function() {
                   $('.frb-rml-email').focus();
               });
           } else {
               $('.frb-rml-email').focus();
           }
       }
   });
   /* Show TY message after RML submit */
   $('.frb-btn-submit').on('click keypress', function(event){
       if ( event.which === 13 || event.type === 'click' ) {
           if ( mw.util.validateEmail( $('.frb-rml-email').val() ) ) {
               $('.frb-rml').slideUp(function() {
                   $('.frb-rml-done').fadeIn();
               });
           }
       }
   });

}); </script>