diff --git a/h5p.classes.php b/h5p.classes.php index 796a564..5b60b58 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -244,7 +244,7 @@ class H5PValidator { private $h5pOptional = array( 'contentType' => '/^.{1,255}$/', 'author' => '/^.{1,255}$/', - 'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT)$/', + 'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT|GPL1|GPL2|GPL3|MPL|MPL2)$/', 'dynamicDependencies' => array( 'machineName' => '/^[\w0-9\-\.]{1,255}$/i', 'majorVersion' => '/^[0-9]{1,5}$/', @@ -268,7 +268,7 @@ class H5PValidator { private $libraryOptional = array( 'author' => '/^.{1,255}$/', - 'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT|GPL1|GPL2|GPL3)$/', + 'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT|GPL1|GPL2|GPL3|MPL|MPL2)$/', 'description' => '/^.{1,}$/', 'dynamicDependencies' => array( 'machineName' => '/^[\w0-9\-\.]{1,255}$/i', @@ -1225,6 +1225,9 @@ class H5PContentValidator { if (in_array('ul', $tags) || in_array('ol', $tags) && ! in_array('li', $tags)) { $tags[] = 'li'; } + if (in_array('del', $tags) || in_array('strike', $tags) && ! in_array('s', $tags)) { + $tags[] = 's'; + } // Strip invalid HTML tags. $text = $this->filter_xss($text, $tags); } diff --git a/js/h5p.js b/js/h5p.js index 75e42ee..7e9b3fb 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -68,19 +68,17 @@ H5P.init = function () { // H5Ps living in iframes. Note: Fullscreen button will be added // inside iFrame if relevant var $h5pIframes = H5P.jQuery(".h5p-iframe"); - $h5pIframes.each(function (idx, iframe) { - var $iframe = H5P.jQuery(iframe), - contentId = $iframe.data('content-id'), - mainLibrary = $iframe.data('class'); - - // Get iFrame body, and reset it to contain only the normal H5P DIV. - $iframe.contents().find('body') - .html('
'); - - // Add scripts required for this iFrame from settings - H5PIntegration.addFilesToIframe($iframe, contentId); - }); if ($h5pIframes.length !== 0) { + $h5pIframes.each(function (idx, iframe) { + var $iframe = H5P.jQuery(iframe), + contentId = $iframe.data('content-id'), + mainLibrary = $iframe.data('class'); + + iframe.contentDocument.open(); + iframe.contentDocument.write('' + H5PIntegration.getHeadTags(contentId) + '
'); + iframe.contentDocument.close(); + }); + // TODO: This seems very hacky... why can't we just use the resize event? What happens if we ain't done before the next interval starts? setInterval(function () { $h5pIframes.each(function (idx, iframe) { @@ -430,7 +428,7 @@ if (String.prototype.trim === undefined) { // Finally, we want to run init when document is ready. But not if we're // in an iFrame. Then we wait for parent to start init(). -if (H5P.jQuery && !H5P.isFramed) { +if (H5P.jQuery) { H5P.jQuery(document).ready(function () { if (!H5P.initialized) { H5P.initialized = true;