     @bind 'blinkTitle', (e, state) ->
       unless window.isActive
         if state == 1
-          document.title = "[new!] - #{context.title}";
+          document.title = "[new!] - #{context.title}"
           state = 0
         else
           document.title = context.title

    @bind 'hideLoadingNotification', ->
      $('.loading').hide()

    @bind 'getAndShow', (e, infos) ->
      path = infos.path || context.path
      $.ajax {
        type: "GET"
        , url: path
        , dataType: "html"
        , success: (data) ->
          if data?
            context.trigger 'showContent', {data: data, target: infos.target}
            if infos.hash?
              context.trigger 'moveTo', {hash: infos.hash}
          context.trigger 'hideLoadingNotification'

      }

    @bind 'posts', (e, data) ->
      $('.page-title').html('')
      context.trigger 'addContent', {data: ich.post(post), target: '.page-title'} for post in data.posts

    @bind 'user', (e, data) ->
      context.trigger 'showContent', {data: ich.user(data), target: 'aside'}

    @bind 'getAndShowJson', (e, infos) ->
      path = infos.path || context.path
      $.ajax {
        type: "GET"
        , url: context.path_json
        , dataType: "json"
        , success: (data) ->
          if data?
            context.trigger infos.type, data
            if infos.hash?
              context.trigger 'moveTo', {hash: infos.hash}
          context.trigger 'hideLoadingNotification'

      }

    @bind 'postAndShow', ->
      $.ajax {
        type: "POST",
        url: context.path,
        dataType: "html",
        data: $.param(context.params.toHash()),
        success: (msg) ->
          context.trigger 'showContent', {data: msg, target: "#contents"}
      }

    @bind 'postAndReplace', ->
      target = "##{context.params['post_id']} .bubble"
      $.ajax {
        type: "POST",
        url: context.path,
        dataType: "html",
        data: $.param(context.params.toHash()),
        success: (msg) ->
          context.trigger 'replaceContent', {data: msg, target: target}
          context.trigger 'hideLoadingNotification'
      }

    @bind 'emptyAside', ->
      $('aside').html('')

    @bind 'postAndAdd', (e, infos) ->
      $.ajax {
        type: "POST",
        url: context.path,
        dataType: "html",
        data: $.param(context.params.toHash()),
        success: (msg) ->
          context.trigger 'addContent', {data: msg, target: infos.target}
          context.trigger 'moveTo', {hash: infos.hash || infos.target}
          context.trigger 'hideLoadingNotification'
      }

    @bind 'getAndReplace', (e, infos) ->
      target = "##{context.params['post_id']} .bubble"
      $.ajax {
        type: "GET"
        , url: context.path
        , dataType: "html"
        , success: (data) ->
          if data?
            context.trigger 'replaceContent', {data: data, target: target}
            context.trigger 'hideLoadingNotification'
      }


    @bind 'showPost', (e, data) ->
      $.ajax {
        type: "GET"
        , url: data.path
        , dataType: "html"
        , success: (data) ->
          if data?
            $(data).hide().appendTo("#posts").show('slow')
            context.trigger 'notify'

      }

    @bind 'deletePost', ->
      target = "##{context.params['post_id']} .bubble"
      $.ajax {
        type: "DELETE",
        url: context.path,
        data: $.param(context.params.toHash()),
        dataType: "html",
        success: (data) ->
          context.trigger 'replaceContent', {data: data, target: target}
          $("#edit_post_#{context.params['post_id']}").remove()
          context.trigger 'hideLoadingNotification'
      }

    @bind 'deleteMember', (e, infos) ->
      $.ajax {
        type: "DELETE",
        url: context.path,
        data: $.param(context.params.toHash()),
        dataType: "html",
        success: (data) ->
          context.trigger 'addContent', {data: data, target: infos.target}
          context.trigger 'hideLoadingNotification'
      }

    @bind 'showContent', (e, data) ->
      $(data.target).show().html data.data
      @trigger 'updateTitle'

    @bind 'addContent', (e, data) ->
      id = data.target || "#contents"
      $(id).append(data.data)

    @bind 'replaceContent', (e, data) ->
      $(data.target).html(data.data)

    @bind 'updateTitle', ->
      title = $('.page-title').attr 'title'
      $("#page-title").html title

    @bind 'topicId', ->
      current_user.topic_id = @params['id']

  $(->
    #app.run()
  )
