Get current library version to use with getLibraryPath
Submitted by Degrange on Mon, 04/12/2021 - 00:34
Forums:
Hi,
I am developping an h5p editor widget.
I need to manualy import some javascript during execution (I can't use preloadedJs). In order to do that, I need the path of my current library.
There is the h5p.getLibraryPath function, but it require the full machine name of my library, including the version number.
I was wondering if there was a way to access library version / full machine name to avoid hardcoding the version number in my javascript file.
Thanks !
Degrange
Mon, 04/12/2021 - 00:45
Permalink
An ugly way to do it would be
An ugly way to do it would be to use H5PEditor.libraryCache[this.parent.currentLibrary].javascript
By searching my current widget name I can find the path but it's a very ugly way to do.