         Moebooru.request @api.vote_url, {id: @current_post.id, score: vote}
 
     updateWidget: ->
+        $ = jQuery
         score = @getScore()
         vote = @getVote()
         i = 1
         while i <= @v.fav
-            star = jQuery '.star-'+i
+            star = $ '.star-'+i
             if i <= vote
                 star.removeClass 'star-set-after'
                 star.addClass 'star-set-upto'


    Moe.on 'vote:update_widget', ->
        vote.updateWidget()

    $(".vote-up").on 'click', ->
        current_score = vote.getVote()

                star.removeClass 'star-set-upto'
                star.addClass 'star-set-after'
            i++
        if vote == @v.fav
            $('#add-to-favs').css 'display', 'none'
            $('#remove-from-favs').css 'display', 'list-item'
        else
            $('#add-to-favs').css 'display', 'list-item'
            $('#remove-from-favs').css 'display', 'none'
        $('#post-score-'+@current_post.id).html score
        $('#favorited-by').html Favorite.link_to_users @votes[@v.fav]
        false


