Added feature to specify first seatmap on load by defining second value of SMAP (must be valid code). If invalid code given, first seatmap will be returned.

This commit is contained in:
zino committed 2022-09-20 14:45:48 +02:00
1 parent 468f0a46b0
commit 8126d7be13
9 files changed
+64832 -7

No files matched your search

+1
View File
@@ -0,0 +1 @@
#containerBookingBtn{display:none;margin:0;text-align:center}#get_flash{display:none}.ui-dialog-title{text-align:center;display:none}.ui-widget-overlay{background:#fff;opacity:1;width:100vw;height:100vh}#openSeatmap img{width:64px}#openSeatmap{padding:1rem!important;cursor:pointer;border-radius:5px}#openSeatmap span{font-size:1.2rem}#foobarParent{display:none}div#dialogSeatmap{padding-top:0}.ui-widget-header{background:#fff;border:1px solid #c6c6c6;border-bottom-right-radius:0;border-bottom-left-radius:0}.ui-dialog{background:#fff;left:0!important;padding:0;top:0!important;right:0!important}.ui-dialog .ui-dialog-content{padding:0}.ui-dialog-titlebar{margin-left:0;margin-right:0;padding:0!important;display:none}#iframeSeatmap{height:100vh;background:#fff;width:100%}.ui-corner-all{border-radius:0}.ui-widget{border:none!important}
+32742
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
.jBox-wrapper{text-align:left;box-sizing:border-box}.jBox-container,.jBox-content,.jBox-title{position:relative;word-break:break-word;box-sizing:border-box}.jBox-container{background:#fff}.jBox-content{padding:8px 12px;overflow-x:hidden;overflow-y:auto;transition:opacity .2s}.jBox-Mouse .jBox-container,.jBox-Tooltip .jBox-container{border-radius:4px;box-shadow:0 0 3px rgba(0,0,0,.25)}.jBox-Mouse .jBox-title,.jBox-Tooltip .jBox-title{padding:8px 10px 0;font-weight:700}.jBox-Mouse.jBox-hasTitle .jBox-content,.jBox-Tooltip.jBox-hasTitle .jBox-content{padding-top:5px}.jBox-Mouse{pointer-events:none}.jBox-pointer{position:absolute;overflow:hidden;box-sizing:border-box}.jBox-pointer:after{content:'';width:20px;height:20px;position:absolute;background:#fff;transform:rotate(45deg);box-sizing:border-box}.jBox-pointer-top{top:0}.jBox-pointer-top:after{left:5px;top:6px;box-shadow:-1px -1px 2px rgba(0,0,0,.15)}.jBox-pointer-right{right:0}.jBox-pointer-right:after{top:5px;right:6px;box-shadow:1px -1px 2px rgba(0,0,0,.15)}.jBox-pointer-left{left:0}.jBox-pointer-left:after{top:5px;left:6px;box-shadow:-1px 1px 2px rgba(0,0,0,.15)}.jBox-pointer-bottom{bottom:0}.jBox-pointer-bottom:after{left:5px;bottom:6px;box-shadow:1px 1px 2px rgba(0,0,0,.15)}.jBox-pointer-bottom,.jBox-pointer-top{width:30px;height:12px}.jBox-pointer-left,.jBox-pointer-right{width:12px;height:30px}.jBox-Modal .jBox-container{border-radius:4px}.jBox-Modal .jBox-container,.jBox-Modal.jBox-closeButton-box:before{box-shadow:0 3px 15px rgba(0,0,0,.4),0 0 5px rgba(0,0,0,.4)}.jBox-Modal .jBox-content{padding:15px 20px}.jBox-Modal .jBox-title{border-radius:4px 4px 0 0;padding:15px 20px;background:#fafafa;border-bottom:1px solid #eee}.jBox-Modal.jBox-closeButton-title .jBox-title{padding-right:65px}.jBox-Modal .jBox-footer{border-radius:0 0 4px 4px}.jBox-closeButton{z-index:1;cursor:pointer;position:absolute;box-sizing:border-box}.jBox-closeButton svg{position:absolute;top:50%;right:50%}.jBox-closeButton path{fill:#aaa;transition:fill .2s}.jBox-closeButton:hover path{fill:#888}.jBox-overlay .jBox-closeButton{top:0;right:0;width:40px;height:40px}.jBox-overlay .jBox-closeButton svg{width:20px;height:20px;margin-top:-10px;margin-right:-10px}.jBox-overlay .jBox-closeButton path{fill:#ddd}.jBox-overlay .jBox-closeButton:hover path{fill:#fff}.jBox-closeButton-title .jBox-closeButton{top:0;right:0;bottom:0;width:50px}.jBox-closeButton-title svg{width:12px;height:12px;margin-top:-6px;margin-right:-6px}.jBox-closeButton-box{box-sizing:border-box}.jBox-closeButton-box .jBox-closeButton{top:-8px;right:-10px;width:24px;height:24px;background:#fff;border-radius:50%}.jBox-closeButton-box .jBox-closeButton svg{width:10px;height:10px;margin-top:-5px;margin-right:-5px}.jBox-closeButton-box:before{content:'';position:absolute;top:-8px;right:-10px;width:24px;height:24px;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.3)}.jBox-closeButton-box.jBox-pointerPosition-top:before{top:5px}.jBox-closeButton-box.jBox-pointerPosition-right:before{right:2px}.jBox-Modal.jBox-hasTitle.jBox-closeButton-box .jBox-closeButton{background:#fafafa}.jBox-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.82)}.jBox-footer{box-sizing:border-box;background:#fafafa;border-top:1px solid #eee;padding:8px 10px;border-radius:0 0 3px 3px}body[class*=" jBox-blockScroll-"],body[class^=jBox-blockScroll-]{overflow:hidden}.jBox-draggable{cursor:move}@keyframes jBoxLoading{to{transform:rotate(360deg)}}.jBox-loading .jBox-content{opacity:.2}.jBox-loading-spinner .jBox-content{min-height:38px!important;min-width:38px!important;opacity:0}.jBox-spinner{box-sizing:border-box;position:absolute;top:50%;left:50%;width:24px;height:24px;margin-top:-12px;margin-left:-12px}.jBox-spinner:before{display:block;box-sizing:border-box;content:'';width:24px;height:24px;border-radius:50%;border:2px solid rgba(0,0,0,.2);border-top-color:rgba(0,0,0,.8);animation:.6s linear infinite jBoxLoading}.jBox-countdown{border-radius:4px 4px 0 0;z-index:0;background:#000;opacity:.2;position:absolute;top:0;left:0;right:0;height:3px;overflow:hidden}.jBox-countdown-inner{top:0;right:0;width:100%;height:3px;position:absolute;background:#fff}[class*=" jBox-animated-"],[class^=jBox-animated-]{animation-fill-mode:both}@keyframes jBox-tada{0%{transform:scale(1)}10%,20%{transform:scale(.8) rotate(-4deg)}30%,50%,70%,90%{transform:scale(1.2) rotate(4deg)}40%,60%,80%{transform:scale(1.2) rotate(-4deg)}100%{transform:scale(1) rotate(0)}}.jBox-animated-tada{animation:1s jBox-tada}@keyframes jBox-tadaSmall{0%{transform:scale(1)}10%,20%{transform:scale(.9) rotate(-2deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(2deg)}40%,60%,80%{transform:scale(1.1) rotate(-2deg)}100%{transform:scale(1) rotate(0)}}.jBox-animated-tadaSmall{animation:1s jBox-tadaSmall}@keyframes jBox-flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}.jBox-animated-flash{animation:.5s jBox-flash}@keyframes jBox-shake{0%,100%{transform:translateX(0)}20%,60%{transforLine truncated
+32050
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "client",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
+4 -2
View File
@@ -37,7 +37,9 @@ export function initSendVenueXML(inE: any) {
UI.setOptionSelect(seatmapListing, "dropdownSeatmap"); UI.setOptionSelect(seatmapListing, "dropdownSeatmap");
// Display first seatmapXML // Display first seatmapXML
const id: string = seatmapListing[0].id[0]; // If smap[1] is given by user, display specific seatmap on load
const id: string = XMLHelper.getFirstSeatmapIDToLoad();
jQuery("#dropdownSeatmap").val(id); jQuery("#dropdownSeatmap").val(id);
Communication.needSeatmapXML(id); Communication.needSeatmapXML(id);
@@ -67,7 +69,7 @@ export function sendSeatmapXML(inE: any) {
Legend.convertLegendToDropdown("dropdownLegend"); Legend.convertLegendToDropdown("dropdownLegend");
Events.dropdownLegendOnChange("#dropdownLegend"); Events.dropdownLegendOnChange("#dropdownLegend");
Trims.addTrims(); Trims.addTrims();
XMLHelper.processSMAP(); XMLHelper.showHideVenueCapacity();
config.state.panzoom = Panzoom.addPanzoom("#containerSeatmapInner", ".panzoomZoomIn", ".panzoomZoomOut", "#panzoomResetZoom"); config.state.panzoom = Panzoom.addPanzoom("#containerSeatmapInner", ".panzoomZoomIn", ".panzoomZoomOut", "#panzoomResetZoom");
Cart.setImportantNote(); Cart.setImportantNote();
UI.controlLoftloader("hide"); UI.controlLoftloader("hide");
+4 -1
View File
@@ -83,7 +83,10 @@ export function getSMAP(): string | undefined {
return undefined; return undefined;
const str: string = jQuery("#seating_map_url a").attr("onclick"); const str: string = jQuery("#seating_map_url a").attr("onclick");
const re = /openNewWindow\(\'(\d+)\'/;
//const re = /openNewWindow\(\'(\d+)\'/;
const re = /openNewWindow\(\'(.+?)\'/;
const found: RegExpMatchArray | null = str.match(re); const found: RegExpMatchArray | null = str.match(re);
return found ? found[1] : undefined; return found ? found[1] : undefined;
+28 -4
View File
@@ -1,19 +1,43 @@
import * as I from "../types/types"; import * as I from "../types/types";
import { config } from "./config"; import { config } from "./config";
export function processSMAP(): void { export function showHideVenueCapacity(): void {
const inputsWithValue = config.state.inputsWithValue!; const inputsWithValue = config.state.inputsWithValue!;
if (!inputsWithValue.smap) if (!inputsWithValue.smap)
return; return;
const smapArr: number[] = inputsWithValue.smap.split("").map(Number); // TODO: We are sure that there are always only two elements [number, string], so we can declare it as a tuple?
const smapArr = inputsWithValue.smap.split(";");
// Form:
// 0: = "0" -> Show venue capacity 1=yes 0=no
// 1: = "SC02" -> Show specific seat plan when loading for the first time
if (!smapArr[0]) // Convert first SMAP element to Number and hide or show venue capacity data
if (!Number(smapArr[0]))
jQuery("#eventInfoCapacity").hide(); jQuery("#eventInfoCapacity").hide();
} }
export function getFirstSeatmapIDToLoad() {
const inputsWithValue = config.state.inputsWithValue!;
const venueXML = config.state.inVenueXML!;
const seatmapListing: I.Seatmap[] = venueXML.seatmap_config[0].seatmap;
const firstSeatmapID: string = seatmapListing[0].id[0];
// If SMAP field is missing, return ID of first seatmap
if (!inputsWithValue.smap)
return firstSeatmapID;
// If seatmap code is given in SMAP, return corresponding seatmap ID, otherwise return ID of first seatmap
const smapArr = inputsWithValue.smap.split(";"); // Form described above
if (!smapArr[1])
return firstSeatmapID;
const seatmapID: string | undefined = seatmapListing.find(arr => smapArr[1] === arr.code[0])?.id[0];
return seatmapID ? seatmapID : firstSeatmapID;
}
export function getSectionDescBySectionID(inSectionID: string): string | undefined { export function getSectionDescBySectionID(inSectionID: string): string | undefined {
const venueXML: I.VenueXML = config.state.inVenueXML!; const venueXML: I.VenueXML = config.state.inVenueXML!;
const sectionArr: I.Section[] = venueXML.master_config[0].section_config[0].section; const sectionArr: I.Section[] = venueXML.master_config[0].section_config[0].section;
Submodule libs/jQuery-Seat-Charts added at f43f2a1884.