mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
add a "copy" button to the "search-url" sidebar
This commit is contained in:
parent
96ccec1aa6
commit
8adc7b0433
3 changed files with 18 additions and 0 deletions
|
|
@ -16,6 +16,8 @@
|
|||
}
|
||||
));
|
||||
|
||||
d.querySelector('#search_url button#copy_url').style.display = "block";
|
||||
|
||||
searxng.on('.btn-collapse', 'click', function () {
|
||||
var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed');
|
||||
var btnLabelNotCollapsed = this.getAttribute('data-btn-text-not-collapsed');
|
||||
|
|
@ -41,6 +43,12 @@
|
|||
}
|
||||
});
|
||||
|
||||
searxng.on('#copy_url', 'click', function () {
|
||||
var target = this.parentElement.querySelector('pre');
|
||||
navigator.clipboard.writeText(target.innerText);
|
||||
this.innerText = this.dataset.copiedText;
|
||||
});
|
||||
|
||||
searxng.selectImage = function (resultElement) {
|
||||
/* eslint no-unused-vars: 0 */
|
||||
if (resultElement) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue