From 06e6c49f57bae8c75edb986406e9f99933676b4a Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 20 Jun 2017 17:11:09 +0000 Subject: [PATCH] do not show an error message when executeCommand('Copy') fails the error is misleading when the clipboard is empty there's nothing the user can do about it --- icedeb.css | 14 -------------- icedeb.html | 1 - icedeb.js | 11 +---------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/icedeb.css b/icedeb.css index 03f22b7..37aaf0a 100644 --- a/icedeb.css +++ b/icedeb.css @@ -33,18 +33,4 @@ body { padding: 1ex; } .icedeb-button:hover { text-decoration: underline; } -.hidden { display: none; } a, a:visited { color: blue; } -#error { - display: block; - background: hsl(48.2,100%,90%); - visibility: visible; - opacity: 1; - transition: visibility 250ms, opacity 250ms; -} -#error.hidden { - display: block; - visibility: hidden; - opacity: 0; - transition: none; -} diff --git a/icedeb.html b/icedeb.html index e0ebc9c..0128bf3 100644 --- a/icedeb.html +++ b/icedeb.html @@ -16,5 +16,4 @@
Build logs (site)
Security tracker (site)
- diff --git a/icedeb.js b/icedeb.js index 9c9a770..175fdf1 100644 --- a/icedeb.js +++ b/icedeb.js @@ -117,8 +117,6 @@ function link_clicked(e) { } let clip_input = document.getElementById("clipboard"); - if(clip_input.value == '') - get_clipboard_contents(); let clip = trim(clip_input.value); if(clip_input.value == '') return; @@ -166,17 +164,10 @@ function link_clicked(e) { } function get_clipboard_contents() { - document.getElementById('error').classList.add('hidden'); - let clip_pot = document.getElementById('clip-pot'); let clip_input = document.getElementById("clipboard"); clip_pot.focus(); - if (!document.execCommand("Paste")) { - let err = document.getElementById('error'); - err.textContent = 'Error retrieving clipboard contents'; - err.classList.remove('hidden'); - } - else { + if (document.execCommand("Paste")) { clip_input.value = clip_pot.textContent.trim(); clip_input.focus(); clip_input.setSelectionRange(0, clip_input.value.length) -- 2.39.2