added coupon code box inject dependency

This commit is contained in:
zino
2021-09-30 14:57:49 +02:00
parent e707d378cc
commit 27aa67889f

View File

@@ -19,14 +19,15 @@ window.addEventListener('load', () => {
Utils.consoleLog(inputsWithValue); Utils.consoleLog(inputsWithValue);
Utils.consoleLog(`trxstate: ${inputsWithValue["trxstate"]}`); Utils.consoleLog(`trxstate: ${inputsWithValue["trxstate"]}`);
// "posturl" in function showMap() only available if "pvmapse" PVO code is true. // "posturl" in function showMap() only available if "pvmapse" is true, false disables seatmap
// "pvmapse" false disables seatmap
const posturlAvail: boolean = /posturl:"(.+?)"/.test(content); const posturlAvail: boolean = /posturl:"(.+?)"/.test(content);
const couponCodeBoxAvail: boolean = !!jQuery("#coupon_code_box").length;
Utils.consoleLog(`couponCodeBoxAvail: ${couponCodeBoxAvail}`);
Utils.consoleLog(`posturl available: ${posturlAvail}`); Utils.consoleLog(`posturl available: ${posturlAvail}`);
// Only inject on page with trxstate 20 and if seatmap is enabled with PVO code "pvmapse" // Only inject on page with trxstate 20 and if seatmap is enabled with PVO code "pvmapse"
if (inputsWithValue["trxstate"] !== "20" || posturlAvail === false) if (inputsWithValue["trxstate"] !== "20" || posturlAvail === false || couponCodeBoxAvail === true)
return; return;
// Inject parent CSS // Inject parent CSS