Template:2011FR/Form-section-links: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
do this more cleanly with parameters as JS objects
rm Monthly, forms all have that as an option now
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<html>
<html>
<style type="text/css">
<style type="text/css">
.collapsible-container {
font-size: 0.8em;
cursor: pointer;
display: none;
background-color: #FFFFFF;
border: 1px solid #AAAAAA;
padding: 1em;
color: black;
}

.form-info-links {
.form-info-links {
list-style: none;
list-style: none !important;
margin-left: 0 !important;
margin-left: 0 !important;
}
}
</style>
</style>
<ul class="form-info-links">
<ul class="form-info-links">
<li><a id="monthly-link" target="_blank" href="https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?form-countryspecific=Form-countryspecific-monthly&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-monthly-donation}}<html></a></li>


<li><a id="ways-to-give-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-otherways-short}}<html></a></li>
<li><a id="ways-to-give-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-otherways-short}}<html></a></li>


<li><a id="faq-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-faqs}}<html></a></li>
<li><a id="faq-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-faqs}}<html></a></li>


<li><a id="tax-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Tax_Deductibility&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-taxded-link-us}}<html></a></li>
<li>
<a id="tax-link" href="https://wikimediafoundation.org/wiki/Deductibility_of_donations" onclick="$('#tax-container').toggle(); return(false);"></html>{{#ifeq: {{{country}}} | US | {{int:donate_interface-taxded-link-us}} | {{int:donate_interface-taxded-link-int}} }}<html></a>
<div class="collapsible-container" id="tax-container" onclick="$('#tax-container').toggle(); return(false);">
</html>{{#ifeq: {{{country}}} | US | {{int:donate_interface-taxded-msg-us}} |{{#ifeq: {{{country}}}| NL | {{int:donate_interface-taxded-msg-nl}} | {{int:donate_interface-taxded-msg-int}} }} }}<html><br/><br/>
</html>{{#ifeq:{{int:lang}}|en||{{int:donate_interface-legal-original}}}}<html>
</div>
</li>


<li><a id="problems-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Problems_donating&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:Donate_interface-problemsdonating}}<html></a></li>
<li><a id="problems-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Problems_donating&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:Donate_interface-problemsdonating}}<html></a></li>
</ul>
</ul>
<script type="text/javascript">
function parseParams(url) {
// helper function to get querystring parameters as a JS object, nicked from WP popups gadget
var ret={};
if (url.indexOf('?')===-1) { return ret; }
var s=url.split('?').slice(1).join();
var t=s.split('&');
for (var i=0; i<t.length; ++i) {
var z=t[i].split('=');
z.push(null);
ret[z[0]]=z[1];
}
return ret;
}

// This piece of script is add to preserve the layout of the page when the user is sent to monthly donation page
var paramsIn = parseParams(window.location.href);
var baseURL = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?';

var paramsOut = paramsIn;
paramsOut.form-countryspecific = 'Form-countryspecific-monthly';

document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);
</script>
</html>
</html>

Latest revision as of 12:25, 26 November 2015