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 @@
-
+
@@ -36,15 +34,15 @@
-
- +
+
-
+
-
+

Inventory

@@ -57,87 +55,25 @@
-
+
-
- +
+
-
+
-
- {{#if _loggedIn}} - - {{/}} +
+
- -
-
-
- - - -
-
-
-

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. -
-
-
-
-
- -
Whilst resting your dailies are saved and aren't effected by day turn-over. Whether you check out tomorrow or in a weeks time you'll continue in the same state as when you checked in.
- - - -
-
-

Tavern Talk & LFG

-
- -
-
-
- -
-
-
- -
    - {#each _habitRPG.chat as :message} - - {/} -
-
-
- diff --git a/views/app/groups.html b/views/app/groups.html index 7c7880fa6f..300d3c7c2f 100644 --- a/views/app/groups.html +++ b/views/app/groups.html @@ -1,11 +1,87 @@ - - {#if _party.members} -
-
-

{{_party.name}}

+ + + +
+
+ {#if _party.id} + + {else if _user.party.invitation} + +

You're Invited To {_party.name}

+ Accept + Reject + {else} +

Create A Party

+ +

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}
+
+ {#if _partyError} +
{_partyError}
+ {/} +
+ + +
+
+ {/} +
+ +
+ + + {#each _guilds as :guild} +
+ +
+ {/} +
+
+ + +
+
+ {{#if equal(@group.id,'habitrpg')}} +
+ + + +
+
+
+

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. +
+
+
+
+
+
Whilst resting your dailies are saved and aren't effected by day turn-over. Whether you check out tomorrow or in a weeks time you'll continue in the same state as when you checked in.
+ + + {{else}} +

{{@group.name}}

- {{#each _party.members as :memberId}} - + {{#each @group.members as :memberId}} + {{/}}
{{username(_party[:memberId].auth, _party[:memberId].profile.name)}}({{:memberId}})
{{username(_members[:memberId].auth, _members[:memberId].profile.name)}}({{:memberId}})
@@ -18,44 +94,45 @@
Leave -
-
-

Chat

-
-
- -
-
    - {#each _party.chat as :message} - - {/} -
-
+ {{/}} +
+
- {else if _user.party.invitation} - -

You're Invited To {_party.name}

- Accept - Reject + {{#if equal(@group.id,'habitrpg')}} +

Tavern Talk & LFG

+
+ +
+ +
+
+ {{else}} +

Chat

+ + {{/}} - {else} -

Create A Party

- -

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}
-
- {#if _partyError} -
{_partyError}
- {/} -
- - -
-
- - {/} +
    + {#each @group.chat as :message} + + {/} +
+
+
+ + {{#with @group as :group}} +
+
+ +
+ {{/}}