E-H MiniMenu

Simplifies the navigation menu.

10.04.2019 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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'+
		'}');
}