From 777808182320e0584a38e2ae9fdfb6e8e7d99973 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sat, 15 Oct 2016 20:59:27 +0100 Subject: Move set topic and join channel functions to commands.js --- commands.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 commands.js (limited to 'commands.js') diff --git a/commands.js b/commands.js new file mode 100644 index 0000000..b8f53f5 --- /dev/null +++ b/commands.js @@ -0,0 +1,34 @@ +var client + +module.exports.init = function(myClient) { + client = myClient +} + +module.exports.setTopic = function(channel, topic) { + client.raw("TOPIC", channel, topic); +} + +module.exports.joinChannel = function (channel, sendJoin) { + + var channelObj = client.channel(channel); + if (sendJoin) { + channelObj.join(); + channelObj.say("beep"); + } + chanId = $(".active.chat").attr("data-id") + + $(".active").removeClass("active"); + + $(".ui.menu").append(""+channel+""); + $("#chan-container").append("
"); + + var chanTab = $("[data-tab='"+ channel +"'].tab"); + + chanTab.append("
"); + chanTab.append("
"); + chanTab.append("
"); + + $('.menu .item').tab({history:false}); + + numChans++; +} -- cgit v1.2.3