Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Every textarea should let you submit comments by pressing cmd-enter or ctrl-enter. For every site that doesn't support it, a kitten weeps. Here's to making less kittens weep.
JavaScript
Tree: d8d836d495

Merge pull request #1 from jakebellacera/master

Adding stackoverflow.com
latest commit d8d836d495
@dewski authored
Failed to load latest commit information.
CONTRIBUTING.md Add contributing guidelines
README.md
dribbble.com.js Add dribbble
news.ycombinator.com.js Add hackernews
reddit.com.js Add reddit
stackoverflow.com.js Adding stackoverflow.com to the readme
twitter.com.js Add twitter

README.md

cmd-enter

Every textarea should let you submit comments by pressing cmd-enter or ctrl-enter. For every site that doesn't support it, a kitten weeps. Here's to making less kittens weep.

Requirements

Supported Sites

Contributing

If reddit.com is giving you a bad time and not letting you use cmd-enter to submit comments, just create a reddit.js.com file and add the JavaScript required to submit comments (example below). jQuery is available from dotjs regardless if the target site has it or not. Some sites may require multiple event listeners if they format their textareas differently throughout their site.

Here is an example of adding cmd-enter to reddit.com:

$(document).on('keydown', '.usertext-edit textarea', function(e) {
  if(e.keyCode == 13 && (e.metaKey || e.ctrlKey)) {
    $(this).parents('form').submit()
  }
})

Hints:

  • .usertext-edit textarea is the selector for all textareas we are listening to.
  • e.keyCode == 13 - 13 here is the enter key.
  • (e.metaKey || e.ctrlKey) is either the command key or ctrl key.

Note on Patches/Pull Requests

  • Fork the project.
  • Add the cmd-enter behavior to a site.
  • Add the site to the Supported Sites part of this README.
  • Send me a pull request.
Something went wrong with that request. Please try again.