Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Simplifications to the copybtn.js script. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
5f0479d097fe07212349e1c107bafe0c |
User & Date: | drh 2019-06-10 01:53:59 |
Context
2019-06-12
| ||
09:41 | Improvements to tooltip handling. ... (check-in: 3a8abf49 user: drh tags: trunk) | |
2019-06-10
| ||
04:48 | Disable the mouse-motion anti-robot requirement for devices that self-identify as a tablet or mobile device, and hence might never send mouse-motion events. ... (Closed-Leaf check-in: 60d25189 user: drh tags: tablet-antirobot-fix) | |
01:53 | Simplifications to the copybtn.js script. ... (check-in: 5f0479d0 user: drh tags: trunk) | |
01:37 | Longer default hash length for the copy button on ticket view pages. ... (check-in: e055942c user: drh tags: trunk) | |
Changes
Changes to src/copybtn.js.
︙ | ︙ | |||
41 42 43 44 45 46 47 | elButton.style.transition = ""; elButton.style.opacity = 1; if( idTarget ) elButton.setAttribute("data-copytarget",idTarget); if( cchLength ) elButton.setAttribute("data-copylength",cchLength); elButton.onclick = clickCopyButton; return elButton; } | | | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | elButton.style.transition = ""; elButton.style.opacity = 1; if( idTarget ) elButton.setAttribute("data-copytarget",idTarget); if( cchLength ) elButton.setAttribute("data-copylength",cchLength); elButton.onclick = clickCopyButton; return elButton; } setTimeout(function(){ var aButtons = document.getElementsByClassName("copy-button"); for ( var i=0; i<aButtons.length; i++ ){ initCopyButton(aButtons[i],0,0); } },1); /* The onclick handler for the "Copy Button". */ var lockCopyText = false; function clickCopyButton(e){ e.preventDefault(); /* Mandatory for <a> and <button>. */ e.stopPropagation(); if( lockCopyText ) return; lockCopyText = true; |
︙ | ︙ | |||
77 78 79 80 81 82 83 | elButton.style.opacity = 1; } lockCopyText = false; }.bind(null,this.id),400); } /* Create a temporary <textarea> element and copy the contents to clipboard. */ function copyTextToClipboard(text){ | | | < | < < < < < < < | | < | | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | elButton.style.opacity = 1; } lockCopyText = false; }.bind(null,this.id),400); } /* Create a temporary <textarea> element and copy the contents to clipboard. */ function copyTextToClipboard(text){ var x = document.createElement("textarea"); x.style.position = 'absolute'; x.style.left = '-9999px'; x.value = text; document.body.appendChild(x); x.select(); try{ document.execCommand('copy'); }catch(err){} document.body.removeChild(x); } |