E-H Better Gallery Hiding

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

Od 18.12.2018.. Pogledajte najnovija verzija.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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');
	}
  });