E-H MiniMenu

Simplifies the navigation menu.

Stan na 10-04-2019. Zobacz najnowsza wersja.

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        E-H MiniMenu
// @description Simplifies the navigation menu.
// @author      Hen Tie
// @homepage    https://hen-tie.tumblr.com/
// @namespace   https://greasyfork.org/en/users/8336
// @include    	/https:\/\/(.*\.)?(ex|e-)hentai\.org.*/
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js
// @icon        https://i.imgur.com/pMMVGRx.png
// @version     2.0
// ==/UserScript==

/*════════════════════════════════╦═══════════════════════════════════╗
║          CONFIGURATION          ║          ALL NAV ITEMS            ║
╠═════════════════════════════════╬═══════════════════════════════════╣
║ "var = miniMenuItems" is a list ║ Bounties    Favorites    Forums   ║
║ of the nav items you want to    ║ Front Page  HentaiVerse  My Home  ║
║ have moved under the menu.      ║ My Tags     My Uploads   News     ║
║ Case sensitive.                 ║ Popular     Settings     Toplists ║
║                                 ║ Torrents    Watched      Wiki     ║
╚═════════════════════════════════╩══════════════════════════════════*/
var miniMenuItems = ['Torrents', 'News', 'Forums', 'Wiki', 'HentaiVerse'];
/*═══════════════════════════════════════════════════════════════════*/

var oldNav = $('#nb');
oldNav.prepend('<ul class="nav-menu"><li class="nav-menu-item"><a href="https://e-hentai.org/">Menu</a><ul class="nav-submenu"></ul></li></ul>');
miniMenuItems.forEach(function(i) {
	var item = oldNav.find('a:contains("'+i+'")');
	item.parent().remove();
	item.appendTo('.nav-submenu').wrap('<li class="nav-submenu-item"></li>');
});

$(`<style type="text/css" data-jqstyle="ehMiniMenu">
/* old nav */
#nb:hover {
	max-height: unset;
}
#nb {
	overflow: visible;
	max-height: unset;
	justify-content: center;
}
/* old nav items */
#nb>div {
	padding: 0 10px;
	background: none;
}
/* nav item aliases */
.nav-menu-item .nbw1 {
	display: inline;
}
/* menu */
.nav-menu {
	display: inline;
	padding: 0 10px 0 0;
	text-align: left;
	white-space: nowrap;
	margin: 0;
}
.nav-menu-item {
	display: inline-block;
	position: relative;
	z-index: 999;
    background-image: url(https://ehgt.org/g/mr.gif);
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 7px;
}
/* submenu */
.nav-submenu {
	display: none;
	padding: .5em;
	background: #f2efde;
	border: 2px solid #b5a3a4;
	border-radius: 3px;
	transform: translateX(-50%);
	left: 50%;
	position: absolute;
}
.nav-submenu-item {
	display: block;
	line-height: 1.3;
}
/* hover */
.nav-submenu-item:hover {
	background-color: none;
}
.nav-menu-item:hover .nav-submenu {
	display: block;
}
.nav-submenu::before {
	content: "";
	display: block;
	position: absolute;
	top: -5px;
	left: -8px;
	width: 100%;
	height: 100%;
	z-index: -1;
	padding: 8px;
}
</style>`).appendTo('head');

if (window.location.href.indexOf("exhentai") > -1) {
	$('.nav-menu-item a').prop('href','https://exhentai.org/');
	$('style[data-jqstyle="ehMiniMenu"]').append(
		'/* exhentai only */\n'+
		'.nav-submenu {\n'+
		'  background: #34353b;\n'+
		'  border: 2px solid #8d8d8d;\n'+
		'}');
}