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

From Donate
Jump to navigation Jump to search
Content deleted Content added
Cbarr (talk | contribs)
No edit summary
mNo edit summary
 
(38 intermediate revisions by 5 users not shown)
Line 5: Line 5:
#radiobuttons-table-header{
#radiobuttons-table-header{
font-weight: bold;
font-weight: bold;
font-size: 17px;
font-size: 1.3em;
float: </html>{{#ifeq:{{Template:Ltr-direction|{{{uselang}}}}}|rtl|right|left}}<html>;
}
}


#radiobuttons-table-body{
#radiobuttons-table-body{
margin-left: -5px;
margin-left: -5px;
padding-top: 1em;
padding-top: 2.3em;
}
}


#input_amount_other_box{
#input_amount_other_box{
color: #aaaaaa;
/* color: #aaaaaa; */
color: black;
font-size: 0.8em;
font-size: 0.8em;
border:1px solid #c0c0c0;
direction: </html>{{Template:Ltr-direction|{{{uselang}}}}}<html>;
}
}


#amount-table{
#amount-table{
font-size: 1.2em;
font-size: 1.2em;
/*width: 100%;*/
}
}


Line 26: Line 31:
}
}


.collapsible-container{
.currency-collapsible-container-contained{
font-size: 0.8em;
display: none;
background-color: #FFFFFF;
cursor: pointer;
color: black;
}
}


.collapsible-container-trigger{
#country-container{
color: blue;
/*display: none;*/
float: </html>{{#ifeq:{{Template:Ltr-direction|{{{uselang}}}}}|rtl|left|right}}<html>;
font-size: 1.2em;
}
}


.collapsible-container-trigger:hover{
#country-container-trigger{
font-size: 0.9em
text-decoration: underline;
color: blue;
}
}


.collapsible-container-contained{
#country-container-contained{
display: none;
background-color: #FFFFFF;
border: 1px solid #AAAAAA;
padding: 1em;
color: black;
}
}


#input_currency_code{
.collapsible-container-marker-collapsed{
display: inline;
width: 9em;
color: blue;
font-size: 0.95em;
}
}


a#currency-link{
.collapsible-container-marker-expanded{
display: none;
color: #0645ad;
}
color: blue;

a#currency-link:hover{
color: #0645ad;
background-image: none !important;
padding-right: 0 !important;
cursor: pointer;
}
}


Line 70: Line 76:


function resetOther(box){
function resetOther(box){
box.value = "</html>{{{donate-amount-other|<html>Other:</html>}}}<html>";
//box.value = "</html>{{int:donate_interface-other}}<html>";
box.value = "</html>{{int:donate_interface-other}}<html>";
box.style.color = "#aaaaaa";
//box.style.color = "#aaaaaa";
}
}


function selectAmount(){
function selectAmount(){
document.getElementById("input_amount_other_box").value = "</html>{{{donate-amount-other|<html>Other:</html>}}}<html>";
//document.getElementById("input_amount_other_box").value = "</html>{{int:donate_interface-other}}<html>";
document.getElementById("input_amount_other_box").style.color = "#aaaaaa";
document.getElementById("input_amount_other_box").value = "";
//document.getElementById("input_amount_other_box").style.color = "#aaaaaa";
document.getElementsByName("amountGiven")[0].value="";
}
}


