diff --git a/index.html b/index.html index c7ad00b..fb785bb 100644 --- a/index.html +++ b/index.html @@ -273,6 +273,8 @@

This script should be saved and should be shared with all the participants before a payment is made, so they may validate the authenticity of the address, it will also be used later to release the bitcoins.

+ + diff --git a/js/coinbin.js b/js/coinbin.js index d615019..c370a6b 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -289,6 +289,7 @@ $(document).ready(function() { var multisig = coinjs.pubkeys2MultisigAddress(keys, sigsNeeded); $("#multiSigData .address").val(multisig['address']); $("#multiSigData .script").val(multisig['redeemScript']); + $("#multiSigData .scriptUrl").val(document.location.origin+''+document.location.pathname+'?verify='+multisig['redeemScript']+'#verify'); $("#multiSigData").removeClass('hidden').addClass('show').fadeIn(); $("#releaseCoins").removeClass('has-error'); } else { @@ -695,6 +696,35 @@ $(document).ready(function() { /* page load code */ + function _get(value) { + var dataArray = (document.location.search).match(/(([a-z0-9\_\[\]]+\=[a-z0-9\_\.\%\@]+))/gi); + var r = []; + if(dataArray) { + for(var x in dataArray) { + if((dataArray[x]) && typeof(dataArray[x])=='string') { + if((dataArray[x].split('=')[0].toLowerCase()).replace(/\[\]$/ig,'') == value.toLowerCase()) { + r.push(unescape(dataArray[x].split('=')[1])); + } + } + } + } + return r; + } + + + var _getBroadcast = _get("broadcast"); + if(_getBroadcast[0]){ + $("#rawTransaction").val(_getBroadcast[0]); + $("#rawSubmitBtn").click(); + } + + var _getVerify = _get("verify"); + if(_getVerify[0]){ + $("#verifyScript").val(_getVerify[0]); + $("#verifyBtn").click(); + } + + $(".qrcodeBtn").click(function(){ $("#qrcode").html(""); var thisbtn = $(this).parent().parent();