added another mime type for JS

This commit is contained in:
azivner 2018-11-30 22:28:30 +01:00
parent 8cbb29ee25
commit ddcb4a0e10
2 changed files with 5 additions and 1 deletions

View File

@ -75,7 +75,9 @@ class Note extends Entity {
/** @returns {boolean} true if this note is JavaScript (code or attachment) */ /** @returns {boolean} true if this note is JavaScript (code or attachment) */
isJavaScript() { isJavaScript() {
return (this.type === "code" || this.type === "file") 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 */ /** @returns {boolean} true if this note is HTML */

View File

@ -225,6 +225,8 @@ function BackendScriptApi(startNote, currentNote, originEntity) {
*/ */
this.transactional = sql.transactional; this.transactional = sql.transactional;
this.sql = sql;
/** /**
* Trigger tree refresh in all connected clients. This is required when some tree change happens in * Trigger tree refresh in all connected clients. This is required when some tree change happens in
* the backend. * the backend.