E-H Better Gallery Hiding

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

2018-12-18 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

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