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

Content deleted Content added
Cbarr (talk | contribs)
No edit summary
Cbarr (talk | contribs)
No edit summary
Line 5:
#radiobuttons-table-header{
font-weight: bold;
font-size: 17px1.3em;
float: </html>{{#ifeq:{{Template:Ltr-direction|{{{uselang}}}}}|rtl|right|left}}<html>;
}
 
#radiobuttons-table-body{
margin-left: -5px;
padding-top: 1em2.3em;
}
 
Line 17 ⟶ 18:
font-size: 0.8em;
border:1px solid #c0c0c0;
direction: </html>{{Template:Ltr-direction|{{{uselang}}}}}<html>;
}
 
#amount-table{
font-size: 1.2em;
/*width: 100%;*/
}
 
.amount-table-cell{
white-space: nowrap;
}
 
.currency-collapsible-container-contained{
display: none;
background-color: #FFFFFF;
color: black;
}
 
#country-container{
/*display: none;*/
float: </html>{{#ifeq:{{Template:Ltr-direction|{{{uselang}}}}}|rtl|left|right}}<html>;
}
 
#country-container-trigger{
font-size: 0.9em
}
 
#country-container-contained{
}
 
#input_currency_code{
width: 9em;
font-size: 0.95em;
}
 
a#currency-link{
color: #0645ad;
}
 
a#currency-link:hover{
color: #0645ad;
background-image: none !important;
padding-right: 0 !important;
cursor: pointer;
}
 
Line 38 ⟶ 75:
 
function resetOther(box){
box.value = "</html>{{{int:donate_interface-other}}}<html>";
box.style.color = "#aaaaaa";
}
Line 47 ⟶ 84:
}
 
function validateForm(form){
 
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.input_amount_other_box.value != "</html>{{int:donate_interface-other}}<html>" ) {
var otherAmount = form.input_amount_other_box.value;
otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
otherAmount = otherAmount.replace(/[\$,.]/g, '');
otherAmount = otherAmount.replace(/:/, '.');
form.input_amount_other_box.value = otherAmount;
form.amountGiven.value = otherAmount;
amount = otherAmount;
}
 
// Check amount is a real number
error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
// Check amount is at least the minimum
var currency = form.currency_code.value;
if ( typeof( minimums[currency] ) == 'undefined' ) {
minimums[currency] = 1;
}
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;
}
 
function triggerClick(elem){
$('#' + elem + '-container-contained').show();
}
 
function loadCountry(){
//alert(window.location);
//var newPage = window.location.value;
//newCountry = $("#currency-select").value;
//newPage.replace("</html>{{{country}}}<html>",newCountry);
//alert(newPage);
//window.location = newPage;
//return false;
}
</script>
 
<!--
<div id="radiobuttons-table-header">
<div>
</html>{{int:donate_interface-amount-legend}}<html> <a id="currency-link"><span style="font-size: 0.6em;"> (Change?)</span></a>
<div id="radiobuttons-table-header">
</div>
</html>{{int:donate_interface-amount-legend}} {{{currency-symbol}}}<html>
<div id="radiobuttons-table-body">
</div>
</div>
-->
 
<div>
<div id="radiobuttons-table-header">
</html>{{int:donate_interface-amount-legend}}<html> </html>{{2011FR/core-currency-symbol|{{2011FR/core-currency-code|{{{country}}}}}}}<html>
</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|{{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="</hmtl>{{{country}}}<html>" selected></html>{{2011FR/core-currency-code|{{{country}}}}}<html> – </html>{{2011FR/core-currency-symbol|{{2011FR/core-currency-code|{{{country}}}}}}}<html></option>
</html>{{#tag:html|{{#ifeq:{{2011FR/core-currency-code|{{{country}}}}}|USD||<option value="USD">USD – $</option>}}}}<html>
</html>{{#tag:html|{{#ifeq:{{2011FR/core-currency-code|{{{country}}}}}|EUR||<option value="EUR">EUR – €</option>}}}}<html>
</select>
</span>
</div>
</div>
 
<div id="radiobuttons-table-body">
<!-- <center> -->
<table id="amount-table">
<tr>
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
</tr>
Line 75 ⟶ 204:
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
<td class="amount-table-cell">
<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}}}{{#ifeq:{{{currency-position}}}|after|{{{currency-symbol}}}|}}<html></label>
</td>
<td class="amount-table-cell">
<input type="radio" name="amount" id="input_amount_other" value="" /><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}}}|before|{{{currency-symbol}}}|}}<html>
<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>
</td>
</tr>
</table>
<!-- </center> -->
</div>
</html>