function validateForm(form){
function triggerClick(elem){
$('#' + elem + '-container-contained').show();

}
var minimums = {
'USD' : 1,
'GBP' : 1, // $1.26
'EUR' : 1, // $1.26
'AUD' : 2, // $1.35
'CAD' : 1, // $0.84
'CHF' : 1, // $0.85
'CZK' : 20, // $1.03
'DKK' : 5, // $0.85
'HKD' : 10, // $1.29
'HUF' : 200, // $0.97
'JPY' : 100, // $1
'NZD' : 2, // $1.18
'NOK' : 10, // $1.44
'PLN' : 5, // $1.78
'SGD' : 2, // $1.35
'SEK' : 10, // $1.28
'ILS' : 5 // $1.39
};

var error = true;

// Get amount selection
for ( var i = 0; i < form.amount.length; i++ ) {
if ( form.amount[i].checked ) {
amount = form.amount[i].value;
}
}
if ( form.amountGiven.value != "</html>{{{donate-amount-other|<html>Other:</html>}}}<html>" ) {
var otherAmount = form.amountGiven.value;
otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
otherAmount = otherAmount.replace(/[\$,.]/g, '');
otherAmount = otherAmount.replace(/:/, '.');
form.amountGiven.value = otherAmount;
amount = otherAmount;
}


function loadCountry(){
// Check amount is a real number
//alert(window.location);
error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
//var newPage = window.location.value;
// Check amount is at least the minimum
var currency = form.currency_code.value;
//newCountry = $("#currency-select").value;
//newPage.replace("</html>{{{country}}}<html>",newCountry);
if ( typeof( minimums[currency] ) == 'undefined' ) {
//alert(newPage);
minimums[currency] = 1;
//window.location = newPage;
}
//return false;
if ( amount < minimums[currency] || error ) {
alert( '</html>{{{validation-error-minimum|You must contribute at least $1}}}<html>'.replace('$1', minimums[currency] + ' ' + currency ) );
error = true;
}
return !error;
}
}


var monthlyDonation = false;
function triggerHover(elem){}
//This line is needed to prevent errors from a if statement in the "form-section-processing" template


</script>
function triggerLeave(elem){}


<input type="hidden" name="currency_code" value="</html>{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}<html>"/>
function triggerClick(elem){
$('#' + elem + '-container-contained').toggle('fast',null);
$('#' + elem + '-collapsed-marker').toggle('fast',null);
$('#' + elem + '-expanded-marker').toggle('fast',null);
}


