MediaWiki:Common.js: различия между версиями
Kerisar (обсуждение | вклад) мНет описания правки |
Kerisar (обсуждение | вклад) мНет описания правки |
||
| Строка 182: | Строка 182: | ||
function copyToClipboard(connectUrl) { | function copyToClipboard(connectUrl) { | ||
const copyIcons = document.querySelectorAll('.copy-icon'); | const copyIcons = document.querySelectorAll('.copy-icon'); | ||
copyIcons.forEach(function(icon) { | |||
icon.addEventListener('click', function() { | icon.addEventListener('click', function() { | ||
// Находим предыдущий элемент | // Находим предыдущий элемент | ||
| Строка 195: | Строка 191: | ||
const textToCopy = previousElement.textContent; | const textToCopy = previousElement.textContent; | ||
const tempInput = document.createElement('input'); | const tempInput = document.createElement('input'); | ||
tempInput.value = textToCopy; | tempInput.value = textToCopy; | ||
| Строка 206: | Строка 201: | ||
} | } | ||
}); | }); | ||
} | }); | ||
} | } | ||