From de0d8f0a0e7ddfddaa0cd5930babd43bbbad1290 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 28 Jul 2023 15:06:51 +0200 Subject: [PATCH] wait #6183 @0.25 --- app/Elearning/QuizCompiler/Animations.php | 3 +-- resources/quizv2/js/quiz.animations.js | 4 ++-- resources/quizv2/js/quiz.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Elearning/QuizCompiler/Animations.php b/app/Elearning/QuizCompiler/Animations.php index 09133da4d..39a616794 100644 --- a/app/Elearning/QuizCompiler/Animations.php +++ b/app/Elearning/QuizCompiler/Animations.php @@ -20,8 +20,7 @@ trait Animations */ protected function writeAnimations() { - $colors = [self::OK_COLOR => /*$this->theme->okColor*/ - '#ffcc00', self::NOK_COLOR => $this->theme->nokColor]; + $colors = [self::OK_COLOR => $this->theme->okColor, self::NOK_COLOR => $this->theme->nokColor]; $animationReplace = []; // Replace colors diff --git a/resources/quizv2/js/quiz.animations.js b/resources/quizv2/js/quiz.animations.js index af3cb6ba8..94e87a686 100644 --- a/resources/quizv2/js/quiz.animations.js +++ b/resources/quizv2/js/quiz.animations.js @@ -10,12 +10,12 @@ QuizAnimations.prototype = { load: function (name, container, replace) { let json = this.quiz.data.animations[name]; $.each(replace, function (k, v) { - console.log(k,v); + console.log(k, v); json = json.replace(new RegExp(k, 'g'), v); }); lottie.loadAnimation({ - container: $('#anim').get(0), + container: $(container).get(0), renderer: 'svg', loop: false, autoplay: true, diff --git a/resources/quizv2/js/quiz.js b/resources/quizv2/js/quiz.js index f6eee707e..5c4efd3d7 100644 --- a/resources/quizv2/js/quiz.js +++ b/resources/quizv2/js/quiz.js @@ -26,7 +26,7 @@ Quiz.prototype = { this.data = data; console.log(this.data); // ICI tout commence vraiment - this.animations.load('OK', $("#anim"), {'$text': 'Test d\'un message custom'}); + this.animations.load('OK', $("#anim"), {'\\$text': 'Salut :)'}); // La fonction resize est appellée à chaque fois qu'un resize de la fenêtre survient (et à l'init de l'app) $(window).on('resize', function () { -- 2.39.5