anchor.diff:    if window.webkitNotifications.checkPermission() > 0
       requestPermission()
   
  -  icon = "<%= image_path "yammi_banana.png" %>"
  +  icon  = "<%= image_path "yammi_banana.png" %>"
     title = "New Message"
  -  body = msg
  +  body  = msg
     popup = window.webkitNotifications.createNotification icon,title,body
     popup.show()
  -  setTimeout( () ->
  +  setTimeout( ->
       popup.cancel()
  -  ,3000)
  +  , 3000)
     return true
   
   $(document).ready ->
  
positive.code:     somethingNew()
    )
  
  sendMessage = () ->
    chatroom_id = $("#chatroom-id").html()
    url = "/chatrooms/" + chatroom_id + "/msgs.js"
    params = $("#new_msg").serialize()
    $.post(url,params,() ->
      $("#msg_message").val("")
      updateChatroom()
    )
  
  emptyFunction = () ->
    return
  
  requestPermission = (callback = emptyFunction) ->
    window.webkitNotifications.requestPermission callback
  
  notify = (msg) ->
    if !window.webkitNotifications
      console.log 'Desktop notifications are only supported by Webkit at this time.'
  
negative.code:   )
    document.title = "Chat"
  
  updateChatroom = ->
    chatroom_id = $("#chatroom-id").html()
    msg_id      = $("#last-msg-id").html()
    user_email  = $("#current-user").html()
    url         = "/msgs/fetch.json?msg_id=#{msg_id}&chatroom_id=#{chatroom_id}"
    $.getJSON(url, (data) ->
      items = []
      last = msg_id
      $.each(data, (key, val) ->
        email = "<span class='who'>#{who(val)}:</span>"
        time  = "<dd class='when'><abbr class='timeago' title='#{val.created_at_in_iso}'>#{val.created_at_in_local}</abbr></dd>"
        m     = "<dl class='latest msg'><dt class='what'>#{email}<span class='notify'>#{val.message}</span></dt>#{time}</dl>"
        html  = "<div class=#{whose(user_email, val)}>#{m}</div>"
        items.push html
        last  = val.id if val.id > last
      )
      $("#messages-list").prepend items.join("")
      $("#last-msg-id").html last
  