Skip to content

Commit

Permalink
JS bugfixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 19, 2008
1 parent b12f7d7 commit 438344b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ User = {
add: function(id, name) {
if (!User.el(id).length) {
user = $('<li/>').attr('id', "user" + id).html('<p>' + name + '</p>')
user.appendTo('#users').hide().show(500)
.appendTo('#users').click(Preved.toUser).hide().show(500)
}
},
remove: function(id) {
Expand Down Expand Up @@ -125,6 +125,9 @@ Style = {
Style.rules[name] = rule
rule('init')
},
remove: function(name) {
delete Style.rules[name]
},
rules: {
messages: function(caller) {
$('#messages').css('height',
Expand All @@ -148,6 +151,10 @@ Style = {
Preved = {
me: $.cookie('user'),
lastTheme: null,
toUser: function() {
$('#new textarea').val($(this).text() + ': ' + $('#new textarea').val())
.focus()
},
muted: function() {
if ($.cookie('muted')) {
Preved.mute()
Expand Down Expand Up @@ -201,7 +208,7 @@ Preved = {
server: {
receive: function(data) {
if ('connect' != data.command && data.user) {
if (0 == User.el(data.user).length) {
if (!User.el(data.user).length) {
if (console) console.log(
'Event from nobody (' + params.user + ')', params)
return
Expand Down Expand Up @@ -339,10 +346,7 @@ $(document).ready(function() {
$('#new textarea').focus()
}).focus()
})
$('#users li:not(.me) p').click(function() {
$('#new textarea').val($(this).text() + ': ' + $('#new textarea').val())
.focus()
})
$('#users li:not(.me) p').click(Preved.toUser)

$('<div />').attr('id', 'sound').appendTo('body')
swfobject.embedSWF('/sounds/player.swf', 'sound',
Expand Down
2 changes: 1 addition & 1 deletion public/themes/road/on.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready(function() {
$('body').css('background', '#7ca2ab url(/themes/road/background.jpg) no-repeat 0 100%')
Style.add('full body', function() {
$('body').css('height', $(window).height())
$('body').css('height', $(document).height())
})
})

0 comments on commit 438344b

Please sign in to comment.