From 434f74dbce9c316410a65255b783e89528490781 Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Wed, 15 Feb 2017 19:51:55 +0100 Subject: [PATCH] Generate Bitcoin payment info --- data/index.html | 32 ++++++++++++++++++++++---------- data/js/tipsy.js | 34 ++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/data/index.html b/data/index.html index 3ea2663..792f153 100644 --- a/data/index.html +++ b/data/index.html @@ -136,9 +136,9 @@

Easy for Publishers

There's nothing to sign up for or install. - No changes to your pages or CMS. All you - need to do is register a PayPal or Dwolla account - to receive payments. + No changes to your pages or CMS. All you + need to do is register a PayPal or Dwolla account, + or get a Bitcoin wallet address to receive payments.

Private

Tipsy is completely private. No Tipsy @@ -259,7 +259,7 @@

Getting Paid

or Dwolla account to receive payments, and (2) publish that account's ID in a single tipsy.txt - file on your web site. That's + file on your web site. That's it—you don't have to change a single page or any step in your CMS workflow. There's nothing to install. @@ -275,9 +275,9 @@

Getting Paid

email. For Dwolla you need to get a key. - Paypal charges transaction fees while Dwolla + PaPpal charges transaction fees while Dwolla does not. But more users have (and can pay - with) Paypal accounts. You can use + with) their PayPal accounts. You can use either or both on your site. @@ -732,6 +732,13 @@ placeholder="kRrCD32hkwH0E7ldn/xeI/WCQKqR2dVPLuQjF6Bu/g4OlMnZa9" /> +
+ +
+ +
+

@@ -775,13 +782,17 @@
-
+
-
+
+
+ +
@@ -924,11 +935,12 @@

Payment methods

   3 d
payment-methods:
    mysite.html:
+         bitcoin: 56aa4626057f4e415444b373f5f9d6aa
        paypal: me@mail.com
-         dwolla: kRrCD32hkwH0E7ldn/xeI/WCQKqR
+         dwolla: kRrCD32hkwH0E7ldn/xeI/WCQKqR
    _:
        paypal:someone@else.com
-         dwolla: H0E7ldH0E7ldKqR/KqRD32hkw
+         dwolla: H0E7ldH0E7ldKqR/KqRD32hkw

All you need to make sure is to have the colons at the end of each heading and keep the indentation levels consistent. diff --git a/data/js/tipsy.js b/data/js/tipsy.js index 17995dc..17faba8 100644 --- a/data/js/tipsy.js +++ b/data/js/tipsy.js @@ -15,6 +15,7 @@ $(function() { var name = $('#linkTagName').val(); var paypalEmail = $('#payPalEmail').val(); var dwollaKey = $('#dwollaKey').val(); + var bitcoinWallet = $('#bitcoinWallet').val(); var data = "" var nameIn = "" @@ -24,7 +25,7 @@ $(function() { if (paypalEmail != "") { if (!(regex.test(paypalEmail))) { - $('#noData').html("

Make sure your paypal email is valid.
"); + $('#noData').html("
Make sure your PayPal email is valid.
"); window.setTimeout(function() { $("#alertMessage").fadeTo(500, 0).slideUp(500, function() { $(this).remove(); @@ -33,21 +34,26 @@ $(function() { return } - data += " data-paypal='" + paypalEmail + "'"; + data += " data-paypal=\"" + paypalEmail + '"'; } if (dwollaKey != "") { - data += " data-dwolla='" + dwollaKey + "'"; + data += " data-dwolla=\"" + dwollaKey + '"'; } - var textArea = " <link rel='author'" + nameIn + data + ">"; + + if (bitcoinWallet != "") { + data += " data-bitcoin=\"" + bitcoinWallet + '"'; + } + + var textArea = '<link rel="author"' + nameIn + data + ">"; if (data != "") { $('#noData').empty(); - $('#placeFollowing').html("

Place the following in the HEAD of your site:

"); + $('#placeFollowing').html("

Place the following in the <head> of your site:

"); $('#generatedLinkTag').html(textArea); } else { - $('#noData').html("
Please make sure you provided at least either PayPal or dwolla information.
"); + $('#noData').html("
Please make sure you provide at least one payment option.
"); window.setTimeout(function() { $("#alertMessage").fadeTo(500, 0).slideUp(500, function() { @@ -122,7 +128,7 @@ $('#txtBar').click(function(e) { function makeGroup(number) { var i = number.toString(); - var str = "

"; + var str = "

"; return str } @@ -165,6 +171,7 @@ function generateTxtOutput() { } var payPal = $("#payPalEmail" + (i + 1).toString()).val(); var dwolla = $("#dwollaKey" + (i + 1).toString()).val(); + var bitcoin = $("#bitcoinWallet" + (i + 1).toString()).val(); if (payPal != "" && !(regex.test(payPal))) { $('#noDataTxt').html("
Please make sure the PayPal email you provide for the Payment Info " + num + " is correct.
"); @@ -176,7 +183,7 @@ function generateTxtOutput() { return; } - if (payPal != "" || dwolla != "") { + if (payPal != "" || dwolla != "" || bitcoin != "") { outString += "payment-methods:
" isThereAnyPaymentInfo = true; break @@ -201,6 +208,7 @@ function generateTxtOutput() { for (var i = 0; i < groups.length; i++) { var payPal = $("#payPalEmail" + (i + 1).toString()).val(); var dwolla = $("#dwollaKey" + (i + 1).toString()).val(); + var bitcoin = $("#bitcoinWallet" + (i + 1).toString()).val(); var num; if (i == 0) { @@ -229,13 +237,15 @@ function generateTxtOutput() { } outString += "  " + currUrlPrefix + ": 
" - if (payPal != "") { - outString += "    paypal: " + payPal + "
" + if (bitcoin != "") { + outString += "    bitcoin: " + bitcoin + "
" } - if (dwolla != "") { outString += "    dwolla: " + dwolla + "
" } + if (payPal != "") { + outString += "    paypal: " + payPal + "
" + } } } @@ -304,4 +314,4 @@ saveAs(blob, "tipsy.txt"); } })); -}); \ No newline at end of file +});