E-H Better Gallery Hiding

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

当前为 2018-10-07 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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=\d)?(\?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.2
// ==/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 = ['uploaderNameHere','uploaderNameHere']; //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');
	}
  });