fix: Update tooltip to say copied when you copy a crypto address
All checks were successful
Build Docker / BuildImage (push) Successful in 46s

This commit is contained in:
Nathan Woodburn 2024-08-15 14:29:36 +10:00
parent 6b5fe4bc2f
commit 8687daecfd
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 15 additions and 2 deletions

View File

@ -710,7 +710,7 @@ def donate():
+ '" alt="QR Code" style="width: 100%; max-width: 200px; margin: 20px auto;">' + '" alt="QR Code" style="width: 100%; max-width: 200px; margin: 20px auto;">'
) )
copyScript = '<script>document.getElementById("crypto-address").addEventListener("click", function() {navigator.clipboard.writeText(this.innerText);this.setAttribute("data-bs-original-title", "Copied!");});document.getElementById("crypto-domain").addEventListener("click", function() {navigator.clipboard.writeText(this.innerText);this.setAttribute("data-bs-original-title", "Copied!");});</script>' copyScript = '<script>document.getElementById("crypto-address").addEventListener("click", function() {navigator.clipboard.writeText(this.innerText);this.setAttribute("data-bs-original-title", "Copied!");const tooltips = document.querySelectorAll(".tooltip-inner");tooltips.forEach(tooltip => {tooltip.innerText = "Copied!";});});document.getElementById("crypto-domain").addEventListener("click", function() {navigator.clipboard.writeText(this.innerText);this.setAttribute("data-bs-original-title", "Copied!");const tooltips = document.querySelectorAll(".tooltip-inner");tooltips.forEach(tooltip => {tooltip.innerText = "Copied!";});});</script>'
cryptoHTML += copyScript cryptoHTML += copyScript
return render_template( return render_template(

View File

@ -151,6 +151,10 @@
textArea.select(); textArea.select();
document.execCommand('copy'); document.execCommand('copy');
document.body.removeChild(textArea); document.body.removeChild(textArea);
const tooltips = document.querySelectorAll('.tooltip-inner');
tooltips.forEach(tooltip => {
tooltip.innerText = 'Copied!';
});
} }
const btc = document.getElementById('btc'); const btc = document.getElementById('btc');

View File

@ -194,7 +194,7 @@ Check them out here!</blockquote><img class="img-fluid" src="/assets/img/pfront.
<li class="list-inline-item">&nbsp;<a class="btn btn-primary btn-lg btn-default" role="button" href="https://github.com/sponsors/Nathanwoodburn" style="width: 170px;" target="_blank"><i class="fab fa-github fa-fw"></i><span class="network-name">&nbsp; Github</span></a></li> <li class="list-inline-item">&nbsp;<a class="btn btn-primary btn-lg btn-default" role="button" href="https://github.com/sponsors/Nathanwoodburn" style="width: 170px;" target="_blank"><i class="fab fa-github fa-fw"></i><span class="network-name">&nbsp; Github</span></a></li>
<li class="list-inline-item">&nbsp;<a class="btn btn-primary btn-lg btn-default" role="button" href="https://donate.stripe.com/8wM6pv0VD08Xe408ww" style="width: 170px;" target="_blank"><i class="fab fa-stripe-s fa-fw"></i><span class="network-name">&nbsp;Stripe</span></a></li> <li class="list-inline-item">&nbsp;<a class="btn btn-primary btn-lg btn-default" role="button" href="https://donate.stripe.com/8wM6pv0VD08Xe408ww" style="width: 170px;" target="_blank"><i class="fab fa-stripe-s fa-fw"></i><span class="network-name">&nbsp;Stripe</span></a></li>
</ul> </ul>
<p>HNS:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="hns-domain" class="hns" style="color: rgb(242,90,5);display: block;" title="Click to copy">nathan.woodburn</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="hns" class="hns" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{HNS}}</code><br>BTC:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="btc" class="btc" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{BTC}}</code><br>SOL:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="sol-domain" class="sol" style="color: rgb(242,90,5);display: block;" title="Click to copy">woodburn.sol</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="sol" class="sol" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{SOL}}</code><br>ETH:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="eth-domain" class="eth" style="color: rgb(242,90,5);display: block;" title="Click to copy">woodburn.au</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="eth" class="eth" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{ETH}}</code><a class="btn btn-primary btn-default" role="button" href="/donate" style="width: 170px;margin-top: 10px;">OTHER OPTIONS</a></p> <p>HNS:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="hns-domain" class="hns" style="color: rgb(242,90,5);display: block;" title="Click to copy">nathan.woodburn</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="hns" class="hns" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{HNS}}</code><br>BTC:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="btc-domain" class="btc" style="color: rgb(242,90,5);display: block;" title="Click to copy">hushedmercury55@walletofsatoshi.com</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="btc" class="btc" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{BTC}}</code><br>SOL:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="sol-domain" class="sol" style="color: rgb(242,90,5);display: block;" title="Click to copy">woodburn.sol</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="sol" class="sol" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{SOL}}</code><br>ETH:<br><code data-bs-toggle="tooltip" data-bss-tooltip="" id="eth-domain" class="eth" style="color: rgb(242,90,5);display: block;" title="Click to copy">woodburn.au</code><code data-bs-toggle="tooltip" data-bss-tooltip="" id="eth" class="eth" style="color: rgb(242,90,5);display: block;" title="Click to copy">{{ETH}}</code><a class="btn btn-primary btn-default" role="button" href="/donate" style="width: 170px;margin-top: 10px;">OTHER OPTIONS</a></p>
</div> </div>
</div> </div>
</div> </div>
@ -222,6 +222,11 @@ Check them out here!</blockquote><img class="img-fluid" src="/assets/img/pfront.
textArea.select(); textArea.select();
document.execCommand('copy'); document.execCommand('copy');
document.body.removeChild(textArea); document.body.removeChild(textArea);
const tooltips = document.querySelectorAll('.tooltip-inner');
tooltips.forEach(tooltip => {
tooltip.innerText = 'Copied!';
});
} }
const btc = document.getElementById('btc'); const btc = document.getElementById('btc');
@ -229,6 +234,7 @@ Check them out here!</blockquote><img class="img-fluid" src="/assets/img/pfront.
const hns = document.getElementById('hns'); const hns = document.getElementById('hns');
const sol = document.getElementById('sol'); const sol = document.getElementById('sol');
const hnsdomain = document.getElementById('hns-domain'); const hnsdomain = document.getElementById('hns-domain');
const btcdomain = document.getElementById('btc-domain');
const soldomain = document.getElementById('sol-domain'); const soldomain = document.getElementById('sol-domain');
const ethdomain = document.getElementById('eth-domain'); const ethdomain = document.getElementById('eth-domain');
@ -248,6 +254,9 @@ Check them out here!</blockquote><img class="img-fluid" src="/assets/img/pfront.
hnsdomain.addEventListener('click', () => { hnsdomain.addEventListener('click', () => {
copyToClipboard(hnsdomain); copyToClipboard(hnsdomain);
}); });
btcdomain.addEventListener('click', () => {
copyToClipboard(btcdomain);
});
soldomain.addEventListener('click', () => { soldomain.addEventListener('click', () => {
copyToClipboard(soldomain); copyToClipboard(soldomain);
}); });