Wykop Obrazki

Przywraca obrazki na wortalu Wykop.pl dopóki ktoś z góry nie zechce ich naprawić

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         Wykop Obrazki
// @namespace    http://lodkut.as/
// @version      1.2.2
// @description  Przywraca obrazki na wortalu Wykop.pl dopóki ktoś z góry nie zechce ich naprawić
// @author       SweetNight
// @match        *://*.wykop.pl/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

	const updatePics = function (){
		$(".hide-image").each(function(){
			const imageElement = $("<img />");
			const imageUrl = $(this).find("a").attr("href");
			const imageThumbUrl = imageUrl.substr(0, imageUrl.length-4) + ",w400.jpg";
			$(imageElement).attr("src", imageThumbUrl);
			//$(this).find("a").append("<br>");
			$(this).find("a").empty();
			$(this).find("a").append(imageElement);
		});
	};
	
	//Dla ajaxowej aktualizacji postow na mirko
	$("#newEntriesCounter").click(function(){
		setTimeout(updatePics, 1000);
	});
	
	//Po rozwinieciu komentarzy
	$(".more").click(function(){
		setTimeout(updatePics, 1000);
	});
	
	$(document).ready(function(){
		updatePics();
	});
	

})();