diff --git a/app/assets/javascripts/misc.js.coffee b/app/assets/javascripts/misc.js.coffee new file mode 100644 index 0000000..3a861c0 --- /dev/null +++ b/app/assets/javascripts/misc.js.coffee @@ -0,0 +1,38 @@ +$ -> + $('#logout').click -> + $(this).closest('form').submit() + + $('select').each (i, el) -> + $select = $(el) + + $select.wrap '
' + $select.on 'DOMSubtreeModified', (event) -> + $el = $(this) + $wrapper = $el.parent() + + if $el.is("[disabled]") + $wrapper.addClass 'disabled' + else + $wrapper.removeClass 'disabled' + + $select.trigger 'DOMSubtreeModified' + + $('a[href=#form_submit]').click -> + $(this).closest('form').submit() + return false + + $('select.autosubmit').change -> + $(this).closest('form').submit() + + $('#notification').delay(3000).fadeOut() + + $('#steam-search a').click (event) -> + event.preventDefault() + + $search = $('#steam-search') + id = $search.data 'user-id' + + $search.html "

Searching...

" + + $.get "/api/v1/users/#{id}", (data) -> + $search.html "Steam Profile: #{data.steam.nickname}" \ No newline at end of file