Sleazy Fork is available in English.

Tag Preview

Show tags on hover.

Stan na 25-03-2019. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

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         Tag Preview
// @version      1.0
// @description  Show tags on hover.
// @author       Hauffen
// @include      /https?:\/\/(e-|ex)hentai\.org\/.*/
// @require      https://code.jquery.com/jquery-3.3.1.min.js
// @namespace    https://greasyfork.org/users/285675
// ==/UserScript==

(function() {
    var $tagP = $('<div id="tagPreview">');
    $tagP.css({
        position:'absolute',
        zIndex: '2',
        visiblility:'hidden',
        maxWidth: '400px',
        border:'1px solid #000',
        padding: '10px'
    });
    $tagP.appendTo("body");

    var element;
    if(document.getElementsByTagName("select").length === 0) {
        return;
    }

    switch(document.getElementsByTagName("select")[0].selectedIndex){
        case 0:
            element = ".gl3m a";
            break;
        case 1: // delete this case if you don't want it on compact view.
            element = ".gl3c a";
            break;
        default:
            element = ".gl3t a";
            break;
    }

    $(element).mouseover(function(e) {
        if(document.getElementById('tagPreview').children.length > 2) {
            document.getElementById('tagPreview').innerHTML = "Loading...";
            $tagP.empty();
        }
        var $content = $('<div>');
        $content.load(this.href, function() {
            document.getElementById('tagPreview').innerHTML = $('#gd2', this).html() + $('#taglist', this).html();

            var posY, posX = (e.pageX + 432 < screen.width) ? e.pageX + 10 : e.pageX - 412;
            var scrollHeight = $(document).height();
            var scrollPosition = $(window).height() + $(window).scrollTop();

            if ((scrollHeight - scrollPosition) < (scrollHeight / 10)) {
                posY = (e.pageY + 300 < scrollHeight) ? e.pageY + 10 : e.pageY - 300;
            } else {
                posY = e.pageY + 10;
            }

            $tagP.css({
                left: posX,
                top: posY,
                visibility:'visible',
                background: window.getComputedStyle(document.getElementsByClassName('ido')[0]).getPropertyValue("background"),
                border: '1px solid ' + window.getComputedStyle(document.getElementsByTagName("a")[0]).getPropertyValue("color")
            });
        });
    }).mousemove(function(e) {
        var posY, posX = (e.pageX + 432 < screen.width) ? e.pageX + 10 : e.pageX - 412;
        var scrollHeight = $(document).height();
        var scrollPosition = $(window).height() + $(window).scrollTop();

        if ((scrollHeight - scrollPosition) < (scrollHeight / 10)) {
            posY = (e.pageY + document.getElementById('tagPreview').offsetHeight < window.innerHeight) ? e.pageY + 10 : e.pageY - 10 - document.getElementById('tagPreview').offsetHeight;
        } else {
            posY = e.pageY + 10;
        }

        $tagP.css({
            visibility:'visible',
            top: posY,
            left: posX
        });
    }).mouseout(function() {
        $tagP.css({
            visibility:'hidden'
        });
        document.getElementById('tagPreview').innerHTML = "Loading...";
        $tagP.empty();
    });
})();