First draft
This commit is contained in:
@@ -4,16 +4,19 @@
|
||||
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html GNU General Public License v2.0
|
||||
*/
|
||||
|
||||
function HostingSupport1984CopyEmailAddress( e ) {
|
||||
e.preventDefault();
|
||||
var emailAddressTag = document.querySelector( '#hosting-support-1984-address' );
|
||||
emailAddressTag.select();
|
||||
document.execCommand( 'copy' );
|
||||
function HostingSupport1984CopyEmailAddress(e) {
|
||||
e.preventDefault();
|
||||
const emailAddressTag = document.querySelector('#hosting-support-1984-address');
|
||||
navigator.clipboard.writeText(emailAddressTag.value)
|
||||
.catch(err => console.error("Clipboard write failed:", err));
|
||||
}
|
||||
|
||||
if (document.querySelector( '#hosting-support-1984-link' )) {
|
||||
document.querySelector( '#hosting-support-1984-link' ).addEventListener(
|
||||
'click',
|
||||
HostingSupport1984CopyEmailAddress
|
||||
);
|
||||
document.querySelector('#hosting-support-1984-link')
|
||||
?.addEventListener('click', HostingSupport1984CopyEmailAddress);
|
||||
|
||||
if (document.querySelector('#hosting-support-1984-link')) {
|
||||
document.querySelector('#hosting-support-1984-link').addEventListener(
|
||||
'click',
|
||||
HostingSupport1984CopyEmailAddress
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user