forked from sdslabs/jinora
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List of changes are: * Redesign of front end * Implementation of announcement system * Fixing bug which could cause the app to break when specific data is sent to it by the client * Changed avatars The rest below are the squashed commits Excluded bots from online list, refactored code -Included a check for is_bot attribute of a user object. -Refactored announcement.coffee to make it more 'coffee like'. Removed import of italic Roboto font Changed font style from italic to normal in <a> tags, which are not used anywhere except possibly in announcement. This will improve page loading time.
- Loading branch information
Showing
27 changed files
with
353 additions
and
783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
# ioObject is the express().http().io().io object for communicating with clients | ||
module.exports = (ioObject, slackObject) -> | ||
io = ioObject | ||
slack = slackObject | ||
announcement = | ||
text: "" | ||
|
||
helpText = "*Usage:*\n\t!" + | ||
"ban nick <nick> _to ban a nick._\n\t" + | ||
"!ban user <nick> _to ban the user session corresponding to given nick._\n\t" + | ||
"!unban nick <nick>\n\t!unban user <nick>\n\t" + | ||
"!announcement _to see the current announcement._\n\t" + | ||
"!announce <announcement> _to change announcement._\n\t" + | ||
"!announce - _to remove announcement._\n\t" + | ||
"!help _to show this message._" | ||
|
||
io.route 'announcement:demand', (req)-> | ||
req.io.emit 'announcement:data', announcement | ||
|
||
showHelp : -> | ||
slack.postMessage helpText, process.env.SLACK_CHANNEL, "Jinora" | ||
|
||
interpret : (message, adminNick) -> | ||
index = message.indexOf(" ") | ||
command = message.substr(0, index) | ||
content = message.substr(index + 1) | ||
if index == -1 | ||
command = message | ||
content = "" | ||
command = command.toLowerCase() | ||
|
||
if command == "announcement" | ||
text = "Current announcement is:\n#{announcement.text}" | ||
slack.postMessage text, process.env.SLACK_CHANNEL, "Jinora" | ||
|
||
if command == "announce" | ||
if content == "" | ||
slack.postMessage helpText, process.env.SLACK_CHANNEL, "Jinora" | ||
return | ||
announcement['text'] = content | ||
io.broadcast 'announcement:data',announcement | ||
text = "*#{adminNick}* changed announcement to:\n#{announcement.text}" | ||
slack.postMessage text, process.env.SLACK_CHANNEL, "Jinora" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.