added shareable urls

This commit is contained in:
OutCast3k 2014-12-23 14:25:43 +00:00
parent c8e361557c
commit a42db15a78
2 changed files with 32 additions and 0 deletions

View file

@ -273,6 +273,8 @@
<label>Redeem Script</label>
<p>This script should be <i>saved and should be shared with all the participants before a payment is made</i>, so they may validate the authenticity of the address, it will also be used later to release the bitcoins.</p>
<textarea class="form-control script" style="height:160px" readonly></textarea>
<label>Shareable URL</label>
<input type="text" class="scriptUrl form-control" disabled>
</div>
<input type="button" class="btn btn-primary" value="Submit" id="newMultiSigAddress">

View file

@ -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();