v0.16.2 - Fix ',' settings key to work on any page; robust MB/HVUT detection
This commit is contained in:
parent
24c47edece
commit
de9605609e
6 changed files with 54 additions and 33 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.16.1
|
||||
// @version 0.16.2
|
||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||
// @author GaboGG + Hermes
|
||||
// @match *://*.hentaiverse.org/*
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.16.1';
|
||||
const VERSION = '0.16.2';
|
||||
|
||||
const CFG = {
|
||||
// — Battle strategy advisory
|
||||
|
|
@ -1670,14 +1670,15 @@ function setupKeybindings() {
|
|||
keybindingsSetup = true;
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// Settings — comma key (non-conflicting with Monsterbation)
|
||||
// Settings — comma key (non-conflicting with Monsterbation).
|
||||
// Works on ANY page the script loads (battle, character, bazaar...).
|
||||
if (e.keyCode === KEYS.COMMA) {
|
||||
if (isBattlePage()) {
|
||||
e.preventDefault();
|
||||
STATE.settingsVisible = !STATE.settingsVisible;
|
||||
toggleSettings();
|
||||
return;
|
||||
}
|
||||
// Don't swallow comma when typing in an input/textarea (e.g. auction bids)
|
||||
const tag = (document.activeElement || {}).tagName;
|
||||
if (tag === 'INPUT' || tag === 'TEXTAREA') return;
|
||||
e.preventDefault();
|
||||
STATE.settingsVisible = !STATE.settingsVisible;
|
||||
toggleSettings();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -3648,8 +3649,14 @@ window.HV = {
|
|||
tier: STATE.tier,
|
||||
// Community script detection
|
||||
scripts: {
|
||||
monsterbation: typeof window.unsafeWindow !== 'undefined' || !!(document.querySelector('script[src*="hvmonsterbate"], [class*="monsterbation"], #homosex, #gay_sex')),
|
||||
hvutils: !!(document.querySelector('[id*="hvut"], [class*="hvut"], #hvut')),
|
||||
monsterbation: !!(document.getElementById('homosex') ||
|
||||
document.getElementById('mbcfgbt') ||
|
||||
document.getElementById('gay_sex') ||
|
||||
typeof window.Monsterbation !== 'undefined'),
|
||||
hvutils: !!(document.getElementById('hvut_menu') ||
|
||||
document.getElementById('hvut') ||
|
||||
window.HVUT ||
|
||||
document.querySelector('[class*="hvut"], [id*="hvut"]')),
|
||||
unified: true,
|
||||
},
|
||||
// State availability
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.16.1
|
||||
// @version 0.16.2
|
||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||
// @author GaboGG + Hermes
|
||||
// @match *://*.hentaiverse.org/*
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.16.1';
|
||||
const VERSION = '0.16.2';
|
||||
|
||||
const CFG = {
|
||||
// — Battle strategy advisory
|
||||
|
|
@ -1670,14 +1670,15 @@ function setupKeybindings() {
|
|||
keybindingsSetup = true;
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// Settings — comma key (non-conflicting with Monsterbation)
|
||||
// Settings — comma key (non-conflicting with Monsterbation).
|
||||
// Works on ANY page the script loads (battle, character, bazaar...).
|
||||
if (e.keyCode === KEYS.COMMA) {
|
||||
if (isBattlePage()) {
|
||||
e.preventDefault();
|
||||
STATE.settingsVisible = !STATE.settingsVisible;
|
||||
toggleSettings();
|
||||
return;
|
||||
}
|
||||
// Don't swallow comma when typing in an input/textarea (e.g. auction bids)
|
||||
const tag = (document.activeElement || {}).tagName;
|
||||
if (tag === 'INPUT' || tag === 'TEXTAREA') return;
|
||||
e.preventDefault();
|
||||
STATE.settingsVisible = !STATE.settingsVisible;
|
||||
toggleSettings();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -3648,8 +3649,14 @@ window.HV = {
|
|||
tier: STATE.tier,
|
||||
// Community script detection
|
||||
scripts: {
|
||||
monsterbation: typeof window.unsafeWindow !== 'undefined' || !!(document.querySelector('script[src*="hvmonsterbate"], [class*="monsterbation"], #homosex, #gay_sex')),
|
||||
hvutils: !!(document.querySelector('[id*="hvut"], [class*="hvut"], #hvut')),
|
||||
monsterbation: !!(document.getElementById('homosex') ||
|
||||
document.getElementById('mbcfgbt') ||
|
||||
document.getElementById('gay_sex') ||
|
||||
typeof window.Monsterbation !== 'undefined'),
|
||||
hvutils: !!(document.getElementById('hvut_menu') ||
|
||||
document.getElementById('hvut') ||
|
||||
window.HVUT ||
|
||||
document.querySelector('[class*="hvut"], [id*="hvut"]')),
|
||||
unified: true,
|
||||
},
|
||||
// State availability
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.16.1';
|
||||
const VERSION = '0.16.2';
|
||||
|
||||
const CFG = {
|
||||
// — Battle strategy advisory
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.16.1
|
||||
// @version 0.16.2
|
||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||
// @author GaboGG + Hermes
|
||||
// @match *://*.hentaiverse.org/*
|
||||
|
|
|
|||
|
|
@ -9,14 +9,15 @@ function setupKeybindings() {
|
|||
keybindingsSetup = true;
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// Settings — comma key (non-conflicting with Monsterbation)
|
||||
// Settings — comma key (non-conflicting with Monsterbation).
|
||||
// Works on ANY page the script loads (battle, character, bazaar...).
|
||||
if (e.keyCode === KEYS.COMMA) {
|
||||
if (isBattlePage()) {
|
||||
e.preventDefault();
|
||||
STATE.settingsVisible = !STATE.settingsVisible;
|
||||
toggleSettings();
|
||||
return;
|
||||
}
|
||||
// Don't swallow comma when typing in an input/textarea (e.g. auction bids)
|
||||
const tag = (document.activeElement || {}).tagName;
|
||||
if (tag === 'INPUT' || tag === 'TEXTAREA') return;
|
||||
e.preventDefault();
|
||||
STATE.settingsVisible = !STATE.settingsVisible;
|
||||
toggleSettings();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,14 @@ window.HV = {
|
|||
tier: STATE.tier,
|
||||
// Community script detection
|
||||
scripts: {
|
||||
monsterbation: typeof window.unsafeWindow !== 'undefined' || !!(document.querySelector('script[src*="hvmonsterbate"], [class*="monsterbation"], #homosex, #gay_sex')),
|
||||
hvutils: !!(document.querySelector('[id*="hvut"], [class*="hvut"], #hvut')),
|
||||
monsterbation: !!(document.getElementById('homosex') ||
|
||||
document.getElementById('mbcfgbt') ||
|
||||
document.getElementById('gay_sex') ||
|
||||
typeof window.Monsterbation !== 'undefined'),
|
||||
hvutils: !!(document.getElementById('hvut_menu') ||
|
||||
document.getElementById('hvut') ||
|
||||
window.HVUT ||
|
||||
document.querySelector('[class*="hvut"], [id*="hvut"]')),
|
||||
unified: true,
|
||||
},
|
||||
// State availability
|
||||
|
|
|
|||
Loading…
Reference in a new issue