Difference between revisions 23522 and 23523 on donatewiki

<html>

HELLLLO!
<style type="text/css">

a.donate-link{
  color: #0645ad;
  background-image: none !important;
  padding-right: 0 !important;
}

.donate {
  width: 25em;
  padding: 1em;
}

#donate-form-wrapper{
  background-color: #CCE7CD;
  border: 1px solid #5EAC58;
  padding: 1em;
}

.donate-form-contained{
  border-bottom: 1px solid #5EAC58;
  padding-top: 1em;
  padding-bottom: 1em;
}

.dividing-line{
  border-bottom: 1px solid #5EAC58;
  padding-bottom: 1em;
  padding-top: 1em;
}

#donor-infobox-block{
  border-bottom: none;
}

#donor-policy-block{
  width: 33.8em;
  font-size: 0.85em;
  line-height: 1.3em;
  padding-left: 1em;
  padding-right: 1em;
  padding-top: 0.5em;
}

#donate-links-block{
  border: none;
  background-color: transparent;
  line-height: 1.3em;
  padding: 0 1em;
  padding-top: 1em;
  /*width: 27em;*/
}

input.button, select#input_currency_code {
  font-size: 95%;
}

.collapsible-container{
  font-size: 0.8em;
  cursor: pointer;
}

.collapsible-container-trigger{
  color: blue;
  font-size: 1.2em;
}

.collapsible-container-trigger:hover{
  text-decoration: underline;
  color: blue;
}

.currency-collapsible-container-contained{
  display: none;
  background-color: #FFFFFF;
  color: black;
}

#country-container{
}

#country-container-trigger{
  font-size: 0.9em
}

#country-container-contained{
}

#input_currency_code{
  width: 9em;
  font-size: 0.95em;
}

</style>
<script type="text/javascript" language="javascript">

function getQuerystring( key ) {
  key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );
  var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\_\-]*)' );
  var qs = regex.exec( window.location.search );
  return qs == null ? '' : qs[1];
}

function getLandingPage() {
  var path = "</html>{{{landing-page|default}}}<html>";

  if( path == "default") {
    pathArray = window.location.pathname.split( '/' );
    return pathArray[2];
  }
  else return path;
}

//Should this be here? 
var amount = null;

function DefaultSubmit(formfield,Action) {
  var keycode;
  if (window.event) keycode = window.event.keyCode;
  else if (Action) keycode = Action.which;
  else return true;

  if (keycode == 13) {
    redirectPayment(</html>{{#ifeq:{{CC-status}}|block|'1'|'2'}}<html>);
    return false;
  }
  else
    return true;
}

function validateForm(form){

  var minimums = {</html>{{2012FR/Switch/Currency/Minimums}}<html>};

  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>" ) {
  if ( form.input_amount_other_box.value != "" ) {
    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 ) {
    $( "#input_amount_other_box" ).val( '' );
    $( "#input_amount_other" ).focus(); 
    $( "#input_amount_other_box" ).focus(); 
    alert( '</html>{{int:donate_interface-smallamount-error}}<html>'.replace('$1', (minimums[currency] + ' ' + currency) ) );
    //alert( '</html>{{int:donate_interface-error-msg-invalid-amount}}<html>');
    error = true;
  }
  if ( amount > 10000*minimums[currency]) {
    $( "#input_amount_other_box" ).val( '' );
    $( "#input_amount_other" ).focus(); 
    $( "#input_amount_other_box" ).focus(); 
    alert('We can not accept donations greater than USD 10,000 (' + 10000*minimums[currency] + ' ' + currency + ') through our website.\nPlease contact our major gifts staff at [email protected].');
    error = true;
  }

  return !error;
}

function triggerClick(elem){
  $('#' + elem + '-container-contained').show('fast',null);
}

</script>
  <form method="post" name="paypalcontribution">
    <input type="hidden" name="utm_source" value="" />
    <input type="hidden" name="utm_medium" value="" />
    <input type="hidden" name="utm_campaign" value="" />
    <input type="hidden" name="referrer" value="" />

    <script type="text/javascript">
      document.paypalcontribution.utm_medium.value = getQuerystring( 'utm_medium' );
      document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );
      document.paypalcontribution.referrer.value = document.referrer;
    </script>

    <input type="hidden" name="language" value="</html>{{int:lang}}<html>" />
    <input type="hidden" name="country" value="</html>{{{country}}}<html>" />
    <input type="hidden" name="returnto" value="Thank_You/</html>{{int:lang}}<html>" />
    <input type="hidden" name="email-opt" id="input_email" value="1" checked="checked" /> 

    <input type="hidden" name="amountGiven" value="" />

    </html>{{2012FR/Form-section/Paymentmethods/Status}}<html>
    </html>{{Template:2012FR/Switch/Country
            |template = 2012FR/Form-countryspecific/{{{form-countryspecific}}}
            |country = {{{country}}}
            |language = {{int:lang}}
            |appeal = {{{appeal}}}
           }}<html>
  </form>
<script type="text/javascript">

( function( $ ) {
  $(document).ready(function(){
   var currency = $("#input_currency_code").val();
   })
} )( jQuery );

</script>
</html><noinclude>
[[Category:Fundraising templates|{{PAGENAME}}]]
[[Category:Fundraising templates 2011|{{PAGENAME}}]]
</noinclude>