Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'history' capability to the chatbox input #195

Merged
merged 2 commits into from
Mar 7, 2013

Conversation

mjtko
Copy link
Contributor

@mjtko mjtko commented Mar 7, 2013

This PR contains a plugin that gives the chatbox input area 'history' capabilities:

  • alt+up (or ctrl-p) shows previous item, alt+down (or ctrl-n) shows next item
  • escape clears current line
  • 20 items of history retained

Also, this PR reinstates the capability of entering multiline text using alt+enter.

@coveralls
Copy link

Coverage decreased (-0.0%) when pulling b47d9b4 on mjtko:feature/chatbox-history into 022a643 on kandanapp:master.

View Details

@ghost ghost assigned gabceb Mar 7, 2013
@@ -11,7 +11,7 @@ class Kandan.Views.Chatbox extends Backbone.View


postMessageOnEnter: (event)->
if event.keyCode == 13
if event.keyCode == 13 && !(event.metaKey || event.shiftKey || event.altKey || event.ctrlKey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be easier to read if it would be:

if event.keyCode == 13 && !event.metaKey && !event.shiftKey && !event.altKey && !event.ctrlKey

Could you also add some comments on why the key booleans 😌

@coveralls
Copy link

Coverage decreased (-0.0%) when pulling 61f9614 on mjtko:feature/chatbox-history into 022a643 on kandanapp:master.

View Details

gabceb added a commit that referenced this pull request Mar 7, 2013
Add 'history' capability to the chatbox input
@gabceb gabceb merged commit e3479c0 into kandanapp:master Mar 7, 2013
ar7em pushed a commit to ar7em/kandan that referenced this pull request Jun 9, 2013
Add 'history' capability to the chatbox input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants