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);

View File

@@ -182,3 +182,5 @@ msgstr "Auszug ist zu lang. Für längeren Text bitte das Feld «aktuelle Themen
msgid "label_excerpt_extension_too_long"
msgstr "Auszug ist zu lang. Für längeren Text bitte das Feld «aktuelle Themen» verwenden."
msgid "button_copy_to_clipboard"
msgstr "in Zwischenablage kopieren"

View File

@@ -175,3 +175,6 @@ msgstr "excerpt is too long. for longer text please use the field «Current Topi
msgid "label_excerpt_extension_too_long"
msgstr "excerpt is too long. for longer text please use the field «Current Topics»"
msgid "button_copy_to_clipboard"
msgstr "copy to clipboard"

View File

@@ -123,6 +123,8 @@
<button type="submit"><TMPL_VAR .loc.button_download></button>
</form>
</TMPL_IF>
<button onclick="copyEventToClipboard();"><TMPL_VAR .loc.button_copy_to_clipboard></button>
</TMPL_UNLESS>
<!--