<commit_before># Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

openNewOrganDialog = ->
  $("#modal-wrap").show()
  $("#create-new-organ").fadeIn('fast')

closeNewOrganDialog = ->
  $("#create-new-organ").fadeOut('fast')
  $("#modal-wrap").hide()

index = ->

newOrgan = ->
  openNewOrganDialog()

organ = (id) ->
  window.location = "/fi/organs/#{id}"

$(document).ready ->
  $("select, input:checkbox, input:radio, input:file, input:text, textarea, submit").uniform()

  $("#sidebar a.create-new-organ").click () ->
    router.setRoute '/organ/new'
    return false

  $("#create-new-organ a.close-modal").click () ->
    router.setRoute '/'
    return false

  $("#create-new-organ a.submit").click () ->
    $.post '/fi/organs', $('#create-new-organ').serialize(), (data) ->
      router.setRoute "/organs/#{data._id}"
    return false

  $("#single-organ a.application-call").click () ->
    $("#modal-wrap").show()
    $("#call-for-application").fadeIn('fast')
    return false

  $("#call-for-application a.close-modal").click () ->
    $("#call-for-application").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $("#single-organ .member-card").click () ->
    $("#modal-wrap").show()
    $("#received-application").fadeIn('fast')
    return false

  $("#received-application a.close-modal").click () ->
    $("#received-application").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $("#single-organ a.send-message").click () ->
    $("#modal-wrap").show()
    $("#send-group-message").fadeIn('fast')
    return false

  $("#send-group-message a.close-modal").click () ->
    $("#send-group-message").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $("#single-call a.send-application").click () ->
    $("#modal-wrap").show()
    $("#send-application").fadeIn('fast')
    return false

  $("#send-application a.close-modal").click () ->
    $("#send-application").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $('.tab-content').each ->
    $(this).children(':gt(0)').hide()

  $('.tabs-list li a').click ->
    tab = $(this).parents('.tabs').siblings('.tab-content').children('.tab').eq($(this).parent().index())
    if tab.length > 0
      tab.show().siblings().hide()
      $(this).parent().addClass('active').siblings().removeClass 'active'
      tab.trigger('tabActivated')
    false


  router = Router(
    "" : index
    "/organ/new" :
      on:    newOrgan
      after: closeNewOrganDialog
    "/organs/:organId" : organ
  )
<commit_msg>Removed obsolete client side routing <commit_after># Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

openNewOrganDialog = ->
  $("#modal-wrap").show()
  $("#create-new-organ").fadeIn('fast')

closeNewOrganDialog = ->
  $("#create-new-organ").fadeOut('fast')
  $("#modal-wrap").hide()

index = ->

newOrgan = ->
  openNewOrganDialog()

$(document).ready ->
  $("select, input:checkbox, input:radio, input:file, input:text, textarea, submit").uniform()

  $("#sidebar a.create-new-organ").click () ->
    router.setRoute '/organ/new'
    return false

  $("#create-new-organ a.close-modal").click () ->
    router.setRoute '/'
    return false

  $("#single-organ a.application-call").click () ->
    $("#modal-wrap").show()
    $("#call-for-application").fadeIn('fast')
    return false

  $("#call-for-application a.close-modal").click () ->
    $("#call-for-application").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $("#single-organ .member-card").click () ->
    $("#modal-wrap").show()
    $("#received-application").fadeIn('fast')
    return false

  $("#received-application a.close-modal").click () ->
    $("#received-application").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $("#single-organ a.send-message").click () ->
    $("#modal-wrap").show()
    $("#send-group-message").fadeIn('fast')
    return false

  $("#send-group-message a.close-modal").click () ->
    $("#send-group-message").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $("#single-call a.send-application").click () ->
    $("#modal-wrap").show()
    $("#send-application").fadeIn('fast')
    return false

  $("#send-application a.close-modal").click () ->
    $("#send-application").fadeOut('fast')
    $("#modal-wrap").hide()
    return false

  $('.tab-content').each ->
    $(this).children(':gt(0)').hide()

  $('.tabs-list li a').click ->
    tab = $(this).parents('.tabs').siblings('.tab-content').children('.tab').eq($(this).parent().index())
    if tab.length > 0
      tab.show().siblings().hide()
      $(this).parent().addClass('active').siblings().removeClass 'active'
      tab.trigger('tabActivated')
    false


  router = Router(
    "" : index
    "/organ/new" :
      on:    newOrgan
      after: closeNewOrganDialog
  )

{'fraction_non_alphanumeric': 0.22603802871556072, 'fraction_numerical': 0.0007760962359332557, 'mean_word_length': 3.383503401360544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6186290', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1618, 'n_words': 279}