HF Poll Counter

Counts polls properly when they are public (or mod of the section)

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name   HF Poll Counter
// @namespace  Xerotic
// @description  Counts polls properly when they are public (or mod of the section)
// @require   http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @include   **hackforums.net/polls.php**
// @run-at    document-end
// @version   1.1
// ==/UserScript==

var total_count = 0;

$('.quick_keys').first().find('tr').each(function() {
 if(!$(this).children().first().hasClass('thread')) {
  if($(this).children().first().hasClass('tfoot')) {
   $(this).children().first().next().html('<strong>' + total_count + ' votes</strong>');
  } else {
   $(this).children().first().next().next().html($(this).children().first().next().find('a').length);
   total_count += parseInt($(this).children().first().next().find('a').length);
  }
 }
});