EX Better Thumbnails

Provides infinite scroll and larger thumbnails for gallery browsing.

اعتبارا من 08-09-2015. شاهد أحدث إصدار.

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         EX Better Thumbnails
// @description      Provides infinite scroll and larger thumbnails for gallery browsing. 
// @version      0.2
// @match        http://exhentai.org/g/*
// @grant        none
// @namespace https://greasyfork.org/users/13871
// ==/UserScript==

var thisURL = document.createElement("a");
thisURL.href = document.URL;
var i = 0;
var URLGen = new URLGenerator();
var maxPage;

(function() {
    var js = document.createElement("script");
    js.type = "text/javascript";
    js.src = "https://code.jquery.com/jquery-1.11.3.min.js"
    js.onload = function() {
		maxPage = $(".gdt2:eq(5)").text().split(" ")[0]
		changeLayout();
        main()
    };
    document.head.appendChild(js)
})();

function* URLGenerator() {
    var base = thisURL.protocol + "//" + thisURL.hostname + thisURL.pathname + "?inline_set=ts_l";
    while (true) {
        yield base + "&" + "p=" + i;
        i += 1;
    }
};

function insert(URL) {
    $.get(URL, function(data) {
        var DOM = $.parseHTML(data);
        $(DOM).find(".gdtl").each(function() {
            $("#gdt > .c").before(this);
            $(this).hide().fadeIn();
        });
    })
};

function call() {
    if ($(".gdtl").length < maxPage) {
        var url = URLGen.next().value;
		console.log(url);
        insert(url);
    }
};

function changeLayout() {
    $("#asm, #gdo, .gtb, #frontpage").remove();
    var thumbnails = document.getElementById("gdt");
    document.body.insertBefore(thumbnails, document.body.lastChild);
    $(".gdtm, .gdtl").each(function() {
        $(this).remove()
    })
};

function main() {
	call();
    $(window).scroll(function() {
        if ($(window).scrollTop() + $(window).height() > 0.95 * $(document).height()) {
            call();
        }
    })
};