Source

openhs / templates / contribute.htm

{% set selected_menu_item = 'contribute' %}
{% set title = 'Contribute' %}
{% extends "base.htm" %}

{% block meta %}
<script type="text/javascript" src="/js/jquery.js"></script> 
<script type="text/javascript">
// Usage:
//   var data = { 'first name': 'George', 'last name': 'Jetson', 'age': 110 };
//   var querystring = encodeQueryData(data);
// 
function encodeQueryData(data)
{
   var ret = [];
   for (var d in data)
      ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]));
   return ret.join("&");
}

var productData = {};
productData["dupeguru"] = {};
productData["dupeguru"]["itemno"] = "1";
productData["dupeguru"]["appname"] = "dupeGuru (all editions)";
productData["dupeguru"]["default_amount"] = "20.00";
productData["moneyguru"] = {};
productData["moneyguru"]["itemno"] = "2";
productData["moneyguru"]["appname"] = "moneyGuru";
productData["moneyguru"]["default_amount"] = "30.00";
productData["pdfmasher"] = {};
productData["pdfmasher"]["itemno"] = "6";
productData["pdfmasher"]["appname"] = "PdfMasher";
productData["pdfmasher"]["default_amount"] = "20.00";
productData["kronox"] = {};
productData["kronox"]["itemno"] = "7";
productData["kronox"]["appname"] = "KronoX";
productData["kronox"]["default_amount"] = "5.00";

var chosenProduct = "";

function updateProductData(productId) {
    var data = productData[productId];
    if (chosenProduct in productData) {
        $("#" + chosenProduct + " > img").removeClass("bordered");
    }
    chosenProduct = productId;
    $("#appname").text(data["appname"]);
    $("input[name=contrib_amount]").val(data["default_amount"]);
    $("#" + productId + " > img").addClass("bordered");
}

function updateCurrency() {
    if ($("input[name=contrib_in_CAD]").is(":checked")) {
        $("#currency_desc").text("Canadian Dollars");
    }
    else {
        $("#currency_desc").text("US Dollars");
    }
}

function goToPaypal() {
    if (!(chosenProduct in productData)) {
        alert("Please choose a project to contribute to.");
        return;
    }
    var amount = parseFloat($("input[name=contrib_amount]").val());
    if (amount < 5) {
        alert("Please contribute an amount over 5$, otherwise transaction fees are too high. " +
              "If you can't afford it, let me know (support@hardcoded.net), I'll send you a key.");
        return;
    }
    var data = productData[chosenProduct];
    var currency = "USD";
    if ($("input[name=contrib_in_CAD]").is(":checked")) {
        currency = "CAD";
    }
    var item_number = data["itemno"];
    if ($("input[name=open_contrib]").is(":checked")) {
        item_number = "o" + item_number;
    }
    var queryData = {
        "business": "hsoft@hardcoded.net",
        "item_number": item_number,
        "item_name": "Contribution to " + data["appname"],
        "amount": Math.round(amount*100)/100,
        "currency_code": currency
    }
    var url = "https://www.paypal.com/xclick?" + encodeQueryData(queryData);
    window.open(url);
}

$(document).ready(function() {
    $("#dupeguru").click(function() { updateProductData("dupeguru"); return false; });
    $("#moneyguru").click(function() { updateProductData("moneyguru"); return false; });
    $("#pdfmasher").click(function() { updateProductData("pdfmasher"); return false; });
    $("#kronox").click(function() { updateProductData("kronox"); return false; });
    
    $("input[name=contrib_in_CAD]").click(updateCurrency);
    $("#contrib_button").click(goToPaypal);
});

</script>
{% endblock %}

{% block content %}
{% filter md %}
Thanks for considering contributing to Hardcoded Software projects. By doing so, you prove that it's possible to expect fairness on the internet. For now, the only way to contribute is through Paypal (although you don't need an account if you pay by credit card), but I'm looking for alternatives. If you can't or won't use it and still wish to contribute, please [let me know](mailto:hsoft@hardcoded.net), we'll work something out.

After having contributed to a project, you will receive a registration key that will make the Fairware reminder pop up go away.

The dupeGuru key works on all editions (Plain, ME and PE).

Although contribution statistics are public, don't worry about your name or e-mail being published somewhere you don't want to, it's not going to happen. If contributor names are ever published, it will be with explicit consent.

**Alternate payment methods.** For now, the only automated way to contribute is through Paypal.
However, I've been interested in [Bitcoin](http://bitcoin.org) for a while now and I'm giving it a
try. See the [Bitcoin payment](http://www.hardcoded.net/bitcoin) page for more details.

**Choose a project to contribute to (click on the logo)**

<p>
    <a id="dupeguru" href=""><img class="product_unselected" alt="dupeGuru's Logo" src="/images/dg_logo_96.png"/></a>
    <a id="moneyguru" href=""><img class="product_unselected" alt="moneyGuru's Logo" src="/images/moneyguru_logo_96.png"/></a>
    <a id="pdfmasher" href=""><img class="product_unselected" alt="PdfMasher's Logo" src="/images/pdfmasher_logo_96.png"/></a>
    <a id="kronox" href=""><img class="product_unselected" alt="KronoX's Logo" src="/images/kronox_logo_96.png"/></a>
</p>

**Project: <span id="appname">(click on a logo to choose)</span>**

**Contribution amount:** <input type="input" name="contrib_amount" value="" size="6" /> <span id="currency_desc">US Dollars</span>

> *The default amount is a suggested amount. You can change it if you want. You can contribute any
  amount of at least 5$ and you will still receive a registration key.*

<input type="checkbox" name="contrib_in_CAD" /> **Contribute in Canadian Dollars**

> *The main developer of these applications is canadian. By contributing in canadian dollars, you
  save him currency conversion fees.*
  
<input type="checkbox" name="open_contrib" /> **Open contribution**

> *If the project you contribute to has a surplus, allow your contribution to be allocated to the
  project that needs it the most. The registration key you will receive will still be for the
  project you chose.*

<input id="contrib_button" type="button" value="Contribute" />

{% endfilter %}
{% endblock %}