Sha256: da6f0796f6b9cca403b70713c7be6ea50759a1115908f828737b706baa828e2c
Contents?: true
Size: 971 Bytes
Versions: 1
Compression:
Stored size: 971 Bytes
Contents
$ -> $menu = $('#iam-menu') linkTemplate = $menu.attr 'href' inputMode = false input = '' iamNotice = (notice) -> $notice = $("<div class='iam-notice'>#{notice}</div>") $('body').append $notice $notice.fadeIn(200).delay(1000).fadeOut 600 log_in_by_link = (link) -> $.post link, (data) -> $menu.hide() iamNotice data.notice log_in_by_input = -> if inputMode if input.match(/^\d+$/) link = linkTemplate.replace(/ID/, input) log_in_by_link link else iamNotice "#{input} is invalid id." input = '' $menu.on 'click', 'td', -> $tr = $(@).parents 'tr' link = $tr.attr 'href' if link log_in_by_link link inputMode = false input = '' $(document).on 'keypress', (e) -> if e.keyCode == 96 || e.keyCode == 1105 # '`' || 'ё' log_in_by_input() inputMode = !inputMode $menu.toggle() else input += String.fromCharCode e.keyCode
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
iam-0.0.8 | vendor/assets/javascripts/iam.js.coffee |