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==
|
// ==UserScript==
|
||||||
// @name HV Unified
|
// @name HV Unified
|
||||||
// @namespace hvunified
|
// @namespace hvunified
|
||||||
// @version 0.16.1
|
// @version 0.16.2
|
||||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||||
// @author GaboGG + Hermes
|
// @author GaboGG + Hermes
|
||||||
// @match *://*.hentaiverse.org/*
|
// @match *://*.hentaiverse.org/*
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
// CONFIG — default settings
|
// CONFIG — default settings
|
||||||
// ═══════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const VERSION = '0.16.1';
|
const VERSION = '0.16.2';
|
||||||
|
|
||||||
const CFG = {
|
const CFG = {
|
||||||
// — Battle strategy advisory
|
// — Battle strategy advisory
|
||||||
|
|
@ -1670,14 +1670,15 @@ function setupKeybindings() {
|
||||||
keybindingsSetup = true;
|
keybindingsSetup = true;
|
||||||
|
|
||||||
document.addEventListener('keydown', function(e) {
|
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 (e.keyCode === KEYS.COMMA) {
|
||||||
if (isBattlePage()) {
|
// 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();
|
e.preventDefault();
|
||||||
STATE.settingsVisible = !STATE.settingsVisible;
|
STATE.settingsVisible = !STATE.settingsVisible;
|
||||||
toggleSettings();
|
toggleSettings();
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -3648,8 +3649,14 @@ window.HV = {
|
||||||
tier: STATE.tier,
|
tier: STATE.tier,
|
||||||
// Community script detection
|
// Community script detection
|
||||||
scripts: {
|
scripts: {
|
||||||
monsterbation: typeof window.unsafeWindow !== 'undefined' || !!(document.querySelector('script[src*="hvmonsterbate"], [class*="monsterbation"], #homosex, #gay_sex')),
|
monsterbation: !!(document.getElementById('homosex') ||
|
||||||
hvutils: !!(document.querySelector('[id*="hvut"], [class*="hvut"], #hvut')),
|
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,
|
unified: true,
|
||||||
},
|
},
|
||||||
// State availability
|
// State availability
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name HV Unified
|
// @name HV Unified
|
||||||
// @namespace hvunified
|
// @namespace hvunified
|
||||||
// @version 0.16.1
|
// @version 0.16.2
|
||||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||||
// @author GaboGG + Hermes
|
// @author GaboGG + Hermes
|
||||||
// @match *://*.hentaiverse.org/*
|
// @match *://*.hentaiverse.org/*
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
// CONFIG — default settings
|
// CONFIG — default settings
|
||||||
// ═══════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const VERSION = '0.16.1';
|
const VERSION = '0.16.2';
|
||||||
|
|
||||||
const CFG = {
|
const CFG = {
|
||||||
// — Battle strategy advisory
|
// — Battle strategy advisory
|
||||||
|
|
@ -1670,14 +1670,15 @@ function setupKeybindings() {
|
||||||
keybindingsSetup = true;
|
keybindingsSetup = true;
|
||||||
|
|
||||||
document.addEventListener('keydown', function(e) {
|
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 (e.keyCode === KEYS.COMMA) {
|
||||||
if (isBattlePage()) {
|
// 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();
|
e.preventDefault();
|
||||||
STATE.settingsVisible = !STATE.settingsVisible;
|
STATE.settingsVisible = !STATE.settingsVisible;
|
||||||
toggleSettings();
|
toggleSettings();
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -3648,8 +3649,14 @@ window.HV = {
|
||||||
tier: STATE.tier,
|
tier: STATE.tier,
|
||||||
// Community script detection
|
// Community script detection
|
||||||
scripts: {
|
scripts: {
|
||||||
monsterbation: typeof window.unsafeWindow !== 'undefined' || !!(document.querySelector('script[src*="hvmonsterbate"], [class*="monsterbation"], #homosex, #gay_sex')),
|
monsterbation: !!(document.getElementById('homosex') ||
|
||||||
hvutils: !!(document.querySelector('[id*="hvut"], [class*="hvut"], #hvut')),
|
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,
|
unified: true,
|
||||||
},
|
},
|
||||||
// State availability
|
// State availability
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// CONFIG — default settings
|
// CONFIG — default settings
|
||||||
// ═══════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const VERSION = '0.16.1';
|
const VERSION = '0.16.2';
|
||||||
|
|
||||||
const CFG = {
|
const CFG = {
|
||||||
// — Battle strategy advisory
|
// — Battle strategy advisory
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name HV Unified
|
// @name HV Unified
|
||||||
// @namespace hvunified
|
// @namespace hvunified
|
||||||
// @version 0.16.1
|
// @version 0.16.2
|
||||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||||
// @author GaboGG + Hermes
|
// @author GaboGG + Hermes
|
||||||
// @match *://*.hentaiverse.org/*
|
// @match *://*.hentaiverse.org/*
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,15 @@ function setupKeybindings() {
|
||||||
keybindingsSetup = true;
|
keybindingsSetup = true;
|
||||||
|
|
||||||
document.addEventListener('keydown', function(e) {
|
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 (e.keyCode === KEYS.COMMA) {
|
||||||
if (isBattlePage()) {
|
// 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();
|
e.preventDefault();
|
||||||
STATE.settingsVisible = !STATE.settingsVisible;
|
STATE.settingsVisible = !STATE.settingsVisible;
|
||||||
toggleSettings();
|
toggleSettings();
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,14 @@ window.HV = {
|
||||||
tier: STATE.tier,
|
tier: STATE.tier,
|
||||||
// Community script detection
|
// Community script detection
|
||||||
scripts: {
|
scripts: {
|
||||||
monsterbation: typeof window.unsafeWindow !== 'undefined' || !!(document.querySelector('script[src*="hvmonsterbate"], [class*="monsterbation"], #homosex, #gay_sex')),
|
monsterbation: !!(document.getElementById('homosex') ||
|
||||||
hvutils: !!(document.querySelector('[id*="hvut"], [class*="hvut"], #hvut')),
|
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,
|
unified: true,
|
||||||
},
|
},
|
||||||
// State availability
|
// State availability
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue