]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7600 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 26 Jun 2025 15:03:27 +0000 (17:03 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 26 Jun 2025 15:03:27 +0000 (17:03 +0200)
app/Models/Base/ToolboxContentTranslate.php
app/Models/ElearningTranslate.php
config/debugbar.php
resources/elearningmedia/js/app.js
resources/elearningmedia/sass/app.sass
resources/views/elearningmedia/index.blade.php

index 51f44a98205a3693215389361083d18e83514f6f..a322720bc11c6663bbfd137730becbb9ee5a0215 100644 (file)
@@ -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;
index 6022cb974774371e347cc49959553fc1c4212374..e3c16d404fd66ef806333cf453a723c7cbdef23d 100644 (file)
@@ -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;
     }
index 5284132ac66e3143e5c1a768499c19d40565531a..ae77ad35f7dfaf957d19cd6e5c07fe857d1663c5 100644 (file)
@@ -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*',
index 8d6717636aba99a31c430f19297bd2f8cd6bea6b..ed969adcd08da8da8b3d7df957f13e7401fdc688 100644 (file)
@@ -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);
         });
     }
 
index d7adc616e72f680c1b7a7a524cb8e184136d5c17..f98da03c51702d99fae7d4f9e01539222a7de919 100644 (file)
@@ -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+CiAgICAgIC5zdDAgewogICAgICAgIGZpbGw6ICM3MTJjZmQ7CiAgICAgIH0KCiAgICAgIC5zdDEgewogICAgICAgIGZpbGw6ICNlNGZmMTk7CiAgICAgIH0KCiAgICAgIC5zdDIgewogIC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LTcuNS02LjItOC45Wk01NSw5MGMtMy41LDEuMy03LjUuMi05LjktMi43LTIuNC0yLjktMi43LTcuMS0uOC0xMC4zLDEuOS0zLjIsNS44LTQuOSw5LjQtNC4yLDMuNi43LDYuNSwzLjcsNy4xLDcuNCwwLC41LjEuOS4xLDEuNCwwLDMuNy0yLjQsNy4xLTUuOSw4LjRaIi8+CiAgPC9nPgo8L3N2Zz4=")
     background-size: cover
@@ -39,13 +39,14 @@ video, audio, 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
index 22a63b83a7460db7ade14f3f2882aeae2a0328f3..706a7dc44e862ac0b98c6db0bfb807f8f80a5c0e 100644 (file)
@@ -1,4 +1,3 @@
-{{-- __('!! e-Learning') --}}
 <!DOCTYPE html>
 <html lang="en">
 <head>