From ddcb4a0e10647aaddd0ffdec8b1bf5a7486f3872 Mon Sep 17 00:00:00 2001 From: azivner Date: Fri, 30 Nov 2018 22:28:30 +0100 Subject: [PATCH] added another mime type for JS --- src/entities/note.js | 4 +++- src/services/backend_script_api.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entities/note.js b/src/entities/note.js index cd7ec238a..859560940 100644 --- a/src/entities/note.js +++ b/src/entities/note.js @@ -75,7 +75,9 @@ class Note extends Entity { /** @returns {boolean} true if this note is JavaScript (code or attachment) */ isJavaScript() { return (this.type === "code" || this.type === "file") - && (this.mime.startsWith("application/javascript") || this.mime === "application/x-javascript"); + && (this.mime.startsWith("application/javascript") + || this.mime === "application/x-javascript" + || this.mime === "text/javascript"); } /** @returns {boolean} true if this note is HTML */ diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js index e88f08522..e02051c20 100644 --- a/src/services/backend_script_api.js +++ b/src/services/backend_script_api.js @@ -225,6 +225,8 @@ function BackendScriptApi(startNote, currentNote, originEntity) { */ this.transactional = sql.transactional; + this.sql = sql; + /** * Trigger tree refresh in all connected clients. This is required when some tree change happens in * the backend.