Advertisement
Fooksie

emjack cc

Mar 26th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var scope=$(document.body).scope();
  2. scope.keypress=function(initial) {
  3.     return function(event) {
  4.         if(event.which===13) {
  5.             var input=event.target.value;
  6.             if(input[0]==="/") {
  7.                 var cmd=input.match(/\/(\w+)/)[1],
  8.                     data=input.match(/\/\w+\s?(.+)?/)[1];
  9.                 if(cmd==="hello") {
  10.                     log("world");
  11.                     }
  12.                 }
  13.             }
  14.         initial.call(scope, event);
  15.         };
  16.     }(scope.keypress);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement