Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
2c93e194
Commit
2c93e194
authored
Jul 17, 2022
by
Volker Krause
Browse files
Use already existing child nodes rather than do manual barcode decoding
parent
a1b00268
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/chaos-communication-congress.js
View file @
2c93e194
...
...
@@ -29,13 +29,12 @@ function parsePdf(pdf, node, triggerNode)
res
.
reservationFor
.
endDate
=
end
;
// search for the QR code with the actual event code
var
images
=
pdf
.
pages
[
triggerNode
.
location
].
images
;
for
(
var
i
=
0
;
i
<
images
.
length
;
++
i
)
{
var
code
=
Barcode
.
decodeQR
(
images
[
i
]);
if
(
code
)
{
res
.
reservedTicket
.
ticketToken
=
"
qrcode:
"
+
code
;
break
;
const
barcodes
=
node
.
findChildNodes
({
scope
:
"
Descendants
"
,
mimeType
:
"
text/plain
"
,
match
:
"
^[0-9a-z]{40}$
"
});
for
(
let
i
=
0
;
i
<
barcodes
.
length
;
++
i
)
{
if
(
barcodes
[
i
].
location
!=
triggerNode
.
location
)
{
continue
;
}
res
.
reservedTicket
.
ticketToken
=
"
qrcode:
"
+
barcodes
[
i
].
content
;
}
// generate the second ticket for public transport
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment