$(window).ready ->

# permissions mod
$('body').on 'click', '.perm-vals input', ->
  $(this).slot().find('#inherit').attr('checked',false)

$('body').on 'click', '.perm-editor #inherit', ->
  slot = $(this).slot()
  slot.find('.perm-group input:checked').attr('checked', false)
  slot.find('.perm-indiv input').val('')

# rstar mod
$('body').on 'click', '._rule-submit-button', ->
  f = $(this).closest('form')
  checked = f.find('.set-editor input:checked')
  if checked.val()
    if checked.attr('warning')
      confirm checked.attr('warning')
    else
      true
  else
    f.find('.set-editor').addClass('attention')
    $(this).notify 'To what Set does this Rule apply?'
    false