Linkomanija

Linkomanija poster preview

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Linkomanija
// @namespace   Namespeisas
// @description Linkomanija poster preview
// @include     https://www.linkomanija.net/browse.php*
// @require		http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @version     1.3
// @grant       none
// ==/UserScript==
jQuery(document).ready(function ($) {
    var number = 0;
    $("table:last tr").each(function (index) {
        var sitas = $(this);
        setTimeout(function () {
            var nuoroda = sitas.find('td').next().find('a').attr('href');
            number += 1;
            $.ajax({
                url: nuoroda,
                context: document.body
            }).done(function (data) {
                var rege = new RegExp('class="descr_text.+src="(.+?[^"])".+', "gim");
                var poster = rege.exec(data);
                sitas.find('td').eq(3).html('<a href="' + nuoroda + '" target="_blank"><img style="max-width:100px" src="' + poster[1] + '" alt="" /></a>');
            });
        }, index * 500);

    });
    $('font[color="red"]').parents('tr').find('td').css('background-color', '#dedede');
});