TheMechanist / MWT Galerie

// ==UserScript==
// @name         MWT Galerie
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Ersetzt den nervigen Link zur Galerie
// @author       The Mechanist
// @include        *://*.mietwagen-talk.*/*
// @grant        GM_addStyle
// @updateURL https://openuserjs.org/meta/TheMechanist/MWT_Galerie.meta.js
// @run-at  document-idle
// ==/UserScript==

(function() {
allGalPics = document.getElementsByClassName("resizeImage");
// loop over all gallery pictures
for ( iGalPic = 0; iGalPic < allGalPics.length; iGalPic++ ) {
	// add the enlargable attributes
	if (allGalPics[iGalPic].parentElement.tagName.toUpperCase() == 'A') {
		allGalPics[iGalPic].parentElement.setAttribute('class','enlargable');
		// Update the href to the large picture
		url = allGalPics[iGalPic].getAttribute('src');
		url = url.replace('small', 'large');
		url = url.replace('medium', 'large');
		url = url.replace('thumbnails/large/', '');
		allGalPics[iGalPic].parentElement.setAttribute('href', url);
	}
}
//GM_addStyle('.imageViewerCurrentImage {border: none !important;} .imageViewerMenu{display: none !important; } .imageViewerCaption {display:none !important;} ');
})();