לוחות מודעות לוחות מודעות

חזרה

accessing external libraries

מתג
accessing external libraries
תשובה
13:55 10/09/24
Hi Smartbuilder,

We are trying to get some new javascript functionality in our lessons, but are having some trouble.

Our main thing is that we are trying to create and download a custumised pdf based upon the variables. For this our programmer is trying to add the external library pdf.js, but for some reason it keeps getting the error 'unable to find pdf.js'. This means it is able to read the the js file in the config folder, but can not load the external library. We've also tried adding code in the html file (manually after publishing), but it still doesn't work.

We are now trying to add the library in ourselves (the js.map file) but this doesn't work either. I know it's a bit of a vague questions, but I was hoping you guys recognise the issue or could maybe point us in the right direction.

A second thing is that we are trying to add a 'fullscreen' button in our lesson. We are already able to let the browser go fullscreen, but the lesson doesn't scale up, so it just ends up the same size in the top left corner, with then the rest of the screen in the color of 'stage background'. I hope we are just targeting the wrong div, but maybe you guys also have an idea on this topic.

Thanks in advance. Our project are getting better each time with all your tips and tricks emoticon

קבצים מצורפים:

0 (0 הצבעות)

RE: accessing external libraries
תשובה
19:05 10/09/24 כתגובה ל-Marcel Ooms
Hi Marcel,

PDF script
I think it may be from trying to run on your computer. I would test this only online from its delivery platform - you'll run into too many security restrictions elsewhere. Generally speaking with scripting stuff, can you get it to run in a browser totally independently of SmartBuilder? Once you can do that (which is usually the hard part), you can look at integrating with SmartBuilder. I don't know if you need to bundle the script with SmartBuilder, or if you can just have a standalone script that accepts a couple pieces of data on the URL string and then generates the PDF. So a script might live at:
https://www.mywebsite.com/pdfscript.js
And you might send a call using a HTTP block similar to:
https://www.mywebsite.com/pdfscript.js?name=John%20Doe&score=88
And then your script would parse that data and then generate the PDF accordingly.

Fullscreen
I've never done this before with an entire lesson. Is your lesson set to Scale on Desktop? (Edit > Lesson Settings > see image below). You might have to keep playing with it to find the right method. If I just F11 on my keyboard when viewing the published content, it seems to scale just fine.

Hope that helps a little!

- Nav

קבצים מצורפים:

קובץ מצורף

0 (0 הצבעות)