Thank You thankyouwiki https://thankyou.wikipedia.org/wiki/Main_Page MediaWiki 1.47.0-wmf.20 first-letter Media Special Talk User User talk Thank You Thank You talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk TimedText TimedText talk Module Module talk Thank You/en 0 4 1507 1495 2026-09-16T10:50:25Z EHughes (WMF) 9 Reinstating text for non-US planned giving CTA 1507 wikitext text/x-wiki {{Thank You 2021 | language = en | title = Thank You | header-new = Thank you! Your generosity means so much to us. | receipt = You will receive a confirmation via email when we have processed your donation. | receipt-bitcoin = Receipts for Bitcoin donations may take 3–7 business days. | monthly-conversion = We will send you a second receipt for your recurring gift, which will begin processing next month. | annual-conversion = We will send you a second receipt for your recurring gift, which will begin processing on the same date next year. | annual-organic = Your donation will process yearly on the same date, and we will send you a receipt each time. | header-text1 = Contributions from readers like you help us host and manage Wikipedia and other free knowledge projects. | header-text2 = <!--Wikipedia is a project of the [https://wikimediafoundation.org Wikimedia&nbsp;Foundation].--> | recurUpgrade-header-no = We understand! Thank you for your ongoing support and commitment to our mission. | recurUpgrade-header-yes = Thank you for upgrading your gift! Your support is powerful. | recurUpgrade-text-no1 = You have chosen not to upgrade at this time. No changes will be made to your existing monthly donation. | recurUpgrade-text-no2 = With your sustaining support, we will continue hosting, improving, and growing Wikipedia and its sister projects for years to come. | recurUpgrade-text-yes1 = Your upgraded monthly gift of <span class="recurUpgradeAmt"></span> will begin on <span class="recurUpgradeDate"></span>. You will receive confirmation of this via email. | recurUpgrade-text-yes2 = Your increased support gives the Wikimedia Foundation stability and strength as we work towards fulfilling our mission: to share the world’s knowledge far and wide through Wikipedia and its sister projects. | tax-disclaimer-default = The Wikimedia Foundation is an international non-profit organization that supports local and independent associations around the world. <strong>Our [https://wikimediafoundation.org/give/donor-frequently-asked-questions/#tax-deductibility tax-exempt status] varies according to the laws of each country. Donations to the Wikimedia Foundation are likely not tax-deductible outside the USA.</strong> If you have any questions about tax exemptions or reductions, we invite you to contact [mailto:donate@wikimedia.org donate@wikimedia.org]. | cookie-explain = We value your support and try to prevent donors like you from receiving more fundraising messages. If you clear your browser's cookies, or visit on a different device, you may still see additional banners. Copying the link to this page and opening it on your other devices will suppress the banners. | chapter-AU-title = [https://wikimedia.org.au/wiki/Wikimedia_Australia Wikimedia Australia] | chapter-AU-text = Wikimedia Australia is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-AU-link = [https://wikimedia.org.au/wiki/Wikimedia_Australia <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-BE-title = [https://be.wikimedia.org/w/index.php?title=Wikimedia_Belgium&uselang=en Wikimedia Belgium] | chapter-BE-text = Wikimedia Belgium is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-BE-link = [https://be.wikimedia.org/w/index.php?title=Wikimedia_Belgium&uselang=en <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-CA-title = [https://www.wikimedia.ca/about/ Wikimedia Canada] | chapter-CA-text = Wikimedia Canada is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-CA-link = [https://www.wikimedia.ca/about/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-CZ-title = [https://www.wikimedia.cz/en/ Wikimedia Česká republika] | chapter-CZ-text = To support and learn more about the local Wikimedia initiatives and the Czech Wikimedia chapter (legally independent from the Wikimedia Foundation), visit [https://www.wikimedia.cz/cs/ Wikimedia Česká republika]. | chapter-CZ-link = [https://www.wikimedia.cz/en/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-FR-title = [https://www.wikimedia.fr/?mtm_campaign=WMF&mtm_kwd=2024 Wikimedia France] | chapter-FR-text = Wikimedia France is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-FR-link = [https://www.wikimedia.fr/?mtm_campaign=WMF&mtm_kwd=2024 <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-GB-title = [https://wikimedia.org.uk/home/education/ Wikimedia UK] | chapter-GB-text = Click here to learn more about Wikimedia UK, your national charity supporting Wikipedia, its sister projects and open knowledge across the UK. Wikimedia UK is legally independent of the Wikimedia Foundation. | chapter-GB-link = [https://wikimedia.org.uk/home/education/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-HU-title = [https://wikimedia.hu/ Wikimedia Hungary] | chapter-HU-text = Wikimedia Hungary is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-HU-link = [https://wikimedia.hu/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-IT-title = [https://www.wikimedia.it/chi-siamo/ Wikimedia Italia] | chapter-IT-text = Wikimedia Italia is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-IT-link = [https://www.wikimedia.it/chi-siamo/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-NL-title = [https://www.wikimedia.nl/thank_you_for_your_donation/ Wikimedia Netherlands] | chapter-NL-text = Wikimedia Netherlands is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-NL-link = [https://www.wikimedia.nl/thank_you_for_your_donation/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-NO-title = [https://www.wikimedia.no/en/ Wikimedia Norway] | chapter-NO-text = Wikimedia Norway is a legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects in Norway and Sápmi. | chapter-NO-link = [https://www.wikimedia.no/en/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-NZ-title = [https://www.wikimedia.nz/ Wikimedia Aotearoa New Zealand] | chapter-NZ-text = Wikimedia Aotearoa New Zealand is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-NZ-link = [https://www.wikimedia.nz/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | chapter-SE-title = [https://wikimedia.se/om-oss/ Wikimedia Sverige] | chapter-SE-text = Wikimedia Sverige is a local, legally independent association that works with the Wikimedia Foundation to support Wikipedia and other free knowledge projects. | chapter-SE-link = [https://wikimedia.se/om-oss/ <span class="btn btn-blue stick-to-bottom">Learn more</span>] | share-text = Tell the world you gave—your support will inspire others to protect Wikipedia’s future. | cta-header = Other ways you can help Wikipedia thrive | survey-code = 8KLN6SH | survey-code-2 = | survey-header = Take our survey | survey-text = Please help us improve by answering a few questions in our survey. | survey-legal = This survey is powered by a third-party service. For information on privacy and data-handling, please see the [[wmf:Donor Thank You Survey Privacy Statement|survey privacy statement]]. | survey-button = Start the survey | match-link = Matching_Gifts | match-header = Match your gift | match-text = Double your impact by finding out if your company has a matching gift program. | match-button = Check your employer | store-header = Buy Wikipedia branded merchandise | store-text-new = Plant the seed of knowledge by purchasing a Wikipedia-themed gift in our online store. Proceeds from sales are used to thank the volunteers who make Wikipedia possible. | store-button = Shop Wikipedia | endowment-header = Ensure the future of free knowledge | endowment-header-1000 = Protect Wikipedia today, tomorrow, forever. | endowment-text = Legacy giving to the [https://wikimediaendowment.org/ Wikimedia Endowment] provides dedicated funding to realize the power and promise of Wikipedia and related Wikimedia projects for the long term. | endowment-text-1000 = Help safeguard the future of free knowledge by naming the [https://wikimediaendowment.org/ Wikimedia Endowment] in your will, trust, or as a beneficiary of your retirement assets or financial accounts. These donations cost nothing now, and you can also change them at any time, for any reason. | legacy-header = Discover the Impact of Legacy Giving | legacy-header-2 = Discover the Impact of Legacy Giving | legacy-header-1000 = Plan Your Gift Today | legacy-text = Instantly download our Planned Giving Guide to discover how you can create a lasting impact through a gift in your will. You’ll find practical information, thoughtful examples, and simple next steps to help you get started. | legacy-text-2 = Our team will be happy to send you a brochure and answer all your questions about including a gift in your will. | legacy-text-1000 = Help free knowledge thrive for generations to come. Download our free Planned Giving Guide to learn how a gift in your will can make a lasting difference, with simple next steps to help you get started. | request-info = Download Your Guide | request-info-2 = Request more information | request-info-1000 = Download Your Guide | will-header = Include Wikipedia in your will | will-header-2 = Include Wikipedia in your will | will-header-1000 = Write Your Will for Free | will-text = Would you like assistance in developing a will? Our partner, FreeWill, can help you write one easily and free of charge. | will-text-2 = Would you like assistance in developing a will? Our partner, FreeWill, can help you write one easily and free of charge. | will-text-1000 = We've partnered with FreeWill so you can write a legally valid will online, for free, in under 30 minutes, valid in all 50 states. After providing for loved ones, you can also leave a gift to causes you care about, including the Wikimedia Endowment. | will-button = Start your will | will-button-2 = Start your will | will-button-1000 = Start your free will | editing-header = Try editing Wikipedia | editing-text = Editing Wikipedia is easier than you might think! You will get suggestions and help as you start. Building knowledge can be as simple as adding a link or fixing a spelling mistake. | editing-button = Create an account | donor-badge-title = Activate your Donor Badge | donor-badge-text = Your support keeps Wikipedia thriving! As a token of gratitude, we’ve created a brand new Donor Badge for you. Once activated, it will be visible at the top of your screen while you browse Wikipedia, with no interruptions to your reading! | donor-badge-link = Get the badge | return = Return to Wikipedia | social-footer-wmf = Follow the Wikimedia Foundation on social media to get news and updates on our projects, global community, and advocacy efforts. | social-footer-wmf-1-title = Instagram | social-footer-wmf-2-title = Bluesky | social-footer-wmf-3-title = Facebook | social-footer-wmf-4-title = LinkedIn | social-footer-wiki = Connect with Wikipedia on social media to learn new facts and know your world better. | social-footer-wiki-1-title = TikTok | social-footer-wiki-2-title = LinkedIn | social-footer-wiki-3-title = Instagram | social-footer-wiki-4-title = Bluesky | social-footer-wiki-5-title = Facebook | social-footer-wiki-6-title = YouTube | chapters = Learn more about [[m:Wikimedia chapters|local chapters and their projects]]. | questions = If you have any questions, please email [mailto:donate@wikimedia.org donate@wikimedia.org]. | terms = Text is available under the [https://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike License 4.0]; additional terms may apply. See [https://foundation.wikimedia.org/wiki/Terms_of_Use Terms of Use] or [https://foundation.wikimedia.org/wiki/Privacy_policy Privacy Policy] for details. }} 8xbhnuf2f2ugn1j7gt0a5yh75xh9ft5 MediaWiki:Common.js 8 32 1504 1503 2026-09-16T10:36:08Z EHughes (WMF) 9 Updating planned giving CTA content for donors > 1000 1504 javascript text/javascript /* Any JavaScript here will be loaded for all users on every page load. */ // Framebuster for https://phabricator.wikimedia.org/T176669 if ( self !== top ) { top.location.href = window.location; } // Redirect anons to en if page doesn't exist if ( mw.config.get('wgUserName') === null && mw.config.get('wgArticleId') === 0 ) { var basePageName = mw.config.get('wgPageName').split('/')[0]; var redirectUrl = 'https://thankyou.wikipedia.org/wiki/'; if ( basePageName === 'Recurring_donor_page' ) { redirectUrl += 'Recurring_donor_page/en'; } else if ( basePageName === 'WP25' ) { redirectUrl += 'WP25/en'; } else { redirectUrl += 'Thank_You/en'; } redirectUrl += window.location.search; // params window.location.replace( redirectUrl ); } mw.loader.using( [ 'mediawiki.cookie' ], function() { /** * Extend a url with a subset of query parameters * * @param {string} url Base url to extend * @param {object} allParams Object with all available query parameters (usually for the current location) * @param {array} paramsToInclude List of parameters to include in the extended url * @return {string} Extended url */ function extendWithSomeParams( url, allParams, paramsToInclude ) { var urlObject = new URL( url ); // Fallback for survey links allParams.wmf_medium = allParams.wmf_medium || allParams.utm_medium; allParams.wmf_campaign = allParams.wmf_campaign || allParams.utm_campaign; allParams.wmf_source = allParams.wmf_source || allParams.utm_source; paramsToInclude.forEach( function(key) { if ( allParams[key] ) { urlObject.searchParams.set( key, allParams[key] ); } }); return urlObject.toString(); } /* -- Start of main TY page code -- */ var params = {}; for ( const [key, value] of new URLSearchParams( location.search ) ) { params[key] = value; } var country = params.country, pageLanguage = mw.config.get('wgPageName').split('/')[1]; if ( params.recurring === '1' ) { document.getElementById('ty-recurringOrganic').style.display = 'block'; } if ( params.recurring === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringOrganic').style.display = 'none'; document.getElementById('ty-recurringOrganicAnnual').style.display = 'block'; } if ( params.recurringConversion === '1' ) { document.getElementById('ty-recurringConversion').style.display = 'block'; } if ( params.recurringConversion === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringConversion').style.display = 'none'; document.getElementById('ty-recurringConversionAnnual').style.display = 'block'; } // Recurring Upgrade if ( params.recurUpgrade === '1' ) { var recurUpgradeAmt = params.recurAmount; var recurUpgradeDate = params.recurDate; $('.recurUpgrade-yes').show(); if ( recurUpgradeAmt && recurUpgradeDate ) { $('.recurUpgradeAmt').text(recurUpgradeAmt); if ( params.country === 'US' ) { $('.recurUpgradeAmt').prepend("$"); } var upgradeDate = new Date(recurUpgradeDate); var formatOptions = { timeZone: 'UTC', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; $('.recurUpgradeDate').text( upgradeDate.toLocaleDateString('en-US', formatOptions) ); $('.recurUpgrade-receipt').show(); } else { $('.recurUpgrade-receipt').hide(); } } else if ( params.recurUpgrade === '0' ) { $('.recurUpgrade-no').show(); } else { $('.ty-vision, .ty-text').show(); } // Extend survey links $('.ty-survey-link, a[href^="https://www.surveymonkey.com"]').attr('href', function( i, val ) { return extendWithSomeParams( val, params, [ 'country', 'payment_method', 'recurring', 'recurringConversion', 'amount', 'currency', 'order_id', 'wmf_medium', 'wmf_campaign', 'wmf_source' ] ); }); // Return to Wikipedia link var returnToUrl = mw.cookie.get( 'fundraising_returnTo', '' ); if ( returnToUrl ) { $( '.ty-return a' ).attr( 'href', returnToUrl ); $( '.ty-return' ).show(); mw.cookie.set( 'fundraising_returnTo', null, { prefix: '', domain: '.wikipedia.org' } ); } // TODO: refactor this to be by feature instead of country? if ( params.featureEndowment ) { // To force endowment feature $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( params.featureMatching ) { // To force matching gifts feature $( '.primary-ctas .matching, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-US, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'US' ) { $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'CA' || country === 'GB' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-notUS, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IE' || country === 'AU' || country === 'NZ' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IT' || country === 'PT' || country === 'BR' || country === 'JP' || country === 'FR' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'ES' || country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'BE' || country === 'CZ' || country === 'NO' || country === 'AT' || country === 'DK' || country === 'PL' || country === 'HU' ) { $( '.primary-ctas .survey, \ .other-ctas' ).show(); } else { $( '.primary-ctas .survey' ).show(); } if ( country === 'US' && params.amount >= 1000) { console.log('amount ' + params.amount); } if ( country === 'SE' ) { $('.chapter-SE').show(); } if ( country === 'CZ' ) { $('.chapter-CZ').show(); } if ( country === 'IT' ) { $('.chapter-IT').show(); } if ( country === 'AU' ) { $('.chapter-AU').show(); } if ( country === 'FR' ) { $('.chapter-FR').show(); } if ( country === 'GB' ) { $('.chapter-GB').show(); } if ( country === 'CA' ) { $('.chapter-CA').show(); } if ( country === 'NO' ) { $('.chapter-NO').show(); } if ( country === 'BE' ) { $('.chapter-BE').show(); } if ( country === 'NL' ) { $('.chapter-NL').show(); } if ( country === 'NZ' ) { $('.chapter-NZ').show(); } if ( country === 'AT' ) { $('.chapter-AT').show(); } if ( country === 'CO' ) { $('.chapter-CO').show(); } if ( country === 'MX' ) { $('.chapter-MX').show(); } if ( country === 'BR' ) { $('.chapter-BR').show(); } if ( country === 'UY' ) { $('.chapter-UY').show(); $('.video-module-UY').show(); } if ( country === 'PL' ) { $('.chapter-PL').show(); } if ( country === 'HU' ) { $('.chapter-HU').show(); } /* Wikiminute blocks */ if ( country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $('.wikiminute-LATAM').show(); } if ( country === 'ES' ) { $('.wikiminute-ES').show(); } if ( country === 'FR' ) { $('.wikiminute-FR').show(); } if ( country === 'AT' ) { $('.wikiminute-DE').show(); } if ( country === 'IT' ) { $('.wikiminute-IT').show(); } if ( country === 'BR' ) { $('.wikiminute-ptBR').show(); } if ( country === 'NL' ) { $('.wikiminute-NL').show(); } if ( country === 'DK' ) { $('.wikiminute-DK').show(); } if ( country === 'SE' ) { $('.wikiminute-SV').show(); } if ( country === 'NO' ) { $('.wikiminute-NB').show(); } if ( country === 'JP' ) { $('.wikiminute-JA').show(); } /* Tax deductibility disclaimer */ if ( country === 'US' ) { $('.tax-disclaimer-US').show(); } else if ( country === 'NL' ) { $('.tax-disclaimer-NL').show(); } else if ( country === 'FR' ) { $('.tax-disclaimer-FR').show(); } else { $('.tax-disclaimer-default').show(); } /* -- "Try editing" feature -- */ var editingUrls = { 'IN': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-in-en-2022' }, 'ZA': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-za-en-2022' }, // Latin America 'BR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'pt-br': 'https://pt.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-pt-2022&uselang=pt-br' }, 'AR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CL': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CO': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'MX': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'PE': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'UY': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, // Northern and Western Europe 'SE': { 'sv': 'https://sv.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023' }, 'IT': { 'it': 'https://it.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023' }, 'FR': { 'fr': 'https://fr.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023' }, 'NL': { 'nl': 'https://nl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023' }, // Central Europe 'PL': { 'pl': 'https://pl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026' }, 'HU': { 'hu': 'https://hu.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026' }, // East, Southeast Asia, and Pacific 'JP': { 'ja': 'https://ja.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023' }, }; // Separate list so we can have others in prep for proofing var editingCTACountries = [ 'IN', 'ZA', 'BR', 'AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'SE', 'IT', 'FR', 'NL', 'JP', 'PL', 'HU' ]; if ( editingCTACountries.indexOf(country) !== -1 || params.testEditingCTA ) { if ( editingUrls[country] ) { if ( editingUrls[country][pageLanguage] ) { $( '.try-editing a' ).attr( 'href', editingUrls[country][pageLanguage] ); $( '.primary-ctas .survey' ).hide(); $( '.primary-ctas .try-editing, .other-ctas, .other-ctas .survey' ).show(); } } } // Only show survey 25% of time on English page //if ( pageLanguage === 'en' ) { // if ( Math.random() > 0.25 ) { // $('.survey').hide(); // } //} if ( pageLanguage === 'en' ) { var surveyNumber = Math.random(); if ( surveyNumber > 0.5 ) { $('.survey').hide(); } else if ( surveyNumber > 0.25 && surveyNumber <= 0.5 ) { $('.survey-1').hide(); } else if ( surveyNumber > 0 && surveyNumber <= 0.25 ) { $('.survey-2').hide(); } } // Don't show editing CTAs on apps: https://phabricator.wikimedia.org/T353023 if ( params.utm_medium === 'WikipediaApp' || params.wmf_medium === 'WikipediaApp' ) { $('.other-ctas .edit-6c, .primary-ctas .try-editing').hide(); } // Finally, if there are no secondary CTAs shown then hide the section header if ( $('.other-ctas .focus-block:visible').length === 0 ) { $('.other-ctas h2').hide(); } // One Click Survey page show/hide CTAs if ($('.ty-page').hasClass('one-click-survey')) { if ( params.variant === 'donate' ) { // To show donate CTA $( '.other-ctas .donate, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } else { // Show edit CTA $( '.other-ctas .edit-6c, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } } // MGFE event invite show/hide if ( params.wmf_campaign === 'MGYEA1R26' && params.wmf_medium === 'MGFE' ) { $('.mgfe-block').show(); } if ( params.wmf_campaign === 'ENDYEA1R26' && params.wmf_medium === 'endowment' ) { $('.mgfe-block').show(); } // WP25 specific if ( country === 'US' ) { $('.wp25 .tax-disclaimer').hide(); } // Show social media share & social media footer only in English if ( pageLanguage === 'en' ) { $( '.social-share' ).show(); $( '.social-footer' ).show(); } /* -- Legacy giving form --- */ var lg = { post: function( $form ) { // Create iframe for the form and use it as the form's target var frameName = 'lgFrame'; 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() { var legacyForm = document.getElementById( 'lg-form' ), legacyDialog = document.getElementById( 'frb-dialog-legacy' ); if ( !legacyForm ) { return false; } // pre-fill country, only shown in US for now legacyForm.country.value = 'United States'; legacyForm.lg_submitDate.value = lg.getCurrentDate(); $('.frb-dialog-link').on( 'click', function(e) { legacyDialog.showModal(); legacyForm.firstname.focus(); }); $('#frb-dialog-legacy .frb-dialog-close').on( 'click', function(e) { legacyDialog.close(); }); // form submit $('#lg-form .lg-submit').on( 'click', function() { var pdfUrl = "https://upload.wikimedia.org/wikipedia/donate/9/97/Wikipedia_Planned_Giving_Guide.pdf"; if ( legacyForm.checkValidity() ) { lg.post( $('#lg-form') ); legacyDialog.close(); mw.notify( 'Thank you! Our team will be in touch.' ); window.open(pdfUrl, '_blank'); } else { legacyForm.reportValidity(); } return false; }); } }; lg.init(); /* -- donor badge dialog --- */ var donorBadge = { init: function() { var donorBadgeDialog = document.getElementById( 'frb-dialog-donor-badge' ); $('.getDonorBadge').on( 'click', function(e) { donorBadge.setCookie(); donorBadgeDialog.showModal(); }); $('#frb-dialog-donor-badge .frb-dialog-close').on( 'click', function(e) { donorBadgeDialog.close(); e.target.blur(); }); }, setCookie: function() { const DONOR_BADGE_COOKIE_NAME = 'fundraising_donor_badge'; const DONOR_BADGE_COOKIE_OPTIONS = { domain: 'wikipedia.org', path: '/', expires: 90 * 24 * 60 * 60 // 90 days }; mw.loader.using( 'mediawiki.cookie' ).then( function () { $.cookie( DONOR_BADGE_COOKIE_NAME, '1', DONOR_BADGE_COOKIE_OPTIONS ); }); } }; donorBadge.init(); // hack to set page language based on template const tyPage = document.querySelector( '.ty-page' ); if ( tyPage ) { document.documentElement.lang = tyPage.lang || 'en'; } }); if ( navigator.share ) { $('#ty-web-share').click(function(e) { var url = 'https://donate.wikimedia.org/?wmf_medium=SocialMedia&wmf_campaign=ThankYouPage&wmf_source=WebShare'; if ( $(this).data('share-language') ) { url += '&uselang=' + $(this).data('share-language'); } navigator.share({ text: $(this).data('share-text'), url: url }); e.preventDefault(); }); $('#ty-web-share').show(); } /* Show all elements for testing and checking translations */ function tyDebug() { $('.ty-page *:not(dialog)').show(); } q8kr05a2g3w953ncp722hkamdos9omv 1505 1504 2026-09-16T10:45:02Z EHughes (WMF) 9 Updating planned giving CTA content for donors > 1000 1505 javascript text/javascript /* Any JavaScript here will be loaded for all users on every page load. */ // Framebuster for https://phabricator.wikimedia.org/T176669 if ( self !== top ) { top.location.href = window.location; } // Redirect anons to en if page doesn't exist if ( mw.config.get('wgUserName') === null && mw.config.get('wgArticleId') === 0 ) { var basePageName = mw.config.get('wgPageName').split('/')[0]; var redirectUrl = 'https://thankyou.wikipedia.org/wiki/'; if ( basePageName === 'Recurring_donor_page' ) { redirectUrl += 'Recurring_donor_page/en'; } else if ( basePageName === 'WP25' ) { redirectUrl += 'WP25/en'; } else { redirectUrl += 'Thank_You/en'; } redirectUrl += window.location.search; // params window.location.replace( redirectUrl ); } mw.loader.using( [ 'mediawiki.cookie' ], function() { /** * Extend a url with a subset of query parameters * * @param {string} url Base url to extend * @param {object} allParams Object with all available query parameters (usually for the current location) * @param {array} paramsToInclude List of parameters to include in the extended url * @return {string} Extended url */ function extendWithSomeParams( url, allParams, paramsToInclude ) { var urlObject = new URL( url ); // Fallback for survey links allParams.wmf_medium = allParams.wmf_medium || allParams.utm_medium; allParams.wmf_campaign = allParams.wmf_campaign || allParams.utm_campaign; allParams.wmf_source = allParams.wmf_source || allParams.utm_source; paramsToInclude.forEach( function(key) { if ( allParams[key] ) { urlObject.searchParams.set( key, allParams[key] ); } }); return urlObject.toString(); } /* -- Start of main TY page code -- */ var params = {}; for ( const [key, value] of new URLSearchParams( location.search ) ) { params[key] = value; } var country = params.country, pageLanguage = mw.config.get('wgPageName').split('/')[1]; if ( params.recurring === '1' ) { document.getElementById('ty-recurringOrganic').style.display = 'block'; } if ( params.recurring === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringOrganic').style.display = 'none'; document.getElementById('ty-recurringOrganicAnnual').style.display = 'block'; } if ( params.recurringConversion === '1' ) { document.getElementById('ty-recurringConversion').style.display = 'block'; } if ( params.recurringConversion === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringConversion').style.display = 'none'; document.getElementById('ty-recurringConversionAnnual').style.display = 'block'; } // Recurring Upgrade if ( params.recurUpgrade === '1' ) { var recurUpgradeAmt = params.recurAmount; var recurUpgradeDate = params.recurDate; $('.recurUpgrade-yes').show(); if ( recurUpgradeAmt && recurUpgradeDate ) { $('.recurUpgradeAmt').text(recurUpgradeAmt); if ( params.country === 'US' ) { $('.recurUpgradeAmt').prepend("$"); } var upgradeDate = new Date(recurUpgradeDate); var formatOptions = { timeZone: 'UTC', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; $('.recurUpgradeDate').text( upgradeDate.toLocaleDateString('en-US', formatOptions) ); $('.recurUpgrade-receipt').show(); } else { $('.recurUpgrade-receipt').hide(); } } else if ( params.recurUpgrade === '0' ) { $('.recurUpgrade-no').show(); } else { $('.ty-vision, .ty-text').show(); } // Extend survey links $('.ty-survey-link, a[href^="https://www.surveymonkey.com"]').attr('href', function( i, val ) { return extendWithSomeParams( val, params, [ 'country', 'payment_method', 'recurring', 'recurringConversion', 'amount', 'currency', 'order_id', 'wmf_medium', 'wmf_campaign', 'wmf_source' ] ); }); // Return to Wikipedia link var returnToUrl = mw.cookie.get( 'fundraising_returnTo', '' ); if ( returnToUrl ) { $( '.ty-return a' ).attr( 'href', returnToUrl ); $( '.ty-return' ).show(); mw.cookie.set( 'fundraising_returnTo', null, { prefix: '', domain: '.wikipedia.org' } ); } // TODO: refactor this to be by feature instead of country? if ( params.featureEndowment ) { // To force endowment feature $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( params.featureMatching ) { // To force matching gifts feature $( '.primary-ctas .matching, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-US, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'US' ) { $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'CA' || country === 'GB' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-notUS, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IE' || country === 'AU' || country === 'NZ' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IT' || country === 'PT' || country === 'BR' || country === 'JP' || country === 'FR' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'ES' || country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'BE' || country === 'CZ' || country === 'NO' || country === 'AT' || country === 'DK' || country === 'PL' || country === 'HU' ) { $( '.primary-ctas .survey, \ .other-ctas' ).show(); } else { $( '.primary-ctas .survey' ).show(); } // show different endowment feature to donors who gave over $1000, and we are not forcing the matching gifts feature if ( country === 'US' && params.amount >= 1000 && !params.featureMatching ) { $('.primary-ctas .endowment-1').hide(); $('.primary-ctas .endowment-1000').show(); } if ( country === 'SE' ) { $('.chapter-SE').show(); } if ( country === 'CZ' ) { $('.chapter-CZ').show(); } if ( country === 'IT' ) { $('.chapter-IT').show(); } if ( country === 'AU' ) { $('.chapter-AU').show(); } if ( country === 'FR' ) { $('.chapter-FR').show(); } if ( country === 'GB' ) { $('.chapter-GB').show(); } if ( country === 'CA' ) { $('.chapter-CA').show(); } if ( country === 'NO' ) { $('.chapter-NO').show(); } if ( country === 'BE' ) { $('.chapter-BE').show(); } if ( country === 'NL' ) { $('.chapter-NL').show(); } if ( country === 'NZ' ) { $('.chapter-NZ').show(); } if ( country === 'AT' ) { $('.chapter-AT').show(); } if ( country === 'CO' ) { $('.chapter-CO').show(); } if ( country === 'MX' ) { $('.chapter-MX').show(); } if ( country === 'BR' ) { $('.chapter-BR').show(); } if ( country === 'UY' ) { $('.chapter-UY').show(); $('.video-module-UY').show(); } if ( country === 'PL' ) { $('.chapter-PL').show(); } if ( country === 'HU' ) { $('.chapter-HU').show(); } /* Wikiminute blocks */ if ( country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $('.wikiminute-LATAM').show(); } if ( country === 'ES' ) { $('.wikiminute-ES').show(); } if ( country === 'FR' ) { $('.wikiminute-FR').show(); } if ( country === 'AT' ) { $('.wikiminute-DE').show(); } if ( country === 'IT' ) { $('.wikiminute-IT').show(); } if ( country === 'BR' ) { $('.wikiminute-ptBR').show(); } if ( country === 'NL' ) { $('.wikiminute-NL').show(); } if ( country === 'DK' ) { $('.wikiminute-DK').show(); } if ( country === 'SE' ) { $('.wikiminute-SV').show(); } if ( country === 'NO' ) { $('.wikiminute-NB').show(); } if ( country === 'JP' ) { $('.wikiminute-JA').show(); } /* Tax deductibility disclaimer */ if ( country === 'US' ) { $('.tax-disclaimer-US').show(); } else if ( country === 'NL' ) { $('.tax-disclaimer-NL').show(); } else if ( country === 'FR' ) { $('.tax-disclaimer-FR').show(); } else { $('.tax-disclaimer-default').show(); } /* -- "Try editing" feature -- */ var editingUrls = { 'IN': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-in-en-2022' }, 'ZA': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-za-en-2022' }, // Latin America 'BR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'pt-br': 'https://pt.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-pt-2022&uselang=pt-br' }, 'AR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CL': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CO': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'MX': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'PE': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'UY': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, // Northern and Western Europe 'SE': { 'sv': 'https://sv.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023' }, 'IT': { 'it': 'https://it.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023' }, 'FR': { 'fr': 'https://fr.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023' }, 'NL': { 'nl': 'https://nl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023' }, // Central Europe 'PL': { 'pl': 'https://pl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026' }, 'HU': { 'hu': 'https://hu.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026' }, // East, Southeast Asia, and Pacific 'JP': { 'ja': 'https://ja.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023' }, }; // Separate list so we can have others in prep for proofing var editingCTACountries = [ 'IN', 'ZA', 'BR', 'AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'SE', 'IT', 'FR', 'NL', 'JP', 'PL', 'HU' ]; if ( editingCTACountries.indexOf(country) !== -1 || params.testEditingCTA ) { if ( editingUrls[country] ) { if ( editingUrls[country][pageLanguage] ) { $( '.try-editing a' ).attr( 'href', editingUrls[country][pageLanguage] ); $( '.primary-ctas .survey' ).hide(); $( '.primary-ctas .try-editing, .other-ctas, .other-ctas .survey' ).show(); } } } // Only show survey 25% of time on English page //if ( pageLanguage === 'en' ) { // if ( Math.random() > 0.25 ) { // $('.survey').hide(); // } //} if ( pageLanguage === 'en' ) { var surveyNumber = Math.random(); if ( surveyNumber > 0.5 ) { $('.survey').hide(); } else if ( surveyNumber > 0.25 && surveyNumber <= 0.5 ) { $('.survey-1').hide(); } else if ( surveyNumber > 0 && surveyNumber <= 0.25 ) { $('.survey-2').hide(); } } // Don't show editing CTAs on apps: https://phabricator.wikimedia.org/T353023 if ( params.utm_medium === 'WikipediaApp' || params.wmf_medium === 'WikipediaApp' ) { $('.other-ctas .edit-6c, .primary-ctas .try-editing').hide(); } // Finally, if there are no secondary CTAs shown then hide the section header if ( $('.other-ctas .focus-block:visible').length === 0 ) { $('.other-ctas h2').hide(); } // One Click Survey page show/hide CTAs if ($('.ty-page').hasClass('one-click-survey')) { if ( params.variant === 'donate' ) { // To show donate CTA $( '.other-ctas .donate, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } else { // Show edit CTA $( '.other-ctas .edit-6c, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } } // MGFE event invite show/hide if ( params.wmf_campaign === 'MGYEA1R26' && params.wmf_medium === 'MGFE' ) { $('.mgfe-block').show(); } if ( params.wmf_campaign === 'ENDYEA1R26' && params.wmf_medium === 'endowment' ) { $('.mgfe-block').show(); } // WP25 specific if ( country === 'US' ) { $('.wp25 .tax-disclaimer').hide(); } // Show social media share & social media footer only in English if ( pageLanguage === 'en' ) { $( '.social-share' ).show(); $( '.social-footer' ).show(); } /* -- Legacy giving form --- */ var lg = { post: function( $form ) { // Create iframe for the form and use it as the form's target var frameName = 'lgFrame'; 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() { var legacyForm = document.getElementById( 'lg-form' ), legacyDialog = document.getElementById( 'frb-dialog-legacy' ); if ( !legacyForm ) { return false; } // pre-fill country, only shown in US for now legacyForm.country.value = 'United States'; legacyForm.lg_submitDate.value = lg.getCurrentDate(); $('.frb-dialog-link').on( 'click', function(e) { legacyDialog.showModal(); legacyForm.firstname.focus(); }); $('#frb-dialog-legacy .frb-dialog-close').on( 'click', function(e) { legacyDialog.close(); }); // form submit $('#lg-form .lg-submit').on( 'click', function() { var pdfUrl = "https://upload.wikimedia.org/wikipedia/donate/9/97/Wikipedia_Planned_Giving_Guide.pdf"; if ( legacyForm.checkValidity() ) { lg.post( $('#lg-form') ); legacyDialog.close(); mw.notify( 'Thank you! Our team will be in touch.' ); window.open(pdfUrl, '_blank'); } else { legacyForm.reportValidity(); } return false; }); } }; lg.init(); /* -- donor badge dialog --- */ var donorBadge = { init: function() { var donorBadgeDialog = document.getElementById( 'frb-dialog-donor-badge' ); $('.getDonorBadge').on( 'click', function(e) { donorBadge.setCookie(); donorBadgeDialog.showModal(); }); $('#frb-dialog-donor-badge .frb-dialog-close').on( 'click', function(e) { donorBadgeDialog.close(); e.target.blur(); }); }, setCookie: function() { const DONOR_BADGE_COOKIE_NAME = 'fundraising_donor_badge'; const DONOR_BADGE_COOKIE_OPTIONS = { domain: 'wikipedia.org', path: '/', expires: 90 * 24 * 60 * 60 // 90 days }; mw.loader.using( 'mediawiki.cookie' ).then( function () { $.cookie( DONOR_BADGE_COOKIE_NAME, '1', DONOR_BADGE_COOKIE_OPTIONS ); }); } }; donorBadge.init(); // hack to set page language based on template const tyPage = document.querySelector( '.ty-page' ); if ( tyPage ) { document.documentElement.lang = tyPage.lang || 'en'; } }); if ( navigator.share ) { $('#ty-web-share').click(function(e) { var url = 'https://donate.wikimedia.org/?wmf_medium=SocialMedia&wmf_campaign=ThankYouPage&wmf_source=WebShare'; if ( $(this).data('share-language') ) { url += '&uselang=' + $(this).data('share-language'); } navigator.share({ text: $(this).data('share-text'), url: url }); e.preventDefault(); }); $('#ty-web-share').show(); } /* Show all elements for testing and checking translations */ function tyDebug() { $('.ty-page *:not(dialog)').show(); } igfvup1tqasyno0tleefos6ovf9eg2b 1506 1505 2026-09-16T10:46:47Z EHughes (WMF) 9 1506 javascript text/javascript /* Any JavaScript here will be loaded for all users on every page load. */ // Framebuster for https://phabricator.wikimedia.org/T176669 if ( self !== top ) { top.location.href = window.location; } // Redirect anons to en if page doesn't exist if ( mw.config.get('wgUserName') === null && mw.config.get('wgArticleId') === 0 ) { var basePageName = mw.config.get('wgPageName').split('/')[0]; var redirectUrl = 'https://thankyou.wikipedia.org/wiki/'; if ( basePageName === 'Recurring_donor_page' ) { redirectUrl += 'Recurring_donor_page/en'; } else if ( basePageName === 'WP25' ) { redirectUrl += 'WP25/en'; } else { redirectUrl += 'Thank_You/en'; } redirectUrl += window.location.search; // params window.location.replace( redirectUrl ); } mw.loader.using( [ 'mediawiki.cookie' ], function() { /** * Extend a url with a subset of query parameters * * @param {string} url Base url to extend * @param {object} allParams Object with all available query parameters (usually for the current location) * @param {array} paramsToInclude List of parameters to include in the extended url * @return {string} Extended url */ function extendWithSomeParams( url, allParams, paramsToInclude ) { var urlObject = new URL( url ); // Fallback for survey links allParams.wmf_medium = allParams.wmf_medium || allParams.utm_medium; allParams.wmf_campaign = allParams.wmf_campaign || allParams.utm_campaign; allParams.wmf_source = allParams.wmf_source || allParams.utm_source; paramsToInclude.forEach( function(key) { if ( allParams[key] ) { urlObject.searchParams.set( key, allParams[key] ); } }); return urlObject.toString(); } /* -- Start of main TY page code -- */ var params = {}; for ( const [key, value] of new URLSearchParams( location.search ) ) { params[key] = value; } var country = params.country, pageLanguage = mw.config.get('wgPageName').split('/')[1]; if ( params.recurring === '1' ) { document.getElementById('ty-recurringOrganic').style.display = 'block'; } if ( params.recurring === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringOrganic').style.display = 'none'; document.getElementById('ty-recurringOrganicAnnual').style.display = 'block'; } if ( params.recurringConversion === '1' ) { document.getElementById('ty-recurringConversion').style.display = 'block'; } if ( params.recurringConversion === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringConversion').style.display = 'none'; document.getElementById('ty-recurringConversionAnnual').style.display = 'block'; } // Recurring Upgrade if ( params.recurUpgrade === '1' ) { var recurUpgradeAmt = params.recurAmount; var recurUpgradeDate = params.recurDate; $('.recurUpgrade-yes').show(); if ( recurUpgradeAmt && recurUpgradeDate ) { $('.recurUpgradeAmt').text(recurUpgradeAmt); if ( params.country === 'US' ) { $('.recurUpgradeAmt').prepend("$"); } var upgradeDate = new Date(recurUpgradeDate); var formatOptions = { timeZone: 'UTC', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; $('.recurUpgradeDate').text( upgradeDate.toLocaleDateString('en-US', formatOptions) ); $('.recurUpgrade-receipt').show(); } else { $('.recurUpgrade-receipt').hide(); } } else if ( params.recurUpgrade === '0' ) { $('.recurUpgrade-no').show(); } else { $('.ty-vision, .ty-text').show(); } // Extend survey links $('.ty-survey-link, a[href^="https://www.surveymonkey.com"]').attr('href', function( i, val ) { return extendWithSomeParams( val, params, [ 'country', 'payment_method', 'recurring', 'recurringConversion', 'amount', 'currency', 'order_id', 'wmf_medium', 'wmf_campaign', 'wmf_source' ] ); }); // Return to Wikipedia link var returnToUrl = mw.cookie.get( 'fundraising_returnTo', '' ); if ( returnToUrl ) { $( '.ty-return a' ).attr( 'href', returnToUrl ); $( '.ty-return' ).show(); mw.cookie.set( 'fundraising_returnTo', null, { prefix: '', domain: '.wikipedia.org' } ); } // TODO: refactor this to be by feature instead of country? if ( params.featureEndowment ) { // To force endowment feature $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( params.featureMatching ) { // To force matching gifts feature $( '.primary-ctas .matching, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-US, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'US' ) { $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'CA' || country === 'GB' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-notUS, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IE' || country === 'AU' || country === 'NZ' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IT' || country === 'PT' || country === 'BR' || country === 'JP' || country === 'FR' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'ES' || country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'BE' || country === 'CZ' || country === 'NO' || country === 'AT' || country === 'DK' || country === 'PL' || country === 'HU' ) { $( '.primary-ctas .survey, \ .other-ctas' ).show(); } else { $( '.primary-ctas .survey' ).show(); } // show different endowment feature to donors who gave over $1000, and we are not forcing the matching gifts feature if ( country === 'US' && params.amount >= 1000 && !params.featureMatching ) { console.log('us 1000') } if ( country === 'SE' ) { $('.chapter-SE').show(); } if ( country === 'CZ' ) { $('.chapter-CZ').show(); } if ( country === 'IT' ) { $('.chapter-IT').show(); } if ( country === 'AU' ) { $('.chapter-AU').show(); } if ( country === 'FR' ) { $('.chapter-FR').show(); } if ( country === 'GB' ) { $('.chapter-GB').show(); } if ( country === 'CA' ) { $('.chapter-CA').show(); } if ( country === 'NO' ) { $('.chapter-NO').show(); } if ( country === 'BE' ) { $('.chapter-BE').show(); } if ( country === 'NL' ) { $('.chapter-NL').show(); } if ( country === 'NZ' ) { $('.chapter-NZ').show(); } if ( country === 'AT' ) { $('.chapter-AT').show(); } if ( country === 'CO' ) { $('.chapter-CO').show(); } if ( country === 'MX' ) { $('.chapter-MX').show(); } if ( country === 'BR' ) { $('.chapter-BR').show(); } if ( country === 'UY' ) { $('.chapter-UY').show(); $('.video-module-UY').show(); } if ( country === 'PL' ) { $('.chapter-PL').show(); } if ( country === 'HU' ) { $('.chapter-HU').show(); } /* Wikiminute blocks */ if ( country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $('.wikiminute-LATAM').show(); } if ( country === 'ES' ) { $('.wikiminute-ES').show(); } if ( country === 'FR' ) { $('.wikiminute-FR').show(); } if ( country === 'AT' ) { $('.wikiminute-DE').show(); } if ( country === 'IT' ) { $('.wikiminute-IT').show(); } if ( country === 'BR' ) { $('.wikiminute-ptBR').show(); } if ( country === 'NL' ) { $('.wikiminute-NL').show(); } if ( country === 'DK' ) { $('.wikiminute-DK').show(); } if ( country === 'SE' ) { $('.wikiminute-SV').show(); } if ( country === 'NO' ) { $('.wikiminute-NB').show(); } if ( country === 'JP' ) { $('.wikiminute-JA').show(); } /* Tax deductibility disclaimer */ if ( country === 'US' ) { $('.tax-disclaimer-US').show(); } else if ( country === 'NL' ) { $('.tax-disclaimer-NL').show(); } else if ( country === 'FR' ) { $('.tax-disclaimer-FR').show(); } else { $('.tax-disclaimer-default').show(); } /* -- "Try editing" feature -- */ var editingUrls = { 'IN': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-in-en-2022' }, 'ZA': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-za-en-2022' }, // Latin America 'BR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'pt-br': 'https://pt.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-pt-2022&uselang=pt-br' }, 'AR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CL': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CO': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'MX': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'PE': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'UY': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, // Northern and Western Europe 'SE': { 'sv': 'https://sv.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023' }, 'IT': { 'it': 'https://it.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023' }, 'FR': { 'fr': 'https://fr.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023' }, 'NL': { 'nl': 'https://nl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023' }, // Central Europe 'PL': { 'pl': 'https://pl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026' }, 'HU': { 'hu': 'https://hu.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026' }, // East, Southeast Asia, and Pacific 'JP': { 'ja': 'https://ja.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023' }, }; // Separate list so we can have others in prep for proofing var editingCTACountries = [ 'IN', 'ZA', 'BR', 'AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'SE', 'IT', 'FR', 'NL', 'JP', 'PL', 'HU' ]; if ( editingCTACountries.indexOf(country) !== -1 || params.testEditingCTA ) { if ( editingUrls[country] ) { if ( editingUrls[country][pageLanguage] ) { $( '.try-editing a' ).attr( 'href', editingUrls[country][pageLanguage] ); $( '.primary-ctas .survey' ).hide(); $( '.primary-ctas .try-editing, .other-ctas, .other-ctas .survey' ).show(); } } } // Only show survey 25% of time on English page //if ( pageLanguage === 'en' ) { // if ( Math.random() > 0.25 ) { // $('.survey').hide(); // } //} if ( pageLanguage === 'en' ) { var surveyNumber = Math.random(); if ( surveyNumber > 0.5 ) { $('.survey').hide(); } else if ( surveyNumber > 0.25 && surveyNumber <= 0.5 ) { $('.survey-1').hide(); } else if ( surveyNumber > 0 && surveyNumber <= 0.25 ) { $('.survey-2').hide(); } } // Don't show editing CTAs on apps: https://phabricator.wikimedia.org/T353023 if ( params.utm_medium === 'WikipediaApp' || params.wmf_medium === 'WikipediaApp' ) { $('.other-ctas .edit-6c, .primary-ctas .try-editing').hide(); } // Finally, if there are no secondary CTAs shown then hide the section header if ( $('.other-ctas .focus-block:visible').length === 0 ) { $('.other-ctas h2').hide(); } // One Click Survey page show/hide CTAs if ($('.ty-page').hasClass('one-click-survey')) { if ( params.variant === 'donate' ) { // To show donate CTA $( '.other-ctas .donate, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } else { // Show edit CTA $( '.other-ctas .edit-6c, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } } // MGFE event invite show/hide if ( params.wmf_campaign === 'MGYEA1R26' && params.wmf_medium === 'MGFE' ) { $('.mgfe-block').show(); } if ( params.wmf_campaign === 'ENDYEA1R26' && params.wmf_medium === 'endowment' ) { $('.mgfe-block').show(); } // WP25 specific if ( country === 'US' ) { $('.wp25 .tax-disclaimer').hide(); } // Show social media share & social media footer only in English if ( pageLanguage === 'en' ) { $( '.social-share' ).show(); $( '.social-footer' ).show(); } /* -- Legacy giving form --- */ var lg = { post: function( $form ) { // Create iframe for the form and use it as the form's target var frameName = 'lgFrame'; 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() { var legacyForm = document.getElementById( 'lg-form' ), legacyDialog = document.getElementById( 'frb-dialog-legacy' ); if ( !legacyForm ) { return false; } // pre-fill country, only shown in US for now legacyForm.country.value = 'United States'; legacyForm.lg_submitDate.value = lg.getCurrentDate(); $('.frb-dialog-link').on( 'click', function(e) { legacyDialog.showModal(); legacyForm.firstname.focus(); }); $('#frb-dialog-legacy .frb-dialog-close').on( 'click', function(e) { legacyDialog.close(); }); // form submit $('#lg-form .lg-submit').on( 'click', function() { var pdfUrl = "https://upload.wikimedia.org/wikipedia/donate/9/97/Wikipedia_Planned_Giving_Guide.pdf"; if ( legacyForm.checkValidity() ) { lg.post( $('#lg-form') ); legacyDialog.close(); mw.notify( 'Thank you! Our team will be in touch.' ); window.open(pdfUrl, '_blank'); } else { legacyForm.reportValidity(); } return false; }); } }; lg.init(); /* -- donor badge dialog --- */ var donorBadge = { init: function() { var donorBadgeDialog = document.getElementById( 'frb-dialog-donor-badge' ); $('.getDonorBadge').on( 'click', function(e) { donorBadge.setCookie(); donorBadgeDialog.showModal(); }); $('#frb-dialog-donor-badge .frb-dialog-close').on( 'click', function(e) { donorBadgeDialog.close(); e.target.blur(); }); }, setCookie: function() { const DONOR_BADGE_COOKIE_NAME = 'fundraising_donor_badge'; const DONOR_BADGE_COOKIE_OPTIONS = { domain: 'wikipedia.org', path: '/', expires: 90 * 24 * 60 * 60 // 90 days }; mw.loader.using( 'mediawiki.cookie' ).then( function () { $.cookie( DONOR_BADGE_COOKIE_NAME, '1', DONOR_BADGE_COOKIE_OPTIONS ); }); } }; donorBadge.init(); // hack to set page language based on template const tyPage = document.querySelector( '.ty-page' ); if ( tyPage ) { document.documentElement.lang = tyPage.lang || 'en'; } }); if ( navigator.share ) { $('#ty-web-share').click(function(e) { var url = 'https://donate.wikimedia.org/?wmf_medium=SocialMedia&wmf_campaign=ThankYouPage&wmf_source=WebShare'; if ( $(this).data('share-language') ) { url += '&uselang=' + $(this).data('share-language'); } navigator.share({ text: $(this).data('share-text'), url: url }); e.preventDefault(); }); $('#ty-web-share').show(); } /* Show all elements for testing and checking translations */ function tyDebug() { $('.ty-page *:not(dialog)').show(); } s0xvo5utcvgq169nfqh6fe4cg38wi3g 1508 1506 2026-09-16T10:52:47Z EHughes (WMF) 9 Updating planned giving CTA content for donors > 1000 1508 javascript text/javascript /* Any JavaScript here will be loaded for all users on every page load. */ // Framebuster for https://phabricator.wikimedia.org/T176669 if ( self !== top ) { top.location.href = window.location; } // Redirect anons to en if page doesn't exist if ( mw.config.get('wgUserName') === null && mw.config.get('wgArticleId') === 0 ) { var basePageName = mw.config.get('wgPageName').split('/')[0]; var redirectUrl = 'https://thankyou.wikipedia.org/wiki/'; if ( basePageName === 'Recurring_donor_page' ) { redirectUrl += 'Recurring_donor_page/en'; } else if ( basePageName === 'WP25' ) { redirectUrl += 'WP25/en'; } else { redirectUrl += 'Thank_You/en'; } redirectUrl += window.location.search; // params window.location.replace( redirectUrl ); } mw.loader.using( [ 'mediawiki.cookie' ], function() { /** * Extend a url with a subset of query parameters * * @param {string} url Base url to extend * @param {object} allParams Object with all available query parameters (usually for the current location) * @param {array} paramsToInclude List of parameters to include in the extended url * @return {string} Extended url */ function extendWithSomeParams( url, allParams, paramsToInclude ) { var urlObject = new URL( url ); // Fallback for survey links allParams.wmf_medium = allParams.wmf_medium || allParams.utm_medium; allParams.wmf_campaign = allParams.wmf_campaign || allParams.utm_campaign; allParams.wmf_source = allParams.wmf_source || allParams.utm_source; paramsToInclude.forEach( function(key) { if ( allParams[key] ) { urlObject.searchParams.set( key, allParams[key] ); } }); return urlObject.toString(); } /* -- Start of main TY page code -- */ var params = {}; for ( const [key, value] of new URLSearchParams( location.search ) ) { params[key] = value; } var country = params.country, pageLanguage = mw.config.get('wgPageName').split('/')[1]; if ( params.recurring === '1' ) { document.getElementById('ty-recurringOrganic').style.display = 'block'; } if ( params.recurring === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringOrganic').style.display = 'none'; document.getElementById('ty-recurringOrganicAnnual').style.display = 'block'; } if ( params.recurringConversion === '1' ) { document.getElementById('ty-recurringConversion').style.display = 'block'; } if ( params.recurringConversion === '1' && params.frequency_unit === 'year' ) { document.getElementById('ty-recurringConversion').style.display = 'none'; document.getElementById('ty-recurringConversionAnnual').style.display = 'block'; } // Recurring Upgrade if ( params.recurUpgrade === '1' ) { var recurUpgradeAmt = params.recurAmount; var recurUpgradeDate = params.recurDate; $('.recurUpgrade-yes').show(); if ( recurUpgradeAmt && recurUpgradeDate ) { $('.recurUpgradeAmt').text(recurUpgradeAmt); if ( params.country === 'US' ) { $('.recurUpgradeAmt').prepend("$"); } var upgradeDate = new Date(recurUpgradeDate); var formatOptions = { timeZone: 'UTC', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; $('.recurUpgradeDate').text( upgradeDate.toLocaleDateString('en-US', formatOptions) ); $('.recurUpgrade-receipt').show(); } else { $('.recurUpgrade-receipt').hide(); } } else if ( params.recurUpgrade === '0' ) { $('.recurUpgrade-no').show(); } else { $('.ty-vision, .ty-text').show(); } // Extend survey links $('.ty-survey-link, a[href^="https://www.surveymonkey.com"]').attr('href', function( i, val ) { return extendWithSomeParams( val, params, [ 'country', 'payment_method', 'recurring', 'recurringConversion', 'amount', 'currency', 'order_id', 'wmf_medium', 'wmf_campaign', 'wmf_source' ] ); }); // Return to Wikipedia link var returnToUrl = mw.cookie.get( 'fundraising_returnTo', '' ); if ( returnToUrl ) { $( '.ty-return a' ).attr( 'href', returnToUrl ); $( '.ty-return' ).show(); mw.cookie.set( 'fundraising_returnTo', null, { prefix: '', domain: '.wikipedia.org' } ); } // TODO: refactor this to be by feature instead of country? if ( params.featureEndowment ) { // To force endowment feature $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( params.featureMatching ) { // To force matching gifts feature $( '.primary-ctas .matching, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-US, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'US' ) { $( '.primary-ctas .endowment-1, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .survey, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'CA' || country === 'GB' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .will-notUS, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IE' || country === 'AU' || country === 'NZ' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store, \ .other-ctas .edit-6c' ).show(); } else if ( country === 'IT' || country === 'PT' || country === 'BR' || country === 'JP' || country === 'FR' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'ES' || country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $( '.primary-ctas .survey, \ .other-ctas, \ .other-ctas .store' ).show(); } else if ( country === 'BE' || country === 'CZ' || country === 'NO' || country === 'AT' || country === 'DK' || country === 'PL' || country === 'HU' ) { $( '.primary-ctas .survey, \ .other-ctas' ).show(); } else { $( '.primary-ctas .survey' ).show(); } // show different endowment feature to donors who gave over $1000, and we are not forcing the matching gifts feature if ( country === 'US' && params.amount >= 1000 && !params.featureMatching ) { $('.primary-ctas .endowment-1').hide(); $('.primary-ctas .endowment-1000').show(); } if ( country === 'SE' ) { $('.chapter-SE').show(); } if ( country === 'CZ' ) { $('.chapter-CZ').show(); } if ( country === 'IT' ) { $('.chapter-IT').show(); } if ( country === 'AU' ) { $('.chapter-AU').show(); } if ( country === 'FR' ) { $('.chapter-FR').show(); } if ( country === 'GB' ) { $('.chapter-GB').show(); } if ( country === 'CA' ) { $('.chapter-CA').show(); } if ( country === 'NO' ) { $('.chapter-NO').show(); } if ( country === 'BE' ) { $('.chapter-BE').show(); } if ( country === 'NL' ) { $('.chapter-NL').show(); } if ( country === 'NZ' ) { $('.chapter-NZ').show(); } if ( country === 'AT' ) { $('.chapter-AT').show(); } if ( country === 'CO' ) { $('.chapter-CO').show(); } if ( country === 'MX' ) { $('.chapter-MX').show(); } if ( country === 'BR' ) { $('.chapter-BR').show(); } if ( country === 'UY' ) { $('.chapter-UY').show(); $('.video-module-UY').show(); } if ( country === 'PL' ) { $('.chapter-PL').show(); } if ( country === 'HU' ) { $('.chapter-HU').show(); } /* Wikiminute blocks */ if ( country === 'CL' || country === 'CO' || country === 'MX' || country === 'PE' || country === 'UY' ) { $('.wikiminute-LATAM').show(); } if ( country === 'ES' ) { $('.wikiminute-ES').show(); } if ( country === 'FR' ) { $('.wikiminute-FR').show(); } if ( country === 'AT' ) { $('.wikiminute-DE').show(); } if ( country === 'IT' ) { $('.wikiminute-IT').show(); } if ( country === 'BR' ) { $('.wikiminute-ptBR').show(); } if ( country === 'NL' ) { $('.wikiminute-NL').show(); } if ( country === 'DK' ) { $('.wikiminute-DK').show(); } if ( country === 'SE' ) { $('.wikiminute-SV').show(); } if ( country === 'NO' ) { $('.wikiminute-NB').show(); } if ( country === 'JP' ) { $('.wikiminute-JA').show(); } /* Tax deductibility disclaimer */ if ( country === 'US' ) { $('.tax-disclaimer-US').show(); } else if ( country === 'NL' ) { $('.tax-disclaimer-NL').show(); } else if ( country === 'FR' ) { $('.tax-disclaimer-FR').show(); } else { $('.tax-disclaimer-default').show(); } /* -- "Try editing" feature -- */ var editingUrls = { 'IN': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-in-en-2022' }, 'ZA': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-za-en-2022' }, // Latin America 'BR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'pt-br': 'https://pt.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-pt-2022&uselang=pt-br' }, 'AR': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CL': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'CO': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'MX': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'PE': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, 'UY': { 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-en-2022', 'es-419': 'https://es.wikipedia.org/w/index.php?title=Special:CreateAccount&geEnabled=1&campaign=typage-latam-es-2022' }, // Northern and Western Europe 'SE': { 'sv': 'https://sv.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-sv-2023' }, 'IT': { 'it': 'https://it.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-it-2023' }, 'FR': { 'fr': 'https://fr.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-fr-2023' }, 'NL': { 'nl': 'https://nl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-nwe-nl-2023' }, // Central Europe 'PL': { 'pl': 'https://pl.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-pl-2026' }, 'HU': { 'hu': 'https://hu.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-ce-hu-2026' }, // East, Southeast Asia, and Pacific 'JP': { 'ja': 'https://ja.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023', 'en': 'https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&campaign=typage-eseap-ja-2023' }, }; // Separate list so we can have others in prep for proofing var editingCTACountries = [ 'IN', 'ZA', 'BR', 'AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'SE', 'IT', 'FR', 'NL', 'JP', 'PL', 'HU' ]; if ( editingCTACountries.indexOf(country) !== -1 || params.testEditingCTA ) { if ( editingUrls[country] ) { if ( editingUrls[country][pageLanguage] ) { $( '.try-editing a' ).attr( 'href', editingUrls[country][pageLanguage] ); $( '.primary-ctas .survey' ).hide(); $( '.primary-ctas .try-editing, .other-ctas, .other-ctas .survey' ).show(); } } } // Only show survey 25% of time on English page //if ( pageLanguage === 'en' ) { // if ( Math.random() > 0.25 ) { // $('.survey').hide(); // } //} if ( pageLanguage === 'en' ) { var surveyNumber = Math.random(); if ( surveyNumber > 0.5 ) { $('.survey').hide(); } else if ( surveyNumber > 0.25 && surveyNumber <= 0.5 ) { $('.survey-1').hide(); } else if ( surveyNumber > 0 && surveyNumber <= 0.25 ) { $('.survey-2').hide(); } } // Don't show editing CTAs on apps: https://phabricator.wikimedia.org/T353023 if ( params.utm_medium === 'WikipediaApp' || params.wmf_medium === 'WikipediaApp' ) { $('.other-ctas .edit-6c, .primary-ctas .try-editing').hide(); } // Finally, if there are no secondary CTAs shown then hide the section header if ( $('.other-ctas .focus-block:visible').length === 0 ) { $('.other-ctas h2').hide(); } // One Click Survey page show/hide CTAs if ($('.ty-page').hasClass('one-click-survey')) { if ( params.variant === 'donate' ) { // To show donate CTA $( '.other-ctas .donate, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } else { // Show edit CTA $( '.other-ctas .edit-6c, \ .other-ctas .store, \ .other-ctas .will-notUS' ).show(); } } // MGFE event invite show/hide if ( params.wmf_campaign === 'MGYEA1R26' && params.wmf_medium === 'MGFE' ) { $('.mgfe-block').show(); } if ( params.wmf_campaign === 'ENDYEA1R26' && params.wmf_medium === 'endowment' ) { $('.mgfe-block').show(); } // WP25 specific if ( country === 'US' ) { $('.wp25 .tax-disclaimer').hide(); } // Show social media share & social media footer only in English if ( pageLanguage === 'en' ) { $( '.social-share' ).show(); $( '.social-footer' ).show(); } /* -- Legacy giving form --- */ var lg = { post: function( $form ) { // Create iframe for the form and use it as the form's target var frameName = 'lgFrame'; 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() { var legacyForm = document.getElementById( 'lg-form' ), legacyDialog = document.getElementById( 'frb-dialog-legacy' ); if ( !legacyForm ) { return false; } // pre-fill country, only shown in US for now legacyForm.country.value = 'United States'; legacyForm.lg_submitDate.value = lg.getCurrentDate(); $('.frb-dialog-link').on( 'click', function(e) { legacyDialog.showModal(); legacyForm.firstname.focus(); }); $('#frb-dialog-legacy .frb-dialog-close').on( 'click', function(e) { legacyDialog.close(); }); // form submit $('#lg-form .lg-submit').on( 'click', function() { var pdfUrl = "https://upload.wikimedia.org/wikipedia/donate/9/97/Wikipedia_Planned_Giving_Guide.pdf"; if ( legacyForm.checkValidity() ) { lg.post( $('#lg-form') ); legacyDialog.close(); mw.notify( 'Thank you! Our team will be in touch.' ); window.open(pdfUrl, '_blank'); } else { legacyForm.reportValidity(); } return false; }); } }; lg.init(); /* -- donor badge dialog --- */ var donorBadge = { init: function() { var donorBadgeDialog = document.getElementById( 'frb-dialog-donor-badge' ); $('.getDonorBadge').on( 'click', function(e) { donorBadge.setCookie(); donorBadgeDialog.showModal(); }); $('#frb-dialog-donor-badge .frb-dialog-close').on( 'click', function(e) { donorBadgeDialog.close(); e.target.blur(); }); }, setCookie: function() { const DONOR_BADGE_COOKIE_NAME = 'fundraising_donor_badge'; const DONOR_BADGE_COOKIE_OPTIONS = { domain: 'wikipedia.org', path: '/', expires: 90 * 24 * 60 * 60 // 90 days }; mw.loader.using( 'mediawiki.cookie' ).then( function () { $.cookie( DONOR_BADGE_COOKIE_NAME, '1', DONOR_BADGE_COOKIE_OPTIONS ); }); } }; donorBadge.init(); // hack to set page language based on template const tyPage = document.querySelector( '.ty-page' ); if ( tyPage ) { document.documentElement.lang = tyPage.lang || 'en'; } }); if ( navigator.share ) { $('#ty-web-share').click(function(e) { var url = 'https://donate.wikimedia.org/?wmf_medium=SocialMedia&wmf_campaign=ThankYouPage&wmf_source=WebShare'; if ( $(this).data('share-language') ) { url += '&uselang=' + $(this).data('share-language'); } navigator.share({ text: $(this).data('share-text'), url: url }); e.preventDefault(); }); $('#ty-web-share').show(); } /* Show all elements for testing and checking translations */ function tyDebug() { $('.ty-page *:not(dialog)').show(); } igfvup1tqasyno0tleefos6ovf9eg2b