intorduced smap

This commit is contained in:
zino
2021-05-06 17:57:51 +02:00
parent 51157645d6
commit 126b9be7ea
5 changed files with 67 additions and 27 deletions

View File

@@ -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([
["&#x8e", "Ä"],
["&#x99", "Ö"],
["&#x9a", "Ü"],
["&#x84", "ä"],
["&#x94", "ö"],
["&#x81", "ü"],
["&#xe1", "ß"]
]);
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;