<link rel="stylesheet" href="icedeb.css"/>
</head>
<script src="icedeb.js"></script>
- <textarea id="clipboard" rows="1"></textarea>
+ <textarea id="clip-pot" contenteditable="true"></textarea>
+ <input type="text" id="clipboard"/>
<div id="button-list-container">
<div><span class="icedeb-button" id="bts">Bug tracker</span> (<a href="https://bugs.debian.org/">site</a>)</div>
<div><span class="icedeb-button" id="pts">Package tracker</span> (<a href="https://tracker.debian.org/">site</a>)</div>
}
let clip_input = document.getElementById("clipboard");
- if(clip_input.textContent == '')
+ if(clip_input.value == '')
get_clipboard_contents();
- let clip = trim(clip_input.textContent);
+ let clip = trim(clip_input.value);
- if(clip_input.textContent == '') return;
+ if(clip_input.value == '') return;
let url;
function get_clipboard_contents() {
document.getElementById('error').classList.add('hidden');
+ let clip_pot = document.getElementById('clip-pot');
let clip_input = document.getElementById("clipboard");
- clip_input.focus();
- if (!document.execCommand("paste")) {
+ clip_pot.focus();
+ if (!document.execCommand("Paste")) {
let err = document.getElementById('error');
err.textContent = 'Error retrieving clipboard contents';
err.classList.remove('hidden');
}
+ else {
+ clip_input.value = clip_pot.textContent.trim();
+ clip_input.focus();
+ clip_input.setSelectionRange(0, clip_input.value.length)
+ }
}
window.addEventListener('DOMContentLoaded', (e) => {