2013-07-10 16:46:37 +07:00
|
|
|
$ ->
|
2013-07-11 01:20:10 +07:00
|
|
|
$form = $('form')
|
|
|
|
$contents = $form.find('textarea')
|
|
|
|
$_button = $form.find('input[type="submit"]')
|
|
|
|
$button = $form.find('a[role="submit"]')
|
2013-07-12 14:34:38 +07:00
|
|
|
$syntax_selector = $('#syntax-selector')
|
2013-07-10 16:46:37 +07:00
|
|
|
|
|
|
|
# Hide generic button, show styled button
|
|
|
|
$_button.hide()
|
|
|
|
$button.show()
|
|
|
|
$contents.focus()
|
|
|
|
|
|
|
|
# Binding submit event to new button
|
2013-07-12 14:34:38 +07:00
|
|
|
$button.on 'click', (e) ->
|
|
|
|
$form.submit() unless $(this).hasClass('disabled')
|
|
|
|
$(this).addClass('disabled')
|
|
|
|
$syntax_selector.addClass('disabled')
|
2013-07-10 16:46:37 +07:00
|
|
|
false
|