Commit 120a3e11 authored by Rafael Masoni's avatar Rafael Masoni
Browse files

Many chat improvements and bug fixes

parent 6b33afd7
......@@ -40,7 +40,7 @@ $ ->
return value[1]
else
return ''
$.fn.commandTrigger = ->
messageStack.push $(this).val()
messageCursor = messageStack.length
......@@ -50,7 +50,7 @@ $ ->
if $.inArray(command, commandList) isnt -1
if command is '/npc'
npc = $(this).getNpc()
$(this).val(command + ' ' + npc + ' ')
$(this).val(command + ' ' + npc + ' ')
else
$(this).val(command + ' ')
if commandHistory[0] isnt command
......
......@@ -27,7 +27,7 @@ em
font-style: italic
code
font-family: monospace
font-family: Menlo, Lucida Console, monospace
// Navigation
......@@ -170,14 +170,14 @@ aside
img
@include box-shadow(0 0 0 2px #fff)
.name,
.char
.login,
.nick
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
width: 240px
.char
.nick
font-size: .9em
@include opacity(.6)
......
......@@ -38,7 +38,7 @@
.scope:before
content: "["
.name
.nick
&:after
content: ":"
......@@ -74,7 +74,7 @@
&.me
color: rgba(#000, .3)
.name:after
.nick:after
content: ""
&.tell
......@@ -92,13 +92,13 @@
padding: .05em .5em
@include border-radius(.5em)
.name:after
.nick:after
content: ""
&.system
color: #36a
.name:after
.nick:after
content: ""
form
......
.login
.signin
background: #{inline_image("lightpaperfibers.png")}
height: 300px
left: 50%
......@@ -14,7 +14,7 @@
img
margin-bottom: 5em
.signin
.twitter-auth
display: inline-block
background-color: #6de
border: none
......
......@@ -30,20 +30,18 @@ class Message
self['login'] = user.login
self['nick'] = user.nick
self['classes'] = [ 'system' ]
self['body'] = "#{user.nick} (#{user.login}) now is #{$2}"
self['body'] = "(#{user.login}) now is #{$2}"
user.update_attributes nick: $2
when %r[/(say|me) (.*)]i
self['login'] = user.login
self['nick'] = user.nick
self['classes'] = [ $1 ]
self['body'] = $2
when %r[/(ooc) (.*)]i
self['login'] = user.login
self['nick'] = user.nick
self['classes'] = [ $1 ]
self['scope'] = 'ooc'
self['body'] = $2
self['scope'] = 'OOC'
self['body'] = "#{user.login}: #{$2}"
when %r[/(npc) ([^:]*): *(.*)$]i
self['classes'] = [ $1 ]
self['scope'] = 'NPC'
......@@ -56,13 +54,12 @@ class Message
dices = Dice.roll($1, $2)
self['classes'] = 'dice'
self['scope'] = 'Dice'
self['body'] = "#{user.nick} (#{user.login}) rolls #{$1}d#{$2}: #{dices.join(' + ')} = **#{dices.inject {|s,d| s + d }}**"
self['body'] = "#{user.login} rolls #{$1}d#{$2}: #{dices.join(' + ')} = **#{dices.inject {|s,d| s + d }}**"
else
self['login'] = user.login
self['nick'] = user.nick
self['classes'] = [ 'ooc' ]
self['scope'] = 'OOC'
self['body'] = plain
self['body'] = "#{user.login}: #{plain}"
end
end
......
......@@ -3,7 +3,8 @@
.content
.line.system.first
Welcome to RailsPG!
:markdown
Welcome to RailsPG! Set up a nickname with `/nick Nickname`.
= form_for Message.new do |form|
%fieldset
......
.login
.signin
= image_tag 'logo.png', alt: 'RailsPG', width: '350px'
%br
......@@ -6,4 +6,4 @@
- if flash.alert
.warning= flash.alert
= link_to 'Sign in with Twitter', '/auth/twitter', class: "signin"
= link_to 'Sign in with Twitter', '/auth/twitter', class: "twitter-auth"
- @users.each do |user|
%li{ class: classes_for(user) }
= image_tag "user.png", alt: ""
.name= user.login
.char= user.nick
.login= user.login
.nick= user.nick
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment