Merge branch 'master' of github.com:h5p/h5p-php-library
commit
500c264b88
|
@ -1715,6 +1715,12 @@ abstract class H5PDisplayOptionBehaviour {
|
|||
|
||||
abstract class H5PHubEndpoints {
|
||||
const CONTENT_TYPES = 'api.h5p.org/v1/content-types/';
|
||||
const SITES = 'api.h5p.org/v1/sites';
|
||||
|
||||
public static function createURL($endpoint) {
|
||||
$protocol = (extension_loaded('openssl') ? 'https' : 'http');
|
||||
return "{$protocol}://{$endpoint}";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2465,9 +2471,7 @@ class H5PCore {
|
|||
|
||||
// Register site if it is not registered
|
||||
if (empty($uuid)) {
|
||||
$protocol = (extension_loaded('openssl') ? 'https' : 'http');
|
||||
$endpoint = 'api.h5p.org/v1/sites';
|
||||
$registration = $this->h5pF->fetchExternalData("{$protocol}://{$endpoint}", $registrationData);
|
||||
$registration = $this->h5pF->fetchExternalData(H5PHubEndpoints::createURL(H5PHubEndpoints::SITES), $registrationData);
|
||||
|
||||
// Failed retrieving uuid
|
||||
if (!$registration) {
|
||||
|
@ -2874,9 +2878,7 @@ class H5PCore {
|
|||
|
||||
$postData['current_cache'] = $this->h5pF->getOption('content_type_cache_updated_at', 0);
|
||||
|
||||
$protocol = (extension_loaded('openssl') ? 'https' : 'http');
|
||||
$endpoint = H5PHubEndpoints::CONTENT_TYPES;
|
||||
$data = $interface->fetchExternalData("{$protocol}://{$endpoint}", $postData);
|
||||
$data = $interface->fetchExternalData(H5PHubEndpoints::createURL(H5PHubEndpoints::CONTENT_TYPES), $postData);
|
||||
|
||||
if (! $this->h5pF->getOption('hub_is_enabled', TRUE)) {
|
||||
return TRUE;
|
||||
|
|
|
@ -93,10 +93,6 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
|||
* Creates the pager element on the bottom of the list
|
||||
*/
|
||||
H5PLibraryDetails.createPagerElement = function () {
|
||||
|
||||
// Only create pager if needed:
|
||||
if(H5PLibraryDetails.currentContent.length > H5PLibraryDetails.PAGER_SIZE) {
|
||||
|
||||
H5PLibraryDetails.$previous = $('<button type="button" class="previous h5p-admin"><</button>');
|
||||
H5PLibraryDetails.$next = $('<button type="button" class="next h5p-admin">></button>');
|
||||
|
||||
|
@ -174,7 +170,6 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
|||
});
|
||||
|
||||
H5PLibraryDetails.updatePager();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
12
js/h5p.js
12
js/h5p.js
|
@ -247,7 +247,7 @@ H5P.init = function (target) {
|
|||
if (H5P.externalEmbed === false) {
|
||||
// Internal embed
|
||||
// Make it possible to resize the iframe when the content changes size. This way we get no scrollbars.
|
||||
var iframe = window.parent.document.getElementById('h5p-iframe-' + contentId);
|
||||
var iframe = window.frameElement;
|
||||
var resizeIframe = function () {
|
||||
if (window.parent.H5P.isFullscreen) {
|
||||
return; // Skip if full screen.
|
||||
|
@ -501,8 +501,7 @@ H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFull
|
|||
// We're called from an iframe.
|
||||
$body = H5P.jQuery(body);
|
||||
$classes = $body.add($element.get());
|
||||
var contentId = $element.closest('[data-content-id]').data('content-id');
|
||||
var iframeSelector = '#h5p-iframe-' + contentId;
|
||||
var iframeSelector = '#h5p-iframe-' + $element.parent().data('content-id');
|
||||
$iframe = H5P.jQuery(iframeSelector);
|
||||
$element = $iframe.parent(); // Put iframe wrapper in fullscreen, not container.
|
||||
}
|
||||
|
@ -1272,9 +1271,14 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
|
|||
|
||||
// Check for version info
|
||||
var versionInfo;
|
||||
if (copyrightLicense.versions) {
|
||||
if (copyrightLicense.versions.default && (!version || !copyrightLicense.versions[version])) {
|
||||
version = copyrightLicense.versions.default;
|
||||
}
|
||||
if (version && copyrightLicense.versions[version]) {
|
||||
versionInfo = copyrightLicense.versions[version];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInfo) {
|
||||
// Add license version
|
||||
|
@ -2031,6 +2035,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
|||
$(document).ready(function () {
|
||||
|
||||
var ccVersions = {
|
||||
'default': '4.0',
|
||||
'4.0': H5P.t('licenseCC40'),
|
||||
'3.0': H5P.t('licenseCC30'),
|
||||
'2.5': H5P.t('licenseCC25'),
|
||||
|
@ -2084,6 +2089,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
|||
'v1': '1.0'
|
||||
},
|
||||
versions: {
|
||||
'default': 'v3',
|
||||
'v3': H5P.t('licenseV3'),
|
||||
'v2': H5P.t('licenseV2'),
|
||||
'v1': H5P.t('licenseV1')
|
||||
|
|
Loading…
Reference in New Issue