<commit_before>Rails.register_init ['check_lists\\new'
                     'confirmations\\edit'
                     'confirmations\\update'
                     'convocations\\new'
                     'fireman_trainings\\new'
                     'firemen\\new'
                     'items\\new'
                     'intervention_roles\\new'
                     'password_resets\\new'
                     'password_resets\\create'
                     'trainings\\new'
                     'uniforms\\new'
                     'user_sessions\\new'
                     'user_sessions\\create'
                     'users\\new'
                     'vehicles\\new'], () -> focus_first_visible_field()

# Account
#######################################################
window.account = () ->
  $('#account_update_owner').submit ->
      return confirm('Etes-vous sur ?')

Rails.register_init ['accounts\\edit'], () -> account()

# Confirmation
#######################################################
window.user_password_strength = () ->
  $('#user_password').pstrength()

Rails.register_init ['confirmations\\edit'], () -> user_password_strength()

# Convocations
#######################################################
window.convocations = () ->
  $('.change_status').click ->
    parts = $(this).attr('id').split('_')
    $('.status_'+parts[2]).attr('checked',!$('.status_'+parts[2]).attr('checked'))

  $.datepicker.setDefaults($.datepicker.regional['fr'])
  $.timepicker.setDefaults($.timepicker.regional['fr'])
  $('.date').datetimepicker(
                              showMonthAfterYear: false
                              changeYear:         true
                              changeMonth:        true
                              dateFormat:         'dd/mm/yy'
                              constrainInput:     true
                              minDate:            '+0'
                              maxDate:            '+1y'
                              duration:           ''
                              showTime:           true
                              stepMinute:         5 )

Rails.register_init ['convocations\\new'
                     'convocations\\create'
                     'convocations\\edit'
                     'convocations\\update'], () -> convocations()

# Convocation_firemen
#######################################################

window.convocation_firemen = () ->
  $('.clickable').click ->
    checkbox = $(this).parent().find(':checkbox')
    checkbox.attr('checked', !checkbox.attr('checked'))

Rails.register_init ['convocation_firemen\\edit_all'], () -> convocation_firemen()

# Firemen
#######################################################
window.jsp = () ->
  $('#fireman_status').change ->
    if parseInt($(this).val()) == 1
      $('#accordion').accordion({ active: 5 });
    else
      $('#accordion').accordion({ active: 4 });

Rails.register_init ['firemen\\new'], () -> jsp()

window.firemen = () ->
  $('#fireman_tag_list').tagit(
    availableTags: tags
    removeConfirmation: true
    allowSpaces: true
    singleField: true
  )

  $.datepicker.setDefaults($.datepicker.regional['fr'])
  $('.date').datepicker(
                        showMonthAfterYear: false
                        showButtonPanel:    true
                        changeYear:         true
                        changeMonth:        true
                        dateFormat:         'dd/mm/yy'
                        constrainInput:     true
                        maxDate:            '+0' )
  $('.date-no-limit').datepicker(
                        showMonthAfterYear: false
                        showButtonPanel:    true
                        changeYear:         true
                        changeMonth:        true
                        dateFormat:         'dd/mm/yy'
                        constrainInput:     true )

  $("#accordion").accordion(
                        heightStyle: "content"
                        active: active_accordion )

Rails.register_init ['firemen\\new'
                     'firemen\\create'
                     'firemen\\edit'
                     'firemen\\update'], () -> firemen()

