Widget:Copy: Difference between revisions

From Irony Wiki
Jump to navigation Jump to search
c
 
does this fix it
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;" <!--{/if}--> onclick="copy('<!--{$text|escape:'html'}-->')"><!--{$buttontext|escape:'html'}--></button>

Revision as of 08:58, 30 August 2020

<script> function copy(text) {

  // const unescapeRegex = /(&#38\;)|(&#34\;)|(&#39\;)|(&#60\;)|(&#62\;)|(&#42\;)/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;" onclick="copy()"></button>