changes to the way the qrcode button is placed from the previous commeit
This commit is contained in:
parent
d81f2779a9
commit
d4772fd601
2 changed files with 17 additions and 14 deletions
10
index.html
10
index.html
|
@ -536,14 +536,12 @@
|
||||||
|
|
||||||
<div id="transactionCreate" class="alert alert-success hidden">
|
<div id="transactionCreate" class="alert alert-success hidden">
|
||||||
<label>Transaction</label>
|
<label>Transaction</label>
|
||||||
|
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode" style="float:right;"><span class="glyphicon glyphicon-qrcode"></span></button>
|
||||||
|
|
||||||
<p>The transaction below has been generated and encoded. It can be broadcasted once it has been signed.</p>
|
<p>The transaction below has been generated and encoded. It can be broadcasted once it has been signed.</p>
|
||||||
<br>
|
<br>
|
||||||
<div class="input-group">
|
<textarea class="form-control" style="height:150px" readonly></textarea>
|
||||||
<textarea class="form-control" style="height:150px" readonly></textarea>
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode"><span class="glyphicon glyphicon-qrcode"></span></button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<p class="text-muted">Size: <span class="txSize">0</span> <i>bytes</i></p>
|
<p class="text-muted">Size: <span class="txSize">0</span> <i>bytes</i></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -929,19 +929,24 @@ $(document).ready(function() {
|
||||||
$(".qrcodeBtn").click(function(){
|
$(".qrcodeBtn").click(function(){
|
||||||
$("#qrcode").html("");
|
$("#qrcode").html("");
|
||||||
var thisbtn = $(this).parent().parent();
|
var thisbtn = $(this).parent().parent();
|
||||||
|
var qrstr = false;
|
||||||
|
var ta = $("textarea",thisbtn);
|
||||||
|
|
||||||
if($('textarea',$(this).closest('.input-group')).length){
|
if(ta.length>0){
|
||||||
var qrcode = new QRCode("qrcode",{width:512,height:512});
|
var w = (screen.availWidth > screen.availHeight ? screen.availWidth : screen.availHeight)/3;
|
||||||
var qrstr = $('textarea',$(this).closest('.input-group')).val();
|
var qrcode = new QRCode("qrcode", {width:w, height:w});
|
||||||
|
qrstr = $(ta).val();
|
||||||
if(qrstr.length > 2000){
|
if(qrstr.length > 2000){
|
||||||
$("#qrcode").html("<p>Sorry the data is too long for the QR generator.</p>");
|
$("#qrcode").html("<p>Sorry the data is too long for the QR generator.</p>");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
var qrcode = new QRCode("qrcode");
|
var qrcode = new QRCode("qrcode");
|
||||||
var qrstr = "bitcoin:"+$('.address',thisbtn).val();
|
qrstr = "bitcoin:"+$('.address',thisbtn).val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(qrstr){
|
||||||
|
qrcode.makeCode(qrstr);
|
||||||
}
|
}
|
||||||
qrcode.makeCode(qrstr);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[title!=""], abbr[title!=""]').tooltip({'placement':'bottom'});
|
$('input[title!=""], abbr[title!=""]').tooltip({'placement':'bottom'});
|
||||||
|
|
Loading…
Reference in a new issue