Sha256: 3265c181d73d547677a294c3beaa33543a8dc13342c5b21dceaf337fd3eba584

Contents?: true

Size: 1.24 KB

Versions: 14

Compression:

Stored size: 1.24 KB

Contents

class window.Locator
  constructor: ->
    @to_locale = $('#edit_locale_name').val()
    @from_locale = $('#main_locale_name').val()
    @initHandlers()

  initHandlers: ->
    self = this

    $('#show_all').click ->
      $('#locale_data tr').show()

    $('#show_incomplete').click ->
      $('#locale_data tr').hide()
      $('#locale_data tr.error').show()

    $('#show_complete').click ->
      $('#locale_data tr').hide()
      $('#locale_data tr.ready').show()

    $('#translate_incomplete').click ->
      empty_areas = _.filter $("#locale_data tr textarea:enabled"), (el) ->
        not $.trim($(el).val())
      for el in empty_areas
        $(el).closest('tr').find('.auto_translate').trigger('click')

    $('#locale_data .auto_translate').click (e) ->
      e.preventDefault()
      $cont = $(this).closest('tr')
      $input_to = $cont.find('textarea:enabled')
      $input_from = $cont.find('textarea:disabled')
      window.google_t($input_from.val(), $input_to, self.from_locale, self.to_locale)

    $('.filter_field').change ->
      $el = $(this)
      ind = $el.closest('th').index() + 1
      text = $el.val().replace(/'/, '\'')
      $('#locale_data tr').hide()
      $("#locale_data td:nth-child(#{ind}):contains('#{text}')").parent().show()

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ab_admin-0.3.6 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.3.5 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.3.4 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.3.3 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.3.2 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.3.1 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.3.0 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.2.3 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.2.2 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.2.1 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.2.0 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.1.2 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.1.1 app/assets/javascripts/ab_admin/components/locator.js.coffee
ab_admin-0.1.0 app/assets/javascripts/ab_admin/components/locator.js.coffee