copy shortcut

This commit is contained in:
2020-01-14 17:22:24 +01:00
parent 981a85c63e
commit d65201202d
3 changed files with 10 additions and 2 deletions

View File

@@ -92,6 +92,14 @@ function shareButton() {
});
}
document.addEventListener("keydown", function(event){
if (event.ctrlKey || event.altKey) {
return // prevent custom shortcuts from interfering with system shortcuts
}
if (event.which == 67 && !uploader.uploading()) { // C to copy to clipboard
copyLink();
}
});
function copyLink() {
if(copyText(shareLink)) {
console.log('Text copied');

View File

@@ -103,7 +103,7 @@
<div id="details_popup" class="popup details_popup">
<div id="details_popup_title" class="highlight_1">
File Info
<button style="position: absolute; top: 3px; right: 3px;" class="button_red" onclick="DetailsWindow.toggle();">🞫</button>
<button style="position: absolute; top: 3px; right: 3px;" class="button_red" onclick="DetailsWindow.toggle();">{{template `close.svg`}}</button>
</div>
<div class="content_area">
<span id="info_file_details"></span>

View File

@@ -81,7 +81,7 @@
</button>
</div>
<button id="btn_copy_link" class="social_button" style="display: inline-block" onclick="copyLink()">
{{template `copy.svg` .}}<br/><span>Copy link</span>
{{template `copy.svg` .}}<br/><span><u>C</u>opy link</span>
</button>
<button id="btn_open_link" class="social_button" style="display: inline-block" onclick="openLink()">
{{template `open_in_new.svg` .}}<br/><span>Open link</span>