Skip to content

Instantly share code, notes, and snippets.

@beshanoe
Created August 28, 2015 14:08
Show Gist options
  • Select an option

  • Save beshanoe/dcab9f6e1561747feb3b to your computer and use it in GitHub Desktop.

Select an option

Save beshanoe/dcab9f6e1561747feb3b to your computer and use it in GitHub Desktop.

Revisions

  1. beshanoe created this gist Aug 28, 2015.
    24 changes: 24 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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);