diff --git a/js/h5p.js b/js/h5p.js index 4eb8c80..b65fbaf 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -4,13 +4,18 @@ window.H5P = window.H5P || {}; // Initialize H5P content // Scans for ".h5p-content" H5P.init = function () { - $(".h5p-content").each(function (idx, el) { + H5P.jQuery(".h5p-content").each(function (idx, el) { var $el = H5P.jQuery(el); - var obj = new (H5P.classFromName($el.data('class')))(H5P.jQuery.parseJSON(Drupal.settings.h5p.jsonContent)); + var contentId = $el.data('content-id'); + var obj = new (H5P.classFromName($el.data('class')))(H5P.jQuery.parseJSON(H5PIntegration.getJsonContent(contentId)), contentId); obj.attach($el); }); }; +H5P.getContentPath = function(contentId) { + H5PIntegration.getContentPath(contentId); +} + // // Used from libraries to construct instances of other libraries' objects by // name.