Proper method of using library packages, local scripts, modules etc.
I'm wondering if there is documentation or an example of the intended use of package libraries vs. local scripts. I've found I'm sometimes unable to reference library methods after installing via package manager (For example: jQuery 3 off of the WebIQ website, custom packages built following documentation). This isn't the case 100% of the time though. I've been able to work around these issues by copying and pasting sections of the library code into local scripts.
Main questions:
1. When and how to use library packages properly?
2. How to include javascript modules in local scripts or libraries?
3. Packaging of custom resources (ie. images,video,models)? I've got this working by adding a /resources directory inside of the webiq-designer/workspace folder and building the project. Is there a method within the designer?
Â
Best reply by webiq-sk
Libraries are meant for code that can be used by LocalScripts etc. and do not do anything on their own without being used, e.g. jQuery, three.js, Chart.js any other JavaScript libraries etc. The define functionalities.
Library packages have to be created according to the documentation and used in your LocalScript as you would normally on any other website.
All libraries added as packages are automatically added to the HTML code (just inspect the HTML code of your HMI in your browser and you will see script tags with the includes of your libraries there) - it's essentially just a normal website (that has been enriched with functionality) as any web HMI is:
You can put custom resources anywhere in your HMI directory - as with any normal website. It doesn't matter whether you put it in a directory named "resources" or "abcd" - you only have to reference the path when using it. You cannot currently upload arbitrary files within WebIQ Designer, simply use File Explorer for that.
Please remember that there are two ways to add files: - with the app being loaded in WebIQ Designer: %APPDATA%\webiq-designer\workspace - with the app not loaded and not running in WebIQ Server/Runtime: %PROGRAMDATA%\WebIQ\WebIQ Projects\{YOUR PROJECT NAME}