KickUseless

Kick Useless

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name        KickUseless
// @namespace   InGame
// @include     http://www.dreadcast.net/Forum/2-691-ami-du-flood-*
// @version     2.1
// @grant       none
// @author	Ladoria
// @description Kick Useless
// ==/UserScript==

var toKick = new Array();
var shown = new Array();
var binded = new Array();


$(document).ready( function() {
	toKick.push(/(.*)<br>/.exec($("#zone_personnage").find('td').first().html())[1].trim());

	function KickThoseThings() {
		$('.bandeau .nom').each( function() {
			if(-1 == $.inArray($(this).html(),toKick)) {
				var bandeau = $(this).parent();
				
				if(-1 == $.inArray(bandeau.next().attr('id'),shown))
					bandeau.next().hide();
				
				if(-1 != $.inArray($(this).attr('id'), binded))
					return;
				
				binded.push($(this).attr('id'));
				
				bandeau.on('click', function() {
					var id = $(this).next().toggle().attr('id');
					
					if(-1 == $.inArray(id, shown))
						shown.push(id);
					else {
						shown = jQuery.grep(shown, function(value) {
							return value != id;
						});
					}
				});
			}
		});
	}

	KickThoseThings();
	
	$(document).ajaxComplete( function(a,b,c) {
		if(false == /Check/.test(c.url)) {
			binded = new Array();
		}
		
		KickThoseThings();
	});
});