Make it possible to have multiple content on one page, and also make it possible to get path to content folder

namespaces
Svein-Tore Griff With 2013-01-17 22:20:41 +01:00
parent 412a90964d
commit ecb795f655
1 changed files with 7 additions and 2 deletions

View File

@ -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.