mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-03 02:05:36 +00:00
Added copy decrypted text
This commit is contained in:
parent
bcef375a1d
commit
75835eedd8
1 changed files with 18 additions and 1 deletions
|
@ -38,8 +38,11 @@
|
|||
|
||||
function load() {
|
||||
let form = document.getElementById('form')
|
||||
let message = document.getElementById('message');
|
||||
let copy = document.getElementById('copy');
|
||||
let error = document.getElementById('error');
|
||||
let details = document.getElementById('details');
|
||||
let year = document.getElementById('year');
|
||||
|
||||
form.addEventListener('submit', submit);
|
||||
|
||||
|
@ -64,7 +67,20 @@
|
|||
error.style.display = 'block';
|
||||
}
|
||||
|
||||
document.getElementById('year').textContent = new Date().getFullYear();
|
||||
copy.onclick = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
const blob = new Blob([message.innerHTML], { type: 'text/html' });
|
||||
const clip = new ClipboardItem({ 'text/html': blob });
|
||||
|
||||
navigator.clipboard.write([clip]).then(function() {
|
||||
alert('Copied to clipboard');
|
||||
}, function() {
|
||||
alert('Copy failed');
|
||||
});
|
||||
}
|
||||
|
||||
year.textContent = new Date().getFullYear();
|
||||
}
|
||||
|
||||
function submit(event) {
|
||||
|
@ -162,6 +178,7 @@
|
|||
<hr>
|
||||
<p id="message" style="width: 100%;"></p>
|
||||
<hr>
|
||||
<span id="copy" style="font-size: x-large">📋</span>
|
||||
</div>
|
||||
|
||||
<p id="error" style="color: red; font-weight: bold; display: none;"></p>
|
||||
|
|
Loading…
Reference in a new issue