intorduced smap
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user