added copy button
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<% }); %>
|
||||
</select>
|
||||
<button id="export-button" onclick="exportReport()">Export</button>
|
||||
<button id="copy-button" onclick="copyToClipboard()">Copy</button>
|
||||
</div>
|
||||
<textarea id="export-textarea"></textarea>
|
||||
|
||||
|
||||
@@ -1,8 +1,23 @@
|
||||
const exportTextarea = document.getElementById('export-textarea');
|
||||
const weekList = document.getElementById('week-list');
|
||||
const exportButton = document.getElementById('export-button');
|
||||
const copyButton = document.getElementById('copy-button');
|
||||
let loadingInterval;
|
||||
|
||||
function copyToClipboard() {
|
||||
navigator.clipboard.writeText(exportTextarea.value).then(() => {
|
||||
copyButton.innerText = 'Copied!';
|
||||
setTimeout(() => {
|
||||
copyButton.innerText = 'Copy';
|
||||
}, 2000);
|
||||
}).catch(() => {
|
||||
copyButton.innerText = 'Error!';
|
||||
setTimeout(() => {
|
||||
copyButton.innerText = 'Copy';
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
function loading() {
|
||||
exportButton.disabled = true;
|
||||
exportTextarea.value = 'Loading';
|
||||
|
||||
@@ -30,7 +30,7 @@ select::-webkit-scrollbar {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.selector button {
|
||||
button {
|
||||
font-size: 16px;
|
||||
height: 30px;
|
||||
margin-left: 10px;
|
||||
@@ -39,7 +39,7 @@ select::-webkit-scrollbar {
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
.selector button:hover {
|
||||
button:hover {
|
||||
scale: 1.1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user