     $("#dashboard > .news")
 
   $alerts: ->
-    @$news().find(".alert")
+    @$news().find(".alert:visible")
+
+  increment_counter: (n) ->
+    span = @$news().find(".amck-gh-filter-counter span")
+    span.html(parseInt(span.html(), 10) + n)
 
   filter_set: (element) ->
     new FilterSet(@repo_name(element))

        })

  apply_to: (items) ->
    items.each (i, element) =>
      event_name = element.className.replace /alert\s+/, ""
      if @filter_set(element).is_filtered(event_name)
        #console.log "Filtering: #{event_name} on #{@repo_name(element)}"
        #$(element).css "opacity", 0.2
        $(element).remove()

  maybe_load_more: ->
    if @$alerts().length < 20

  repo_name: (element) ->
    links = $("div.title > a", element)
    $(links[links.length - 1]).attr("href")

  css: ->
    """
    .amck-gh-filter-counter {
      border: 1px solid #eee;
      border-radius: 5px;
      background: #f8f8f8;
      font-size: 12px;
      color: #333;
      margin-bottom: 25px;
      padding: 10px;
    }

    .amck-gh-filter-counter span {
      font-weight: bold;
    }

    .amck-gh-filter-counter a {
      float: right;
    }
    """



