intorduced smap
This commit is contained in:
@@ -137,17 +137,30 @@ window.addEventListener('load', function () {
|
||||
inputsWithValue = { ...inputsWithValue, ...Parser.getAdditionalInputs(content) };
|
||||
inputsWithValue = { ...inputsWithValue, ...Parser.getVenueImage() };
|
||||
|
||||
const importantNote = Parser.getImportantNote();
|
||||
if (importantNote)
|
||||
inputsWithValue = { ...inputsWithValue, ...importantNote };
|
||||
// const importantNote = Parser.getImportantNote();
|
||||
// if (importantNote)
|
||||
// inputsWithValue = { ...inputsWithValue, ...importantNote };
|
||||
|
||||
inputsWithValue = { ...inputsWithValue, ...Parser.getImportantNote() };
|
||||
inputsWithValue["smap"] = getSMAP();
|
||||
|
||||
|
||||
UI.injectBookingBtn();
|
||||
UI.createDialog();
|
||||
|
||||
console.log(inputsWithValue);
|
||||
});
|
||||
|
||||
// remove on production
|
||||
jQuery("#foobarParent").on("click", () => {
|
||||
Communication.sendEventToChild("parent_init_venue");
|
||||
});
|
||||
});
|
||||
function getSMAP(): string | undefined {
|
||||
if (jQuery("#seating_map_url").length === 0)
|
||||
return undefined;
|
||||
|
||||
const str: string = jQuery("#seating_map_url a").attr("onclick");
|
||||
const re = /openNewWindow\(\'(\d+)\'/;
|
||||
const found: RegExpMatchArray | null = str.match(re);
|
||||
|
||||
if (found)
|
||||
return found[1];
|
||||
else
|
||||
return undefined;
|
||||
}
|
||||
@@ -57,15 +57,12 @@ export function injectBookingBtn(): void {
|
||||
"width": "100%"
|
||||
});
|
||||
jQuery("#flash_seat_map_box_id").append(`
|
||||
<div class="row_space"></div>
|
||||
<div class="row_space"></div>
|
||||
<div id="containerBookingBtn">
|
||||
<button type="button" id="openSeatmap">
|
||||
<div>
|
||||
<img src="https://staging.tickets.zinomedia.de/dist/stadium.png">
|
||||
</div>
|
||||
Saalplanbuchung <br/><br/>
|
||||
<span>Suchen Sie Ihren Platz selbst aus</span>
|
||||
</button> <br/>
|
||||
<button type="button" id="foobarParent">foobarParent</button> <br/>
|
||||
<a class="continue" id="openSeatmap">
|
||||
<span>Saalplanbuchung</span>
|
||||
</a>
|
||||
<div id="dialogSeatmap" hidden="hidden"></div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
@@ -35,7 +35,7 @@ export function getEventInfo(inVenueXML: I.VenueXML): I.EventInfo {
|
||||
const eventObj: I.Event = inVenueXML.event[0];
|
||||
const event = inVenueXML.event[0];
|
||||
const venue_config = inVenueXML.venue_config[0];
|
||||
const dateObj: Date = new Date(parseInt(event.year[0]), parseInt(event.month[0])-1, parseInt(event.hour[0]), parseInt(event.minute[0]));
|
||||
const dateObj: Date = new Date(parseInt(event.year[0]), parseInt(event.month[0])-1, parseInt(event.day[0]), parseInt(event.hour[0]), parseInt(event.minute[0]));
|
||||
const start: string[] = [ dateObj.toLocaleString(["de-DE"], { weekday: "long", day: "2-digit", month: "2-digit", year: "numeric", hour: "2-digit", minute: "2-digit", timeZoneName: "short" }) ];
|
||||
const weekday = [ Utils.getDayName(dateObj, "de-DE") ];
|
||||
const seats_available = sectionArr.map(item => parseInt(item.available[0])).reduce((prev, curr) => prev + curr);
|
||||
|
||||
@@ -87,14 +87,13 @@ function messagesHandler(inE: any) {
|
||||
|
||||
addTrims();
|
||||
|
||||
processSMAP();
|
||||
|
||||
panzoom = UI.addPanzoom("#containerSeatmapInner", ".panzoomZoomIn", ".panzoomZoomOut", "#panzoomResetZoom");
|
||||
UI.controlLoftloader("hide");
|
||||
|
||||
|
||||
new jBox("Tooltip", {
|
||||
attach: jQuery(".seatCharts-seat"),
|
||||
// title: "title",
|
||||
// content: "foooobar",
|
||||
onOpen: function (this: any) {
|
||||
showSeatTooltip(this);
|
||||
},
|
||||
@@ -130,6 +129,16 @@ function messagesHandler(inE: any) {
|
||||
}
|
||||
}
|
||||
|
||||
function processSMAP() {
|
||||
if (!inputsWithValue.smap)
|
||||
return;
|
||||
|
||||
const smapArr = inputsWithValue.smap.split("").map(Number);
|
||||
|
||||
if (!smapArr[0])
|
||||
jQuery("#eventInfoCapacity").hide();
|
||||
}
|
||||
|
||||
function addTrims() {
|
||||
const trimArr: I.Trim[] = seatmapXML.seatmap[0].trims[0].trim;
|
||||
trimArr.forEach(arr => {
|
||||
@@ -146,22 +155,42 @@ function addTrims() {
|
||||
|
||||
function decodeAddTrims(textArr: string[], x: number, y: number) {
|
||||
let i = 0;
|
||||
const specialChar = new Map([
|
||||
["Ž", "Ä"],
|
||||
["™", "Ö"],
|
||||
["š", "Ü"],
|
||||
["„", "ä"],
|
||||
["”", "ö"],
|
||||
["", "ü"],
|
||||
["á", "ß"]
|
||||
]);
|
||||
|
||||
textArr.forEach(element => {
|
||||
const charCode = element.replace(/^\&\#/, "0");
|
||||
const character = String.fromCharCode(parseInt(charCode, 16));
|
||||
let character;
|
||||
|
||||
if(!/[^a-zA-Z0-9äöüÄÖÜß$]/.test(character)) {
|
||||
const _x = (x - 1) + i;
|
||||
const _y = y - 1;
|
||||
console.log(`${character} -> ${_x} ${_y}`);
|
||||
jQuery(".seatCharts-row")[_y].children[_x].innerHTML = `<span class="trimChar">${character}</span>`
|
||||
if (specialChar.has(element))
|
||||
character = specialChar.get(element);
|
||||
else {
|
||||
const charCode = element.replace(/^\&\#/, "0");
|
||||
character = String.fromCharCode(parseInt(charCode, 16));
|
||||
}
|
||||
|
||||
if (character)
|
||||
applyTrim(x, y, i, character);
|
||||
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
function applyTrim(x: number, y: number, i: number, character: string) {
|
||||
if(!/[^a-zA-Z0-9äöüÄÖÜß$]/.test(character)) {
|
||||
const _x = (x - 1) + i;
|
||||
const _y = y - 1;
|
||||
console.log(`${character} -> ${_x} ${_y}`);
|
||||
jQuery(".seatCharts-row")[_y].children[_x].innerHTML = `<span class="trimChar">${character}</span>`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showSeatTooltip(jBox: any): void {
|
||||
const seatID: string = jBox.source[0].id;
|
||||
|
||||
1
client/src/types/types.d.ts
vendored
1
client/src/types/types.d.ts
vendored
@@ -71,6 +71,7 @@ export interface InputsWithValue {
|
||||
venueImageHeight: number;
|
||||
venueImageWidth: number;
|
||||
ticketPurchaseUrl: string;
|
||||
smap: string | undefined;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
|
||||
Reference in New Issue
Block a user