diff --git a/src/app/party.coffee b/src/app/party.coffee index 7205c55569..05fd657967 100644 --- a/src/app/party.coffee +++ b/src/app/party.coffee @@ -84,12 +84,17 @@ module.exports.app = (appExports, model, app) -> Chat Functionality ### - sendChat = (path, input) -> - chat = model.at path - text = model.get input + model.on 'unshift', '_party.chat', -> $('.chat-message').tooltip() + model.on 'unshift', '_habitrpg.chat', -> $('.chat-message').tooltip() + + appExports.sendChat = (e,el) -> + text = model.get '_chatMessage' # Check for non-whitespace characters return unless /\S/.test text - model.set(input, '') + + group = e.at() + chat = group.at('chat') + model.set('_chatMessage', '') message = id: model.id() @@ -114,24 +119,12 @@ module.exports.app = (appExports, model, app) -> chat.set messages else chat.remove(200) + type = $(el).attr('data-type') + model.set '_user.party.lastMessageSeen', chat.get()[0].id if group.get('type') is 'party' - model.on 'unshift', '_party.chat', -> $('.chat-message').tooltip() - model.on 'unshift', '_habitrpg.chat', -> $('.chat-message').tooltip() - - appExports.partySendChat = -> - sendChat('_party.chat', '_chatMessage') - model.set '_user.party.lastMessageSeen', model.get('_party.chat')[0].id - - appExports.tavernSendChat = -> - sendChat('_habitRPG.chat', '_tavernMessage') - - appExports.partyMessageKeyup = (e, el, next) -> + appExports.chatKeyup = (e, el, next) -> return next() unless e.keyCode is 13 - appExports.partySendChat() - - appExports.tavernMessageKeyup = (e, el, next) -> - return next() unless e.keyCode is 13 - appExports.tavernSendChat() + appExports.sendChat(e, el) appExports.deleteChatMessage = (e) -> if confirm("Delete chat message?") is true diff --git a/views/app/game-pane.html b/views/app/game-pane.html index b7c1ff4036..d96f1ca136 100644 --- a/views/app/game-pane.html +++ b/views/app/game-pane.html @@ -6,23 +6,21 @@
| - |
-
-
-
- Daniel Johansson-
- Welcome to the Tavern! I'm Daniel, the bar keep. If you want to rest a while (going on vacation? sudden illness?), I'll set you up at the inn - dailies won't hurt you while you're resting. Stay a while & meet the locals.
-
-
- |
-
You are not in a party. You can either create one and invite friends, or if you want to join an existing party, have them enter:
+{_user.id}
+
+ {/}
+ | + |
+
+
+
+ Daniel Johansson+
+ Welcome to the Tavern! I'm Daniel, the bar keep. If you want to rest a while (going on vacation? sudden illness?), I'll set you up at the inn - dailies won't hurt you while you're resting. Stay a while & meet the locals.
+
+
+ |
+
| {{username(_party[:memberId].auth, _party[:memberId].profile.name)}} | ({{:memberId}}) |
| {{username(_members[:memberId].auth, _members[:memberId].profile.name)}} | ({{:memberId}}) |
You are not in a party. You can either create one and invite friends, or if you want to join an existing party, have them enter:
-{_user.id}
-
-
- {/}
+