Widget:Copy: Difference between revisions
Jump to navigation
Jump to search
c |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
} | } | ||
</script> | </script> | ||
<button type="button" <!--{if $style == 'button'} class="mw-ui-button mw-ui-progressive" {else} style="text-decoration:none;color:#0645ad;background:none;padding:0;" {/if}--> onclick="copy('<!--{$text|escape:'html'}-->')"><!--{$buttontext|escape:'html'}--></button> | <button type="button" <!--{if $style == 'button'}--> class="mw-ui-button mw-ui-progressive" <!--{else}--> style="text-decoration:none;color:#0645ad;background:none;padding:0;border:none;" <!--{/if}--> onclick="copy('<!--{$text|escape:'html'}-->')"><!--{$buttontext|escape:'html'}--></button> |
Latest revision as of 08:58, 30 August 2020
<script> function copy(text) {
// const unescapeRegex = /(&\;)|("\;)|('\;)|(<\;)|(>\;)|(*\;)/g; navigator.clipboard.writeText(text);
} </script> <button type="button" class="mw-ui-button mw-ui-progressive" style="text-decoration:none;color:#0645ad;background:none;padding:0;border:none;" onclick="copy()"></button>