mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 15:56:29 +01:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47d61c416d | ||
|
|
6c57b2220f | ||
|
|
99f01b9ccf | ||
|
|
d5a9abd911 | ||
|
|
a3a2bc0a74 | ||
|
|
402e5c4d81 | ||
|
|
5157fc15e9 | ||
|
|
4bd87b1796 | ||
|
|
ce33eb3abd | ||
|
|
f988935a33 | ||
|
|
9b05d30b47 | ||
|
|
9e97fdcc49 | ||
|
|
8e8148ce42 | ||
|
|
af41e5d115 | ||
|
|
4f75b6aaaf | ||
|
|
82f410f695 | ||
|
|
2bc06959c3 | ||
|
|
b898973ee6 | ||
|
|
a2b0d8a379 | ||
|
|
06a4eab7d5 | ||
|
|
25df1a054c | ||
|
|
8c4ff7ed2a | ||
|
|
609829653e | ||
|
|
5f20d033a8 | ||
|
|
93d0324177 | ||
|
|
0afd3c65aa | ||
|
|
8901c3ec91 | ||
|
|
c671b0a345 | ||
|
|
9f424836e2 | ||
|
|
7f5af4b959 | ||
|
|
dc64d333b6 | ||
|
|
283808d691 | ||
|
|
a4bf69fe6a | ||
|
|
6c7853319c | ||
|
|
2b1aa0d386 | ||
|
|
24ae24a1ac | ||
|
|
00d860bfae | ||
|
|
a9f49e7f25 | ||
|
|
fcf80f1e57 | ||
|
|
dc94e1a1bf | ||
|
|
313b9dba61 | ||
|
|
32e3560dce | ||
|
|
7bd7323097 | ||
|
|
0cb46f8f9b | ||
|
|
c2b64bad80 | ||
|
|
991b335c3e | ||
|
|
fd2d49de4f | ||
|
|
b990239219 | ||
|
|
f23454ffa3 | ||
|
|
631a11509a | ||
|
|
bf9bfe920a |
18
.idea/codeStyles/Project.xml
generated
18
.idea/codeStyles/Project.xml
generated
@@ -9,23 +9,5 @@
|
||||
<JSCodeStyleSettings version="0">
|
||||
<option name="USE_EXPLICIT_JS_EXTENSION" value="TRUE" />
|
||||
</JSCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JetCodeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:12.16.3-alpine
|
||||
FROM node:12.19.0-alpine
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@@ -5,7 +5,7 @@ SERIES=${VERSION:0:4}-latest
|
||||
|
||||
cat package.json | grep -v electron > server-package.json
|
||||
|
||||
sudo docker build -t zadam/trilium:$VERSION -t zadam/trilium:$SERIES .
|
||||
sudo docker build -t zadam/trilium:$VERSION --network host -t zadam/trilium:$SERIES .
|
||||
|
||||
if [[ $VERSION != *"beta"* ]]; then
|
||||
sudo docker tag zadam/trilium:$VERSION zadam/trilium:latest
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
libraries/boxicons/css/boxicons.min.css
vendored
2
libraries/boxicons/css/boxicons.min.css
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 912 KiB After Width: | Height: | Size: 952 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
libraries/ckeditor/ckeditor.js
vendored
2
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
91
libraries/katex/README.md
Normal file
91
libraries/katex/README.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
|
||||
[](https://www.npmjs.com/package/katex)
|
||||
[](https://circleci.com/gh/KaTeX/KaTeX)
|
||||
[](https://codecov.io/gh/KaTeX/KaTeX)
|
||||
[](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://dependabot.com)
|
||||
[](https://www.jsdelivr.com/package/npm/katex)
|
||||

|
||||
|
||||
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
||||
|
||||
* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://www.intmath.com/cg5/katex-mathjax-comparison.php).
|
||||
* **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
|
||||
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
|
||||
* **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
|
||||
|
||||
KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11.
|
||||
|
||||
KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html).
|
||||
|
||||
Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
||||
|
||||
## Getting started
|
||||
|
||||
### Starter template
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
|
||||
|
||||
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body);"></script>
|
||||
</head>
|
||||
...
|
||||
</html>
|
||||
```
|
||||
|
||||
You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.
|
||||
|
||||
For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).
|
||||
|
||||
### API
|
||||
|
||||
Call `katex.render` to render a TeX expression directly into a DOM element.
|
||||
For example:
|
||||
|
||||
```js
|
||||
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, {
|
||||
throwOnError: false
|
||||
});
|
||||
```
|
||||
|
||||
Call `katex.renderToString` to generate an HTML string of the rendered math,
|
||||
e.g., for server-side rendering. For example:
|
||||
|
||||
```js
|
||||
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
|
||||
throwOnError: false
|
||||
});
|
||||
// '<span class="katex">...</span>'
|
||||
```
|
||||
|
||||
Make sure to include the CSS and font files in both cases.
|
||||
If you are doing all rendering on the server, there is no need to include the
|
||||
JavaScript on the client.
|
||||
|
||||
The examples above use the `throwOnError: false` option, which renders invalid
|
||||
inputs as the TeX source code in red (by default), with the error message as
|
||||
hover text. For other available options, see the
|
||||
[API documentation](https://katex.org/docs/api.html),
|
||||
[options documentation](https://katex.org/docs/options.html), and
|
||||
[handling errors documentation](https://katex.org/docs/error.html).
|
||||
|
||||
## Demo and Documentation
|
||||
|
||||
Learn more about using KaTeX [on the website](https://katex.org)!
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT).
|
||||
1
libraries/katex/auto-render.min.js
vendored
Normal file
1
libraries/katex/auto-render.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),a=function(e,t,r){for(var n=r,o=0,a=e.length;n<t.length;){var i=t[n];if(o<=0&&t.slice(n,n+a)===e)return n;"\\"===i?n++:"{"===i?o++:"}"===i&&o--,n++}return-1},i=function(e,t,r,n){for(var o=[],i=0;i<e.length;i++)if("text"===e[i].type){var l=e[i].data,d=!0,s=0,f=void 0;for(-1!==(f=l.indexOf(t))&&(s=f,o.push({type:"text",data:l.slice(0,s)}),d=!1);;){if(d){if(-1===(f=l.indexOf(t,s)))break;o.push({type:"text",data:l.slice(s,f)}),s=f}else{if(-1===(f=a(r,l,s+t.length)))break;o.push({type:"math",data:l.slice(s+t.length,f),rawData:l.slice(s,f+r.length),display:n}),s=f+r.length}d=!d}o.push({type:"text",data:l.slice(s)})}else o.push(e[i]);return o},l=function(e,t){var r=function(e,t){for(var r=[{type:"text",data:e}],n=0;n<t.length;n++){var o=t[n];r=i(r,o.left,o.right,o.display||!1)}return r}(e,t.delimiters);if(1===r.length&&"text"===r[0].type)return null;for(var n=document.createDocumentFragment(),a=0;a<r.length;a++)if("text"===r[a].type)n.appendChild(document.createTextNode(r[a].data));else{var l=document.createElement("span"),d=r[a].data;t.displayMode=r[a].display;try{t.preProcess&&(d=t.preProcess(d)),o.a.render(d,l,t)}catch(e){if(!(e instanceof o.a.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+r[a].data+"` with ",e),n.appendChild(document.createTextNode(r[a].rawData));continue}n.appendChild(l)}return n};t.default=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},function e(t,r){for(var n=0;n<t.childNodes.length;n++){var o=t.childNodes[n];if(3===o.nodeType){var a=l(o.textContent,r);a&&(n+=a.childNodes.length-1,t.replaceChild(a,o))}else 1===o.nodeType&&function(){var t=" "+o.className+" ";-1===r.ignoredTags.indexOf(o.nodeName.toLowerCase())&&r.ignoredClasses.every(function(e){return-1===t.indexOf(" "+e+" ")})&&e(o,r)}()}}(e,r)}}]).default});
|
||||
BIN
libraries/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Bold.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Italic.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Math-Italic.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Script-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
BIN
libraries/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
BIN
libraries/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
Binary file not shown.
BIN
libraries/katex/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
BIN
libraries/katex/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
Binary file not shown.
1035
libraries/katex/katex.css
Normal file
1035
libraries/katex/katex.css
Normal file
File diff suppressed because it is too large
Load Diff
17308
libraries/katex/katex.js
Normal file
17308
libraries/katex/katex.js
Normal file
File diff suppressed because it is too large
Load Diff
1
libraries/katex/katex.min.css
vendored
Normal file
1
libraries/katex/katex.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
libraries/katex/katex.min.js
vendored
Normal file
1
libraries/katex/katex.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16911
libraries/katex/katex.mjs
Normal file
16911
libraries/katex/katex.mjs
Normal file
File diff suppressed because it is too large
Load Diff
5747
package-lock.json
generated
5747
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
25
package.json
25
package.json
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.44.8",
|
||||
"version": "0.45.4",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
@@ -32,7 +32,7 @@
|
||||
"commonmark": "0.29.2",
|
||||
"cookie-parser": "1.4.5",
|
||||
"csurf": "1.11.0",
|
||||
"dayjs": "1.8.36",
|
||||
"dayjs": "1.9.3",
|
||||
"ejs": "3.1.5",
|
||||
"electron-debug": "3.1.0",
|
||||
"electron-dl": "3.0.2",
|
||||
@@ -40,7 +40,6 @@
|
||||
"electron-window-state": "5.0.3",
|
||||
"express": "4.17.1",
|
||||
"express-session": "1.17.1",
|
||||
"file-type": "15.0.1",
|
||||
"fs-extra": "9.0.1",
|
||||
"helmet": "4.1.1",
|
||||
"html": "1.0.0",
|
||||
@@ -55,20 +54,20 @@
|
||||
"mime-types": "2.1.27",
|
||||
"multer": "1.4.2",
|
||||
"node-abi": "2.19.1",
|
||||
"open": "7.2.1",
|
||||
"open": "7.3.0",
|
||||
"portscanner": "2.2.0",
|
||||
"rand-token": "1.0.1",
|
||||
"request": "^2.88.2",
|
||||
"rimraf": "3.0.2",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"sanitize-html": "1.27.4",
|
||||
"sanitize-html": "2.1.1",
|
||||
"sax": "1.2.4",
|
||||
"semver": "7.3.2",
|
||||
"serve-favicon": "2.5.0",
|
||||
"session-file-store": "1.4.0",
|
||||
"session-file-store": "1.5.0",
|
||||
"striptags": "3.1.1",
|
||||
"tmp": "^0.2.1",
|
||||
"turndown": "6.0.0",
|
||||
"turndown": "7.0.0",
|
||||
"turndown-plugin-gfm": "1.0.2",
|
||||
"unescape": "1.0.1",
|
||||
"ws": "7.3.1",
|
||||
@@ -77,17 +76,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "7.0.2",
|
||||
"electron": "9.3.2",
|
||||
"electron-builder": "22.8.1",
|
||||
"electron": "9.3.4",
|
||||
"electron-builder": "22.9.1",
|
||||
"electron-packager": "15.1.0",
|
||||
"electron-rebuild": "2.0.3",
|
||||
"electron-rebuild": "2.3.2",
|
||||
"esm": "3.2.25",
|
||||
"jasmine": "3.6.1",
|
||||
"jasmine": "3.6.2",
|
||||
"jsdoc": "3.6.6",
|
||||
"lorem-ipsum": "2.0.3",
|
||||
"rcedit": "2.2.0",
|
||||
"webpack": "5.1.0",
|
||||
"webpack-cli": "4.0.0"
|
||||
"webpack": "5.1.3",
|
||||
"webpack-cli": "4.1.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"electron-installer-debian": "2.0.1"
|
||||
|
||||
@@ -57,8 +57,15 @@ function id() {
|
||||
return randtoken.generate(10);
|
||||
}
|
||||
|
||||
function note(title, type = 'text', mime = 'text/html') {
|
||||
const note = new Note(noteCache, {noteId: id(), title, type, mime});
|
||||
function note(title, extraParams = {}) {
|
||||
const row = Object.assign({
|
||||
noteId: id(),
|
||||
title: title,
|
||||
type: 'text',
|
||||
mime: 'text/html'
|
||||
}, extraParams);
|
||||
|
||||
const note = new Note(noteCache, row);
|
||||
|
||||
return new NoteBuilder(note);
|
||||
}
|
||||
|
||||
@@ -247,6 +247,6 @@ describe("Invalid expressions", () => {
|
||||
searchContext
|
||||
});
|
||||
|
||||
expect(searchContext.error).toEqual('Misplaced or incomplete expression "="')
|
||||
expect(searchContext.error).toEqual('Relation can be compared only with property, e.g. ~relation.title=hello in ""')
|
||||
});
|
||||
});
|
||||
|
||||
@@ -53,8 +53,8 @@ describe("Search", () => {
|
||||
|
||||
it("normal search looks also at type and mime", () => {
|
||||
rootNote
|
||||
.child(note("Effective Java", 'book', ''))
|
||||
.child(note("Hello World.java", 'code', 'text/x-java'));
|
||||
.child(note("Effective Java", {type: 'book', mime:''}))
|
||||
.child(note("Hello World.java", {type: 'code', mime: 'text/x-java'}));
|
||||
|
||||
const searchContext = new SearchContext();
|
||||
let searchResults = searchService.findNotesWithQuery('book', searchContext);
|
||||
@@ -178,7 +178,7 @@ describe("Search", () => {
|
||||
// dates should not be coerced into numbers which would then give wrong numbers
|
||||
|
||||
rootNote
|
||||
.child(note("My note")
|
||||
.child(note("My note", {dateCreated: dateUtils.localNowDateTime()})
|
||||
.label('year', new Date().getFullYear().toString())
|
||||
.label('month', dateUtils.localNowDate().substr(0, 7))
|
||||
.label('date', dateUtils.localNowDate())
|
||||
@@ -209,6 +209,8 @@ describe("Search", () => {
|
||||
test("#month = month", 1);
|
||||
test("#month = 'MONTH'", 0);
|
||||
|
||||
test("note.dateCreated =* month", 1);
|
||||
|
||||
test("#date = TODAY", 1);
|
||||
test("#date = today", 1);
|
||||
test("#date = 'today'", 0);
|
||||
@@ -586,7 +588,7 @@ describe("Search", () => {
|
||||
|
||||
const searchContext = new SearchContext();
|
||||
|
||||
let searchResults = searchService.findNotesWithQuery('# note.text *=* rati and note.noteId != root', searchContext);
|
||||
let searchResults = searchService.findNotesWithQuery('# note.text *=* vaki and note.noteId != root', searchContext);
|
||||
expect(searchResults.length).toEqual(1);
|
||||
expect(noteCache.notes[searchResults[0].noteId].title).toEqual("Slovakia");
|
||||
});
|
||||
|
||||
@@ -34,6 +34,10 @@ class Attribute extends Entity {
|
||||
this.isInheritable = !!this.isInheritable;
|
||||
}
|
||||
|
||||
isAutoLink() {
|
||||
return this.type === 'relation' && ['internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'].includes(this.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ import utils from "../services/utils.js";
|
||||
import ws from "../services/ws.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
import openService from "../services/open.js";
|
||||
|
||||
const $dialog = $("#export-dialog");
|
||||
const $form = $("#export-form");
|
||||
@@ -73,9 +74,9 @@ $form.on('submit', () => {
|
||||
function exportBranch(branchId, type, format, version) {
|
||||
taskId = utils.randomString(10);
|
||||
|
||||
const url = utils.getUrlForDownload(`api/notes/${branchId}/export/${type}/${format}/${version}/${taskId}`);
|
||||
const url = openService.getUrlForDownload(`api/notes/${branchId}/export/${type}/${format}/${version}/${taskId}`);
|
||||
|
||||
utils.download(url);
|
||||
openService.download(url);
|
||||
}
|
||||
|
||||
$('input[name=export-type]').on('change', function () {
|
||||
@@ -133,4 +134,4 @@ ws.subscribeToMessages(async message => {
|
||||
|
||||
toastService.showPersistent(toast);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,8 @@ import utils from '../services/utils.js';
|
||||
import server from '../services/server.js';
|
||||
import toastService from "../services/toast.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
import libraryLoader from "../services/library_loader.js";
|
||||
import openService from "../services/open.js";
|
||||
|
||||
const $dialog = $("#note-revisions-dialog");
|
||||
const $list = $("#note-revision-list");
|
||||
@@ -120,11 +122,7 @@ async function setContentPane() {
|
||||
|
||||
const $downloadButton = $('<button class="btn btn-sm btn-primary" type="button">Download</button>');
|
||||
|
||||
$downloadButton.on('click', () => {
|
||||
const url = utils.getUrlForDownload(`api/notes/${revisionItem.noteId}/revisions/${revisionItem.noteRevisionId}/download`);
|
||||
|
||||
utils.download(url);
|
||||
});
|
||||
$downloadButton.on('click', () => openService.downloadNoteRevision(revisionItem.noteId, revisionItem.noteRevisionId));
|
||||
|
||||
$titleButtons.append($downloadButton);
|
||||
|
||||
@@ -132,6 +130,12 @@ async function setContentPane() {
|
||||
|
||||
if (revisionItem.type === 'text') {
|
||||
$content.html(fullNoteRevision.content);
|
||||
|
||||
if ($content.find('span.math-tex').length > 0) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.KATEX);
|
||||
|
||||
renderMathInElement($content[0], {});
|
||||
}
|
||||
}
|
||||
else if (revisionItem.type === 'code') {
|
||||
$content.html($("<pre>").text(fullNoteRevision.content));
|
||||
|
||||
@@ -8,6 +8,11 @@ const TPL = `
|
||||
<p>Your username is <strong id="credentials-username"></strong>.</p>
|
||||
|
||||
<h3>Change password</h3>
|
||||
|
||||
<div class="alert alert-warning" role="alert" style="font-weight: bold; color: red !important;">
|
||||
Please take care to remember your new password. Password is used to encrypt protected notes. If you forget your password, then all your protected notes are forever lost with no recovery options.
|
||||
</div>
|
||||
|
||||
<form id="change-password-form">
|
||||
<div class="form-group">
|
||||
<label for="old-password">Old password</label>
|
||||
|
||||
@@ -81,7 +81,7 @@ export default class KeyboardShortcutsOptions {
|
||||
.filter(shortcut => !!shortcut);
|
||||
|
||||
const opts = {};
|
||||
opts['keyboardShortcuts' + actionName] = JSON.stringify(shortcuts);
|
||||
opts['keyboardShortcuts' + actionName.substr(0, 1).toUpperCase() + actionName.substr(1)] = JSON.stringify(shortcuts);
|
||||
|
||||
server.put('options', opts);
|
||||
});
|
||||
@@ -138,4 +138,4 @@ export default class KeyboardShortcutsOptions {
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ class Branch {
|
||||
this.isExpanded = !!row.isExpanded;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
/** @param {boolean} */
|
||||
this.fromSearchNote = !!row.fromSearchNote;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
@@ -48,4 +50,4 @@ class Branch {
|
||||
}
|
||||
}
|
||||
|
||||
export default Branch;
|
||||
export default Branch;
|
||||
|
||||
@@ -60,7 +60,7 @@ class NoteShort {
|
||||
/** @param {string} content-type, e.g. "application/json" */
|
||||
this.mime = row.mime;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = row.isDeleted;
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
addParent(parentNoteId, branchId) {
|
||||
|
||||
@@ -62,14 +62,19 @@ const RIGHT_PANE_CSS = `
|
||||
}
|
||||
|
||||
#right-pane .widget-header-action {
|
||||
color: var(--link-color) !important;
|
||||
cursor: pointer;
|
||||
color: var(--main-text-color) !important;
|
||||
text-decoration: none;
|
||||
font-size: large;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
#right-pane .widget-help {
|
||||
color: var(--muted-text-color);
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
#right-pane .widget-help.no-link:hover {
|
||||
@@ -82,6 +87,7 @@ const RIGHT_PANE_CSS = `
|
||||
color: var(--main-text-color) !important;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
#right-pane .widget-toggle-button:hover {
|
||||
|
||||
@@ -48,6 +48,11 @@ const PRINT_THIS = {js: ["libraries/printThis.js"]};
|
||||
|
||||
const CALENDAR_WIDGET = {css: ["stylesheets/calendar.css"]};
|
||||
|
||||
const KATEX = {
|
||||
js: [ "libraries/katex/katex.min.js", "libraries/katex/auto-render.min.js" ],
|
||||
css: [ "libraries/katex/katex.min.css" ]
|
||||
};
|
||||
|
||||
async function requireLibrary(library) {
|
||||
if (library.css) {
|
||||
library.css.map(cssUrl => requireCss(cssUrl));
|
||||
@@ -95,5 +100,6 @@ export default {
|
||||
RELATION_MAP,
|
||||
LINK_MAP,
|
||||
PRINT_THIS,
|
||||
CALENDAR_WIDGET
|
||||
CALENDAR_WIDGET,
|
||||
KATEX
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import server from "./server.js";
|
||||
import utils from "./utils.js";
|
||||
import renderService from "./render.js";
|
||||
import protectedSessionService from "./protected_session.js";
|
||||
import protectedSessionHolder from "./protected_session_holder.js";
|
||||
import libraryLoader from "./library_loader.js";
|
||||
import openService from "./open.js";
|
||||
|
||||
async function getRenderedContent(note) {
|
||||
const type = getRenderingType(note);
|
||||
@@ -13,6 +14,12 @@ async function getRenderedContent(note) {
|
||||
const fullNote = await server.get('notes/' + note.noteId);
|
||||
|
||||
$rendered = $('<div class="ck-content">').html(fullNote.content);
|
||||
|
||||
if ($rendered.find('span.math-tex').length > 0) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.KATEX);
|
||||
|
||||
renderMathInElement($rendered[0], {});
|
||||
}
|
||||
}
|
||||
else if (type === 'code') {
|
||||
const fullNote = await server.get('notes/' + note.noteId);
|
||||
@@ -25,24 +32,11 @@ async function getRenderedContent(note) {
|
||||
.css("max-width", "100%");
|
||||
}
|
||||
else if (type === 'file' || type === 'pdf') {
|
||||
function getFileUrl() {
|
||||
return utils.getUrlForDownload("api/notes/" + note.noteId + "/download");
|
||||
}
|
||||
|
||||
const $downloadButton = $('<button class="file-download btn btn-primary" type="button">Download</button>');
|
||||
const $openButton = $('<button class="file-open btn btn-primary" type="button">Open</button>');
|
||||
|
||||
$downloadButton.on('click', () => utils.download(getFileUrl()));
|
||||
$openButton.on('click', () => {
|
||||
if (utils.isElectron()) {
|
||||
const open = utils.dynamicRequire("open");
|
||||
|
||||
open(getFileUrl(), {url: true});
|
||||
}
|
||||
else {
|
||||
window.location.href = getFileUrl();
|
||||
}
|
||||
});
|
||||
$downloadButton.on('click', () => openService.downloadFileNote(note.noteId));
|
||||
$openButton.on('click', () => openService.openFileNote(note.noteId));
|
||||
|
||||
// open doesn't work for protected notes since it works through browser which isn't in protected session
|
||||
$openButton.toggle(!note.isProtected);
|
||||
@@ -51,7 +45,7 @@ async function getRenderedContent(note) {
|
||||
|
||||
if (type === 'pdf') {
|
||||
const $pdfPreview = $('<iframe class="pdf-preview" style="width: 100%; flex-grow: 100;"></iframe>');
|
||||
$pdfPreview.attr("src", utils.getUrlForDownload("api/notes/" + note.noteId + "/open"));
|
||||
$pdfPreview.attr("src", openService.getUrlForDownload("api/notes/" + note.noteId + "/open"));
|
||||
|
||||
$rendered.append($pdfPreview);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import linkService from "./link.js";
|
||||
import treeCache from "./tree_cache.js";
|
||||
import utils from "./utils.js";
|
||||
import attributeRenderer from "./attribute_renderer.js";
|
||||
import libraryLoader from "./library_loader.js";
|
||||
|
||||
function setupGlobalTooltip() {
|
||||
$(document).on("mouseenter", "a", mouseEnterHandler);
|
||||
@@ -101,7 +102,15 @@ async function renderTooltip(note, noteComplement) {
|
||||
}
|
||||
|
||||
if (note.type === 'text' && !utils.isHtmlEmpty(noteComplement.content)) {
|
||||
content += '<div class="ck-content">' + noteComplement.content + '</div>';
|
||||
const $content = $('<div class="ck-content">').append(noteComplement.content);
|
||||
|
||||
if ($content.find('span.math-tex').length > 0) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.KATEX);
|
||||
|
||||
renderMathInElement($content[0], {});
|
||||
}
|
||||
|
||||
content += $content[0].outerHTML;
|
||||
}
|
||||
else if (note.type === 'code' && noteComplement.content && noteComplement.content.trim()) {
|
||||
content += $("<pre>")
|
||||
|
||||
72
src/public/app/services/open.js
Normal file
72
src/public/app/services/open.js
Normal file
@@ -0,0 +1,72 @@
|
||||
import utils from "./utils.js";
|
||||
import server from "./server.js";
|
||||
|
||||
function getFileUrl(noteId) {
|
||||
return getUrlForDownload("api/notes/" + noteId + "/download");
|
||||
}
|
||||
|
||||
function download(url) {
|
||||
if (utils.isElectron()) {
|
||||
const remote = utils.dynamicRequire('electron').remote;
|
||||
|
||||
remote.getCurrentWebContents().downloadURL(url);
|
||||
} else {
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
|
||||
function downloadFileNote(noteId) {
|
||||
const url = getFileUrl(noteId) + '?' + Date.now(); // don't use cache
|
||||
|
||||
download(url);
|
||||
}
|
||||
|
||||
async function openFileNote(noteId) {
|
||||
if (utils.isElectron()) {
|
||||
const resp = await server.post("notes/" + noteId + "/saveToTmpDir");
|
||||
|
||||
const electron = utils.dynamicRequire('electron');
|
||||
const res = await electron.shell.openPath(resp.tmpFilePath);
|
||||
|
||||
if (res) {
|
||||
// fallback in case there's no default application for this file
|
||||
open(getFileUrl(noteId), {url: true});
|
||||
}
|
||||
}
|
||||
else {
|
||||
window.location.href = getFileUrl(noteId);
|
||||
}
|
||||
}
|
||||
|
||||
function downloadNoteRevision(noteId, noteRevisionId) {
|
||||
const url = getUrlForDownload(`api/notes/${noteId}/revisions/${noteRevisionId}/download`);
|
||||
|
||||
download(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url - should be without initial slash!!!
|
||||
*/
|
||||
function getUrlForDownload(url) {
|
||||
if (utils.isElectron()) {
|
||||
// electron needs absolute URL so we extract current host, port, protocol
|
||||
return getHost() + '/' + url;
|
||||
}
|
||||
else {
|
||||
// web server can be deployed on subdomain so we need to use relative path
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
function getHost() {
|
||||
const url = new URL(window.location.href);
|
||||
return url.protocol + "//" + url.hostname + ":" + url.port;
|
||||
}
|
||||
|
||||
export default {
|
||||
download,
|
||||
downloadFileNote,
|
||||
openFileNote,
|
||||
downloadNoteRevision,
|
||||
getUrlForDownload
|
||||
}
|
||||
@@ -47,6 +47,9 @@ class TabContext extends Component {
|
||||
if (await hoistedNoteService.checkNoteAccess(resolvedNotePath) === false) {
|
||||
return; // note is outside of hoisted subtree and user chose not to unhoist
|
||||
}
|
||||
|
||||
// if user choise to unhoist, cache was reloaded, but might not contain this note (since it's on unexpanded path)
|
||||
await treeCache.getNote(noteId);
|
||||
}
|
||||
|
||||
await this.triggerEvent('beforeNoteSwitch', {tabContext: this});
|
||||
@@ -78,10 +81,19 @@ class TabContext extends Component {
|
||||
notePath: this.notePath
|
||||
});
|
||||
}
|
||||
|
||||
if (utils.isDesktop()) {
|
||||
// close dangling autocompletes after closing the tab
|
||||
$(".aa-input").autocomplete("close");
|
||||
}
|
||||
}
|
||||
|
||||
/** @property {NoteShort} */
|
||||
get note() {
|
||||
if (this.noteId && !(this.noteId in treeCache.notes)) {
|
||||
logError(`Cannot find tabContext's note id='${this.noteId}'`);
|
||||
}
|
||||
|
||||
return treeCache.notes[this.noteId];
|
||||
}
|
||||
|
||||
|
||||
@@ -115,13 +115,13 @@ export default class TabManager extends Component {
|
||||
|
||||
// using pushState instead of directly modifying document.location because it does not trigger hashchange
|
||||
window.history.pushState(null, "", url);
|
||||
}
|
||||
|
||||
document.title = "Trilium Notes";
|
||||
document.title = "Trilium Notes";
|
||||
|
||||
if (activeTabContext.note) {
|
||||
// it helps navigating in history if note title is included in the title
|
||||
document.title += " - " + activeTabContext.note.title;
|
||||
}
|
||||
if (activeTabContext.note) {
|
||||
// it helps navigating in history if note title is included in the title
|
||||
document.title += " - " + activeTabContext.note.title;
|
||||
}
|
||||
|
||||
this.triggerEvent('activeNoteChanged'); // trigger this even in on popstate event
|
||||
|
||||
@@ -54,7 +54,7 @@ function closePersistent(id) {
|
||||
}
|
||||
|
||||
function showMessage(message, delay = 2000) {
|
||||
console.debug(utils.now(), "message: ", message);
|
||||
console.debug(utils.now(), "message:", message);
|
||||
|
||||
toast({
|
||||
title: "Info",
|
||||
|
||||
@@ -62,7 +62,7 @@ async function resolveNotePathToSegments(notePath, logErrors = true) {
|
||||
|
||||
if (!parents.length) {
|
||||
if (logErrors) {
|
||||
ws.logError(`No parents found for ${childNoteId} (${child.title})`);
|
||||
ws.logError(`No parents found for ${childNoteId} (${child.title}) for path ${notePath}`);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -83,8 +83,6 @@ async function resolveNotePathToSegments(notePath, logErrors = true) {
|
||||
for (const noteId of pathToRoot) {
|
||||
effectivePath.push(noteId);
|
||||
}
|
||||
|
||||
effectivePath.push('root');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user