fixed splitting
This commit is contained in:
@@ -9,8 +9,8 @@ export function getVenueLocation(): string {
|
||||
return span.join(", ");
|
||||
}
|
||||
|
||||
export function getInputs(inContent: string, inInputsWithValue: I.InputsWithValue): void {
|
||||
const parsedHTML: Node[] = $.parseHTML(inContent);
|
||||
export function getInputs(inContent: string): I.Inputs {
|
||||
const parsedHTML: Node[] = jQuery.parseHTML(inContent);
|
||||
let inputs: I.Inputs = {};
|
||||
|
||||
jQuery(parsedHTML).find('input').each(function (this: any) {
|
||||
@@ -20,25 +20,38 @@ export function getInputs(inContent: string, inInputsWithValue: I.InputsWithValu
|
||||
inputs[name] = value;
|
||||
});
|
||||
|
||||
inInputsWithValue = { ...inInputsWithValue, ...inputs };
|
||||
return inputs;
|
||||
}
|
||||
|
||||
// todo: check with different venues
|
||||
export function getImportantNote(inInputsWithValue: I.InputsWithValue): void {
|
||||
const importantNote: string | null = $(".important_note")[0].textContent;
|
||||
export function getImportantNote(): { importantNote: string, importantNoteEncoded: string } | undefined {
|
||||
const importantNote: string | null = jQuery(".important_note")[0].textContent;
|
||||
|
||||
if (importantNote?.trim().length) {
|
||||
const importantNoteEncoded: string = encodeURIComponent(importantNote);
|
||||
inInputsWithValue["importantNote"] = importantNote;
|
||||
inInputsWithValue["importantNoteEncoded"] = importantNoteEncoded;
|
||||
return {
|
||||
"importantNote": importantNote,
|
||||
"importantNoteEncoded": importantNoteEncoded
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getAdditionalInputs(inContent: string, inInputsWithValue: I.InputsWithValue): void {
|
||||
inInputsWithValue["event"] = inContent.match(/event:"(.+?)"/)![1];
|
||||
inInputsWithValue["holdcode"] = inContent.match(/holdcode:"(.+?)"/)![1];
|
||||
inInputsWithValue["posturlRaw"] = inContent.match(/posturl:"(.+?)"/)![1];
|
||||
inInputsWithValue["posturlRawDecoded"] = decodeURIComponent(inInputsWithValue["posturlRaw"]);
|
||||
inInputsWithValue["posturl"] = decodeURIComponent(`${inInputsWithValue["posturlRaw"]}&event=${inInputsWithValue["event"]}&holdcode=${inInputsWithValue["holdcode"]}&nocache=0&inclpkg=Y&incloffer=Y&inclcartdetails=Y&inclCart=Y&inclvenue=Y`);
|
||||
inInputsWithValue["venueLocation"] = getVenueLocation();
|
||||
export function getAdditionalInputs(inContent: string): { [key: string]: string } {
|
||||
const event = inContent.match(/event:"(.+?)"/)![1];
|
||||
const holdcode = inContent.match(/holdcode:"(.+?)"/)![1];
|
||||
const posturlRaw = inContent.match(/posturl:"(.+?)"/)![1];
|
||||
const posturlRawDecoded = decodeURIComponent(posturlRaw);
|
||||
const posturl = decodeURIComponent(`${posturlRaw}&event=${event}&holdcode=${holdcode}&nocache=0&inclpkg=Y&incloffer=Y&inclcartdetails=Y&inclCart=Y&inclvenue=Y`);
|
||||
const venueLocation = getVenueLocation()
|
||||
|
||||
return {
|
||||
"event": event,
|
||||
"holdcode": holdcode,
|
||||
"posturlRaw": posturlRaw,
|
||||
"posturlRawDecoded": posturlRawDecoded,
|
||||
"posturl": posturl,
|
||||
"venueLocation": venueLocation
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user