Equipment Popup for MoogleMail

Press "c" to open the equipment popup of the attached equipment in a new tab.

Stan na 08-05-2015. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

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            Equipment Popup for MoogleMail
// @description     Press "c" to open the equipment popup of the attached equipment in a new tab.
// @include         http://hentaiverse.org/?s=Bazaar&ss=mm*
// @grant           GM_openInTab
// @version 0.0.1.20150508092648
// @namespace https://greasyfork.org/users/2233
// ==/UserScript==

/*** Settings ***/

var hotkey = 67 // Default: 67 (The "c" key)

/*** End of Settings ***/

var wnd = window
var doc = wnd.document
var loc = location
var href = loc.href

var $  = function(e, css) { if(!css) { css=e; e=doc }; return e.querySelector(css) }
var $$ = function(e, css) { if(!css) { css=e; e=doc }; return e.querySelectorAll(css) }

if(/&mid=/.test(href)) {
    var m = doc.body.innerHTML.match(/equips.set\((.+?),\s*['"](.+?)['"]\)/)
    if(m) {
        var eid = m[1]
        var key = m[2]
        var equip_url = 'http://hentaiverse.org/pages/showequip.php?eid=' + eid + '&key=' + key
        addEventListener('keydown', function(evt) {
            if((evt.target.tagName!='INPUT') && (evt.target.tagName!='TEXTAREA') && (evt.keyCode == hotkey)) {
                if(typeof GM_openInTab != 'undefined') {
                    GM_openInTab(equip_url)
                }
                else {
                    window.open(equip_url, '_blank')
                }
            }
        }, false)
        var body_section = $('#leftpane').children[1]
        body_section.innerHTML += '<HR>' + equip_url
    }
}