E-H Colour Conversion

Gives E-Hentai the Exhentai colour scheme.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name           E-H Colour Conversion
// @description    Gives E-Hentai the Exhentai colour scheme.
// @author         Hen Tie
// @homepage       https://hen-tie.tumblr.com/
// @namespace      https://greasyfork.org/en/users/8336
// @include        /https://(.*\.)?e-hentai.org.*/
// @exclude        https://forums.e-hentai.org/*
// @grant          none
// @icon           https://i.imgur.com/pMMVGRx.png
// @version        1.6
// ==/UserScript==

var ehCss = 'https://e-hentai.org/z/0347/g.css';
var exCss = 'https://exhentai.org/z/0347/x.css';

var addStyle = (function() {
	var style = document.createElement("style");
	style.setAttribute('data-jqstyle','ehColourConversion');
	style.appendChild(document.createTextNode("")); // WebKit hack
	document.head.appendChild(style);
	return style.sheet;
})();
function addLink(url, name) {
	var link = document.createElement('link');
	link.type = 'text/css';
	link.rel = 'stylesheet';
	link.href = url;
	if (name !== "undefined") {
		link.setAttribute('data-jqlink', name);
	}
	document.head.appendChild(link);
}
function removeLink(url) {
	if (document.querySelector('link[href="' + url + '"]')) {
		document.querySelectorAll('link[href="' + url + '"]')[0].disabled = true;
	}
}
function inlineStyle(selector, css) {
	if (document.querySelector(selector)) {
		document.querySelector(selector).style.cssText += ';' + css;
	}
}

addLink(exCss, "ehColourConversion");
removeLink(ehCss);

// bounty pages
addStyle.insertRule('.stuffbox #x {background: none; border-color: #000;}');
// events
addStyle.insertRule('#eventpane {background: #4f535b !important; border-color: #000 !important;}');
// E-H MiniMenu script compatibility
addStyle.insertRule('.nav-submenu {background: #34353b !important; border: 2px solid #8d8d8d !important;}');