Merge branch 'without-pal' of github.com:h5p/h5p-php-library into without-pal

namespaces
Frode Petterson 2014-09-23 15:10:42 +02:00
commit 909fb3aca3
2 changed files with 11 additions and 2 deletions

View File

@ -1251,7 +1251,9 @@ Class H5PExport {
// Build h5p.json // Build h5p.json
$h5pJson = array ( $h5pJson = array (
'title' => $content['title'], 'title' => $content['title'],
'language' => $content['language'], // TODO - stop using 'und', this is not the preferred way.
// Either remove language from the json if not existing, or use "language": null
'language' => isset($content['language']) ? $content['language'] : 'und',
'mainLibrary' => $content['library']['name'], 'mainLibrary' => $content['library']['name'],
'embedTypes' => $embedTypes, 'embedTypes' => $embedTypes,
); );
@ -1344,7 +1346,7 @@ class H5PCore {
public static $coreApi = array( public static $coreApi = array(
'majorVersion' => 1, 'majorVersion' => 1,
'minorVersion' => 3 'minorVersion' => 4
); );
public static $styles = array( public static $styles = array(
'styles/h5p.css', 'styles/h5p.css',

View File

@ -975,6 +975,13 @@ H5P.setFinished = function (contentId, points, maxPoints) {
} }
}; };
/**
* Mimics how php's htmlspecialchars works (the way we use it)
*/
H5P.htmlSpecialChars = function(string) {
return string.toString().replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g, '&#039;').replace(/"/g, '&quot;');
};
// 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) {