From: Vincent Vanwaelscappel Date: Thu, 26 Jun 2025 15:03:27 +0000 (+0200) Subject: wip #7600 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4800a0bcbdd2675ca3cd5b22ba47dc795958b93d;p=fluidbook-toolbox.git wip #7600 @1.5 --- diff --git a/app/Models/Base/ToolboxContentTranslate.php b/app/Models/Base/ToolboxContentTranslate.php index 51f44a982..a322720bc 100644 --- a/app/Models/Base/ToolboxContentTranslate.php +++ b/app/Models/Base/ToolboxContentTranslate.php @@ -16,14 +16,15 @@ class ToolboxContentTranslate extends ToolboxBaseTranslate protected static $_basePath = ''; + protected static $_playerName='Player'; public function getPaths() { $res = []; if (method_exists(static::class, 'getActiveBranches')) { foreach (static::getActiveBranches() as $branch) { - $res['Player - git:' . $branch] = static::$_basePath . '/branches/' . $branch; - $res['Player - local:' . $branch] = static::$_basePath . '/local/' . $branch; + $res[static::$_playerName.' - git:' . $branch] = static::$_basePath . '/branches/' . $branch; + $res[static::$_playerName.' - local:' . $branch] = static::$_basePath . '/local/' . $branch; } } return $res; diff --git a/app/Models/ElearningTranslate.php b/app/Models/ElearningTranslate.php index 6022cb974..e3c16d404 100644 --- a/app/Models/ElearningTranslate.php +++ b/app/Models/ElearningTranslate.php @@ -20,6 +20,8 @@ class ElearningTranslate extends ToolboxContentTranslate protected static string $_name = 'elearning'; protected static $_basePath = 'resources/quiz/player'; + protected static $_playerName = 'Quiz'; + protected $_enableRevisions = false; protected $_options = ['name' => 'elearning-translate', @@ -34,7 +36,7 @@ class ElearningTranslate extends ToolboxContentTranslate public function getPaths() { $res = parent::getPaths(); - $res['Elearning Media'] = 'resources/view/elearningmedia'; + $res['Elearning Media'] = 'resources/views/elearningmedia'; $res['OpenBadges'] = 'resources/badge/translate'; return $res; } diff --git a/config/debugbar.php b/config/debugbar.php index 5284132ac..ae77ad35f 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -14,7 +14,7 @@ return [ | */ - 'enabled' => !isset($_SERVER['HTTP_X_REAL_IP']) || in_array($_SERVER['HTTP_X_REAL_IP'], ['130.180.213.67', '82.64.156.165']) ? env('DEBUGBAR_ENABLED', null) : false, + 'enabled' => !isset($_SERVER['HTTP_X_REAL_IP']) || in_array($_SERVER['HTTP_X_REAL_IP'], ['176.134.43.17', '82.64.156.165']) ? env('DEBUGBAR_ENABLED', null) : false, 'except' => [ 'telescope*', 'horizon*', diff --git a/resources/elearningmedia/js/app.js b/resources/elearningmedia/js/app.js index 8d6717636..ed969adcd 100644 --- a/resources/elearningmedia/js/app.js +++ b/resources/elearningmedia/js/app.js @@ -51,60 +51,36 @@ document.addEventListener("DOMContentLoaded", function () { } }, 1000); } else if (window.type === 'pdf') { - playerIframe.addEventListener('load', function () { - var interval; - - if (pc === 'button') { - interval = setInterval(function () { - try { - var app = playerWindow.PDFViewerApplication; - if (app === undefined || app === null) { - return; - } - var pdfViewer = app.pdfViewer; - if (pdfViewer === undefined || pdfViewer === null) { - return; - } + var interval = setInterval(function () { + try { + var app = playerWindow.PDFViewerApplication; + if (app === undefined || app === null) { + return; + } + var pdfViewer = app.pdfViewer; + if (pdfViewer === undefined || pdfViewer === null) { + return; + } - let container = pdfViewer.container; - container.addEventListener('scroll', function () { - if (container.scrollTop / (container.scrollHeight - container.offsetHeight) > 0.95) { + let container = pdfViewer.container; + container.addEventListener('scroll', function () { + let progress = container.scrollTop / (container.scrollHeight - container.offsetHeight); + if (pc === 'button') { + if (progress >= 0.95) { resize(); showCompleteButton(); } - }); - clearInterval(interval); - } catch (e) { - console.error('Error while updating pdf course status'); - console.error(e); - } - }, 200); - } else { - interval = setInterval(function () { - console.log('Check pdf progress'); - try { - var app = playerWindow.PDFViewerApplication; - if (app === undefined || app === null) { - return; + } else if (progress >= pc) { + markComplete(); } - var pdfViewer = app.pdfViewer; - if (pdfViewer === undefined || pdfViewer === null) { - return; - } - - var total = pdfViewer.pagesCount; - var current = pdfViewer._currentPageNumber; - if (total > 0 && current / total >= pc) { - markComplete(interval); - } - - } catch (e) { - console.error('Error while updating pdf course status'); - console.error(e); - } - }, 1000); - } + }); + clearInterval(interval); + } catch (e) { + console.error('Error while updating pdf course status'); + console.error(e); + } + }, 200); }); } diff --git a/resources/elearningmedia/sass/app.sass b/resources/elearningmedia/sass/app.sass index d7adc616e..f98da03c5 100644 --- a/resources/elearningmedia/sass/app.sass +++ b/resources/elearningmedia/sass/app.sass @@ -29,9 +29,9 @@ video, audio, iframe display: flex right: 30px bottom: 30px - width: 130px - height: 130px - padding: 10px 10px 40px 10px + width: 190px + height: 190px + padding: 10px 30px 40px 30px transition: opacity 600ms background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAxMDQgMTA0Ij4KICA8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMjkuNi4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogMi4xLjEgQnVpbGQgMjA3KSAgLS0+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5zdDAgewogICAgICAgIGZpbGw6ICM3MTJjZmQ7CiAgICAgIH0KCiAgICAgIC5zdDEgewogICAgICAgIGZpbGw6ICNlNGZmMTk7CiAgICAgIH0KCiAgICAgIC5zdDIgewogICAgICAgIGZpbGw6ICMyNTBjNjY7CiAgICAgIH0KCiAgICAgIC5zdDMgewogICAgICAgIGZpbGw6ICMzMzM7CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgPC9kZWZzPgogIDxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjUyIiBjeT0iNTEuOSIgcj0iNDUiLz4KICA8cGF0aCBjbGFzcz0ic3QyIiBkPSJNNTIsMTAyLjRDMjQuMiwxMDIuNCwxLj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iframe text-decoration: none align-items: center justify-content: center + text-align: center + font-size: 15px &.visible transition: opacity 600ms opacity: 1 pointer-events: all - .plyr position: absolute top: 0 diff --git a/resources/views/elearningmedia/index.blade.php b/resources/views/elearningmedia/index.blade.php index 22a63b83a..706a7dc44 100644 --- a/resources/views/elearningmedia/index.blade.php +++ b/resources/views/elearningmedia/index.blade.php @@ -1,4 +1,3 @@ -{{-- __('!! e-Learning') --}}