edit_event: copy event to clipboard button

This commit is contained in:
Milan
2020-05-23 23:28:39 +02:00
parent 380b167354
commit f311ce01e5
4 changed files with 22 additions and 0 deletions

View File

@@ -276,6 +276,21 @@ function checkFields(){
}
}
function copyEventToClipboard(){
var text = $('textarea[name="excerpt"]').val()+"\n";
text += $('textarea[name="user_excerpt"]').val()+"\n";
text += $('textarea[name="topic"]').val()+"\n\n";
text += $('textarea[name="content"]').val()+"\n";
text = '<textarea style="none" id="clipboard">' + text + '</textarea>';
$('body').append(text);
var copyText = document.getElementById('clipboard');
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
}
$(document).ready(
function(){
initRegions(region);