removed state vars from function params
This commit is contained in:
@@ -55,66 +55,6 @@ export function getRowsNaming(): string[] {
|
||||
return namingArr;
|
||||
}
|
||||
|
||||
// export function getColumnNaming(inXML: any): string[] {
|
||||
// const layout: I.SeatmapLayout = inXML.seatmap[0].layouts[0].layout[0];
|
||||
|
||||
|
||||
|
||||
// const width: number = parseInt(layout.width[0]);
|
||||
|
||||
|
||||
// const namingArr = Array.from({ length: width }, (_) => "");
|
||||
// const rowsArr = layout.rows[0].row;
|
||||
|
||||
// // let seats: number[] = [];
|
||||
// // let x: number[] = [];
|
||||
// rowsArr.forEach(element => {
|
||||
// // const index: number = parseInt(element.y_cell_coord[0]);
|
||||
// const seatsArr: string[] = element.seats[0].split("|");
|
||||
|
||||
// seatsArr.forEach(seatStr => {
|
||||
// const seatArr: string[] = splitSeatStr(seatStr);
|
||||
// // seats.push(parseInt(seatArr[5]));
|
||||
// // x.push(parseInt(seatArr[2]));
|
||||
|
||||
// const x = parseInt(seatArr[2]);
|
||||
|
||||
// // Form:
|
||||
// // 0: "568528" -> ID
|
||||
// // 1: "568528" -> ID
|
||||
// // 2: "21" -> X-Coord benutzen
|
||||
// // 3: "7024" -> section ID
|
||||
// // 4: "13" -> Reihenbezeichnung
|
||||
// // 5: "4" -> Platznummer
|
||||
// namingArr[x] = seatArr[5];
|
||||
|
||||
|
||||
// });
|
||||
|
||||
// // const row = seatArr[4];
|
||||
// // namingArr[index] = row;
|
||||
// });
|
||||
|
||||
// // console.log(seats);
|
||||
// // console.log(x);
|
||||
// // console.log(Math.min.apply(Math, seats));
|
||||
// // console.log(Math.max.apply(Math, seats));
|
||||
// // console.log(Math.min.apply(Math, x));
|
||||
// // console.log(Math.max.apply(Math, x));
|
||||
|
||||
// // const minimum = Math.min.apply(Math, seats);
|
||||
// // let i = 0;
|
||||
// // for (let index = Math.min.apply(Math, x); index < Math.max.apply(Math, x); index++) {
|
||||
// // // const element = array[index];
|
||||
|
||||
// // namingArr[index] = (minimum + i).toString();
|
||||
// // i++;
|
||||
// // }
|
||||
|
||||
// console.log(namingArr);
|
||||
// return namingArr;
|
||||
// }
|
||||
|
||||
export function generateMap(): string[] {
|
||||
const seatmapXML = config.state.seatmapXML;
|
||||
const layout: I.SeatmapLayout = seatmapXML.seatmap[0].layouts[0].layout[0];
|
||||
@@ -130,9 +70,11 @@ export function generateMap(): string[] {
|
||||
return stringArrMatrix;
|
||||
}
|
||||
|
||||
export function generateLegend(inVenueXML: I.VenueXML, inSeatmapXML: any, inNode: string): I.JSCLegend {
|
||||
const pricescaleArr: I.SeatmapPricescale[] = inSeatmapXML.seatmap[0].pricescale_config[0].pricescale;
|
||||
const venuePricescaleArr: I.Pricescale2[] = inVenueXML.venue[0].pricescales[0].pricescale;
|
||||
export function generateLegend(inNode: string): I.JSCLegend {
|
||||
const seatmapXML = config.state.seatmapXML;
|
||||
const venueXML = config.state.inVenueXML!;
|
||||
const pricescaleArr: I.SeatmapPricescale[] = seatmapXML.seatmap[0].pricescale_config[0].pricescale;
|
||||
const venuePricescaleArr: I.Pricescale2[] = venueXML.venue[0].pricescales[0].pricescale;
|
||||
let legend: I.JSCLegend = {
|
||||
node: jQuery(inNode),
|
||||
items: []
|
||||
@@ -157,8 +99,10 @@ export function generateLegend(inVenueXML: I.VenueXML, inSeatmapXML: any, inNode
|
||||
return legend;
|
||||
}
|
||||
|
||||
export function setUnavailableSeats(inXML: any, seatmap: any): void {
|
||||
const availabilityArr: I.JSCAvailability = inXML.seatmap[0].view_modes[0].view_mode[0].availability[0];
|
||||
export function setUnavailableSeats(): void {
|
||||
const seatmapXML = config.state.seatmapXML;
|
||||
const seatmap = config.state.seatmap;
|
||||
const availabilityArr: I.JSCAvailability = seatmapXML.seatmap[0].view_modes[0].view_mode[0].availability[0];
|
||||
|
||||
if (availabilityArr.unavailable_unselectable_mask[0] === "")
|
||||
return;
|
||||
@@ -254,8 +198,9 @@ export function createArrMatrix(inNumrows: number, inNumcols: number, inInitial:
|
||||
return arr;
|
||||
}
|
||||
|
||||
export function addTrims(inSeatmapXML: any) {
|
||||
const trimArr: I.Trim[] = inSeatmapXML.seatmap[0].trims[0].trim;
|
||||
export function addTrims() {
|
||||
const seatmapXML = config.state.seatmapXML;
|
||||
const trimArr: I.Trim[] = seatmapXML.seatmap[0].trims[0].trim;
|
||||
trimArr.forEach(arr => {
|
||||
const [xTrim, yTrim] = arr.coord[0].split(",").map(Number);
|
||||
const textArr: string[] = arr.text[0].split(";").filter(Boolean);
|
||||
@@ -306,23 +251,24 @@ function applyTrim(x: number, y: number, i: number, character: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export function selectSeatsInCart(inSeatmap: any) {
|
||||
export function selectSeatsInCart() {
|
||||
const seatmapXML = config.state.seatmapXML;
|
||||
config.state.selectedSeatsArr.forEach(arr => {
|
||||
const seatID: string = arr[0];
|
||||
|
||||
if (inSeatmap.get(seatID))
|
||||
inSeatmap.status(seatID, "selected");
|
||||
if (seatmapXML.get(seatID))
|
||||
seatmapXML.status(seatID, "selected");
|
||||
});
|
||||
}
|
||||
|
||||
export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: string[], inSeats: I.JSCSeats, inLegend: I.JSCLegend, inSeatmap: any): void {
|
||||
export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: string[], inSeats: I.JSCSeats, inLegend: I.JSCLegend): void {
|
||||
const containerSeatmap: any = (<any>window).jQuery(inSelector);
|
||||
|
||||
// console.log(inSeatmapInitMap);
|
||||
// console.log(inSeats);
|
||||
// console.log(inLegend);
|
||||
|
||||
inSeatmap = containerSeatmap.seatCharts({
|
||||
config.state.seatmap = containerSeatmap.seatCharts({
|
||||
naming: {
|
||||
top: false,
|
||||
left: false,
|
||||
@@ -337,7 +283,7 @@ export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: st
|
||||
|
||||
console.log(selectedSeat);
|
||||
|
||||
if (State.maximumSelectedSeatsReached(selectedSeat, inSeatmap))
|
||||
if (State.maximumSelectedSeatsReached(selectedSeat))
|
||||
return "available";
|
||||
|
||||
State.addSeatToState(selectedSeat);
|
||||
|
||||
Reference in New Issue
Block a user