From f3f38586638d28443dad196f876b594030d7be46 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Mon, 30 Jun 2014 03:20:54 +0200 Subject: [PATCH] Render chat --- Gruntfile.js | 6 +- client/components/jquery/tabcomplete.js | 256 ++++++++++++++++++++++++ client/css/style.css | 49 +++-- client/index.html | 93 +++------ client/js/chat.js | 200 ++++++++++++++++++ client/js/components.min.js | 2 +- client/js/shout.js | 116 ----------- lib/models/chan.js | 2 +- lib/plugins/irc-events/errors.js | 3 +- lib/plugins/irc-events/join.js | 3 +- lib/plugins/irc-events/mode.js | 1 + lib/plugins/irc-events/motd.js | 25 ++- lib/plugins/irc-events/nick.js | 1 - lib/plugins/irc-events/notice.js | 4 +- lib/plugins/irc-events/welcome.js | 1 - lib/plugins/irc-events/whois.js | 2 +- lib/shout.js | 34 +++- 17 files changed, 579 insertions(+), 219 deletions(-) create mode 100644 client/components/jquery/tabcomplete.js create mode 100644 client/js/chat.js delete mode 100644 client/js/shout.js diff --git a/Gruntfile.js b/Gruntfile.js index 828da36..9560f52 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,5 @@ module.exports = function(grunt) { + var components = ""; var files = [ "./lib/**/*.js", "./client/js/shout.js" @@ -14,7 +15,10 @@ module.exports = function(grunt) { uglify: { js: { files: { - "client/js/components.min.js": ["client/components/*.js"] + "client/js/components.min.js": [ + "client/components/*.js", + "client/components/jquery/*.js" + ] } } } diff --git a/client/components/jquery/tabcomplete.js b/client/components/jquery/tabcomplete.js new file mode 100644 index 0000000..af03b9d --- /dev/null +++ b/client/components/jquery/tabcomplete.js @@ -0,0 +1,256 @@ +/*! + * tabcomplete + * http://github.com/erming/tabcomplete + * v1.3.1 + */ +(function($) { + var keys = { + backspace: 8, + tab: 9, + up: 38, + down: 40 + }; + + $.tabcomplete = {}; + $.tabcomplete.defaultOptions = { + after: "", + arrowKeys: false, + caseSensitive: false, + hint: "placeholder", + minLength: 1 + }; + + $.fn.tab = // Alias + $.fn.tabcomplete = function(args, options) { + if (this.length > 1) { + return this.each(function() { + $(this).tabcomplete(args, options); + }); + } + + // Only enable the plugin on and