Skip to content

Instantly share code, notes, and snippets.

@GMMan
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GMMan/43a8f1c4ca92aca7184e to your computer and use it in GitHub Desktop.
Save GMMan/43a8f1c4ca92aca7184e to your computer and use it in GitHub Desktop.
Fun with JQuery on Groupees
$.getScript('https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.min.js', function()
{
Mousetrap.stopCallback = function() { return false; };
Mousetrap.bind('alt+1', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(0); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+2', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(1); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+3', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(2); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+4', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(3); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+5', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(4); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+6', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(5); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+7', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(6); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+8', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(7); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+9', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(8); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
Mousetrap.bind('alt+0', function() { var el = chatBoxer.el.children('span.tab[data-chat-id]').eq(9); if (el) { el.children().eq(1).click(); el.next().find('input[type=text]').focus(); } });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment