Created
December 5, 2013 06:21
-
-
Save blha303/7800947 to your computer and use it in GitHub Desktop.
IRCCloud trout-slapping bookmarklet | Usage: Select the username or text you want to slap. If you can fix prompt(), please let me know.
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
javascript: (function () { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && document.selection.type != "Control") { text = document.selection.createRange().text; } else { text = prompt("Enter username", "everyone"); } if (!text) { text = "everyone"; } cb().say("/me slaps " + text.replace(/[<>@+~&]/g, '').trim() + " around a bit with a large trout"); }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Superb