fixed umlauts using iconv-lite

This commit is contained in:
zino
2021-05-26 11:55:33 +02:00
parent 5c195abe72
commit 01560a5c20
11 changed files with 64410 additions and 517 deletions

View File

@@ -3,19 +3,23 @@ import { config } from "./config";
import * as I from "../types/types";
import * as Events from "./events";
import * as CartButtons from "./cartButtons";
import Utils from "./utils";
export function addItem(inSeatObj: I.JSCSelectedSeat): void {
const color: string = `#${XMLHelper.getVenuePricescalePropertyByPricescaleID("color", inSeatObj.data.seatsObj.id[0])}`;
const category: string | undefined = XMLHelper.getVenuePricescalePropertyByPricescaleID("desc", inSeatObj.data.seatsObj.id[0]);
const category: string | undefined = Utils.encodeCP850DecodeUTF8( XMLHelper.getVenuePricescalePropertyByPricescaleID("desc", inSeatObj.data.seatsObj.id[0])! );
const seat: string = config.state.layoutRows[inSeatObj.id][5];
const row: string = config.state.layoutRows[inSeatObj.id][4];
const sectionID: string = config.state.layoutRows[inSeatObj.id][3];
const sectionDesc: string | undefined = XMLHelper.getSectionDescBySectionID(sectionID);
const seatStr: string | undefined = `${sectionDesc}<br/>Reihe ${row} Platz ${seat}`;
const seatStr: string | undefined = Utils.encodeCP850DecodeUTF8( `${sectionDesc}<br/>Reihe ${row} Platz ${seat}` );
const buyerTypes: I.TypeBuyerType = XMLHelper.getBuyerTypesByPricescaleID(inSeatObj.data.seatsObj.id[0]);
const cartID: string = `cartItem-${inSeatObj.id}`;
const dropdownBuyerTypesSelector: string = `#${cartID} .dropdownBuyerTypes`;
console.log(category);
console.log(seatStr);
appendHTML(cartID, color, category, seatStr);
addDropdownBuyerTypeOptions(buyerTypes, dropdownBuyerTypesSelector);
Events.addCartDropdownBuyerTypes(dropdownBuyerTypesSelector, inSeatObj);
@@ -104,10 +108,14 @@ function addDropdownBuyerTypeOptions(inBuyerTypes: I.TypeBuyerType, inSelector:
}
function appendOption(inSelector: string, inArr: I.TypeBuyerTypeArr): void {
const desc: string = Utils.encodeCP850DecodeUTF8( <string>inArr[2] );
const id: string = <string>inArr[0];
const price: string = <string>inArr[1];
const dropdownBuyerTypes: HTMLElement = jQuery(inSelector).get(0);
let opt: HTMLOptionElement = document.createElement('option');
opt.value = <string>inArr[0];
opt.innerHTML = `${inArr[2]}${inArr[1]}`;
opt.value = id;
opt.innerHTML = `${desc}${price}`;
dropdownBuyerTypes.appendChild(opt);
}