You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//import * as QRCode from 'qrcode';importHelperfrom'../../Helper';import'./styles.scss';constappStore='a[href^="https://apps.apple.com/"]';constplayStore='a[href^="https://play.google.com/"]';functionembed(paragraphs: HTMLElement[]){paragraphs.forEach((p)=>{constios=p.querySelector(appStore)asHTMLAnchorElement;constandroid=p.querySelector(playStore)asHTMLAnchorElement;constid=crypto.randomUUID();p.outerHTML=`<div id="${id}">`+`<div class="gs-app-links">`+(ios&&`<a class="gs-apple" href="${ios.href}"></a>`)+(android&&`<a class="gs-play" href="${android.href}"></a>`)+`</div>`+`</div>`;/* * TODO implement QRCodes * Probably the most straight-forward approach is either to compile * external libraries into my code (ugh) or externalize them and host * them on GAE, which I believe is a white-listed script source in * OverDrive *//* QRCode.toCanvas( document.querySelector(`#${id} .gs-apple canvas`) as HTMLCanvasElement, ios.href ); QRCode.toCanvas( document.querySelector(`#${id} .gs-android canvas`) as HTMLCanvasElement, android.href ); */});Helper.log('embedded app store links');}/*function waitForLib(paragraphs: HTMLElement[]) { if (QRCode === undefined) { setTimeout(() => waitForLib(paragraphs)); } else { embed(paragraphs); }}*/exportdefaultfunctionAppStoreLinks(){Helper.onGoogleDocEmbed(`p:has(${appStore}), p:has(${playStore})`).then((paragraphs)=>{/* const lib = document.createElement('script') as HTMLScriptElement; lib.src = 'https://cdnjs.cloudflare.com/ajax/libs/qrcode/1.5.1/qrcode.min.js'; lib.integrity = 'sha512-PEhlWBZBrQL7flpJPY8lXx8tIN7HWX912GzGhFTDqA3iWFrakVH3lVHomCoU9BhfKzgxfEk6EG2C3xej+9srOQ=='; lib.crossOrigin = 'anonymous'; lib.referrerPolicy = 'no-referrer'; document.head.appendChild(lib); waitForLib(paragraphs); */embed(paragraphs);});}
The text was updated successfully, but these errors were encountered:
Probably the most straight-forward approach is either to compile
external libraries into my code (ugh) or externalize them and host
them on GAE, which I believe is a white-listed script source in
OverDrive
https://api.github.com/groton-school/knowledgebase/blob/cf6f469c9c0d56602df52459b4517896ac43856b/src/Embed/AppStoreLinks/index.ts#L22
The text was updated successfully, but these errors were encountered: