Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Fixed CDN problems in UI demo
Browse files Browse the repository at this point in the history
  • Loading branch information
vjekoart committed Apr 20, 2021
1 parent e04fa8e commit 03fc912
Showing 1 changed file with 45 additions and 18 deletions.
63 changes: 45 additions & 18 deletions ui/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,18 @@ <h2>Minimal example</h2>
(function (){
const el = document.querySelector('#example-minimal photopay-in-browser');

/* [TEMPORARY FIX]
* Use basic WebAssembly builds since most performant option requires server setup and unpkg.com, which is used
* for examples, doesn't support COOP and COEP headers.
*
* For more information see "Integration" section in the official documentation.
*/
el.wasmType = "BASIC";

el.engineLocation = window.engineLocation;
el.licenseKey = window.licenseKey;
el.recognizers = ['CroatiaPdf417PaymentRecognizer'];



el.addEventListener('scanError', ev => {
console.log('scanError', ev.detail);

Expand All @@ -183,11 +189,6 @@ <h2>Minimal example</h2>
})();
</script>






<section id="example-feedback-message">
<h2>Example with feedback message</h2>
<p>UI component with default behaviour where it's required to set valid license key and recognizer.</p>
Expand All @@ -204,6 +205,14 @@ <h2>Example with feedback message</h2>
(function (){
const el = document.querySelector('#example-feedback-message photopay-in-browser');

/* [TEMPORARY FIX]
* Use basic WebAssembly builds since most performant option requires server setup and unpkg.com, which is used
* for examples, doesn't support COOP and COEP headers.
*
* For more information see "Integration" section in the official documentation.
*/
el.wasmType = "BASIC";

el.engineLocation = window.engineLocation;
el.licenseKey = window.licenseKey;
el.recognizers = ['CroatiaPdf417PaymentRecognizer'];
Expand Down Expand Up @@ -245,24 +254,30 @@ <h2>Custom messages</h2>
(function (){
const el = document.querySelector('#example-localization photopay-in-browser');

/* [TEMPORARY FIX]
* Use basic WebAssembly builds since most performant option requires server setup and unpkg.com, which is used
* for examples, doesn't support COOP and COEP headers.
*
* For more information see "Integration" section in the official documentation.
*/
el.wasmType = "BASIC";

el.engineLocation = window.engineLocation;
el.licenseKey = window.licenseKey;
el.recognizers = ['CroatiaPdf417PaymentRecognizer'];

window.setTimeout(() => {
el.translations = {
el.translations = {
'action-message': 'Alternative CTA'
};
}, 3000);



el.addEventListener('scanError', ev => {
console.log('scanError', ev.detail);

el.setUiState('ERROR');
});


el.addEventListener('scanSuccess', ev => {
console.log('scanSuccess', ev.detail);
});
Expand Down Expand Up @@ -293,18 +308,24 @@ <h2>RTL support</h2>
(function (){
const el = document.querySelector('#example-localization-rtl photopay-in-browser');

/* [TEMPORARY FIX]
* Use basic WebAssembly builds since most performant option requires server setup and unpkg.com, which is used
* for examples, doesn't support COOP and COEP headers.
*
* For more information see "Integration" section in the official documentation.
*/
el.wasmType = "BASIC";

el.engineLocation = window.engineLocation;
el.licenseKey = window.licenseKey;
el.recognizers = ['CroatiaPdf417PaymentRecognizer'];

window.setTimeout(() => {
el.translations = {
el.translations = {
'action-message': 'Alternative CTA'
};
}, 3000);



el.addEventListener('scanError', ev => {
console.log('scanError', ev.detail);

Expand Down Expand Up @@ -388,12 +409,18 @@ <h3>CSS variables</h3>
(function (){
const el = document.querySelector('#example-customization photopay-in-browser');

/* [TEMPORARY FIX]
* Use basic WebAssembly builds since most performant option requires server setup and unpkg.com, which is used
* for examples, doesn't support COOP and COEP headers.
*
* For more information see "Integration" section in the official documentation.
*/
el.wasmType = "BASIC";

el.engineLocation = window.engineLocation;
el.licenseKey = window.licenseKey;
el.recognizers = ['CroatiaPdf417PaymentRecognizer'];



el.addEventListener('scanError', ev => {
console.log('scanError', ev.detail);

Expand Down Expand Up @@ -468,7 +495,7 @@ <h3>CSS variables</h3>

customizatorForm.addEventListener('submit', ev => {
ev.preventDefault();

document.querySelector(
'#example-customization .box'
).style.background = document.getElementById('customization-background').value;
Expand All @@ -487,4 +514,4 @@ <h3>CSS variables</h3>
</script>

</body>
</html>
</html>

0 comments on commit 03fc912

Please sign in to comment.