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

@ -90,10 +90,10 @@ interface H5PFrameworkInterface {
* FALSE otherwise * FALSE otherwise
*/ */
public function isPatchedLibrary($library); public function isPatchedLibrary($library);
/** /**
* Is H5P in development mode? * Is H5P in development mode?
* *
* @return boolean * @return boolean
* TRUE if H5P development mode is active * TRUE if H5P development mode is active
* FALSE otherwise * FALSE otherwise
@ -784,12 +784,12 @@ class H5PValidator {
*/ */
private function getJsonData($filePath, $return_as_string = FALSE) { private function getJsonData($filePath, $return_as_string = FALSE) {
$json = file_get_contents($filePath); $json = file_get_contents($filePath);
if (!$json) { if ($json === FALSE) {
return FALSE; return FALSE; // Cannot read from file.
} }
$jsonData = json_decode($json, TRUE); $jsonData = json_decode($json, TRUE);
if (!$jsonData) { if ($jsonData === NULL) {
return FALSE; return FALSE; // JSON cannot be decoded or the recursion limit has been reached.
} }
return $return_as_string ? $json : $jsonData; return $return_as_string ? $json : $jsonData;
} }

View File

@ -44,7 +44,7 @@ H5P.init = function () {
obj.attach($el); obj.attach($el);
if (H5PIntegration.getFullscreen(contentId)) { 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); H5P.fullScreen($el, obj);
return false; return false;
}); });
@ -303,6 +303,20 @@ H5P.shuffleArray = function(array) {
return 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) // Add indexOf to browsers that lack them. (IEs)
if(!Array.prototype.indexOf) { if(!Array.prototype.indexOf) {
Array.prototype.indexOf = function(needle) { Array.prototype.indexOf = function(needle) {

View File

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