Skip to content

Commit

Permalink
Added option to support raw QR codes for altcoin support
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Dec 14, 2014
1 parent 58f0a5d commit a91bce4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setup:
npm install .

clean:
rm dist/* > /dev/nul
rm dist/* > /dev/null

# Build QRCode + bitcoinaddress combo in UMD boilerplate wrapped distributable .Jjs bundle
# Debug version comes with source maps.
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ Setting up `<script>` tag:
height: 128,
colorDark : "#000000",
colorLight : "#ffffff"
}
},
// By default the generated QR code is bitcoin:// URL.
// However you might want to change this for altcoins, which do not have
// official protocol handlers. Set true to remove bitcoin:// from
// QR code.
qrRawAddress: false
});
});
</script>
Expand Down
9 changes: 6 additions & 3 deletions bitcoinaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,16 @@ module.exports = {
generateQR : function(qrContainer) {

var elem = qrContainer.parents(".bitcoin-address-container");
var url;
//var addr = elem.attr("data-bc-address");

var url = this.buildBitcoinURI(elem.attr("data-bc-address"),
if(this.config.qrRawAddress) {
url = elem.attr("data-bc-address");
} else {
url = this.buildBitcoinURI(elem.attr("data-bc-address"),
elem.attr("data-bc-amount"),
elem.attr("data-bc-label"));

console.log("QR address URL is ", url);
}

var options = $.extend({}, this.config.qr, {
text: url
Expand Down
11 changes: 7 additions & 4 deletions dist/bitcoinaddress-bundle.debug.js

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions dist/bitcoinaddress-bundle.js

Large diffs are not rendered by default.

0 comments on commit a91bce4

Please sign in to comment.