Skip to content

Instantly share code, notes, and snippets.

@beshanoe
Created August 28, 2015 14:08
Show Gist options
  • Save beshanoe/dcab9f6e1561747feb3b to your computer and use it in GitHub Desktop.
Save beshanoe/dcab9f6e1561747feb3b to your computer and use it in GitHub Desktop.
function cop(text) {
if (document.execCommand) {
var textArea = $('<textarea></textarea>');
textArea.css({
position: 'absolute',
top: 0,
left: -10000
});
textArea.val(text);
$(document.body).append(textArea);
textArea.select();
document.execCommand('copy');
textArea.remove();
}
}
setInterval(function() {
if (!$('#copybaba').length) {
if ($('.ui-title').length) {
$('.ui-title').prepend($('<button id="copybaba">Copy!</button>').click(function(){
cop($('.ui-title td').map(function(){return this.textContent}).toArray().join(' '));
}))
}
}
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment