Equipment Popup for MoogleMail

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

Tính đến 08-05-2015. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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            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
    }
}