window.fireman_availabilities = () ->
  $('#calendar').fullCalendar({
    header: {
      left: ''
      right: 'prev, next today'
      center: 'title'
    }
    defaultView: 'agendaWeek'
    allowCalEventOverlap: false
    allDaySlot: false
    slotDuration: '00:60:00'
    timeFormat: ''
    contentHeight: 475
    eventStartEditable: false
    eventDurationEditable: false
    firstDay: 1
    editable: true
    timezone: "Europe/Paris"
    columnFormat: {
      agendaWeek: 'ddd DD/MM/YY'
    }
    events: {
      url: '/firemen/' + fireman_id + '/fireman_availabilities',
    }
    dayClick : (date, jsEvent, view) -><commit_msg>Fix planning title column format.<commit_after>Rails.register_init ['check_lists\\new'
                     'confirmations\\edit'
                     'confirmations\\update'
                     'convocations\\new'
                     'fireman_trainings\\new'
                     'firemen\\new'
                     'items\\new'
                     'intervention_roles\\new'
                     'password_resets\\new'
                     'password_resets\\create'
                     'trainings\\new'
                     'uniforms\\new'
                     'user_sessions\\new'
                     'user_sessions\\create'
                     'users\\new'
                     'vehicles\\new'], () -> focus_first_visible_field()

# Account
#######################################################
window.account = () ->
  $('#account_update_owner').submit ->
      return confirm('Etes-vous sur ?')

Rails.register_init ['accounts\\edit'], () -> account()

# Confirmation
#######################################################
window.user_password_strength = () ->
  $('#user_password').pstrength()

Rails.register_init ['confirmations\\edit'], () -> user_password_strength()

# Convocations
#######################################################
window.convocations = () ->
  $('.change_status').click ->
    parts = $(this).attr('id').split('_')
    $('.status_'+parts[2]).attr('checked',!$('.status_'+parts[2]).attr('checked'))

  $.datepicker.setDefaults($.datepicker.regional['fr'])
  $.timepicker.setDefaults($.timepicker.regional['fr'])
  $('.date').datetimepicker(
                              showMonthAfterYear: false
                              changeYear:         true
                              changeMonth:        true
                              dateFormat:         'dd/mm/yy'
                              constrainInput:     true
                              minDate:            '+0'
                              maxDate:            '+1y'
                              duration:           ''
                              showTime:           true
                              stepMinute:         5 )

Rails.register_init ['convocations\\new'
                     'convocations\\create'
                     'convocations\\edit'
                     'convocations\\update'], () -> convocations()

# Convocation_firemen
#######################################################

window.convocation_firemen = () ->
  $('.clickable').click ->
    checkbox = $(this).parent().find(':checkbox')
    checkbox.attr('checked', !checkbox.attr('checked'))

Rails.register_init ['convocation_firemen\\edit_all'], () -> convocation_firemen()

# Firemen
#######################################################
window.jsp = () ->
  $('#fireman_status').change ->
    if parseInt($(this).val()) == 1
      $('#accordion').accordion({ active: 5 });
    else
      $('#accordion').accordion({ active: 4 });

Rails.register_init ['firemen\\new'], () -> jsp()

window.firemen = () ->
  $('#fireman_tag_list').tagit(
    availableTags: tags
    removeConfirmation: true
    allowSpaces: true
    singleField: true
  )

  $.datepicker.setDefaults($.datepicker.regional['fr'])
  $('.date').datepicker(
                        showMonthAfterYear: false
                        showButtonPanel:    true
                        changeYear:         true
                        changeMonth:        true
                        dateFormat:         'dd/mm/yy'
                        constrainInput:     true
                        maxDate:            '+0' )
  $('.date-no-limit').datepicker(
                        showMonthAfterYear: false
                        showButtonPanel:    true
                        changeYear:         true
                        changeMonth:        true
                        dateFormat:         'dd/mm/yy'
                        constrainInput:     true )

  $("#accordion").accordion(
                        heightStyle: "content"
                        active: active_accordion )

Rails.register_init ['firemen\\new'
                     'firemen\\create'
                     'firemen\\edit'
                     'firemen\\update'], () -> firemen()

window.fireman_availabilities = () ->
  $('#calendar').fullCalendar({
    header: {
      left: ''
      right: 'prev, next today'
      center: 'title'
    }
    defaultView: 'agendaWeek'
    allowCalEventOverlap: false
    allDaySlot: false
    slotDuration: '00:60:00'
    timeFormat: ''
    contentHeight: 475
    eventStartEditable: false
    eventDurationEditable: false
    firstDay: 1
    editable: true
    timezone: "Europe/Paris"
    events: {
      url: '/firemen/' + fireman_id + '/fireman_availabilities',
    }
    dayClick : (date, jsEvent, view) ->
{'fraction_non_alphanumeric': 0.18158087083637883, 'fraction_numerical': 0.003967839615746058, 'mean_word_length': 1.58585313174946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '662021', 'n_tokens_mistral': 2519, 'n_tokens_neox': 2354, 'n_words': 374}