mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
added another mime type for JS
This commit is contained in:
parent
8cbb29ee25
commit
ddcb4a0e10
@ -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 */
|
||||||
|
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user