Created
September 26, 2013 15:20
-
-
Save sergiitk/6715690 to your computer and use it in GitHub Desktop.
GistBox copy code on double click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GitBox extra features | |
// @namespace https://www.facebook.com/sergii.tk | |
// @version 0.1 | |
// @description Copies code blocks to clipboard | |
// @match https://app.gistboxapp.com/* | |
// @copyright 2013+, Sergii Tkachenko | |
// @require https://raw.github.com/rafjaf/ClipCopy-for-TM/master/lib/installGM_setClipboard.js | |
// ==/UserScript== | |
// Tested with tampermonkey 3.5.3630.44. | |
// https://chrome.google.com/webstore/detail/gcalenpjmijncebpfijmoaglllgpjagf | |
function gitbox_extra_save_to_clipboard(text, text_copied) { | |
if (text_copied == null) { | |
text_copied = "Copied!"; | |
} | |
GM_setClipboard(text); | |
notyfy({text: text_copied, layout: 'topRight', type: 'Success', timeout: 2000}); | |
} | |
// Copy code tags with double click. | |
$(document).on('dblclick', '.gist-file-code code', function() { | |
gitbox_extra_save_to_clipboard($(this).text()); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment