Comparing version 1.1.0 to 1.1.1
@@ -299,2 +299,3 @@ 'use strict'; | ||
@param {String} config.sixtydevsUsername The 60devs username to donate to | ||
@param {String} config.sixtydevstipsURL The url to the 60devs donate page | ||
@return {String} the result badge | ||
@@ -304,9 +305,13 @@ */ | ||
var sixtydevstipsID = _ref13.sixtydevstipsID; | ||
var sixtydevstipsURL = _ref13.sixtydevstipsURL; | ||
// Check | ||
if (!sixtydevstipsID) throw new Error('sixtydevstipsID is missing'); | ||
if (!sixtydevstipsURL) { | ||
if (!sixtydevstipsID) throw new Error('sixtydevstipsID is missing'); | ||
sixtydevstipsURL = 'https://tips.60devs.com/tip/' + sixtydevstipsID; | ||
} | ||
// Create | ||
var image = 'https://img.shields.io/badge/60devs-donate-yellow.svg'; | ||
var url = 'https://tips.60devs.com/tip/' + sixtydevstipsID; | ||
var url = sixtydevstipsURL; | ||
var alt = '60devs tips donate button'; | ||
@@ -322,2 +327,3 @@ var title = 'Donate to this project using 60devs tips'; | ||
@param {String} config.patreonUsername The patreon username to donate to | ||
@param {String} config.patreonURL The url to the patreon donate page | ||
@return {String} the result badge | ||
@@ -327,9 +333,13 @@ */ | ||
var patreonUsername = _ref14.patreonUsername; | ||
var patreonURL = _ref14.patreonURL; | ||
// Check | ||
if (!patreonUsername) throw new Error('patreonUsername is missing'); | ||
if (!patreonURL) { | ||
if (!patreonUsername) throw new Error('patreonUsername is missing'); | ||
patreonURL = 'http://patreon.com/' + patreonUsername; | ||
} | ||
// Create | ||
var image = 'https://img.shields.io/badge/patreon-donate-yellow.svg'; | ||
var url = 'http://patreon.com/' + patreonUsername; | ||
var url = patreonURL; | ||
var alt = 'Patreon donate button'; | ||
@@ -345,2 +355,3 @@ var title = 'Donate to this project using Patreon'; | ||
@param {String} config.gratipayUsername The gratipay username to donate to | ||
@param {String} config.gratipayURL The url to the gratipay donate page | ||
@return {String} the result badge | ||
@@ -350,9 +361,13 @@ */ | ||
var gratipayUsername = _ref15.gratipayUsername; | ||
var gratipayURL = _ref15.gratipayURL; | ||
// Check | ||
if (!gratipayUsername) throw new Error('gratipayUsername is missing'); | ||
if (!gratipayURL) { | ||
if (!gratipayUsername) throw new Error('gratipayUsername is missing'); | ||
gratipayURL = 'https://www.gratipay.com/' + gratipayUsername; | ||
} | ||
// Create | ||
var image = 'https://img.shields.io/badge/gratipay-donate-yellow.svg'; | ||
var url = 'https://www.gratipay.com/' + gratipayUsername; | ||
var url = gratipayURL; | ||
var alt = 'Gratipay donate button'; | ||
@@ -367,3 +382,5 @@ var title = 'Donate weekly to this project using Gratipay'; | ||
@method flattr | ||
@param {String} config.flattrUsername The flattr code to donate to (e.g. 344188/balupton-on-Flattr) | ||
@param {String} config.flattrCode The flattr code to donate to (e.g. 344188/balupton-on-Flattr) | ||
@param {String} config.flattrUsername The flattr username to donate to (e.g. balupton) | ||
@param {String} config.flattrURL The url to the flattr donate page | ||
@return {String} the result badge | ||
@@ -373,9 +390,19 @@ */ | ||
var flattrCode = _ref16.flattrCode; | ||
var flattrUsername = _ref16.flattrUsername; | ||
var flattrURL = _ref16.flattrURL; | ||
// Check | ||
if (!flattrCode) throw new Error('flattrCode is missing'); | ||
if (!flattrURL) { | ||
if (flattrUsername) { | ||
flattrURL = 'https://flattr.com/profile/' + flattrUsername; | ||
} else if (flattrCode) { | ||
flattrURL = 'https://flattr.com/thing/' + flattrCode; | ||
} else { | ||
throw new Error('flattrUsername/flattrCode is missing'); | ||
} | ||
} | ||
// Create | ||
var image = 'https://img.shields.io/badge/flattr-donate-yellow.svg'; | ||
var url = 'http://flattr.com/thing/' + flattrCode; | ||
var url = flattrURL; | ||
var alt = 'Flattr donate button'; | ||
@@ -382,0 +409,0 @@ var title = 'Donate to this project using Flattr'; |
@@ -265,11 +265,15 @@ 'use strict' | ||
@param {String} config.sixtydevsUsername The 60devs username to donate to | ||
@param {String} config.sixtydevstipsURL The url to the 60devs donate page | ||
@return {String} the result badge | ||
*/ | ||
function sixtydevstips ({sixtydevstipsID}) { | ||
function sixtydevstips ({sixtydevstipsID, sixtydevstipsURL}) { | ||
// Check | ||
if ( !sixtydevstipsID ) throw new Error('sixtydevstipsID is missing') | ||
if ( !sixtydevstipsURL ) { | ||
if ( !sixtydevstipsID ) throw new Error('sixtydevstipsID is missing') | ||
sixtydevstipsURL = `https://tips.60devs.com/tip/${sixtydevstipsID}` | ||
} | ||
// Create | ||
const image = `https://img.shields.io/badge/60devs-donate-yellow.svg` | ||
const url = `https://tips.60devs.com/tip/${sixtydevstipsID}` | ||
const url = sixtydevstipsURL | ||
const alt = '60devs tips donate button' | ||
@@ -285,11 +289,15 @@ const title = 'Donate to this project using 60devs tips' | ||
@param {String} config.patreonUsername The patreon username to donate to | ||
@param {String} config.patreonURL The url to the patreon donate page | ||
@return {String} the result badge | ||
*/ | ||
function patreon ({patreonUsername}) { | ||
function patreon ({patreonUsername, patreonURL}) { | ||
// Check | ||
if ( !patreonUsername ) throw new Error('patreonUsername is missing') | ||
if ( !patreonURL ) { | ||
if ( !patreonUsername ) throw new Error('patreonUsername is missing') | ||
patreonURL = `http://patreon.com/${patreonUsername}` | ||
} | ||
// Create | ||
const image = `https://img.shields.io/badge/patreon-donate-yellow.svg` | ||
const url = `http://patreon.com/${patreonUsername}` | ||
const url = patreonURL | ||
const alt = 'Patreon donate button' | ||
@@ -305,11 +313,15 @@ const title = 'Donate to this project using Patreon' | ||
@param {String} config.gratipayUsername The gratipay username to donate to | ||
@param {String} config.gratipayURL The url to the gratipay donate page | ||
@return {String} the result badge | ||
*/ | ||
function gratipay ({gratipayUsername}) { | ||
function gratipay ({gratipayUsername, gratipayURL}) { | ||
// Check | ||
if ( !gratipayUsername ) throw new Error('gratipayUsername is missing') | ||
if ( !gratipayURL ) { | ||
if ( !gratipayUsername ) throw new Error('gratipayUsername is missing') | ||
gratipayURL = `https://www.gratipay.com/${gratipayUsername}` | ||
} | ||
// Create | ||
const image = `https://img.shields.io/badge/gratipay-donate-yellow.svg` | ||
const url = `https://www.gratipay.com/${gratipayUsername}` | ||
const url = gratipayURL | ||
const alt = 'Gratipay donate button' | ||
@@ -324,12 +336,24 @@ const title = 'Donate weekly to this project using Gratipay' | ||
@method flattr | ||
@param {String} config.flattrUsername The flattr code to donate to (e.g. 344188/balupton-on-Flattr) | ||
@param {String} config.flattrCode The flattr code to donate to (e.g. 344188/balupton-on-Flattr) | ||
@param {String} config.flattrUsername The flattr username to donate to (e.g. balupton) | ||
@param {String} config.flattrURL The url to the flattr donate page | ||
@return {String} the result badge | ||
*/ | ||
function flattr ({flattrCode}) { | ||
function flattr ({flattrCode, flattrUsername, flattrURL}) { | ||
// Check | ||
if ( !flattrCode ) throw new Error('flattrCode is missing') | ||
if ( !flattrURL ) { | ||
if ( flattrUsername ) { | ||
flattrURL = `https://flattr.com/profile/${flattrUsername}` | ||
} | ||
else if ( flattrCode ) { | ||
flattrURL = `https://flattr.com/thing/${flattrCode}` | ||
} | ||
else { | ||
throw new Error('flattrUsername/flattrCode is missing') | ||
} | ||
} | ||
// Create | ||
const image = 'https://img.shields.io/badge/flattr-donate-yellow.svg' | ||
const url = `http://flattr.com/thing/${flattrCode}` | ||
const url = flattrURL | ||
const alt = 'Flattr donate button' | ||
@@ -336,0 +360,0 @@ const title = 'Donate to this project using Flattr' |
# History | ||
## v1.1.1 2016 January 14 | ||
- Added `flattrUsername` and `flattrURL` for new flattr system | ||
- Added `sixtydevstipsURL`, `patreonURL`, and `gratipayURL` for consistency | ||
## v1.1.0 2015 December 9 | ||
@@ -4,0 +8,0 @@ - Updated internal conventions |
{ | ||
"name": "badges", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "The definitive collection of badges for rendering", | ||
@@ -80,4 +80,5 @@ "homepage": "https://github.com/bevry/badges", | ||
"gratipayUsername": "bevry", | ||
"flattrUsername": "balupton", | ||
"flattrCode": "344188/balupton-on-Flattr", | ||
"paypalButtonID": "QB8GQPZAH84N6", | ||
"paypalURL": "https://bevry.me/paypal", | ||
"bitcoinURL": "https://bevry.me/bitcoin", | ||
@@ -84,0 +85,0 @@ "wishlistURL": "https://bevry.me/wishlist", |
@@ -20,3 +20,3 @@ <!-- TITLE/ --> | ||
<span class="badge-flattr"><a href="http://flattr.com/thing/344188/balupton-on-Flattr" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span> | ||
<span class="badge-paypal"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span> | ||
<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span> | ||
<span class="badge-bitcoin"><a href="https://bevry.me/bitcoin" title="Donate once-off to this project using Bitcoin"><img src="https://img.shields.io/badge/bitcoin-donate-yellow.svg" alt="Bitcoin donate button" /></a></span> | ||
@@ -46,3 +46,3 @@ <span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span> | ||
<li>Use: <code>require('badges')</code></li> | ||
<li>CDN URL: <code>//wzrd.in/bundle/badges@1.1.0</code></li></ul> | ||
<li>CDN URL: <code>//wzrd.in/bundle/badges@1.1.1</code></li></ul> | ||
@@ -194,3 +194,3 @@ <a href="http://enderjs.com" title="Ender is a full featured package manager for your browser"><h3>Ender</h3></a><ul> | ||
<span class="badge-flattr"><a href="http://flattr.com/thing/344188/balupton-on-Flattr" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span> | ||
<span class="badge-paypal"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span> | ||
<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span> | ||
<span class="badge-bitcoin"><a href="https://bevry.me/bitcoin" title="Donate once-off to this project using Bitcoin"><img src="https://img.shields.io/badge/bitcoin-donate-yellow.svg" alt="Bitcoin donate button" /></a></span> | ||
@@ -197,0 +197,0 @@ <span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span> |
89623
1946