MediaWiki:ASBSearch.js: Difference between revisions
From HorizonXI Wiki
Starfox9507 (talk | contribs) Created page with "→Copy to Clipboard helper for ASBSearch: function copyURLToClipboard() { url = document.location.href; navigator.clipboard.writeText(url).then(function() { console.log('copyURLToClipboard(): Copied!'); }, function() { alert("Error copying to clipboard. Please report on our Discord."); console.log('copyURLToClipboard(): Copy error'); }); };" |
Starfox9507 (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Copy to Clipboard helper for | /* Copy to Clipboard helper for FFXIHelper */ | ||
function copyURLToClipboard() { | function copyURLToClipboard() { | ||
| Line 6: | Line 6: | ||
navigator.clipboard.writeText(url).then(function() { | navigator.clipboard.writeText(url).then(function() { | ||
console.log('copyURLToClipboard(): Copied!'); | console.log('copyURLToClipboard(): Copied!'); | ||
mw.notify( 'Copied to Clipboard !', { autoHide: true, type: 'warn' } ); | |||
}, function() { | }, function() { | ||
mw.notify( 'Error copying to clipboard. Please report on our Discord.', { autoHide: true, type: 'error' } ); | |||
console.log('copyURLToClipboard(): Copy error'); | console.log('copyURLToClipboard(): Copy error'); | ||
}); | }); | ||
}; | }; | ||
Latest revision as of 11:03, 16 May 2026
/* Copy to Clipboard helper for FFXIHelper */
function copyURLToClipboard() {
url = document.location.href;
navigator.clipboard.writeText(url).then(function() {
console.log('copyURLToClipboard(): Copied!');
mw.notify( 'Copied to Clipboard !', { autoHide: true, type: 'warn' } );
}, function() {
mw.notify( 'Error copying to clipboard. Please report on our Discord.', { autoHide: true, type: 'error' } );
console.log('copyURLToClipboard(): Copy error');
});
};
