]> git.ktnx.net Git - icedeb.git/commitdiff
do not show an error message when executeCommand('Copy') fails
authorDamyan Ivanov <dmn@debian.org>
Tue, 20 Jun 2017 17:11:09 +0000 (17:11 +0000)
committerDamyan Ivanov <dmn@debian.org>
Tue, 20 Jun 2017 17:11:09 +0000 (17:11 +0000)
the error is misleading when the clipboard is empty

there's nothing the user can do about it

icedeb.css
icedeb.html
icedeb.js

index 03f22b7407e54d31bc0a0f2bae7520fbc3d54900..37aaf0aacc1ed357ca8c546cdb733a3eed8cec70 100644 (file)
@@ -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;
-}
index e0ebc9cd0bd156308bcb78ca37b7d6881e35394d..0128bf3c6c617883070f5506865b0cd3086b3e2c 100644 (file)
@@ -16,5 +16,4 @@
       <div><span class="icedeb-button" id="buildd">Build logs</span> (<a href="https://buildd.debian.org/">site</a>)</div>
       <div><span class="icedeb-button" id="security">Security tracker</span> (<a href="https://security-tracker.debian.org/">site</a>)</div>
   </div>
-  <div id="error" class="hidden"></div>
 </html>
index 9c9a77053aa597e6b418f69d5efd6c2306a92eb6..175fdf1c5ec443ee6c66657a77cf0371487a79ad 100644 (file)
--- 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)