diff --git a/h5p/h5plib/v127/joubel/core/composer.json b/h5p/h5plib/v127/joubel/core/composer.json new file mode 100644 index 00000000000..84bd849a5c4 --- /dev/null +++ b/h5p/h5plib/v127/joubel/core/composer.json @@ -0,0 +1,35 @@ +{ + "name": "h5p/h5p-core", + "type": "library", + "description": "H5P Core functionality in PHP", + "keywords": ["h5p","hvp","interactive","content","quiz"], + "homepage": "https://h5p.org", + "license": "GPL-3.0", + "authors": [ + { + "name": "Svein-Tore Griff With", + "email": "with@joubel.com", + "homepage": "http://joubel.com", + "role": "CEO" + }, + { + "name": "Frode Petterson", + "email": "frode.petterson@joubel.com", + "homepage": "http://joubel.com", + "role": "Developer" + } + ], + "require": { + "php": ">=7.0.0" + }, + "autoload": { + "files": [ + "h5p.classes.php", + "h5p-development.class.php", + "h5p-file-storage.interface.php", + "h5p-default-storage.class.php", + "h5p-event-base.class.php", + "h5p-metadata.class.php" + ] + } +} diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.eot b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.eot deleted file mode 100644 index 4b2bf455c30..00000000000 Binary files a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.eot and /dev/null differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.svg b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.svg deleted file mode 100644 index 8150d8ba7f0..00000000000 --- a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - -{ - "fontFamily": "h5p-core-27", - "description": "Font generated by IcoMoon.", - "copyright": "H5P", - "majorVersion": 1, - "minorVersion": 1, - "version": "Version 1.1", - "fontId": "h5p-core-27", - "psName": "h5p-core-27", - "subFamily": "Regular", - "fullName": "h5p-core-27" -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.ttf b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.ttf deleted file mode 100644 index 520db3a9fa5..00000000000 Binary files a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.ttf and /dev/null differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.woff b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.woff deleted file mode 100644 index 6ba910961f4..00000000000 Binary files a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-28.woff and /dev/null differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.eot b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.eot new file mode 100644 index 00000000000..1f00b20c2ad Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.eot differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.svg b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.svg new file mode 100644 index 00000000000..7c1f4bc4457 --- /dev/null +++ b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.svg @@ -0,0 +1,599 @@ + +<<<<<<< HEAD + + +Copyright (C) 2024 by original authors @ fontello.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +======= + + + +Created by FontForge 20230101 at Fri Apr 12 21:40:06 2024 + By John Smith +H5P + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> cb09d99 (HFP-3875 Add icons for expand and collapse) diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.ttf b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.ttf new file mode 100644 index 00000000000..bfc840c3102 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.ttf differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.woff b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.woff new file mode 100644 index 00000000000..b3b11549440 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.woff differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.woff2 b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.woff2 new file mode 100644 index 00000000000..82d9c8b8564 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-29.woff2 differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.eot b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.eot new file mode 100644 index 00000000000..0ec19be77b7 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.eot differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.svg b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.svg new file mode 100644 index 00000000000..8be85fa677b --- /dev/null +++ b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.svg @@ -0,0 +1,123 @@ + + + + + + +{ + "fontFamily": "h5p-core-30", + "description": "Font generated by IcoMoon.", + "copyright": "H5P", + "majorVersion": 1, + "minorVersion": 9, + "version": "Version 1.9", + "fontId": "h5p-core-30", + "psName": "h5p-core-30", + "subFamily": "Regular", + "fullName": "h5p-core-30" +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.ttf b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.ttf new file mode 100644 index 00000000000..58ffb7803a1 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.ttf differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.woff b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.woff new file mode 100644 index 00000000000..d597b59cb56 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.woff differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.woff2 b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.woff2 new file mode 100644 index 00000000000..4e82ff90a57 Binary files /dev/null and b/h5p/h5plib/v127/joubel/core/fonts/h5p-core-30.woff2 differ diff --git a/h5p/h5plib/v127/joubel/core/fonts/h5p-hub-publish.svg b/h5p/h5plib/v127/joubel/core/fonts/h5p-hub-publish.svg index eec568bca03..e32badd40c3 100644 --- a/h5p/h5plib/v127/joubel/core/fonts/h5p-hub-publish.svg +++ b/h5p/h5plib/v127/joubel/core/fonts/h5p-hub-publish.svg @@ -1,6 +1,6 @@ - + diff --git a/h5p/h5plib/v127/joubel/core/h5p-default-storage.class.php b/h5p/h5plib/v127/joubel/core/h5p-default-storage.class.php index 80757d19f59..c2fc826b73e 100644 --- a/h5p/h5plib/v127/joubel/core/h5p-default-storage.class.php +++ b/h5p/h5plib/v127/joubel/core/h5p-default-storage.class.php @@ -1,7 +1,5 @@ <?php -namespace Moodle; - /** * File info? */ @@ -11,13 +9,13 @@ namespace Moodle; * operations using PHP's standard file operation functions. * * Some implementations of H5P that doesn't use the standard file system will - * want to create their own implementation of the H5P\FileStorage interface. + * want to create their own implementation of the \H5P\FileStorage interface. * * @package H5P * @copyright 2016 Joubel AS * @license MIT */ -class H5PDefaultStorage implements H5PFileStorage { +class H5PDefaultStorage implements \H5PFileStorage { private $path, $alteditorpath; /** @@ -41,10 +39,10 @@ class H5PDefaultStorage implements H5PFileStorage { * Library properties */ public function saveLibrary($library) { - $dest = $this->path . '/libraries/' . H5PCore::libraryToFolderName($library); + $dest = $this->path . '/libraries/' . \H5PCore::libraryToFolderName($library); // Make sure destination dir doesn't exist - H5PCore::deleteFileTree($dest); + \H5PCore::deleteFileTree($dest); // Move library folder self::copyFileTree($library['uploadDirectory'], $dest); @@ -66,7 +64,7 @@ class H5PDefaultStorage implements H5PFileStorage { $dest = "{$this->path}/content/{$content['id']}"; // Remove any old content - H5PCore::deleteFileTree($dest); + \H5PCore::deleteFileTree($dest); self::copyFileTree($source, $dest); } @@ -78,7 +76,7 @@ class H5PDefaultStorage implements H5PFileStorage { * Content properties */ public function deleteContent($content) { - H5PCore::deleteFileTree("{$this->path}/content/{$content['id']}"); + \H5PCore::deleteFileTree("{$this->path}/content/{$content['id']}"); } /** @@ -139,10 +137,14 @@ class H5PDefaultStorage implements H5PFileStorage { * Folder that library resides in */ public function exportLibrary($library, $target, $developmentPath=NULL) { - $folder = H5PCore::libraryToFolderName($library); + $srcFolder = \H5PCore::libraryToFolderName($library); + $srcPath = ($developmentPath === NULL ? "/libraries/{$srcFolder}" : $developmentPath); - $srcPath = ($developmentPath === NULL ? "/libraries/{$folder}" : $developmentPath); - self::copyFileTree("{$this->path}{$srcPath}", "{$target}/{$folder}"); + // Library folders inside the H5P zip file shall not contain patch version in the folder name + $library['patchVersionInFolderName'] = false; + $destinationFolder = \H5PCore::libraryToFolderName($library); + + self::copyFileTree("{$this->path}{$srcPath}", "{$target}/{$destinationFolder}"); } /** diff --git a/h5p/h5plib/v127/joubel/core/h5p-development.class.php b/h5p/h5plib/v127/joubel/core/h5p-development.class.php index b85df27150d..c2244025b25 100644 --- a/h5p/h5plib/v127/joubel/core/h5p-development.class.php +++ b/h5p/h5plib/v127/joubel/core/h5p-development.class.php @@ -1,7 +1,5 @@ <?php -namespace Moodle; - /** * This is a data layer which uses the file system so it isn't specific to any framework. */ diff --git a/h5p/h5plib/v127/joubel/core/h5p-event-base.class.php b/h5p/h5plib/v127/joubel/core/h5p-event-base.class.php index a3569add22b..454ea50de68 100644 --- a/h5p/h5plib/v127/joubel/core/h5p-event-base.class.php +++ b/h5p/h5plib/v127/joubel/core/h5p-event-base.class.php @@ -1,7 +1,5 @@ <?php -namespace Moodle; - /** * The base class for H5P events. Extend to track H5P events in your system. * diff --git a/h5p/h5plib/v127/joubel/core/h5p-file-storage.interface.php b/h5p/h5plib/v127/joubel/core/h5p-file-storage.interface.php index 724a75cab49..74565d40e17 100644 --- a/h5p/h5plib/v127/joubel/core/h5p-file-storage.interface.php +++ b/h5p/h5plib/v127/joubel/core/h5p-file-storage.interface.php @@ -1,7 +1,5 @@ <?php -namespace Moodle; - /** * File info? */ diff --git a/h5p/h5plib/v127/joubel/core/h5p-metadata.class.php b/h5p/h5plib/v127/joubel/core/h5p-metadata.class.php index 3c98aedb3db..5b045aaf46f 100644 --- a/h5p/h5plib/v127/joubel/core/h5p-metadata.class.php +++ b/h5p/h5plib/v127/joubel/core/h5p-metadata.class.php @@ -1,7 +1,4 @@ <?php - -namespace Moodle; - /** * Utility class for handling metadata */ diff --git a/h5p/h5plib/v127/joubel/core/h5p.classes.php b/h5p/h5plib/v127/joubel/core/h5p.classes.php index 50c698329ae..254e86ed27e 100644 --- a/h5p/h5plib/v127/joubel/core/h5p.classes.php +++ b/h5p/h5plib/v127/joubel/core/h5p.classes.php @@ -1,9 +1,4 @@ <?php - -namespace Moodle; - -use ZipArchive; - /** * Interface defining functions the h5p library needs the framework to implement */ @@ -1655,14 +1650,12 @@ class H5PStorage { H5PMetadata::boolifyAndEncodeSettings($library['metadataSettings']) : NULL; - // MOODLE PATCH: The library needs to be saved in database first before creating the files, because the libraryid is used - // as itemid for the files. - // Update our DB - $this->h5pF->saveLibraryData($library, $new); - // Save library folder $this->h5pC->fs->saveLibrary($library); + // Update our DB + $this->h5pF->saveLibraryData($library, $new); + // Remove cached assets that uses this library if ($this->h5pC->aggregateAssets && isset($library['libraryId'])) { $removedKeys = $this->h5pF->deleteCachedAssets($library['libraryId']); @@ -2079,13 +2072,14 @@ class H5PCore { public static $coreApi = array( 'majorVersion' => 1, - 'minorVersion' => 26 + 'minorVersion' => 27 ); public static $styles = array( 'styles/h5p.css', 'styles/h5p-confirmation-dialog.css', 'styles/h5p-core-button.css', 'styles/h5p-tooltip.css', + 'styles/h5p-table.css', ); public static $scripts = array( 'js/jquery.js', @@ -2104,8 +2098,8 @@ class H5PCore { 'js/h5p-utils.js', ); - public static $defaultContentWhitelist = 'json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt gltf glb'; - public static $defaultLibraryWhitelistExtras = 'js css'; + public static $defaultContentWhitelist = 'json png jpg jpeg gif bmp tif tiff eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp csv diff patch swf md textile vtt webvtt gltf glb'; + public static $defaultLibraryWhitelistExtras = 'js css svg xml'; public $librariesJsonData, $contentJsonData, $mainJsonData, $h5pF, $fs, $h5pD, $disableFileCheck; const SECONDS_IN_WEEK = 604800; @@ -2155,7 +2149,7 @@ class H5PCore { * * @param H5PFrameworkInterface $H5PFramework * The frameworks implementation of the H5PFrameworkInterface - * @param string|H5PFileStorage $path H5P file storage directory or class. + * @param string|\H5PFileStorage $path H5P file storage directory or class. * @param string $url To file storage directory. * @param string $language code. Defaults to english. * @param boolean $export enabled? @@ -2163,7 +2157,7 @@ class H5PCore { public function __construct(H5PFrameworkInterface $H5PFramework, $path, $url, $language = 'en', $export = FALSE) { $this->h5pF = $H5PFramework; - $this->fs = ($path instanceof H5PFileStorage ? $path : new H5PDefaultStorage($path)); + $this->fs = ($path instanceof \H5PFileStorage ? $path : new \H5PDefaultStorage($path)); $this->url = $url; $this->exportEnabled = $export; @@ -3330,22 +3324,21 @@ class H5PCore { * @return string */ private static function hashToken($action, $time_factor) { - global $SESSION; - if (!isset($SESSION->h5p_token)) { + if (!isset($_SESSION['h5p_token'])) { // Create an unique key which is used to create action tokens for this session. if (function_exists('random_bytes')) { - $SESSION->h5p_token = base64_encode(random_bytes(15)); + $_SESSION['h5p_token'] = base64_encode(random_bytes(15)); } else if (function_exists('openssl_random_pseudo_bytes')) { - $SESSION->h5p_token = base64_encode(openssl_random_pseudo_bytes(15)); + $_SESSION['h5p_token'] = base64_encode(openssl_random_pseudo_bytes(15)); } else { - $SESSION->h5p_token = uniqid('', TRUE); + $_SESSION['h5p_token'] = uniqid('', TRUE); } } // Create hash and return - return substr(hash('md5', $action . $time_factor . $SESSION->h5p_token), -16, 13); + return substr(hash('md5', $action . $time_factor . $_SESSION['h5p_token']), -16, 13); } /** @@ -3788,7 +3781,12 @@ class H5PCore { 'keywordsExits' => $this->h5pF->t('Keywords already exists!'), 'someKeywordsExits' => $this->h5pF->t('Some of these keywords already exist'), 'width' => $this->h5pF->t('width'), - 'height' => $this->h5pF->t('height') + 'height' => $this->h5pF->t('height'), + 'rotateLeft' => $this->h5pF->t('Rotate Left'), + 'rotateRight' => $this->h5pF->t('Rotate Right'), + 'cropImage' => $this->h5pF->t('Crop Image'), + 'confirmCrop' => $this->h5pF->t('Confirm Crop'), + 'cancelCrop' => $this->h5pF->t('Cancel Crop') ); } @@ -3966,7 +3964,6 @@ class H5PCore { } if (empty($siteUuid) || empty($secret)) { - $this->h5pF->setErrorMessage($this->h5pF->t('Missing Site UUID or Hub Secret. Please check your Hub registration.')); return false; } @@ -4170,7 +4167,20 @@ class H5PContentValidator { public $h5pF; public $h5pC; private $typeMap, $libraries, $dependencies, $nextWeight; - private static $allowed_styleable_tags = array('span', 'p', 'div','h1','h2','h3', 'td'); + private static $allowed_styleable_tags = [ + 'span', + 'p', + 'div', + 'h1', + 'h2', + 'h3', + 'table', + 'col', + 'figure', + 'td', + 'th', + 'li' + ]; /** @var bool Allowed styles status. */ protected $allowedStyles; @@ -4270,7 +4280,7 @@ class H5PContentValidator { // Add related tags for table etc. if (in_array('table', $tags)) { - $tags = array_merge($tags, array('tr', 'td', 'th', 'colgroup', 'thead', 'tbody', 'tfoot')); + $tags = array_merge($tags, array('tr', 'td', 'th', 'colgroup', 'col', 'thead', 'tbody', 'tfoot', 'figure', 'figcaption')); } if (in_array('b', $tags) && ! in_array('strong', $tags)) { $tags[] = 'strong'; @@ -4293,13 +4303,13 @@ class H5PContentValidator { $stylePatterns[] = '/^font-size: *[0-9.]+(em|px|%) *;?$/i'; } if (isset($semantics->font->family) && $semantics->font->family) { - $stylePatterns[] = '/^font-family: *[-a-z0-9," ]+;?$/i'; + $stylePatterns[] = '/^font-family: *[-a-z0-9,\'&; ]+;?$/i'; } if (isset($semantics->font->color) && $semantics->font->color) { - $stylePatterns[] = '/^color: *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)) *;?$/i'; + $stylePatterns[] = '/^color: *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)|hsla?\([0-9,.% ]+\)) *;?$/i'; } if (isset($semantics->font->background) && $semantics->font->background) { - $stylePatterns[] = '/^background-color: *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)) *;?$/i'; + $stylePatterns[] = '/^background-color: *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)|hsla?\([0-9,.% ]+\)) *;?$/i'; } if (isset($semantics->font->spacing) && $semantics->font->spacing) { $stylePatterns[] = '/^letter-spacing: *[0-9.]+(em|px|%) *;?$/i'; @@ -4309,6 +4319,28 @@ class H5PContentValidator { } } + // Allow styling of tables if they are allowed + if (isset($semantics->tags) && in_array('table', $semantics->tags)) { + // CKEditor outputs border as width style color + $stylePatterns[] = '/^border: *[0-9.]+(em|px|%|) *(none|solid|dotted|dashed|double|groove|ridge|inset|outset) *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)|hsla?\([0-9,.% ]+\)) *;?$/i'; + $stylePatterns[] = '/^border-style: *(none|solid|dotted|dashed|double|groove|ridge|inset|outset) *;?$/i'; + $stylePatterns[] = '/^border-width: *[0-9.]+(em|px|%|) *;?$/i'; + $stylePatterns[] = '/^border-color: *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)|hsla?\([0-9,.% ]+\)) *;?$/i'; + + $stylePatterns[] = '/^vertical-align: *(middle|top|bottom);?$/i'; + $stylePatterns[] = '/^padding: *[0-9.]+(em|px|%|) *;?$/i'; + $stylePatterns[] = '/^width: *[0-9.]+(em|px|%|) *;?$/i'; + $stylePatterns[] = '/^height: *[0-9.]+(em|px|%|) *;?$/i'; + $stylePatterns[] = '/^float: *(right|left|none) *;?$/i'; + + // Needed for backwards compatibility + $stylePatterns[] = '/^border-collapse: *collapse *;?$/i'; + + // Table can have background color when font bgcolor is disabled + // Double entry of bgcolor in stylePatterns shouldn't matter + $stylePatterns[] = '/^background-color: *(#[a-f0-9]{3}[a-f0-9]{3}?|rgba?\([0-9, ]+\)|hsla?\([0-9,.% ]+\)) *;?$/i'; + } + // Alignment is allowed for all wysiwyg texts $stylePatterns[] = '/^text-align: *(center|left|right);?$/i'; @@ -5005,13 +5037,25 @@ class H5PContentValidator { if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match)) { if ($allowedStyles && $attrName === 'style') { // Allow certain styles + + // Prevent font family from getting split wrong because of the ; in &quot; + if (str_contains($match[1], 'font-family')) { + $match[1] = str_replace('&quot;', "'", $match[1]); + } + + $validatedStyles = []; + $styles = explode(';', $match[1]); + foreach ($allowedStyles as $pattern) { - if (preg_match($pattern, $match[1])) { - // All patterns are start to end patterns, and CKEditor adds one span per style - $attrArr[] = 'style="' . $match[1] . '"'; - break; + foreach ($styles as $style) { + $style = trim($style); + if (preg_match($pattern, $style)) { + $validatedStyles[] = $style; + } } } + + $attrArr[] = 'style="' . implode(';', $validatedStyles) . ';"'; break; } diff --git a/h5p/h5plib/v127/joubel/core/images/h5p.svg b/h5p/h5plib/v127/joubel/core/images/h5p.svg index 9ef61ae8fb9..07191aa8b2a 100644 --- a/h5p/h5plib/v127/joubel/core/images/h5p.svg +++ b/h5p/h5plib/v127/joubel/core/images/h5p.svg @@ -2,7 +2,7 @@ <!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - viewBox="0 0 345 150" enable-background="new 0 0 345 150" xml:space="preserve" preserveAspectRatio="xMinYMid meet"> + viewBox="0 0 345 150" enable-background="new 0 0 345 150" xml:space="preserve"> <g> <path fill="#FFFFFF" d="M325.7,14.7C317.6,6.9,305.3,3,289,3h-43.5H234v31h-66l-5.4,22.2c4.5-2.1,10.9-4.2,15.3-5.3 c4.4-1.1,8.8-0.9,13.1-0.9c14.6,0,26.5,4.5,35.6,13.3c9.1,8.8,13.6,20,13.6,33.4c0,9.4-2.3,18.5-7,27.2c-4.7,8.7-11.3,15.4-19.9,20 diff --git a/h5p/h5plib/v127/joubel/core/js/h5p.js b/h5p/h5plib/v127/joubel/core/js/h5p.js index f6716506f38..c2732344756 100644 --- a/h5p/h5plib/v127/joubel/core/js/h5p.js +++ b/h5p/h5plib/v127/joubel/core/js/h5p.js @@ -186,7 +186,7 @@ H5P.init = function (target) { instance.triggerXAPI('accessed-reuse'); }); actionBar.on('copyrights', function () { - var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyrights, $container, $actions.find('.h5p-copyrights')[0]); + var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyrights, $container); dialog.open(true); instance.triggerXAPI('accessed-copyright'); }); @@ -1045,6 +1045,7 @@ H5P.t = function (key, vars, ns) { H5P.Dialog = function (name, title, content, $element, $returnElement) { /** @alias H5P.Dialog# */ var self = this; + this.activeElement = document.activeElement; var $dialog = H5P.jQuery('<div class="h5p-popup-dialog h5p-' + name + '-dialog" aria-labelledby="' + name + '-dialog-header" aria-modal="true" role="dialog" tabindex="-1">\ <div class="h5p-inner">\ <h2 id="' + name + '-dialog-header">' + title + '</h2>\ @@ -1109,6 +1110,9 @@ H5P.Dialog = function (name, title, content, $element, $returnElement) { if ($returnElement) { $returnElement.focus(); } + else if(self.activeElement) { + self.activeElement.focus(); + } else { $element.focus(); } @@ -1894,7 +1898,7 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) { * @param {string} source * @param {number} width * @param {number} height - * @param {string} alt + * @param {string} alt * alternative text for the thumbnail */ H5P.Thumbnail = function (source, width, height, alt) { @@ -2373,11 +2377,6 @@ H5P.createTitle = function (rawTitle, maxLength) { done('Not signed in.'); return; } - // Moodle patch to let override this method. - if (H5P.contentUserDataAjax !== undefined) { - return H5P.contentUserDataAjax(contentId, dataType, subContentId, done, data, preload, invalidate, async); - } - // End of Moodle patch. var options = { url: H5PIntegration.ajax.contentUserData.replace(':contentId', contentId).replace(':dataType', dataType).replace(':subContentId', subContentId ? subContentId : 0), @@ -2721,7 +2720,7 @@ H5P.createTitle = function (rawTitle, maxLength) { } return path.substr(0, prefix.length) === prefix ? path : prefix + path; } - + return path; // Will automatically be looked for in tmp folder }); diff --git a/h5p/h5plib/v127/joubel/core/styles/h5p-table.css b/h5p/h5plib/v127/joubel/core/styles/h5p-table.css new file mode 100644 index 00000000000..e781bdce389 --- /dev/null +++ b/h5p/h5plib/v127/joubel/core/styles/h5p-table.css @@ -0,0 +1,56 @@ +/* Table styling for content types to imitate ckeditor 5 */ +.h5p-iframe { + /* The figure around the table */ + figure.table { + display: table; + table-layout: fixed; + margin: 0 auto; + padding: 0; + float: left; + + /* The actual table */ + table { + border-collapse: collapse; + height: 100%; + width: 100%; + border-spacing: 0; + border-width: 1px; + border-color: #494949; + + td, th { + padding: 1px; + border-color: #494949; + border-bottom-style: solid; + } + + td { + border-width: 0.083em; + } + + th { + text-align: left; + border-width: .167em; + } + + tr:last-child > td { + border-bottom-style: none; + } + } + + figcaption { + background-color: transparent; + caption-side: top; + color: #333; + display: table-caption; + font-size: .75em; + outline-offset: -1px; + padding: .6em; + text-align: center; + word-break: break-word; + } + } + + .table-overflow-protection { + clear: both; + } +} diff --git a/h5p/h5plib/v127/joubel/core/styles/h5p.css b/h5p/h5plib/v127/joubel/core/styles/h5p.css index c0a18a54ab4..b4f65182049 100644 --- a/h5p/h5plib/v127/joubel/core/styles/h5p.css +++ b/h5p/h5plib/v127/joubel/core/styles/h5p.css @@ -4,11 +4,11 @@ /* Custom H5P font to use for icons. */ @font-face { font-family: 'h5p'; - src: url('../fonts/h5p-core-28.eot?h1atjl'); - src: url('../fonts/h5p-core-28.eot?h1atjl#iefix') format('embedded-opentype'), - url('../fonts/h5p-core-28.ttf?h1atjl') format('truetype'), - url('../fonts/h5p-core-28.woff?h1atjl') format('woff'), - url('../fonts/h5p-core-28.svg?h1atjl#h5p-core-28') format('svg'); + src: url('../fonts/h5p-core-30.eot?h1atjl'); + src: url('../fonts/h5p-core-30.eot?h1atjl#iefix') format('embedded-opentype'), + url('../fonts/h5p-core-30.ttf?h1atjl') format('truetype'), + url('../fonts/h5p-core-30.woff?h1atjl') format('woff'), + url('../fonts/h5p-core-30.svg?h1atjl#h5p-core-30') format('svg'); font-weight: normal; font-style: normal; }