Created
December 9, 2010 18:47
-
-
Save NickCraver/735127 to your computer and use it in GitHub Desktop.
User Script - Disable Enter key on comments on StackExchange.
This file contains 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 Disable Enter key on comments on Stack Exchange. | |
// @namespace http://networkpx.googlecode.com | |
// @description Disable Enter key on comments on Stack Exchange. | |
// @include http://*.stackexchange.com/* | |
// @include http://stackoverflow.com/* | |
// @include http://meta.stackoverflow.com/* | |
// @include http://serverfault.com/* | |
// @include http://meta.serverfault.com/* | |
// @include http://superuser.com/* | |
// @include http://meta.superuser.com/* | |
// @include http://askubuntu.com/* | |
// @include http://meta.askubuntu.com/* | |
// ==/UserScript== | |
var s = document.createElement("script"); | |
s.innerHTML = '$(document).delegate(".comments-link, .comment-edit", "click", function(e) { \ | |
var events = $(this).closest("td").find("textarea[name=comment]").data("events"); \ | |
var makeShift = { handler: function(e) { e.shiftKey = true; } }; \ | |
events.keyup.splice(0, 0, makeShift); \ | |
events.keypress.splice(0, 0, makeShift); \ | |
});'; | |
document.body.appendChild(s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment