No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
dev:DiscordIntegrator/code.js |
dev:DiscordIntegrator/code.js |
||
+ | |||
dev:CopyText/code.js |
dev:CopyText/code.js |
||
+ | $('body').on('click', '.copy-to-clipboard-button', function(e){ |
||
− | <includeonly> |
||
+ | var text = $(this).data('text'), |
||
− | <br style="clear: both;"> |
||
+ | $input = $('<input>', { type: 'text' }) |
||
− | <!-- |
||
+ | .val($('.copy-to-clipboard-text[data-text="' + text + '"]').first().text()) |
||
− | --><span class="copy-to-clipboard-button wds-button wds-is-secondary wds-is-squished" style="float: right; cursor: pointer; color: currentColor; border-color: currentColor; margin-top: -37px;">Click Here to Copy the Autoloot</span><!-- |
||
+ | .appendTo('body') |
||
− | --><div style="height: 1px; margin: 2px 0 0; background: rgb(166, 166, 166); background: rgba(166, 166, 166, 0.5);"></div>Click on the "COPY TO CLIPBOARD" button, to copy the following text:<!-- |
||
+ | .select(); |
||
− | -- Insert your text in the span below: -- |
||
+ | document.execCommand('Copy'); |
||
− | --> <span class="Click Here to Copy the Autoloot">{{{1|}}}</span> |
||
+ | $input.remove(); |
||
− | </includeonly><noinclude> |
||
+ | }); |
||
− | {{Documentation}} |
||
− | </noinclude> |
Latest revision as of 08:32, 2 October 2018
dev:DiscordIntegrator/code.js
dev:CopyText/code.js $('body').on('click', '.copy-to-clipboard-button', function(e){
var text = $(this).data('text'), $input = $('<input>', { type: 'text' }) .val($('.copy-to-clipboard-text[data-text="' + text + '"]').first().text()) .appendTo('body') .select(); document.execCommand('Copy'); $input.remove();
});