Wykop Obrazki

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

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         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();
	});
	

})();