Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:railsrumble/gobrain
Browse files Browse the repository at this point in the history
  • Loading branch information
brainopia committed Oct 19, 2008
2 parents 0d1c071 + 96919d1 commit a825359
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/controllers/rooms_controller.rb
Expand Up @@ -28,7 +28,7 @@ def create
end

def update
if params[:user]
if params[:name]
user
elsif params[:theme]
theme
Expand Down
1 change: 0 additions & 1 deletion app/views/rooms/show.html.haml
Expand Up @@ -34,7 +34,6 @@
- if @user.id == user.id
%li{ :id => "user#{user.id}", :class => 'me' + (@new_user ? ' new' : '') }
%input{ :type => 'button', :value => 'Rename me', :class => 'rename' }
%span{ :title => 'Me' } ☺
%p= user.name
- else
%li{ :id => "user#{user.id}" }
Expand Down
Binary file added public/images/smile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions public/javascripts/application.js
Expand Up @@ -316,19 +316,23 @@ $(document).ready(function() {
$('#users .rename').hide()
})
$('#users li .rename').click(function() {
$(this).hide()
$(this).nextAll('p, span').hide()
$('<input type="text" />').addClass('renamer').appendTo($(this).parent())
.val($(this).nextAll('p').text())
var el = $(this)
el.parent().addClass('renamed')
el.hide()
el.nextAll('p').hide()
$('<input type="text" />').addClass('renamer').appendTo(el.parent())
.val(el.nextAll('p').text())
.keyup(function(e) {
if (13 == e.keyCode || 3 == e.keyCode) {
$(this).blur()
}
})
.blur(function() {
Preved.user($(this).val())
$(this).prevAll('p, span').show()
$(this).remove()
var el = $(this)
el.parent().removeClass('renamed')
Preved.user(el.val())
el.prevAll('p').show()
el.remove()
$('#new textarea').focus()
}).focus()
})
Expand Down
20 changes: 15 additions & 5 deletions public/stylesheets/application.css
Expand Up @@ -93,27 +93,28 @@ li {
#settings {
background: black;
color: white;
padding: 4px 7px 4px 0.7em;
padding: 0 7px 0 0.7em;
margin-bottom: 1px;
text-align: right;
height: 3.5ex;
line-height: 3.5ex;
}
#settings a {
float: left;
display: block;
width: 20px;
height: 100%;
height: 3.5ex;
overflow: hidden;
text-decoration: none;
margin-top: 2px;
}
#settings a span {
visibility: hidden;
}
#settings a.muted {
background: url(../images/muted.png) no-repeat 0 100%;
background: url(../images/muted.png) no-repeat 0 50%;
}
#settings a.sounds {
background: url(../images/sounds.png) no-repeat 0 100%;
background: url(../images/sounds.png) no-repeat 0 50%;
}
#about {
padding: 5px;
Expand Down Expand Up @@ -146,10 +147,19 @@ li {
float: right;
margin-top: -1px;
font-size: 150%;
display: none;
}
#users li p {
cursor: pointer;
}
#users li.me p {
cursor: default;
}
#users li.me {
background: black url(/images/smile.png) no-repeat 10.5em 0.5ex;
padding-right: 1.5em;
}
#users li.me.renamed {
background-image: none;
padding-right: 5px;
}

0 comments on commit a825359

Please sign in to comment.