HWM_NewLotLinkInMenu

Добавляет ссылку на выставление нового лота в меню "Персонаж"

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         HWM_NewLotLinkInMenu
// @namespace    Небылица
// @version      1.1
// @description  Добавляет ссылку на выставление нового лота в меню "Персонаж"
// @author       Небылица
// @include      /^https{0,1}:\/\/((www|qrator)\.heroeswm\.ru|178\.248\.235\.15)\/.+/
// @exclude      /^https{0,1}:\/\/((www|qrator)\.heroeswm\.ru|178\.248\.235\.15)\/(login|war|cgame|campaign|frames|chat|chatonline|ch_box|chat_line|ticker|chatpost)\.php.*/
// ==/UserScript==

(function() {
    "use strict";

    // определяем элемент li "Рынок" и массив дочерних элементов
    var auctionLi = document.querySelector("li a[href='auction.php']").parentNode,
        auctionLiChildren = auctionLi.childNodes;

    // добавляем плюсик
    auctionLi.innerHTML += "<a href='auction_new_lot.php' title='Выставить новый лот'><b>+</b></a>";

    // задаём стили для ссылок на рынок и на выставление нового лота
    auctionLiChildren[0].style.display = "inline";
    auctionLiChildren[0].style.padding = "2px 6px 2px 9px";

    auctionLiChildren[1].style.display = "inline";
    auctionLiChildren[1].style.padding = "2px 0px 2px 0px";
})();