Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
spell check support + small options tabs reorganization
zadamc1e8a4b3840b
diff --git a/db/migrations/0146__add_spell_check_options.sql b/db/migrations/0146__add_spell_check_options.sqlnew file mode 100644index 0000000000..7f2378f39e--- /dev/null+++ b/db/migrations/0146__add_spell_check_options.sql@@ -0,0 +1,5 @@+INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)+VALUES ('spellCheckEnabled', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);++INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)+VALUES ('spellCheckLanguageCode', 'en-US', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);\ No newline at end of filediff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.htmlindex 803a7e61df..e4dc8c3720 100644--- a/docs/backend_api/BackendScriptApi.html+++ b/docs/backend_api/BackendScriptApi.html@@ -396,7 +396,7 @@ the backend.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line310">line 310</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line312">line 312</a></li></ul></dd>@@ -1533,7 +1533,7 @@ the backend.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line315">line 315</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line317">line 317</a></li></ul></dd>@@ -1997,7 +1997,7 @@ the backend.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line239">line 239</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line241">line 241</a></li></ul></dd>@@ -2765,7 +2765,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line258">line 258</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line260">line 260</a></li></ul></dd>@@ -3418,7 +3418,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line230">line 230</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line232">line 232</a></li></ul></dd>@@ -3596,7 +3596,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line249">line 249</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line251">line 251</a></li></ul></dd>@@ -3751,7 +3751,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line267">line 267</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line269">line 269</a></li></ul></dd>@@ -3901,7 +3901,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line222">line 222</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line224">line 224</a></li></ul></dd>@@ -4427,7 +4427,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line287">line 287</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line289">line 289</a></li></ul></dd>@@ -4560,7 +4560,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line274">line 274</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line276">line 276</a></li></ul></dd>@@ -4935,7 +4935,7 @@ transactional by default.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line300">line 300</a>+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line302">line 302</a></li></ul></dd>diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.htmlindex 9afc0aea4a..52e7f35464 100644--- a/docs/backend_api/services_backend_script_api.js.html+++ b/docs/backend_api/services_backend_script_api.js.html@@ -237,9 +237,11 @@ function BackendScriptApi(currentNote, apiParams) {* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch*/this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {- await noteService.createNote(parentNoteId, title, content, extraOptions);+ const ret = await noteService.createNote(parentNoteId, title, content, extraOptions);ws.refreshTree();++ return ret;};/**@@ -343,7 +345,8 @@ function BackendScriptApi(currentNote, apiParams) {this.getAppInfo = () => appInfo}-module.exports = BackendScriptApi;</code></pre>+module.exports = BackendScriptApi;+</code></pre></article></section>diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.htmlindex 58f9fcc866..8df1577430 100644--- a/docs/frontend_api/FrontendScriptApi.html+++ b/docs/frontend_api/FrontendScriptApi.html@@ -131,6 +131,116 @@+<h4 class="name" id="$container"><span class="type-signature"></span>$container<span class="type-signature"></span></h4>+++++++++++ <h5 class="subsection-title">Properties:</h5>++++<table class="props">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>++++++ <th class="last">Description</th>+ </tr>+ </thead>++ <tbody>+++ <tr>++ <td class="name"><code>container</code></td>+++ <td class="type">+++<span class="param-type">jQuery</span>++++ </td>++++++ <td class="description last">of all the rendered script content</td>+ </tr>+++ </tbody>+</table>+++++<dl class="details">+++++++++++++++++++++++++++ <dt class="tag-source">Source:</dt>+ <dd class="tag-source"><ul class="dummy"><li>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line23">line 23</a>+ </li></ul></dd>++++++++</dl>++++++++<h4 class="name" id="currentNote"><span class="type-signature"></span>currentNote<span class="type-signature"></span></h4>@@ -223,7 +333,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line25">line 25</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line28">line 28</a></li></ul></dd>@@ -336,7 +446,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line27">line 27</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line30">line 30</a></li></ul></dd>@@ -442,7 +552,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line36">line 36</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line39">line 39</a></li></ul></dd>@@ -552,7 +662,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line23">line 23</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line26">line 26</a></li></ul></dd>@@ -661,7 +771,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line33">line 33</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line36">line 36</a></li></ul></dd>@@ -790,7 +900,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line61">line 61</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line64">line 64</a></li></ul></dd>@@ -945,7 +1055,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line45">line 45</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line48">line 48</a></li></ul></dd>@@ -1100,7 +1210,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line80">line 80</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line83">line 83</a></li></ul></dd>@@ -1280,7 +1390,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line269">line 269</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line272">line 272</a></li></ul></dd>@@ -1413,7 +1523,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line229">line 229</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line232">line 232</a></li></ul></dd>@@ -1519,7 +1629,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line275">line 275</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line278">line 278</a></li></ul></dd>@@ -1625,7 +1735,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line281">line 281</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line284">line 284</a></li></ul></dd>@@ -1784,7 +1894,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line332">line 332</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line335">line 335</a></li></ul></dd>@@ -1891,7 +2001,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line222">line 222</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line225">line 225</a></li></ul></dd>@@ -2046,7 +2156,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line341">line 341</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line344">line 344</a></li></ul></dd>@@ -2202,7 +2312,7 @@ if some action needs to happen on only one specific instance.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line190">line 190</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line193">line 193</a></li></ul></dd>@@ -2403,7 +2513,7 @@ otherwise (by e.g. createNoteLink())<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line202">line 202</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line205">line 205</a></li></ul></dd>@@ -2509,7 +2619,7 @@ otherwise (by e.g. createNoteLink())<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line323">line 323</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line326">line 326</a></li></ul></dd>@@ -2664,7 +2774,7 @@ otherwise (by e.g. createNoteLink())<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line350">line 350</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line353">line 353</a></li></ul></dd>@@ -2773,7 +2883,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line296">line 296</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line299">line 299</a></li></ul></dd>@@ -2928,7 +3038,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line304">line 304</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line307">line 307</a></li></ul></dd>@@ -3061,7 +3171,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line236">line 236</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line239">line 239</a></li></ul></dd>@@ -3167,7 +3277,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line315">line 315</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line318">line 318</a></li></ul></dd>@@ -3255,7 +3365,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line260">line 260</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line263">line 263</a></li></ul></dd>@@ -3406,7 +3516,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line208">line 208</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line211">line 211</a></li></ul></dd>@@ -3539,7 +3649,7 @@ note.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line214">line 214</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line217">line 217</a></li></ul></dd>@@ -3700,7 +3810,7 @@ Internally this serializes the anonymous function into string and sends it to ba<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line130">line 130</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line133">line 133</a></li></ul></dd>@@ -3860,7 +3970,7 @@ Internally this serializes the anonymous function into string and sends it to ba<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line178">line 178</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line181">line 181</a></li></ul></dd>@@ -4016,7 +4126,7 @@ Internally this serializes the anonymous function into string and sends it to ba<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line160">line 160</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line163">line 163</a></li></ul></dd>@@ -4167,7 +4277,7 @@ Internally this serializes the anonymous function into string and sends it to ba<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line310">line 310</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line313">line 313</a></li></ul></dd>@@ -4304,7 +4414,7 @@ Internally this serializes the anonymous function into string and sends it to ba<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line252">line 252</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line255">line 255</a></li></ul></dd>@@ -4441,7 +4551,7 @@ Internally this serializes the anonymous function into string and sends it to ba<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line244">line 244</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line247">line 247</a></li></ul></dd>diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.htmlindex 6514efb81f..11675a2c8a 100644--- a/docs/frontend_api/NoteShort.html+++ b/docs/frontend_api/NoteShort.html@@ -30,7 +30,10 @@<h2><span class="attribs"><span class="type-signature"></span></span>NoteShort<span class="signature">()</span><span class="type-signature"></span></h2>- <div class="class-description">This note's representation is used in note tree and is kept in TreeCache.</div>+ <div class="class-description">FIXME: rethink how attributes are cached in Note entities since they are long lived inside the cache.+Attribute cache should be limited to "transaction".++This note's representation is used in note tree and is kept in TreeCache.</div></header>@@ -93,7 +96,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line13">line 13</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line16">line 16</a></li></ul></dd>@@ -183,7 +186,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line26">line 26</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line29">line 29</a></li></ul></dd>@@ -241,7 +244,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line28">line 28</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line31">line 31</a></li></ul></dd>@@ -299,7 +302,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line20">line 20</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line23">line 23</a></li></ul></dd>@@ -357,7 +360,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line24">line 24</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line27">line 27</a></li></ul></dd>@@ -415,7 +418,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line16">line 16</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line19">line 19</a></li></ul></dd>@@ -473,7 +476,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line18">line 18</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line21">line 21</a></li></ul></dd>@@ -531,7 +534,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line22">line 22</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line25">line 25</a></li></ul></dd>@@ -679,7 +682,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line166">line 166</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line169">line 169</a></li></ul></dd>@@ -846,7 +849,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line106">line 106</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line109">line 109</a></li></ul></dd>@@ -1020,7 +1023,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line177">line 177</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line180">line 180</a></li></ul></dd>@@ -1126,7 +1129,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line57">line 57</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line60">line 60</a></li></ul></dd>@@ -1228,7 +1231,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line71">line 71</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line74">line 74</a></li></ul></dd>@@ -1330,7 +1333,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line93">line 93</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line96">line 96</a></li></ul></dd>@@ -1432,7 +1435,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line98">line 98</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line101">line 101</a></li></ul></dd>@@ -1583,7 +1586,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line199">line 199</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line202">line 202</a></li></ul></dd>@@ -1750,7 +1753,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line132">line 132</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line135">line 135</a></li></ul></dd>@@ -1917,7 +1920,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line124">line 124</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line127">line 127</a></li></ul></dd>@@ -2072,7 +2075,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line211">line 211</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line214">line 214</a></li></ul></dd>@@ -2178,7 +2181,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line83">line 83</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line86">line 86</a></li></ul></dd>@@ -2280,7 +2283,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line88">line 88</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line91">line 91</a></li></ul></dd>@@ -2431,7 +2434,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line205">line 205</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line208">line 208</a></li></ul></dd>@@ -2598,7 +2601,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line148">line 148</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line151">line 151</a></li></ul></dd>@@ -2765,7 +2768,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line140">line 140</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line143">line 143</a></li></ul></dd>@@ -2920,7 +2923,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line223">line 223</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line226">line 226</a></li></ul></dd>@@ -3090,7 +3093,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line233">line 233</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line236">line 236</a></li></ul></dd>@@ -3241,7 +3244,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line217">line 217</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line220">line 220</a></li></ul></dd>@@ -3351,7 +3354,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line257">line 257</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line260">line 260</a></li></ul></dd>@@ -3525,7 +3528,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line157">line 157</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line160">line 160</a></li></ul></dd>@@ -3631,7 +3634,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line65">line 65</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line68">line 68</a></li></ul></dd>@@ -3782,7 +3785,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line187">line 187</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line190">line 190</a></li></ul></dd>@@ -3937,7 +3940,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line193">line 193</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line196">line 196</a></li></ul></dd>@@ -4048,7 +4051,7 @@ Cache is note instance scoped.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line248">line 248</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line251">line 251</a></li></ul></dd>@@ -4132,7 +4135,7 @@ Cache is note instance scoped.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line32">line 32</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line35">line 35</a></li></ul></dd>diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.htmlindex 7e0281d3ba..a61030a294 100644--- a/docs/frontend_api/entities_note_short.js.html+++ b/docs/frontend_api/entities_note_short.js.html@@ -35,6 +35,9 @@ const RELATION = 'relation';const RELATION_DEFINITION = 'relation-definition';/**+ * FIXME: rethink how attributes are cached in Note entities since they are long lived inside the cache.+ * Attribute cache should be limited to "transaction".+ ** This note's representation is used in note tree and is kept in TreeCache.*/class NoteShort {diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.htmlindex 0a422518d4..6e4c07a95f 100644--- a/docs/frontend_api/global.html+++ b/docs/frontend_api/global.html@@ -303,7 +303,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line67">line 67</a>+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line70">line 70</a></li></ul></dd>diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.htmlindex 74d1bb234a..203bd234ea 100644--- a/docs/frontend_api/services_frontend_script_api.js.html+++ b/docs/frontend_api/services_frontend_script_api.js.html@@ -44,9 +44,12 @@ import StandardWidget from '../widgets/standard_widget.js';* @constructor* @hideconstructor*/-function FrontendScriptApi(startNote, currentNote, originEntity = null, tabContext = null) {+function FrontendScriptApi(startNote, currentNote, originEntity = null, tabContext = null, $container = null) {const $pluginButtons = $("#plugin-buttons");+ /** @property {jQuery} container of all the rendered script content */+ this.$container = $container;+/** @property {object} note where script started executing */this.startNote = startNote;/** @property {object} note where script is currently executing */@@ -322,7 +325,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte* @return {boolean} returns true if the original note is still loaded, false if user switched to another*/this.isNoteStillActive = () => {- return this.originEntity.noteId === tabContext.noteId;+ return tabContext.note && this.originEntity.noteId === tabContext.note.noteId;};/**diff --git a/electron.js b/electron.jsindex 693532e581..ab70a1e412 100644--- a/electron.js+++ b/electron.js@@ -10,7 +10,6 @@ const port = require('./src/services/port');const env = require('./src/services/env');const appIconService = require('./src/services/app_icon');const windowStateKeeper = require('electron-window-state');-const contextMenu = require('electron-context-menu');// Adds debug features like hotkeys for triggering dev tools and reloadrequire('electron-debug')();@@ -22,25 +21,25 @@ let mainWindow;require('electron-dl')({ saveAs: true });-contextMenu({- menu: (actions, params, browserWindow) => [- actions.cut(),- actions.copy(),- actions.copyLink(),- actions.paste(),- {- label: 'Search DuckDuckGo for “{selection}”',- // Only show it when right-clicking text- visible: params.selectionText.trim().length > 0,- click: () => {- const {shell} = require('electron');-- shell.openExternal(`https://duckduckgo.com?q=${encodeURIComponent(params.selectionText)}`);- }- },- actions.inspect()- ]-});+// contextMenu({+// menu: (actions, params, browserWindow) => [+// actions.cut(),+// actions.copy(),+// actions.copyLink(),+// actions.paste(),+// {+// label: 'Search DuckDuckGo for “{selection}”',+// // Only show it when right-clicking text+// visible: params.selectionText.trim().length > 0,+// click: () => {+// const {shell} = require('electron');+//+// shell.openExternal(`https://duckduckgo.com?q=${encodeURIComponent(params.selectionText)}`);+// }+// },+// actions.inspect()+// ]+// });function onClosed() {// Dereference the windowdiff --git a/package-lock.json b/package-lock.jsonindex abd302069e..fe24051882 100644--- a/package-lock.json+++ b/package-lock.json@@ -10,6 +10,34 @@"integrity": "sha512-GLyWIFBbGvpKPGo55JyRZAo4lVbnBiD52cKlw/0Vt+wnmKvWJkpZvsjVoaIolyBXDeAQKSicRtqFNPem9w0WYA==","dev": true},+ "@aabuhijleh/electron-remote": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/@aabuhijleh/electron-remote/-/electron-remote-1.4.0.tgz",+ "integrity": "sha512-EG4ZXxqbFY4lpX55vctwz14mFrEOcOHFCMLH5z5lOl6fiviTqscy86tSlKwEE3/o3ExtdPr2tECgCogYYL7d+g==",+ "requires": {+ "debug": "^2.5.1",+ "hashids": "^1.1.1",+ "lodash.get": "^4.4.2",+ "pify": "^2.3.0",+ "rxjs": "^5.0.0-beta.12",+ "xmlhttprequest": "^1.8.0"+ },+ "dependencies": {+ "debug": {+ "version": "2.6.9",+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",+ "requires": {+ "ms": "2.0.0"+ }+ },+ "pify": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="+ }+ }+ },"@babel/code-frame": {"version": "7.5.5","resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",@@ -233,6 +261,14 @@}}},+ "@felixrieseberg/spellchecker": {+ "version": "4.0.10",+ "resolved": "https://registry.npmjs.org/@felixrieseberg/spellchecker/-/spellchecker-4.0.10.tgz",+ "integrity": "sha512-b+BlHcBXjx+W7yGNAtoVpAv8dvmAQ8Tp2YhNjqxIgocb6Wq1nKLl4jfu9DG60UWC0hTNvvQ74ny9ojiUFNqGSA==",+ "requires": {+ "nan": "^2.13.2"+ }+ },"@jimp/bmp": {"version": "0.8.4","resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.8.4.tgz",@@ -1202,6 +1238,11 @@"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz","integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw=="},+ "bcp47": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/bcp47/-/bcp47-1.1.2.tgz",+ "integrity": "sha1-NUvjMH/9CEM6ePXh4glYRfifx/4="+ },"bcrypt-pbkdf": {"version": "1.0.2","resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",@@ -1955,6 +1996,54 @@}}},+ "cld": {+ "version": "2.5.1",+ "resolved": "https://registry.npmjs.org/cld/-/cld-2.5.1.tgz",+ "integrity": "sha512-DwdvvcFVizwDdPCocoPPReFk3BwLEaTZ3RzFgJ4jLzsBzJKUC3cTna0ZmAZG4tFtMmQdl0ciso3+ijkH3OPZPA==",+ "requires": {+ "glob": "^5.0.10",+ "nan": "^2.9.2",+ "rimraf": "^2.4.0",+ "underscore": "^1.6.0"+ },+ "dependencies": {+ "glob": {+ "version": "5.0.15",+ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",+ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",+ "requires": {+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "2 || 3",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ }+ },+ "rimraf": {+ "version": "2.7.1",+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",+ "requires": {+ "glob": "^7.1.3"+ },+ "dependencies": {+ "glob": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",+ "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",+ "requires": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.0.4",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ }+ }+ }+ }+ }+ },"clean-regexp": {"version": "1.0.0","resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz",@@ -4139,6 +4228,45 @@}}},+ "electron-spellchecker": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/electron-spellchecker/-/electron-spellchecker-2.2.0.tgz",+ "integrity": "sha512-QkOVgjmjx6bDkqNshRTfVzEz9ctjiKVPZw77YLS0sQReP320QNtTXAKyo+01TORWk58RFT/LdxPZ/aejLdPmOA==",+ "requires": {+ "@aabuhijleh/electron-remote": "^1.4.0",+ "@felixrieseberg/spellchecker": "^4.0.10",+ "bcp47": "^1.1.2",+ "cld": "^2.5.1",+ "debug": "^4.1.1",+ "keyboard-layout": "^2.0.16",+ "lru-cache": "^5.1.1",+ "mkdirp": "^0.5.1",+ "pify": "^4.0.1",+ "rxjs": "^5.0.1",+ "rxjs-serial-subscription": "^0.1.1",+ "spawn-rx": "^2.0.7"+ },+ "dependencies": {+ "lru-cache": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",+ "requires": {+ "yallist": "^3.0.2"+ }+ },+ "pify": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="+ },+ "yallist": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="+ }+ }+ },"electron-window-state": {"version": "5.0.3","resolved": "https://registry.npmjs.org/electron-window-state/-/electron-window-state-5.0.3.tgz",@@ -5089,6 +5217,11 @@"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz","integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="},+ "event-kit": {+ "version": "2.5.3",+ "resolved": "https://registry.npmjs.org/event-kit/-/event-kit-2.5.3.tgz",+ "integrity": "sha512-b7Qi1JNzY4BfAYfnIRanLk0DOD1gdkWHT4GISIn8Q2tAf3LpU8SP2CMwWaq40imYoKWbtN4ZhbSRxvsnikooZQ=="+ },"exec-buffer": {"version": "3.2.0","resolved": "https://registry.npmjs.org/exec-buffer/-/exec-buffer-3.2.0.tgz",@@ -6721,6 +6854,11 @@"integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==","dev": true},+ "hashids": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/hashids/-/hashids-1.2.2.tgz",+ "integrity": "sha512-dEHCG2LraR6PNvSGxosZHIRgxF5sNLOIBFEHbj8lfP9WWmu/PWPMzsip1drdVSOFi51N2pU7gZavrgn7sbGFuw=="+ },"he": {"version": "1.2.0","resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",@@ -7991,6 +8129,15 @@"resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz","integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ=="},+ "keyboard-layout": {+ "version": "2.0.16",+ "resolved": "https://registry.npmjs.org/keyboard-layout/-/keyboard-layout-2.0.16.tgz",+ "integrity": "sha512-eGrxmlV6jbm/mbPEOpYGuH53XEC7wIUj9ZxKcT2z9QHJ/RwrT9iVkvxka9zRxqHZHwQzcffgsa5OxoVAKnhK9w==",+ "requires": {+ "event-kit": "^2.0.0",+ "nan": "^2.13.2"+ }+ },"keyboardevent-from-electron-accelerator": {"version": "1.1.0","resolved": "https://registry.npmjs.org/keyboardevent-from-electron-accelerator/-/keyboardevent-from-electron-accelerator-1.1.0.tgz",@@ -8203,8 +8350,7 @@"lodash.assign": {"version": "4.2.0","resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",- "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=",- "dev": true+ "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc="},"lodash.camelcase": {"version": "4.3.0",@@ -8229,8 +8375,7 @@"lodash.get": {"version": "4.4.2","resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",- "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",- "dev": true+ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="},"lodash.isarguments": {"version": "3.1.0",@@ -11793,11 +11938,18 @@"version": "5.5.12","resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz","integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==",- "dev": true,"requires": {"symbol-observable": "1.0.1"}},+ "rxjs-serial-subscription": {+ "version": "0.1.1",+ "resolved": "https://registry.npmjs.org/rxjs-serial-subscription/-/rxjs-serial-subscription-0.1.1.tgz",+ "integrity": "sha1-pCsdsL8QlLCSMRkeJ3jKP8+e0Uc=",+ "requires": {+ "rxjs": "^5.0.0-beta.12"+ }+ },"safe-buffer": {"version": "5.1.2","resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",@@ -12293,7 +12445,6 @@"version": "2.0.12","resolved": "https://registry.npmjs.org/spawn-rx/-/spawn-rx-2.0.12.tgz","integrity": "sha512-gOPXiQQFQ9lTOLuys0iMn3jfxxv9c7zzwhbYLOEbQGvEShHVJ5sSR1oD3Daj88os7jKArDYT7rbOKdvNhe7iEg==",- "dev": true,"requires": {"debug": "^2.5.1","lodash.assign": "^4.2.0",@@ -12304,7 +12455,6 @@"version": "2.6.9","resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz","integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",- "dev": true,"requires": {"ms": "2.0.0"}@@ -12667,8 +12817,7 @@"symbol-observable": {"version": "1.0.1","resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",- "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=",- "dev": true+ "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ="},"symbol-tree": {"version": "3.2.2",@@ -13194,8 +13343,7 @@"underscore": {"version": "1.9.1","resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",- "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==",- "dev": true+ "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="},"unescape": {"version": "1.0.1",@@ -13893,6 +14041,11 @@"integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=","dev": true},+ "xmlhttprequest": {+ "version": "1.8.0",+ "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",+ "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw="+ },"xo": {"version": "0.25.3","resolved": "https://registry.npmjs.org/xo/-/xo-0.25.3.tgz",diff --git a/package.json b/package.jsonindex fa148f97b4..1fc2c5d1b7 100644--- a/package.json+++ b/package.json@@ -35,6 +35,7 @@"electron-debug": "3.0.1","electron-dl": "1.14.0","electron-find": "1.0.6",+ "electron-spellchecker": "^2.2.0","electron-window-state": "5.0.3","express": "4.17.1","express-session": "1.16.2",diff --git a/src/app.js b/src/app.jsindex 26b5f439d1..b25bf7dd27 100644--- a/src/app.js+++ b/src/app.js@@ -88,7 +88,10 @@ app.use((req, res, next) => {// error handlerapp.use((err, req, res, next) => {- if (err && err.message && err.message.includes("Invalid package")) {+ if (err && err.message && (+ err.message.includes("Invalid package")+ || (err.message.includes("Router not found for request") && err.message.includes("node_modules"))+ )) {// electron 6 outputs a lot of such errors which do not seem important}else {diff --git a/src/public/javascripts/desktop.js b/src/public/javascripts/desktop.jsindex 30ef34d6b5..5f33fd985e 100644--- a/src/public/javascripts/desktop.js+++ b/src/public/javascripts/desktop.js@@ -177,3 +177,7 @@ entrypoints.registerEntrypoints();noteTooltipService.setupGlobalTooltip();noteAutocompleteService.init();++if (utils.isElectron()) {+ import("./services/spell_check.js").then(spellCheckService => spellCheckService.initSpellCheck());+}\ No newline at end of filediff --git a/src/public/javascripts/dialogs/options.js b/src/public/javascripts/dialogs/options.jsindex 2e5b991fce..e2835a35cc 100644--- a/src/public/javascripts/dialogs/options.js+++ b/src/public/javascripts/dialogs/options.js@@ -19,8 +19,7 @@ export async function showDialog() {import('./options/appearance.js'),import('./options/code_notes.js'),import('./options/change_password.js'),- import('./options/note_revisions.js'),- import('./options/protected_session.js'),+ import('./options/other.js'),import('./options/sidebar.js'),import('./options/sync.js'),]))diff --git a/src/public/javascripts/dialogs/options/note_revisions.js b/src/public/javascripts/dialogs/options/note_revisions.jsdeleted file mode 100644index 17d3ff010c..0000000000--- a/src/public/javascripts/dialogs/options/note_revisions.js+++ /dev/null@@ -1,20 +0,0 @@-import server from "../../services/server.js";-import infoService from "../../services/info.js";--export default class NoteRevisionsOptions {- constructor() {- this.$form = $("#note-revision-snapshot-time-interval-form");- this.$timeInterval = $("#note-revision-snapshot-time-interval-in-seconds");-- this.$form.submit(() => {- const opts = { 'noteRevisionSnapshotTimeInterval': this.$timeInterval.val() };- server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));-- return false;- });- }-- optionsLoaded(options) {- this.$timeInterval.val(options['noteRevisionSnapshotTimeInterval']);- }-}\ No newline at end of filediff --git a/src/public/javascripts/dialogs/options/other.js b/src/public/javascripts/dialogs/options/other.jsnew file mode 100644index 0000000000..98eaafd0a8--- /dev/null+++ b/src/public/javascripts/dialogs/options/other.js@@ -0,0 +1,54 @@+import optionsService from "../../services/options.js";+import server from "../../services/server.js";+import infoService from "../../services/info.js";++export default class ProtectedSessionOptions {+ constructor() {+ this.$spellCheckEnabled = $("#spell-check-enabled");+ this.$spellCheckLanguageCode = $("#spell-check-language-code");++ this.$protectedSessionTimeout = $("#protected-session-timeout-in-seconds");+ this.$noteRevisionsTimeInterval = $("#note-revision-snapshot-time-interval-in-seconds");++ this.$spellCheckEnabled.change(() => {+ const opts = { 'spellCheckEnabled': this.$spellCheckEnabled.is(":checked") ? "true" : "false" };+ server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));++ return false;+ });++ this.$spellCheckLanguageCode.change(() => {+ const opts = { 'spellCheckLanguageCode': this.$spellCheckLanguageCode.val() };+ server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));++ return false;+ });++ this.$protectedSessionTimeout.change(() => {+ const protectedSessionTimeout = this.$protectedSessionTimeout.val();++ server.put('options', { 'protectedSessionTimeout': protectedSessionTimeout }).then(() => {+ optionsService.reloadOptions();++ infoService.showMessage("Options change have been saved.");+ });++ return false;+ });++ this.$noteRevisionsTimeInterval.change(() => {+ const opts = { 'noteRevisionSnapshotTimeInterval': this.$noteRevisionsTimeInterval.val() };+ server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));++ return false;+ });+ }++ optionsLoaded(options) {+ this.$spellCheckEnabled.prop("checked", options['spellCheckEnabled'] === 'true');+ this.$spellCheckLanguageCode.val(options['spellCheckLanguageCode']);++ this.$protectedSessionTimeout.val(options['protectedSessionTimeout']);+ this.$noteRevisionsTimeInterval.val(options['noteRevisionSnapshotTimeInterval']);+ }+}\ No newline at end of filediff --git a/src/public/javascripts/dialogs/options/protected_session.js b/src/public/javascripts/dialogs/options/protected_session.jsdeleted file mode 100644index 5db0fe1260..0000000000--- a/src/public/javascripts/dialogs/options/protected_session.js+++ /dev/null@@ -1,28 +0,0 @@-import optionsService from "../../services/options.js";-import server from "../../services/server.js";-import infoService from "../../services/info.js";--export default class ProtectedSessionOptions {- constructor() {- this.$form = $("#protected-session-timeout-form");- this.$protectedSessionTimeout = $("#protected-session-timeout-in-seconds");-- this.$form.submit(() => this.save());- }-- optionsLoaded(options) {- this.$protectedSessionTimeout.val(options['protectedSessionTimeout']);- }-- save() {- const protectedSessionTimeout = this.$protectedSessionTimeout.val();-- server.put('options', { 'protectedSessionTimeout': protectedSessionTimeout }).then(() => {- optionsService.reloadOptions();-- infoService.showMessage("Options change have been saved.");- });-- return false;- }-}\ No newline at end of filediff --git a/src/public/javascripts/services/options.js b/src/public/javascripts/services/options.jsindex 11e34efbf2..c671907107 100644--- a/src/public/javascripts/services/options.js+++ b/src/public/javascripts/services/options.js@@ -51,7 +51,11 @@ function reloadOptions() {return optionsReady;}-/** just waits for some options without triggering reload */+/**+ * just waits for some options without triggering reload+ *+ * @return {Options}+ */async function waitForOptions() {return await optionsReady;}diff --git a/src/public/javascripts/services/spell_check.js b/src/public/javascripts/services/spell_check.jsnew file mode 100644index 0000000000..db1546b3d6--- /dev/null+++ b/src/public/javascripts/services/spell_check.js@@ -0,0 +1,43 @@+import optionsService from "./options.js";++export async function initSpellCheck() {+ const options = await optionsService.waitForOptions();++ if (!options.is('spellCheckEnabled')) {+ return;+ }++ const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker');+ const {remote, shell} = require('electron');++ const spellCheckHandler = new SpellCheckHandler();+ spellCheckHandler.attachToInput();++ spellCheckHandler.switchLanguage(options.get('spellCheckLanguageCode'));++ spellCheckHandler.currentSpellcheckerChanged.subscribe(() => {+ console.debug(`Detected language is ${spellCheckHandler.currentSpellcheckerLanguage}`);+ });++ const contextMenuBuilder = new ContextMenuBuilder(spellCheckHandler, null, true, (menu, menuInfo) => {+ // There's no menu.remove(id) so this is a convoluted way of removing the 'Search with Google' menu item+ const oldItems = menu.items;+ menu.clear();+ oldItems.forEach(oldItem => {+ if (!oldItem.label.includes('Google')) {+ menu.append(oldItem);+ } else {+ menu.append(new remote.MenuItem({+ label: 'Search with DuckDuckGo',+ click: () => {+ shell.openExternal(`https://duckduckgo.com/?q=${encodeURIComponent(menuInfo.selectionText)}`);+ }+ }));+ }+ });+ });++ new ContextMenuListener(async (info) => {+ await contextMenuBuilder.showPopupMenu(info);+ });+}\ No newline at end of filediff --git a/src/routes/api/options.js b/src/routes/api/options.jsindex 5d956cd3e4..3533ae9de3 100644--- a/src/routes/api/options.js+++ b/src/routes/api/options.js@@ -32,7 +32,9 @@ const ALLOWED_OPTIONS = ['similarNotesWidget','editedNotesWidget','calendarWidget',- 'codeNotesMimeTypes'+ 'codeNotesMimeTypes',+ 'spellCheckEnabled',+ 'spellCheckLanguageCode'];async function getOptions() {diff --git a/src/services/app_info.js b/src/services/app_info.jsindex ee1db9289b..477fb83c39 100644--- a/src/services/app_info.js+++ b/src/services/app_info.js@@ -4,7 +4,7 @@ const build = require('./build');const packageJson = require('../../package');const {TRILIUM_DATA_DIR} = require('./data_dir');-const APP_DB_VERSION = 145;+const APP_DB_VERSION = 146;const SYNC_VERSION = 10;const CLIPPER_PROTOCOL_VERSION = "1.0";diff --git a/src/services/options_init.js b/src/services/options_init.jsindex d1dcf3e786..2ebb2b9deb 100644--- a/src/services/options_init.js+++ b/src/services/options_init.js@@ -79,6 +79,9 @@ async function initNotSyncedOptions(initialized, startNotePath = 'root', opts =await optionService.createOption('similarNotesWidget', '{"enabled":true,"expanded":true,"position":600}', false);await optionService.createOption('initialized', initialized ? 'true' : 'false', false);++ await optionService.createOption('spellCheckEnabled', 'true', false);+ await optionService.createOption('spellCheckLanguageCode', 'en-US', false);}module.exports = {diff --git a/src/views/dialogs/options.ejs b/src/views/dialogs/options.ejsindex 17e110f9c6..b551975b25 100644--- a/src/views/dialogs/options.ejs+++ b/src/views/dialogs/options.ejs@@ -23,13 +23,10 @@<a class="nav-link" data-toggle="tab" href="#options-change-password">Change password</a></li><li class="nav-item">- <a class="nav-link" data-toggle="tab" href="#options-protected-session">Protected session</a>- </li>- <li class="nav-item">- <a class="nav-link" data-toggle="tab" href="#options-note-revisions">Note revisions</a>+ <a class="nav-link" data-toggle="tab" href="#options-sync-setup">Sync</a></li><li class="nav-item">- <a class="nav-link" data-toggle="tab" href="#options-sync-setup">Sync</a>+ <a class="nav-link" data-toggle="tab" href="#options-other">Other</a></li><li class="nav-item"><a class="nav-link" data-toggle="tab" href="#options-advanced">Advanced</a>@@ -41,8 +38,7 @@<% include options/sidebar.ejs %><% include options/code_notes.ejs %><% include options/change_password.ejs %>- <% include options/protected_session.ejs %>- <% include options/note_revisions.ejs %>+ <% include options/other.ejs %><% include options/sync.ejs %><% include options/advanced.ejs %></div>diff --git a/src/views/dialogs/options/note_revisions.ejs b/src/views/dialogs/options/note_revisions.ejsdeleted file mode 100644index 376bdd0859..0000000000--- a/src/views/dialogs/options/note_revisions.ejs+++ /dev/null@@ -1,18 +0,0 @@-<div id="options-note-revisions" class="tab-pane">- <h4>Note revisions snapshot interval</h4>-- <p>Note revision snapshot time interval is time in seconds after which new note revision will be created for the note.</p>-- <form id="note-revision-snapshot-time-interval-form">- <div class="form-group">- <label for="note-revision-snapshot-time-interval-in-seconds">Note revision snapshot time interval (in seconds)</label>- <input class="form-control" id="note-revision-snapshot-time-interval-in-seconds" type="number">- </div>-- <div style="display: flex; justify-content: space-between;">- <button class="btn btn-primary">Save</button>-- <button class="btn btn-secondary" type="button" data-help-page="Note-revisions">Help</button>- </div>- </form>-</div>\ No newline at end of filediff --git a/src/views/dialogs/options/other.ejs b/src/views/dialogs/options/other.ejsnew file mode 100644index 0000000000..6cb0b6b93f--- /dev/null+++ b/src/views/dialogs/options/other.ejs@@ -0,0 +1,44 @@+<div id="options-other" class="tab-pane">+ <div>+ <h4>Spell check</h4>++ <p>These options apply only for desktop builds, browsers will use their own native spell check.</p>++ <div class="custom-control custom-checkbox">+ <input type="checkbox" class="custom-control-input" id="spell-check-enabled">+ <label class="custom-control-label" for="spell-check-enabled">Enable spellcheck</label>+ </div>++ <br/>++ <div class="form-group">+ <label for="spell-check-language-code">Language code</label>+ <input type="email" class="form-control" id="spell-check-language-code" placeholder="for example "en-US", "de-AT"">+ </div>++ <p>Changes to the spell check options will take effect after application restart.</p>+ </div>++ <div>+ <h4>Protected session timeout</h4>++ <p>Protected session timeout is a time period after which the protected session is wiped out from+ browser's memory. This is measured from the last interaction with protected notes. See <a href="https://github.com/zadam/trilium/wiki/Protected-notes" class="external">wiki</a> for more info.</p>++ <div class="form-group">+ <label for="protected-session-timeout-in-seconds">Protected session timeout (in seconds)</label>+ <input class="form-control" id="protected-session-timeout-in-seconds" type="number">+ </div>+ </div>++ <div>+ <h4>Note revisions snapshot interval</h4>++ <p>Note revision snapshot time interval is time in seconds after which new note revision will be created for the note. See <a href="https://github.com/zadam/trilium/wiki/Note-revisions" class="external">wiki</a> for more info.</p>++ <div class="form-group">+ <label for="note-revision-snapshot-time-interval-in-seconds">Note revision snapshot time interval (in seconds)</label>+ <input class="form-control" id="note-revision-snapshot-time-interval-in-seconds" type="number">+ </div>+ </div>+</div>\ No newline at end of filediff --git a/src/views/dialogs/options/protected_session.ejs b/src/views/dialogs/options/protected_session.ejsdeleted file mode 100644index da8c212ad1..0000000000--- a/src/views/dialogs/options/protected_session.ejs+++ /dev/null@@ -1,19 +0,0 @@-<div id="options-protected-session" class="tab-pane">- <h4>Protected session timeout</h4>-- <p>Protected session timeout is a time period after which the protected session is wiped out from- browser's memory. This is measured from the last interaction with protected notes.</p>-- <form id="protected-session-timeout-form">- <div class="form-group">- <label for="protected-session-timeout-in-seconds">Protected session timeout (in seconds)</label>- <input class="form-control" id="protected-session-timeout-in-seconds" type="number">- </div>-- <div style="display: flex; justify-content: space-between;">- <button class="btn btn-primary">Save</button>-- <button class="btn btn-secondary" type="button" data-help-page="Protected-notes">Help</button>- </div>- </form>-</div>\ No newline at end of file