feat: Fixed copy button for mobile
All checks were successful
Build Docker / Build Image (push) Successful in 22s
All checks were successful
Build Docker / Build Image (push) Successful in 22s
This commit is contained in:
parent
4c08d4e24e
commit
97f7792612
Binary file not shown.
12
main.py
12
main.py
@ -673,8 +673,8 @@ def signMessage(domain):
|
|||||||
|
|
||||||
content += "<textarea style='display: none;' id='data' rows='4' cols='50'>"+json.dumps(data)+"</textarea>"
|
content += "<textarea style='display: none;' id='data' rows='4' cols='50'>"+json.dumps(data)+"</textarea>"
|
||||||
|
|
||||||
copyScript = "<script>function copyToClipboard() {var copyText = document.getElementById('data');copyText.style.display = 'block';copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');copyText.style.display = 'none';}</script>"
|
copyScript = "<script>function copyToClipboard() {var copyText = document.getElementById('data');copyText.style.display = 'block';copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');copyText.style.display = 'none';var copyButton = document.getElementById('copyButton');copyButton.innerHTML='Copied';}</script>"
|
||||||
content += "<button onclick='copyToClipboard()'>Copy to clipboard</button>" + copyScript
|
content += "<button id='copyButton' onclick='copyToClipboard()' class='btn btn-secondary'>Copy to clipboard</button>" + copyScript
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -959,9 +959,15 @@ def settings_action(action):
|
|||||||
return redirect("/settings?error=" + str(resp['error']))
|
return redirect("/settings?error=" + str(resp['error']))
|
||||||
return redirect("/settings?success=Zapped transactions")
|
return redirect("/settings?success=Zapped transactions")
|
||||||
elif action == "xpub":
|
elif action == "xpub":
|
||||||
|
xpub = account_module.getxPub(request.cookies.get("account"))
|
||||||
|
content = "<br><br>"
|
||||||
|
content += "<textarea style='display: none;' id='data' rows='4' cols='50'>"+xpub+"</textarea>"
|
||||||
|
content += "<script>function copyToClipboard() {var copyText = document.getElementById('data');copyText.style.display = 'block';copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');copyText.style.display = 'none';var copyButton = document.getElementById('copyButton');copyButton.innerHTML='Copied';}</script>"
|
||||||
|
content += "<button id='copyButton' onclick='copyToClipboard()' class='btn btn-secondary'>Copy to clipboard</button>"
|
||||||
|
|
||||||
return render_template("message.html", account=account,sync=account_module.getNodeSync(),
|
return render_template("message.html", account=account,sync=account_module.getNodeSync(),
|
||||||
title="xPub Key",
|
title="xPub Key",
|
||||||
content="<code>"+account_module.getxPub(request.cookies.get("account"))+"</code>")
|
content="<code>"+xpub+"</code>" + content)
|
||||||
|
|
||||||
return redirect("/settings?error=Invalid action")
|
return redirect("/settings?error=Invalid action")
|
||||||
|
|
||||||
|
2
templates/assets/js/receive.min.js
vendored
2
templates/assets/js/receive.min.js
vendored
@ -1 +1 @@
|
|||||||
function copyAddress(){var e=document.getElementById("copyLink").getAttribute("address"),t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value),document.body.removeChild(t),document.getElementById("copyLink").innerHTML="Copied!"}
|
function copyToClipboard(){var e=document.getElementById("data");e.style.display="block",e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.style.display="none",document.getElementById("copyButton").innerHTML="Copied"}
|
@ -66,7 +66,7 @@
|
|||||||
<div class="card" style="margin: auto;max-width: 500px;margin-top: 50px;">
|
<div class="card" style="margin: auto;max-width: 500px;margin-top: 50px;">
|
||||||
<div class="card-body text-center">
|
<div class="card-body text-center">
|
||||||
<h4 class="card-title">{{address}}</h4><img src="/qr/{{address}}">
|
<h4 class="card-title">{{address}}</h4><img src="/qr/{{address}}">
|
||||||
<p class="card-text">Use this address to receive HNS or Handshake domains from other people or wallets.</p><a class="card-link" id="copyLink" href="javascript:;" address="{{address}}" onclick="copyAddress()">Copy</a>
|
<p class="card-text">Use this address to receive HNS or Handshake domains from other people or wallets.</p><textarea id="data" style="display: none;">{{address}}</textarea><button class="btn btn-primary" id="copyButton" type="button" onclick="copyToClipboard()">Copy</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user