Skip to content

Commit

Permalink
Rebuild docs and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed May 26, 2024
1 parent 7f0262a commit 794b0c8
Show file tree
Hide file tree
Showing 15 changed files with 1,384 additions and 984 deletions.
2 changes: 1 addition & 1 deletion docs/demo/example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function process_clicked() {
} else if (data.startsWith('^')) {
document.getElementById("syntax").value = "Unbracketed AI element string";
gs1encoder.dataStr = data;
} else if (data.startsWith("http://") || data.startsWith("https://")) {
} else if (data.startsWith("http://") || data.startsWith("HTTP://") || data.startsWith("https://") || data.startsWith("HTTPS://")) {
document.getElementById("syntax").value = "GS1 Digital Link URI";
gs1encoder.dataStr = data;
} else if (/^\d+$/.test(data)) {
Expand Down
14 changes: 1 addition & 13 deletions docs/demo/gs1encoder-wasm.mjs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/demo/gs1encoder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* JavaScript wrapper for the GS1 Syntax Engine compiled as a WASM by
* Emscripten.
*
* Copyright (c) 2022-2023 GS1 AISBL.
* Copyright (c) 2022-2024 GS1 AISBL.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -221,7 +221,7 @@ export class GS1encoder {
*
*/
get addCheckDigit() {
return this.api.gs1_encoder_getAddCheckDigit(this.ctx);
return this.api.gs1_encoder_getAddCheckDigit(this.ctx) != 0;
}
set addCheckDigit(value) {
if (!this.api.gs1_encoder_setAddCheckDigit(this.ctx, value ? 1 : 0))
Expand All @@ -241,7 +241,7 @@ export class GS1encoder {
*
*/
get permitUnknownAIs() {
return this.api.gs1_encoder_getPermitUnknownAIs(this.ctx);
return this.api.gs1_encoder_getPermitUnknownAIs(this.ctx) != 0;
}
set permitUnknownAIs(value) {
if (!this.api.gs1_encoder_setPermitUnknownAIs(this.ctx, value ? 1 : 0))
Expand All @@ -261,7 +261,7 @@ export class GS1encoder {
*
*/
get permitZeroSuppressedGTINinDLuris() {
return this.api.gs1_encoder_getPermitZeroSuppressedGTINinDLuris(this.ctx);
return this.api.gs1_encoder_getPermitZeroSuppressedGTINinDLuris(this.ctx) != 0;
}
set permitZeroSuppressedGTINinDLuris(value) {
if (!this.api.gs1_encoder_setPermitZeroSuppressedGTINinDLuris(this.ctx, value ? 1 : 0))
Expand All @@ -281,7 +281,7 @@ export class GS1encoder {
*
*/
get includeDataTitlesInHRI() {
return this.api.gs1_encoder_getIncludeDataTitlesInHRI(this.ctx);
return this.api.gs1_encoder_getIncludeDataTitlesInHRI(this.ctx) != 0;
}
set includeDataTitlesInHRI(value) {
if (!this.api.gs1_encoder_setIncludeDataTitlesInHRI(this.ctx, value ? 1 : 0))
Expand All @@ -300,7 +300,7 @@ export class GS1encoder {
*
*/
getValidationEnabled(validation) {
return this.api.gs1_encoder_getValidationEnabled(this.ctx, validation);
return this.api.gs1_encoder_getValidationEnabled(this.ctx, validation) != 0;
}


Expand Down Expand Up @@ -334,7 +334,7 @@ export class GS1encoder {
*
*/
get validateAIassociations() {
return this.api.gs1_encoder_getValidateAIassociations(this.ctx);
return this.api.gs1_encoder_getValidateAIassociations(this.ctx) != 0;
}
set validateAIassociations(value) {
if (!this.api.gs1_encoder_setValidateAIassociations(this.ctx, value ? 1 : 0))
Expand Down
Loading

0 comments on commit 794b0c8

Please sign in to comment.