</script>
<div>
<div id="radiobuttons-table-header">
</html>{{int:donate_interface-amount-legend}}<html>: <div style="display: inline;"></html>{{2011FR/core-currency-symbol|{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}}}<html></div> <div style="display: inline;"></html>({{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}})<html></div>
</div>
<div class="collapsible-container-trigger" id="country-container" style="display: none; cursor: pointer;" onclick="triggerClick('country');">
<span style="font-weight: bold; font-size: 1.2em"></html>{{2011FR/core-currency-symbol|{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}}}<html></span><span style="font-size: 0.6em">(Change?)</span>
<br/>
<span class="currency-collapsible-container-contained" id="country-container-contained">
<select id="currency-select" style="font-size: 0.5em;" onchange="loadCountry();">
<option value="</html>{{{country}}}<html>" selected="selected"></html>{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}<html> – </html>{{2011FR/core-currency-symbol|{{{currency{{2011FR/core-currency-code|{{{country}}}}}}}}}}<html></option>
</html>{{#tag:html|{{#ifeq:{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}|USD||<option value="USD">USD – $</option>}}}}<html>
</html>{{#tag:html|{{#ifeq:{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}|EUR||<option value="EUR">EUR – €</option>}}}}<html>
</select>
</span>
</div>
</div>


<div id="radiobuttons-table-header">
<div id="radiobuttons-table-body">
<!-- <center> -->
</html>{{{form-title|Donate Amount}}}<html>
</div>
<div id="radiobuttons-table-body">
<table id="amount-table">
<table id="amount-table">
<tr>
<tr>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_0" onclick="selectAmount();" value="</html>{{{donate-amount-0|5}}}<html>" />
<input type="radio" name="amount" id="input_amount_0" onclick="selectAmount();" value="</html>{{{donate-amount-0}}}<html>" />
<label for="input_amount_0"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-0|5}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_0"></html>{{{donate-amount-0}}}<html></label>
</td>
</td>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_1" onclick="selectAmount();" value="</html>{{{donate-amount-1|10}}}<html>" />
<input type="radio" name="amount" id="input_amount_1" onclick="selectAmount();" value="</html>{{{donate-amount-1}}}<html>" />
<label for="input_amount_1"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-1|10}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_1"></html>{{{donate-amount-1}}}<html></label>
</td>
</td>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_2" onclick="selectAmount();" value="</html>{{{donate-amount-2|20}}}<html>" />
<input type="radio" name="amount" id="input_amount_2" onclick="selectAmount();" value="</html>{{{donate-amount-2}}}<html>" />
<label for="input_amount_2"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-2|20}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_2"></html>{{{donate-amount-2}}}<html></label>
</td>
</td>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_3" onclick="selectAmount();" value="</html>{{{donate-amount-3|35}}}<html>" />
<input type="radio" name="amount" id="input_amount_3" onclick="selectAmount();" value="</html>{{{donate-amount-3}}}<html>" />
<label for="input_amount_3"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-3|35}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_3"></html>{{{donate-amount-3}}}<html></label>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_4" onclick="selectAmount();" value="</html>{{{donate-amount-4|50}}}<html>" />
<input type="radio" name="amount" id="input_amount_4" onclick="selectAmount();" value="</html>{{{donate-amount-4}}}<html>" />
<label for="input_amount_4"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-4|50}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_4"></html>{{{donate-amount-4}}}<html></label>
</td>
</td>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_5" onclick="selectAmount();" value="</html>{{{donate-amount-5|100}}}<html>" />
<input type="radio" name="amount" id="input_amount_5" onclick="selectAmount();" value="</html>{{{donate-amount-5}}}<html>" />
<label for="input_amount_5"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-5|100}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_5"></html>{{{donate-amount-5}}}<html></label>
</td>
</td>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_6" onclick="selectAmount();" value="</html>{{{donate-amount-6|250}}}<html>" />
<input type="radio" name="amount" id="input_amount_6" onclick="selectAmount();" value="</html>{{{donate-amount-6}}}<html>" />
<label for="input_amount_6"></html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}{{{donate-amount-6|250}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
<label for="input_amount_6"></html>{{{donate-amount-6}}}<html></label>
</td>
</td>
<td class="amount-table-cell">
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_other" value="" />
<input type="radio" name="amount" id="input_amount_other" value="Other" onclick="document.getElementById('input_amount_other_box').focus();"/>
<label for="input_amount_other"></html>{{int:donate_interface-other}}<html></label>
</html>{{#ifeq:{{{currency-position}}}|before|{{{currency-symbol}}}|}}<html>
<input type="text" name="amountGiven" id="input_amount_other_box" size="3" autocomplete="off" value="</html>{{{donate-amount-other|<html>Other:</html>}}}<html>" onfocus="clearOther(this)"/>
<!-- <input type="text" id="input_amount_other_box" size="3" autocomplete="off" />-->
<!-- <input type="text" id="input_amount_other_box" size="3" autocomplete="off" value="</html>{{int:donate_interface-other}}<html>" onfocus="clearOther(this)"/> -->
</html>{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html>
<input type="text" id="input_amount_other_box" size="3" autocomplete="off" value="" onfocus="clearOther(this)"/>
</td>
</td>
</tr>
</tr>
</table>
</table>
<!-- </center> -->
</div>
</div>

<div class="collapsible-container" id="country-container" onmouseover="triggerHover('country');" onmouseout="triggerLeave('country');" onclick="triggerClick('country');">
<span class="collapsible-container-marker-collapsed" id="country-collapsed-marker">&#9650;</span>
<span class="collapsible-container-marker-expanded" id="country-expanded-marker">&#9660;</span>
<span class="collapsible-container-trigger">Not your currency?</span>
<div class="collapsible-container-contained" id="country-container-contained">
Wikimedia Foundation is a non-profit charity established in the United States under the US IRS Code Section 501(c)(3), and, for that reason, donations from persons or entities located in the United States may benefit from tax deductible status. Donations from persons or entities located outside the United States may not be eligible for tax deductions in the United States and elsewhere; in such cases, donors should seek local tax advice. Importantly, Wikimedia does not seek donations from persons or entities located in any jurisdiction that prohibits or restricts fundraising activities by international charities such as Wikimedia or applies gift taxes on donations made to such international charities.
</div>
</div>

</html>
</html>

Latest revision as of 20:18, 24 January 2012

Donation amount:
$
(USD)