From 6af3add7fd4bd4dea650df83b52c607e63612c9d Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 14 Jan 2025 12:46:20 +0100 Subject: [PATCH 01/14] coding style fixes --- ajax.php | 2 +- classes/local/opencast_manager.php | 10 +++++----- classes/local/theme_manager.php | 6 +++--- classes/local/video_manager.php | 12 ++++++------ classes/privacy/provider.php | 2 +- lib.php | 6 +++--- settings.php | 4 ++-- tests/behat/behat_local_och5pcore.php | 4 ++-- version.php | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ajax.php b/ajax.php index e9378ef..89f044c 100755 --- a/ajax.php +++ b/ajax.php @@ -76,7 +76,7 @@ die; } -$data = array(); +$data = []; switch ($action) { case 'courseVideos': diff --git a/classes/local/opencast_manager.php b/classes/local/opencast_manager.php index c249587..0ed6ee3 100644 --- a/classes/local/opencast_manager.php +++ b/classes/local/opencast_manager.php @@ -27,7 +27,7 @@ use tool_opencast\local\api; use block_opencast\local\apibridge; -use \tool_opencast\local\settings_api; +use tool_opencast\local\settings_api; use oauth_helper; use moodle_exception; @@ -138,7 +138,7 @@ public static function get_episode_tracks($identifier) { } // Initialise the sorted videos array. - $sortedvideos = array(); + $sortedvideos = []; foreach ($videotracks as $videotrack) { @@ -271,11 +271,11 @@ public static function generate_lti_params($courseid, $endpoint) { } $endpoint .= '/lti'; - $helper = new oauth_helper(array('oauth_consumer_key' => $consumerkey, - 'oauth_consumer_secret' => $consumersecret)); + $helper = new oauth_helper(['oauth_consumer_key' => $consumerkey, + 'oauth_consumer_secret' => $consumersecret]); // Set all necessary parameters. - $params = array(); + $params = []; $params['oauth_version'] = '1.0'; $params['oauth_nonce'] = $helper->get_nonce(); $params['oauth_timestamp'] = $helper->get_timestamp(); diff --git a/classes/local/theme_manager.php b/classes/local/theme_manager.php index 0a93737..d7af21c 100644 --- a/classes/local/theme_manager.php +++ b/classes/local/theme_manager.php @@ -52,7 +52,7 @@ public static function extend_themes($themes) { global $CFG; // Initialise the extended themes array list. - $extendedthemes = array(); + $extendedthemes = []; // Gather all required contents. $renderercontent = file_get_contents($CFG->dirroot . '/local/och5pcore/lib/extension_contents/renderer_content.txt'); @@ -143,7 +143,7 @@ public static function extend_themes($themes) { */ public static function remove_themes_extension($themes) { // Initialise the list of themes failed to remove extension. - $failedtoremoveextension = array(); + $failedtoremoveextension = []; foreach ($themes as $themename) { // Get the directory of the theme. @@ -214,7 +214,7 @@ public static function cleaup_themes_extension() { // We define the clean-up flags here. // Start and End of a flag help to locate the codes better. $cleanupflags = [ - ['start' => '//#och5p_core', 'end' => '//#end_och5p_core'] + ['start' => '//#och5p_core', 'end' => '//#end_och5p_core'], ]; foreach ($installedthemes as $themename => $themedir) { diff --git a/classes/local/video_manager.php b/classes/local/video_manager.php index 2888f5e..2cbb3cb 100644 --- a/classes/local/video_manager.php +++ b/classes/local/video_manager.php @@ -54,7 +54,7 @@ public static function prepare_course_videos($courseid) { } // Initialise options array with an empty option. - $options = array(''); + $options = ['']; // Loop through videos if there is any. foreach ($coursevideos->videos as $video) { @@ -77,11 +77,11 @@ public static function get_video_flavors_with_qualities($identifier) { $sortedvideos = opencast_manager::get_episode_tracks($identifier); // Initialise options array with an empty option tag. - $options = array(''); + $options = ['']; foreach ($sortedvideos as $flavor => $qualities) { // Extract type and mime from the item. - $obj = array(); + $obj = []; $obj['type'] = ((strpos($flavor, 'presenter/delivery') !== false) ? get_string('flavor:presenter', 'local_och5pcore') : get_string('flavor:presentation', 'local_och5pcore')); @@ -92,8 +92,8 @@ public static function get_video_flavors_with_qualities($identifier) { $optiontext = "{$obj['type']} ({$obj['mime']})"; // Extract and place the qualities. - $optionvalue = array(); - $qualitiesarray = array(); + $optionvalue = []; + $qualitiesarray = []; foreach ($qualities as $quality => $video) { $qualitydatastring = '{"quality": "' . $quality . '", "url": "' . $video['url'] . '", "mime": "' . $match[1] . '", "id": "' . $video['id'] . @@ -130,7 +130,7 @@ public static function get_course_lists() { // Get the enrolled courses. $courses = enrol_get_my_courses(); // Initialise options array with an empty option tag. - $options = array(''); + $options = ['']; foreach ($courses as $course) { $context = \context_course::instance($course->id); if (!is_null($context) && has_capability('block/opencast:viewunpublishedvideos', $context)) { diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index c8adad2..ac5ebe6 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -41,7 +41,7 @@ class provider implements \core_privacy\local\metadata\null_provider { * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } } diff --git a/lib.php b/lib.php index 255c17a..029687b 100755 --- a/lib.php +++ b/lib.php @@ -33,9 +33,9 @@ function local_och5pcore_extend_themes() { $returnurl = new moodle_url('/admin/settings.php?section=local_och5pcore_settings'); $config = get_config('local_och5pcore', 'extended_themes'); - $selectedthemes = !empty($config) ? explode(',', $config) : array(); + $selectedthemes = !empty($config) ? explode(',', $config) : []; - $installedthemes = core_component::get_plugin_list('theme'); + $installedthemes = \core\component::get_plugin_list('theme'); $unselectedthemes = array_diff(array_keys($installedthemes), $selectedthemes); @@ -43,7 +43,7 @@ function local_och5pcore_extend_themes() { $extendedthemes = theme_manager::extend_themes($selectedthemes); if ($diffs = array_diff($selectedthemes, $extendedthemes)) { - $themenames = array(); + $themenames = []; foreach ($diffs as $diff) { $themenames[] = ucfirst(str_replace('_', ' ', $diff)); } diff --git a/settings.php b/settings.php index 61155ff..91108b7 100755 --- a/settings.php +++ b/settings.php @@ -41,7 +41,7 @@ get_string('setting_extended_themes_header', 'local_och5pcore'), '')); - $availablethemes = array(); + $availablethemes = []; foreach (\core_component::get_plugin_list('theme') as $name => $dir) { $availablethemes[$name] = ucfirst(str_replace('_', ' ', $name)); @@ -51,7 +51,7 @@ 'local_och5pcore/extended_themes', get_string('setting_extended_themes', 'local_och5pcore'), get_string('setting_extended_themes_desc', 'local_och5pcore'), - array(), + [], $availablethemes ); diff --git a/tests/behat/behat_local_och5pcore.php b/tests/behat/behat_local_och5pcore.php index 6e6b142..d88982c 100644 --- a/tests/behat/behat_local_och5pcore.php +++ b/tests/behat/behat_local_och5pcore.php @@ -59,7 +59,7 @@ public function breakpoint_in_och5pcore() { * @Given /^I setup the opencast video block for the course with och5pcore$/ */ public function i_setup_the_opencast_video_block_for_the_course_with_och5pcore() { - $courses = core_course_category::search_courses(array('search' => 'Course 1')); + $courses = core_course_category::search_courses(['search' => 'Course 1']); // When we are using stable.opencast.org, the series Blender Foundation Productions with id: ID-blender-foundation, // is by default avaialble. Therefore, and as for make things simpler, we use this series in our course. @@ -84,7 +84,7 @@ public function i_get_the_latest_h5p_content_types() { 'minorVersion' => 26, 'patchVersion' => 6, 'example' => "https://h5p.org/interactive-video", - 'tutorial' => "https://h5p.org/tutorial-interactive-video" + 'tutorial' => "https://h5p.org/tutorial-interactive-video", ]; $res = $core->fetch_content_type($library); } diff --git a/version.php b/version.php index 26a844b..dab9ed9 100755 --- a/version.php +++ b/version.php @@ -32,5 +32,5 @@ $plugin->requires = 2020110900; // Only Moodle v3.10 and above. $plugin->dependencies = [ 'tool_opencast' => 2023030100, - 'block_opencast' => 2023030100 + 'block_opencast' => 2023030100, ]; From 9425132b156e01755e55c0f5c7dc8bcc74f8b7f1 Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 14 Jan 2025 12:46:33 +0100 Subject: [PATCH 02/14] lang string sorting --- lang/en/local_och5pcore.php | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lang/en/local_och5pcore.php b/lang/en/local_och5pcore.php index 3051a14..96c3f5f 100755 --- a/lang/en/local_och5pcore.php +++ b/lang/en/local_och5pcore.php @@ -24,32 +24,32 @@ */ defined('MOODLE_INTERNAL') || die; +$string['behat_error_unabletofind_element'] = 'Unable to locate element in the page'; +$string['extended_error'] = 'Unable to extend theme(s): %s'; +$string['flavor:presentation'] = 'Presentation'; +$string['flavor:presenter'] = 'Presenter'; +$string['header_text'] = 'Opencast Videos'; +$string['invalidtoken_error'] = 'Invalid token - token not found'; +$string['label_course'] = 'Select a course'; +$string['label_video_file'] = 'Select a video file'; +$string['label_video_flavor'] = 'Select the video\'s flavor and quality'; +$string['no_action_error'] = 'Undefined action.'; +$string['no_admin_user_error'] = 'Only admins can access this feature.'; +$string['no_lti_config_error'] = 'Unable to perform Opencast LTI authentication in H5P'; +$string['no_tracks_error'] = 'Invalid video data.'; +$string['no_view_error'] = 'The opencast view capability is not granted.'; $string['pluginname'] = 'H5P Opencast Extension (Core)'; -$string['setting_extended_themes_header'] = 'Themes'; +$string['privacy:metadata'] = 'The H5P Opencast Extension (Core) only works as an integration of Opencast into H5P and store no user data.'; +$string['search_episode_error'] = 'Unable to get video data from opencast.'; $string['setting_extended_themes'] = 'Available themes to extend'; $string['setting_extended_themes_desc'] = 'Select the themes that should be extended to show Opencast Videos in H5P Interactive videos. Hold down the Ctrl key to select multiple themes. Unselecting a theme will remove the previous extension.'; -$string['setting_lti_header'] = 'LTI Configuration'; -$string['setting_lti_header_desc'] = 'When "Securing Static Files" in Opencast configuration is enabled, it is necessary to use LTI authentication.'; +$string['setting_extended_themes_header'] = 'Themes'; $string['setting_lti_consumerkey'] = 'LTI Consumer key'; $string['setting_lti_consumerkey_desc'] = 'LTI Consumer key for the opencast.'; $string['setting_lti_consumersecret'] = 'LTI Consumer Secret'; $string['setting_lti_consumersecret_desc'] = 'LTI Consumer Secret for the opencast.'; -$string['extended_error'] = 'Unable to extend theme(s): %s'; +$string['setting_lti_header'] = 'LTI Configuration'; +$string['setting_lti_header_desc'] = 'When "Securing Static Files" in Opencast configuration is enabled, it is necessary to use LTI authentication.'; $string['unextended_error'] = 'Unable to unextend theme(s): %s'; -$string['flavor:presenter'] = 'Presenter'; -$string['flavor:presentation'] = 'Presentation'; $string['video_course_error'] = 'An error occured while obtaining Opencast course videos.'; -$string['search_episode_error'] = 'Unable to get video data from opencast.'; -$string['no_tracks_error'] = 'Invalid video data.'; -$string['no_admin_user_error'] = 'Only admins can access this feature.'; -$string['no_action_error'] = 'Undefined action.'; -$string['no_view_error'] = 'The opencast view capability is not granted.'; -$string['no_lti_config_error'] = 'Unable to perform Opencast LTI authentication in H5P'; -$string['invalidtoken_error'] = 'Invalid token - token not found'; -$string['privacy:metadata'] = 'The H5P Opencast Extension (Core) only works as an integration of Opencast into H5P and store no user data.'; -$string['label_video_file'] = 'Select a video file'; -$string['label_video_flavor'] = 'Select the video\'s flavor and quality'; -$string['label_course'] = 'Select a course'; -$string['header_text'] = 'Opencast Videos'; -$string['behat_error_unabletofind_element'] = 'Unable to locate element in the page'; From d0f058078c151113a083b48b2c3794ea8c8373c8 Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 14 Jan 2025 12:48:13 +0100 Subject: [PATCH 03/14] core\component instead of core_component --- classes/local/theme_manager.php | 8 +++----- db/uninstall.php | 2 +- settings.php | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/classes/local/theme_manager.php b/classes/local/theme_manager.php index d7af21c..2d9444f 100644 --- a/classes/local/theme_manager.php +++ b/classes/local/theme_manager.php @@ -25,8 +25,6 @@ namespace local_och5pcore\local; -use core_component; - /** * Theme Manager class contains all related functions to extend and unextend the themes. * @@ -68,7 +66,7 @@ public static function extend_themes($themes) { foreach ($themes as $themename) { // Get the directory of the theme. - $dir = core_component::get_plugin_directory('theme', $themename); + $dir = \core\component::get_plugin_directory('theme', $themename); // Replace the renderer class name with the theme name in the renderer content. $renderercontent = str_replace('local_och5pcore_h5p_renderer', @@ -147,7 +145,7 @@ public static function remove_themes_extension($themes) { foreach ($themes as $themename) { // Get the directory of the theme. - $dir = core_component::get_plugin_directory('theme', $themename); + $dir = \core\component::get_plugin_directory('theme', $themename); // Step 1: remove extension from theme renderers file. // If the theme has the renderer file. @@ -210,7 +208,7 @@ public static function remove_themes_extension($themes) { */ public static function cleaup_themes_extension() { // Get the installed themes. - $installedthemes = core_component::get_plugin_list('theme'); + $installedthemes = \core\component::get_plugin_list('theme'); // We define the clean-up flags here. // Start and End of a flag help to locate the codes better. $cleanupflags = [ diff --git a/db/uninstall.php b/db/uninstall.php index 6d46995..b1097f7 100755 --- a/db/uninstall.php +++ b/db/uninstall.php @@ -30,7 +30,7 @@ */ function xmldb_local_och5pcore_uninstall() { - $themes = core_component::get_plugin_list('theme'); + $themes = \core\component::get_plugin_list('theme'); if (count($themes) > 0) { theme_manager::remove_themes_extension(array_keys($themes)); } diff --git a/settings.php b/settings.php index 91108b7..761cde9 100755 --- a/settings.php +++ b/settings.php @@ -43,7 +43,7 @@ $availablethemes = []; - foreach (\core_component::get_plugin_list('theme') as $name => $dir) { + foreach (\core\component::get_plugin_list('theme') as $name => $dir) { $availablethemes[$name] = ucfirst(str_replace('_', ' ', $name)); } From df1c41be4a2417f1229e44d5c50cdb16cbb0c2b2 Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 14 Jan 2025 12:52:51 +0100 Subject: [PATCH 04/14] remove using unnecessary namespaces --- ajax.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/ajax.php b/ajax.php index 89f044c..3871850 100755 --- a/ajax.php +++ b/ajax.php @@ -26,8 +26,6 @@ use local_och5pcore\local\video_manager; use local_och5pcore\local\opencast_manager; use core_h5p\factory; -use moodle_exception; -use context_course; define('AJAX_SCRIPT', true); require(__DIR__ . '/../../config.php'); From 4e4b34aadd9803a11c0d19b879152485fc102ab8 Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 14 Jan 2025 14:50:42 +0100 Subject: [PATCH 05/14] js cleanup --- lib/js/H5PEditor.AV.js | 103 +++++++++++++++++++++-------------------- lib/js/H5PRunLTI.js | 3 +- 2 files changed, 54 insertions(+), 52 deletions(-) diff --git a/lib/js/H5PEditor.AV.js b/lib/js/H5PEditor.AV.js index 1ed27e0..cf60307 100755 --- a/lib/js/H5PEditor.AV.js +++ b/lib/js/H5PEditor.AV.js @@ -1,3 +1,4 @@ +/* eslint-disable */ (function ($) { if (window.H5PEditor === undefined) { @@ -39,12 +40,12 @@ return returnArray; } else { return urlParams.get(params); - } + } } function getOpencastActionUrl(action) { var contextid = getUrlParamValues('contextid'); - + var ocAjaxPath = H5PEditor.ajaxPath.replace('/h5p', '/local/och5pcore'); var OCActionUrl = ocAjaxPath + action; @@ -86,7 +87,7 @@ return result; } - + function getCourseVideosInsertDropdown() { var action = getUrlParamValues('contextid') == 1 ? 'courseList' : 'courseVideos'; var dropdownContent = opencastAjaxCallSync(action); @@ -124,13 +125,13 @@ '' + '' + '' + - '
' + + '
' + ''+ ''; } H5PEditor.AV.createAdd = function (type, id, hasDescription) { - var InsertContent = + var InsertContent = '
' + H5PEditor.AV.createTabContent('BasicFileUpload', type) + '
' + @@ -158,7 +159,7 @@ '' + ''; }; - + /** * Append widget to given wrapper. * @@ -167,36 +168,36 @@ H5PEditor.AV.prototype.appendTo = function ($wrapper) { var self = this; const id = ns.getNextFieldId(this.field); - + var imageHtml = '
    ' + (self.field.widgetExtensions ? H5PEditor.AV.createTabbedAdd(self.field.type, self.field.widgetExtensions, id, self.field.description !== undefined) : H5PEditor.AV.createAdd(self.field.type, id, self.field.description !== undefined)) - + if (!this.field.disableCopyright) { imageHtml += '' + H5PEditor.t('core', 'editCopyright') + ''; } - + imageHtml += '
    ' + '' + '
    '; - + var html = H5PEditor.createFieldMarkup(this.field, imageHtml, id); var $container = $(html).appendTo($wrapper); - + this.$files = $container.children('.file'); this.$add = $container.children('.h5p-add-file').click(function () { self.$addDialog.addClass('h5p-open'); }); - + // Tabs that are hard-coded into this widget. Any other tab must be an extension. const TABS = { UPLOAD: 0, INPUT: 1 }; - + // The current active tab let activeTab = TABS.UPLOAD; - + /** * @param {number} tab * @return {boolean} @@ -204,7 +205,7 @@ const isExtension = function (tab) { return tab > TABS.INPUT; // Always last tab }; - + /** * Toggle the currently active tab. */ @@ -213,16 +214,16 @@ if (isExtension(activeTab)) { tabInstances[activeTab].pause(); } - + // Update tab this.parentElement.querySelector('.selected').classList.remove('selected'); this.classList.add('selected'); - + // Update tab panel const el = document.getElementById(this.getAttribute('aria-controls')); el.parentElement.querySelector('.av-tabpanel:not([hidden])').setAttribute('hidden', ''); el.removeAttribute('hidden'); - + // Set active tab index for (let i = 0; i < el.parentElement.children.length; i++) { if (el.parentElement.children[i] === el) { @@ -230,7 +231,7 @@ break; } } - + // Toggle insert button disabled if (activeTab === TABS.UPLOAD) { self.$insertButton[0].disabled = true; @@ -242,7 +243,7 @@ self.$insertButton[0].disabled = !tabInstances[activeTab].hasMedia(); } } - + /** * Switch focus between the buttons in the tablist */ @@ -253,7 +254,7 @@ el.focus(); } } - + // Register event listeners to tab DOM elements $container.find('.av-tab').click(toggleTab).keydown(function (e) { if (e.which === 13 || e.which === 32) { // Enter or Space @@ -269,15 +270,15 @@ e.preventDefault(); } }); - + this.$addDialog = this.$add.next().children().first(); - + // Prepare to add the extra tab instances const tabInstances = [null, null]; // Add nulls for hard-coded tabs self.tabInstances = tabInstances; - + if (self.field.widgetExtensions) { - + /** * @param {string} type Constructor name scoped inside this widget * @param {number} index @@ -292,7 +293,7 @@ }); tabInstances.push(tabInstance); } - + // Append extra tabs for (let i = 0; i < self.field.widgetExtensions.length; i++) { if (H5PEditor.AV[self.field.widgetExtensions[i]]) { @@ -300,13 +301,13 @@ } } } - + var $url = this.$url = this.$addDialog.find('.h5p-file-url'); this.$addDialog.find('.h5p-cancel').click(function () { self.updateIndex = undefined; self.closeDialog(); }); - + this.$addDialog.find('.h5p-file-drop-upload') .addClass('has-advanced-upload') .on('drag dragstart dragend dragover dragenter dragleave drop', function (e) { @@ -417,13 +418,13 @@ self.useUrl(url); } } - + self.closeDialog(); }); - - + + this.$errors = $container.children('.h5p-errors'); - + if (this.params !== undefined) { for (var i = 0; i < this.params.length; i++) { this.addFile(i); @@ -432,17 +433,17 @@ else { $container.find('.h5p-copyright-button').addClass('hidden'); } - + var $dialog = $container.find('.h5p-editor-dialog'); $container.find('.h5p-copyright-button').add($dialog.find('.h5p-close')).click(function () { $dialog.toggleClass('h5p-open'); return false; }); - + ns.File.addCopyright(self, $dialog, function (field, value) { self.setCopyright(value); }); - + }; /** @@ -491,7 +492,7 @@ } } } - + var file = { path: url, mime: this.field.type + '/' + (mime ? mime : 'unknown'), @@ -514,7 +515,7 @@ var index = (this.updateIndex !== undefined ? this.updateIndex : this.params.length); this.params[index] = file; this.addFile(index); - + for (i = 0; i < this.changes.length; i++) { this.changes[i](file); } @@ -538,7 +539,7 @@ return provider.name === 'YouTube'; })[0].regexp; var isYoutube = file.path && file.path.match(youtubeRegex); - + var isOpencast = (file.id && file.org && file.org == 'opencast') ? true : false; if (!isOpencast) { //double check on edit part... @@ -552,7 +553,7 @@ } }); } - + // Only allow single source if YouTube if (isYoutube) { @@ -572,14 +573,14 @@ this.$add.toggleClass('hidden', !!isYoutube); // this.$add.toggleClass('hidden', !!isOpencast); - + // If updating remove and recreate element if (that.updateIndex !== undefined) { var $oldFile = this.$files.children(':eq(' + index + ')'); $oldFile.remove(); this.updateIndex = undefined; } - + // Create file with customizable quality if enabled and not youtube if ((this.field.enableCustomQualityLabel === true && !isYoutube) || isOpencast) { var thumbnail_mimetype = isOpencast ? 'Opencast' : file.mime.split('/')[1]; @@ -604,7 +605,7 @@ '' + ''; } - + // Insert file element in appropriate order var $file = $(fileHtml); if (index >= that.$files.children().length) { @@ -613,9 +614,9 @@ else { $file.insertBefore(that.$files.children().eq(index)); } - + this.$add.parent().find('.h5p-copyright-button').removeClass('hidden'); - + // Handle thumbnail click $file .children('.h5p-thumbnail') @@ -626,7 +627,7 @@ if (isOpencast) { /* It will create confusion since several qualities will be added to the file list automatically - therefore, it will be prevented to edit opencast videos + therefore, it will be prevented to edit opencast videos */ return; } else { @@ -634,7 +635,7 @@ } that.updateIndex = index; }); - + // Handle remove button click $file .find('.h5p-remove') @@ -642,23 +643,23 @@ if (that.$add.is(':visible')) { confirmRemovalDialog.show($file.offset().top); } - + return false; }); - + // on input update $file .find('input') .change(function () { file.metadata = { qualityName: $(this).val() }; }); - + // Create remove file dialog var confirmRemovalDialog = new H5P.ConfirmationDialog({ headerText: H5PEditor.t('core', 'removeFile'), dialogText: H5PEditor.t('core', 'confirmRemoval', {':type': 'file'}) }).appendTo(document.body); - + // Remove file on confirmation confirmRemovalDialog.on('confirmed', function () { that.removeFileWithElement($file); @@ -667,5 +668,5 @@ } }); }; - + })(H5P.jQuery); diff --git a/lib/js/H5PRunLTI.js b/lib/js/H5PRunLTI.js index b38cb48..393c867 100644 --- a/lib/js/H5PRunLTI.js +++ b/lib/js/H5PRunLTI.js @@ -1,3 +1,4 @@ +/* eslint-disable */ (function ($) { runLti(); @@ -17,7 +18,7 @@ } function performLti(formName, ltiParams) { - + var endpoint = ltiParams.endpoint; delete ltiParams.endpoint; var ltiLaunchForm = H5P.jQuery('