Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var scope=$(document.body).scope();
- scope.keypress=function(initial) {
- return function(event) {
- if(event.which===13) {
- var input=event.target.value;
- if(input[0]==="/") {
- var cmd=input.match(/\/(\w+)/)[1],
- data=input.match(/\/\w+\s?(.+)?/)[1];
- if(cmd==="hello") {
- log("world");
- }
- }
- }
- initial.call(scope, event);
- };
- }(scope.keypress);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement