Fix styling issues for sites that has uncleard floating blocks

namespaces
Svein-Tore Griff With 2013-10-21 13:22:13 +02:00
parent ece7b5bcde
commit f939e00f44
3 changed files with 23 additions and 12 deletions

View File

@ -784,12 +784,12 @@ class H5PValidator {
*/
private function getJsonData($filePath, $return_as_string = FALSE) {
$json = file_get_contents($filePath);
if (!$json) {
return FALSE;
if ($json === FALSE) {
return FALSE; // Cannot read from file.
}
$jsonData = json_decode($json, TRUE);
if (!$jsonData) {
return FALSE;
if ($jsonData === NULL) {
return FALSE; // JSON cannot be decoded or the recursion limit has been reached.
}
return $return_as_string ? $json : $jsonData;
}

View File

@ -44,7 +44,7 @@ H5P.init = function () {
obj.attach($el);
if (H5PIntegration.getFullscreen(contentId)) {
H5P.jQuery('<div class="h5p-content-controls"><a href="#" class="h5p-enable-fullscreen">' + H5PIntegration.fullscreenText + '</a><div>').insertBefore($el).children().click(function () {
H5P.jQuery('<div class="h5p-content-controls"><a href="#" class="h5p-enable-fullscreen">' + H5PIntegration.fullscreenText + '</a></div>').insertBefore($el).children().click(function () {
H5P.fullScreen($el, obj);
return false;
});
@ -303,6 +303,20 @@ H5P.shuffleArray = function(array) {
return array;
};
/**
* Post finished results for user.
*
* @param {Number} contentId
* @param {Number} points
* @param {Number} maxPoints
*/
H5P.setFinished = function (contentId, points, maxPoints) {
return; // Not yet implemented for Drupal!
if (H5P.postUserStatistics === true) {
H5P.jQuery.post(H5P.ajaxPath + 'setFinished', {contentId: contentId, points: points, maxPoints: maxPoints});
}
};
// Add indexOf to browsers that lack them. (IEs)
if(!Array.prototype.indexOf) {
Array.prototype.indexOf = function(needle) {

View File

@ -16,9 +16,7 @@ div.h5p-semi-fullscreen {
.h5p-content-controls {
margin-bottom: 10px;
}
.h5p-content-controls > div:last-child {
clear: both;
text-align: right;
}
.h5p-content-controls > a:link, .h5p-content-controls > a:visited, a.h5p-disable-fullscreen:link, a.h5p-disable-fullscreen:visited {
@ -26,8 +24,7 @@ div.h5p-semi-fullscreen {
}
.h5p-enable-fullscreen, .h5p-disable-fullscreen {
float: right;
display: block;
display: inline-block;
padding: 6px 12px;
background: #539ad7;
background-image: -webkit-linear-gradient(top, #4584ba, #539ad7);