E-H Better Gallery Hiding

Hides completely based on hide flag, uploader, ongoing status. Displays a count.

Stan na 18-12-2018. Zobacz najnowsza wersja.

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           E-H Better Gallery Hiding
// @description    Hides completely based on hide flag, uploader, ongoing status. Displays a count.
// @author         Hen Tie
// @homepage       https://hen-tie.tumblr.com/
// @namespace      https://greasyfork.org/en/users/8336
// @include        /https?:\/\/(e-|ex)hentai\.org\/?(\?page=.*)?(\?f_.*)?/
// @grant          none
// @require        https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js
// @icon           https://i.imgur.com/pMMVGRx.png
// @version        2.3
// ==/UserScript==

$(function(){
	//count removed galleries
	var removed = 0;
	var fRemoved = 0;
	var uRemoved = 0;
	var oRemoved = 0;

	//list view filters
	if($('.gtr0').length > 1) {
		$('.gtr0, .gtr1').each(function() {
			var blocked = ['uploader1NameHere','uploader2NameHere']; //list of blocked uploaders
			var uploader = $(this).find('.itu a').text().toLowerCase(); //name of uploader
			var galTitle = $(this).find('.it5 a').text(); //title of gallery

			$.each(blocked, function(index,value) { //convert to lowercase
				blocked[index] = value.toLowerCase();
			});
			//check if gallery is flagged and hidden
			if ($(this).find('.it5 a').not('[onmouseover]').length !== 0) {
				$(this).remove(); //remove
				removed++;
				fRemoved++;
			}
			//check if uploader is blocked
			else if ($.inArray(uploader, blocked) !== -1) {
				$(this).remove(); //remove
				removed++;
				uRemoved++;
			}
			//check if gallery is ongoing
			else if(/ongoing/i.test(galTitle)) {
				$(this).remove(); //remove
				removed++;
				oRemoved++;
			}
		});
	}
	//thumbnail view filters
	else if($('.id1').length > 1) {
		$('.id1').each(function() {
			var galTitle = $(this).find('.id2 a').text(); //title of gallery

			//check if gallery is flagged and hidden
			if ($(this).find('.id3 img[src="https://exhentai.org/img/blank.gif"]').length !== 0) {
				$(this).remove(); //remove
				removed++;
				fRemoved++;
			}
			//check if gallery is ongoing
			else if(/ongoing/i.test(galTitle)) {
				$(this).remove(); //remove
				removed++;
				oRemoved++;
			}
		});
	}

	//if anything was removed show count
	var removedInfo = 'Flagged:'+fRemoved+' Uploader:'+uRemoved+' Ongoing:'+oRemoved;
	if (removed > 0) {
		$('p.ip').append('<span>'+' | <span class="hiddenCount" title="'+removedInfo+'">Hiding '+removed+'</span></span>'); //append text
		$('.hiddenCount').css('border-bottom','1px dotted #f1f1f1');
	}
  });