#30 copyToClipboard button

This commit is contained in:
Synox 2018-01-13 14:22:09 +01:00
parent 003037009d
commit 125586506e

View File

@ -84,6 +84,16 @@ $purifier = new HTMLPurifier($purifier_config);
return false;
}
function copyToClipboard(text) {
var inp = document.createElement('input');
document.body.appendChild(inp);
inp.value = text;
inp.select();
document.execCommand('copy', false);
inp.remove();
}
</script>
</head>
@ -145,6 +155,14 @@ $purifier = new HTMLPurifier($purifier_config);
<div class="card-block">
<p class="lead">Your mailbox <strong
><?php echo $address ?></strong> is ready. </p>
<p>
<button class="btn btn-outline-primary"
onClick="copyToClipboard('<?php echo $address ?>');">
Copy email address
</button>
</p>
<p>Emails will appear here automatically. They will be deleted after 30 days.</p>
<div class="spinner">
<div class="rect1"></div>