From 74b36129b898c240e8e4a1c483431ea911aa0364 Mon Sep 17 00:00:00 2001
From: Pierre Ranwez <pierre.ranwez.etu@univ-lille.fr>
Date: Wed, 16 Feb 2022 12:43:30 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20bug:=20desactivate=20css=20code?=
 =?UTF-8?q?=20verification?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 content.js | 22 ++++++++++++----------
 main.js    |  1 +
 popup.html |  2 ++
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/content.js b/content.js
index 23b32f7..a3b5f7f 100644
--- a/content.js
+++ b/content.js
@@ -163,16 +163,18 @@ function midiEvent(type, data) {
         });
     });
 
-    for (let index = 0; index < INFOLOOP.length; index++) {
-        const element = INFOLOOP[index];
-        if (element.controllerPlayPause == data.note.number) {
-            loop(index);
-        }
-        else if (element.controllerRecord == data.note.number) {
-            INFOLOOP[index].isRecording = !INFOLOOP[index].isRecording;
-            record(INFOLOOP[index].isRecording, index);
-        }
-    };
+    if (type == 'noteon') {
+        for (let index = 0; index < INFOLOOP.length; index++) {
+            const element = INFOLOOP[index];
+            if (element.controllerPlayPause == data.note.number) {
+                loop(index);
+            }
+            else if (element.controllerRecord == data.note.number) {
+                INFOLOOP[index].isRecording = !INFOLOOP[index].isRecording;
+                record(INFOLOOP[index].isRecording, index);
+            }
+        };
+    }
 
     if (isRecording) {
         const time = Math.floor(performance.now() - recordingTime);
diff --git a/main.js b/main.js
index b88172d..4c0c396 100644
--- a/main.js
+++ b/main.js
@@ -57,6 +57,7 @@ function loadEditor() {
 	editor = ace.edit("editor");
 	editor.setTheme("ace/theme/tomorrow_night_blue");
 	editor.session.setMode("ace/mode/css");
+	editor.getSession().setUseWorker(false);
 	langTools = ace.require('ace/ext/language_tools');
 	editor.setOptions({
 		enableBasicAutocompletion: true,
diff --git a/popup.html b/popup.html
index 018d332..fb8fac0 100644
--- a/popup.html
+++ b/popup.html
@@ -129,6 +129,8 @@
 
 	<script src="cssParser.js" type="text/javascript" charset="utf-8"></script>
 	<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
+	<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.14/ace.min.js" integrity="sha512-hDyKEpCc9jPn3u2VffFjScCtNqZI+BAbThAhhDYqqqZbxMqmTSNIgdU0OU9BRD/8wFxHIWLAo561hh9fW7j6sA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
+	<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.14/ext-language_tools.min.js" integrity="sha512-S7Whi8oQAQu/MK6AhBWufIJIyOvqORj+/1YDM9MaHeRalsZjzyYS7Usk4fsh+6J77PUhuk5v/BxaMDXRdWd1KA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
 	<script src="ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
 	<script src="main.js" type="text/javascript" charset="utf-8"></script>
 </body>
-- 
GitLab