refactoring of note loading

This commit is contained in:
zadam 2019-09-04 22:13:22 +02:00
parent fdc86bab50
commit a17b8a053e
5 changed files with 268 additions and 240 deletions

430
package-lock.json generated
View file

@ -67,22 +67,6 @@
"integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==",
"dev": true
},
"@babel/polyfill": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.4.4.tgz",
"integrity": "sha512-WlthFLfhQQhh+A2Gn5NSFl0Huxz36x86Jn+E9OW7ibK8edKPq+KLy4apM1yDpQ8kJOVi1OVjpP4vSDLdrI04dg==",
"requires": {
"core-js": "^2.6.5",
"regenerator-runtime": "^0.13.2"
},
"dependencies": {
"core-js": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz",
"integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A=="
}
}
},
"@develar/schema-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.1.0.tgz",
@ -250,21 +234,21 @@
}
},
"@jimp/bmp": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.6.4.tgz",
"integrity": "sha512-dhKM7Cjw4XoOefx3/we2+vWyTP6hQPpM7mEsziGjtsrK2f/e3/+hhHbEsQNgO9BOA1FPJRXAOiYHts9IlMH1mg==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.6.8.tgz",
"integrity": "sha512-uxVgSkI62uAzk5ZazYHEHBehow590WAkLKmDXLzkr/XP/Hv2Fx1T4DKwJ/15IY5ktq5VAhAUWGXTyd8KWFsx7w==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"bmp-js": "^0.1.0",
"core-js": "^2.5.7"
}
},
"@jimp/core": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.6.4.tgz",
"integrity": "sha512-nyiAXI8/uU54fGO53KrRB8pdn1s+IODZ+rj0jG2owsNJlTlagFrsZAy8IVTUCOiiXjh9TbwFo7D5XMrmi4KUww==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.6.8.tgz",
"integrity": "sha512-JOFqBBcSNiDiMZJFr6OJqC6viXj5NVBQISua0eacoYvo4YJtTajOIxC4MqWyUmGrDpRMZBR8QhSsIOwsFrdROA==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"any-base": "^1.1.0",
"buffer": "^5.2.0",
"core-js": "^2.5.7",
@ -285,252 +269,252 @@
}
},
"@jimp/custom": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.6.4.tgz",
"integrity": "sha512-sdBHrBoVr1+PFx4dlUAgXvvu4dG0esQobhg7qhpSLRje1ScavIgE2iXdJKpycgzrqwAOL8vW4/E5w2/rONlaoQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.6.8.tgz",
"integrity": "sha512-FrYlzZRVXP2vuVwd7Nc2dlK+iZk4g6IaT1Ib8Z6vU5Kkwlt83FJIPJ2UUFABf3bF5big0wkk8ZUihWxE4Nzdng==",
"requires": {
"@jimp/core": "^0.6.4",
"@jimp/core": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/gif": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.6.4.tgz",
"integrity": "sha512-14mLoyG0UrYJsGNRoXBFvSJdFtBD0BSBwQ1zCNeW+HpQqdl+Kh5E1Pz4nqT2KNylJe1jypyR51Q2yndgcfGVyg==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.6.8.tgz",
"integrity": "sha512-yyOlujjQcgz9zkjM5ihZDEppn9d1brJ7jQHP5rAKmqep0G7FU1D0AKcV+Ql18RhuI/CgWs10wAVcrQpmLnu4Yw==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7",
"omggif": "^1.0.9"
}
},
"@jimp/jpeg": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.6.4.tgz",
"integrity": "sha512-NrFla9fZC/Bhw1Aa9vJ6cBOqpB5ylEPb9jD+yZ0fzcAw5HwILguS//oXv9EWLApIY1XsOMFFe0XWpY653rv8hw==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.6.8.tgz",
"integrity": "sha512-rGtXbYpFXAn471qLpTGvhbBMNHJo5KiufN+vC5AWyufntmkt5f0Ox2Cx4ijuBMDtirZchxbMLtrfGjznS4L/ew==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7",
"jpeg-js": "^0.3.4"
}
},
"@jimp/plugin-blit": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.6.4.tgz",
"integrity": "sha512-suVznd4XozkQIuECX0u8kMl+cAQpZN3WcbWXUcJaVxRi+VBvHIetG1Qs5qGLzuEg9627+kE7ppv0UgZ5mkE6lg==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.6.8.tgz",
"integrity": "sha512-7Tl6YpKTSpvwQbnGNhsfX2zyl3jRVVopd276Y2hF2zpDz9Bycow7NdfNU/4Nx1jaf96X6uWOtSVINcQ7rGd47w==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-blur": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.6.4.tgz",
"integrity": "sha512-M2fDMYUUtEKVNnCJZk5J0KSMzzISobmWfnG88RdHXJCkOn98kdawQFwTsYOfJJfCM8jWfhIxwZLFhC/2lkTN2w==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.6.8.tgz",
"integrity": "sha512-NpZCMKxXHLDQsX9zPlWtpMA660DQStY6/z8ZetyxCDbqrLe9YCXpeR4MNhdJdABIiwTm1W5FyFF4kp81PHJx3Q==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-color": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.6.4.tgz",
"integrity": "sha512-6Nfr2l9KSb6zH2fij8G6fQOw85TTkyRaBlqMvDmsQp/I1IlaDbXzA2C2Eh9jkQYZQDPu61B1MkmlEhJp/TUx6Q==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.6.8.tgz",
"integrity": "sha512-jjFyU0zNmGOH2rjzHuOMU4kaia0oo82s/7UYfn5h7OUkmUZTd6Do3ZSK1PiXA7KR+s4B76/Omm6Doh/0SGb7BQ==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7",
"tinycolor2": "^1.4.1"
}
},
"@jimp/plugin-contain": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.6.4.tgz",
"integrity": "sha512-qI1MxU1noS6NbEPu/bDDeP405aMviuIsfpOz8J3En8IwIwrJV22qt6QIHmF+eyng8CYgivwIPjEPzFzLR566Nw==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.6.8.tgz",
"integrity": "sha512-p/P2wCXhAzbmEgXvGsvmxLmbz45feF6VpR4m9suPSOr8PC/i/XvTklTqYEUidYYAft4vHgsYJdS74HKSMnH8lw==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-cover": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.6.4.tgz",
"integrity": "sha512-z6eafPonj3LJY8cTEfRkXmOfCDi1+f0tbYaNvmiu+OrWJ3Ojw2hMt+BVVvJ8pKe1dWIFkCjxOjyjZWj1gEkaLw==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.6.8.tgz",
"integrity": "sha512-2PvWgk+PJfRsfWDI1G8Fpjrsu0ZlpNyZxO2+fqWlVo6y/y2gP4v08FqvbkcqSjNlOu2IDWIFXpgyU0sTINWZLg==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-crop": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.6.4.tgz",
"integrity": "sha512-w9TR+pn+GeWbznscGe2HRkPxInge0whAF3TLPWhPwBVjZChTT8dSDXsUpUlxQqvI4SfzuKp8z3/0SBqYDCzxxA==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.6.8.tgz",
"integrity": "sha512-CbrcpWE2xxPK1n/JoTXzhRUhP4mO07mTWaSavenCg664oQl/9XCtL+A0FekuNHzIvn4myEqvkiTwN7FsbunS/Q==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-displace": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.6.4.tgz",
"integrity": "sha512-MEvtBXOAio/3iGJkKBrTtFs3Q38ez2Wy/wTD0Ruas+L8fjJR7l4mDgV+zjRr57CqB5mpY+L48VEoa2/gNXh9cg==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.6.8.tgz",
"integrity": "sha512-RmV2bPxoPE6mrPxtYSPtHxm2cGwBQr5a2p+9gH6SPy+eUMrbGjbvjwKNfXWUYD0leML+Pt5XOmAS9pIROmuruQ==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-dither": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.6.4.tgz",
"integrity": "sha512-w+AGLcIMUeJZ4CI0FvFomahgKLcW+ICsLidUNOqyLzceluPAfug4X7vDhQ41pNkzKg0M1+Q1j0aWV8bdyF+LhA==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.6.8.tgz",
"integrity": "sha512-x6V/qjxe+xypjpQm7GbiMNqci1EW5UizrcebOhHr8AHijOEqHd2hjXh5f6QIGfrkTFelc4/jzq1UyCsYntqz9Q==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-flip": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.6.4.tgz",
"integrity": "sha512-ukINMegMUM9KYjyDCiyYKYdSsbhNRLHDwOJN0xVRalmOKqNaZmjNbiMbaVxKlYt6sHW76RhSMOekw9f6GQB9tQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.6.8.tgz",
"integrity": "sha512-4il6Da6G39s9MyWBEee4jztEOUGJ40E6OlPjkMrdpDNvge6hYEAB31BczTYBP/CEY74j4LDSoY5LbcU4kv06yA==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-gaussian": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.6.4.tgz",
"integrity": "sha512-C1P6ohzIddpNb7CX5X+ygbp+ow8Fpt64ZLoIgdjYPs/42HxKluvY62fVfMhY6m5zUGKIMbg0uYeAtz/9LRJPyw==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.6.8.tgz",
"integrity": "sha512-pVOblmjv7stZjsqloi4YzHVwAPXKGdNaHPhp4KP4vj41qtc6Hxd9z/+VWGYRTunMFac84gUToe0UKIXd6GhoKw==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-invert": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.6.4.tgz",
"integrity": "sha512-sleGz1jXaNEsP/5Ayqw8oez/6KesWcyCqovIuK4Z4kDmMc2ncuhsXIJQXDWtIF4tTQVzNEgrxUDNA4bi9xpCUA==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.6.8.tgz",
"integrity": "sha512-11zuLiXDHr6tFv4U8aieXqNXQEKbDbSBG/h+X62gGTNFpyn8EVPpncHhOqrAFtZUaPibBqMFlNJ15SzwC7ExsQ==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-mask": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.6.4.tgz",
"integrity": "sha512-3D4FbRxnpO9nzwa6cF8AImgO1aVReYbfRRO4I4bku4/iZ+kuU3fBLV+SRhB4c7di3ejG5u+rGsIfaNc94iYYvw==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.6.8.tgz",
"integrity": "sha512-hZJ0OiKGJyv7hDSATwJDkunB1Ie80xJnONMgpUuUseteK45YeYNBOiZVUe8vum8QI1UwavgBzcvQ9u4fcgXc9g==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-normalize": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.6.4.tgz",
"integrity": "sha512-nOFMwOaVkOKArHkD/T6/1HKAPj3jlW6l0JduVDn1A5eIPCtlnyhlE9zdjgi5Q9IBR/gRjwW6tTzBKuJenS51kg==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.6.8.tgz",
"integrity": "sha512-Q4oYhU+sSyTJI7pMZlg9/mYh68ujLfOxXzQGEXuw0sHGoGQs3B0Jw7jmzGa6pIS06Hup5hD2Zuh1ppvMdjJBfQ==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-print": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.6.4.tgz",
"integrity": "sha512-3z5DLVCKg0NfZhHATEaYH/4XanIboPP1pOUoxIUeF++qOnGiGgH2giFJlRprHmx2l3E3DukR1v8pt54PGvfrFw==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.6.8.tgz",
"integrity": "sha512-2aokejGn4Drv1FesnZGqh5KEq0FQtR0drlmtyZrBH+r9cx7hh0Qgf4D1BOTDEgXkfSSngjGRjKKRW/fwOrVXYw==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7",
"load-bmfont": "^1.4.0"
}
},
"@jimp/plugin-resize": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.6.4.tgz",
"integrity": "sha512-fk2+KheUNClrOWj6aDNWj1r4byVQb6Qxy4aT1UHX5GXPHDA+nhlej7ghaYdzeWZYodeM3lpasYtByu1XE2qScQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.6.8.tgz",
"integrity": "sha512-27nPh8L1YWsxtfmV/+Ub5dOTpXyC0HMF2cu52RQSCYxr+Lm1+23dJF70AF1poUbUe+FWXphwuUxQzjBJza9UoA==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-rotate": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.6.4.tgz",
"integrity": "sha512-44VgV5D4xQIYInJAVevdW9J3SOhGKyz0OEr2ciA8Q3ktonKx0O5Q1g2kbruiqxFSkK/u2CKPLeKXZzYCFrmJGQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.6.8.tgz",
"integrity": "sha512-GbjETvL05BDoLdszNUV4Y0yLkHf177MnqGqilA113LIvx9aD0FtUopGXYfRGVvmtTOTouoaGJUc+K6qngvKxww==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-scale": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.6.4.tgz",
"integrity": "sha512-RAQRaDiCHmEz+A8QS5d/Z38EnlNsQizz3Mu3NsjA8uFtJsv1yMKWXZSQuzniofZw8tlMV6oI3VdM0eQVE07/5w==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.6.8.tgz",
"integrity": "sha512-GzIYWR/oCUK2jAwku23zt19V1ssaEU4pL0x2XsLNKuuJEU6DvEytJyTMXCE7OLG/MpDBQcQclJKHgiyQm5gIOQ==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7"
}
},
"@jimp/plugins": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.6.4.tgz",
"integrity": "sha512-NpO/87CKnF4Q9r8gMl6w+jPKOM/C089qExkViD9cPvcFZEnyVOu7ucGzcMmTcabWOU62iQTOkRViPYr6XaK0LQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.6.8.tgz",
"integrity": "sha512-fMcTI72Vn/Lz6JftezTURmyP5ml/xGMe0Ljx2KRJ85IWyP33vDmGIUuutFiBEbh2+y7lRT+aTSmjs0QGa/xTmQ==",
"requires": {
"@jimp/plugin-blit": "^0.6.4",
"@jimp/plugin-blur": "^0.6.4",
"@jimp/plugin-color": "^0.6.4",
"@jimp/plugin-contain": "^0.6.4",
"@jimp/plugin-cover": "^0.6.4",
"@jimp/plugin-crop": "^0.6.4",
"@jimp/plugin-displace": "^0.6.4",
"@jimp/plugin-dither": "^0.6.4",
"@jimp/plugin-flip": "^0.6.4",
"@jimp/plugin-gaussian": "^0.6.4",
"@jimp/plugin-invert": "^0.6.4",
"@jimp/plugin-mask": "^0.6.4",
"@jimp/plugin-normalize": "^0.6.4",
"@jimp/plugin-print": "^0.6.4",
"@jimp/plugin-resize": "^0.6.4",
"@jimp/plugin-rotate": "^0.6.4",
"@jimp/plugin-scale": "^0.6.4",
"@jimp/plugin-blit": "^0.6.8",
"@jimp/plugin-blur": "^0.6.8",
"@jimp/plugin-color": "^0.6.8",
"@jimp/plugin-contain": "^0.6.8",
"@jimp/plugin-cover": "^0.6.8",
"@jimp/plugin-crop": "^0.6.8",
"@jimp/plugin-displace": "^0.6.8",
"@jimp/plugin-dither": "^0.6.8",
"@jimp/plugin-flip": "^0.6.8",
"@jimp/plugin-gaussian": "^0.6.8",
"@jimp/plugin-invert": "^0.6.8",
"@jimp/plugin-mask": "^0.6.8",
"@jimp/plugin-normalize": "^0.6.8",
"@jimp/plugin-print": "^0.6.8",
"@jimp/plugin-resize": "^0.6.8",
"@jimp/plugin-rotate": "^0.6.8",
"@jimp/plugin-scale": "^0.6.8",
"core-js": "^2.5.7",
"timm": "^1.6.1"
}
},
"@jimp/png": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.6.4.tgz",
"integrity": "sha512-qv3oo6ll3XWVIToBwVC1wQX0MFKwpxbe2o+1ld9B4ZDavqvAHzalzcmTd/iyooI85CVDAcC3RRDo66oiizGZCQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.6.8.tgz",
"integrity": "sha512-JHHg/BZ7KDtHQrcG+a7fztw45rdf7okL/YwkN4qU5FH7Fcrp41nX5QnRviDtD9hN+GaNC7kvjvcqRAxW25qjew==",
"requires": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "^0.6.8",
"core-js": "^2.5.7",
"pngjs": "^3.3.3"
}
},
"@jimp/tiff": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.6.4.tgz",
"integrity": "sha512-8/vD4qleexmhPdppiu6fSstj/n/kGNTn8iIlf1emiqOuMN2PL9q5GOPDWU0xWdGNyJMMIDXJPgUFUkKfqXdg7w==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.6.8.tgz",
"integrity": "sha512-iWHbxd+0IKWdJyJ0HhoJCGYmtjPBOusz1z1HT/DnpePs/Lo3TO4d9ALXqYfUkyG74ZK5jULZ69KLtwuhuJz1bg==",
"requires": {
"core-js": "^2.5.7",
"utif": "^2.0.1"
}
},
"@jimp/types": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.6.4.tgz",
"integrity": "sha512-/EMbipQDg5U6DnBAgcSiydlMBRYoKhnaK7MJRImeTzhDJ6xfgNOF7lYq66o0kmaezKdG/cIwZ1CLecn2y3D8SQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.6.8.tgz",
"integrity": "sha512-vCZ/Cp2osy69VP21XOBACfHI5HeR60Rfd4Jidj4W73UL+HrFWOtyQiJ7hlToyu1vI5mR/NsUQpzyQvz56ADm5A==",
"requires": {
"@jimp/bmp": "^0.6.4",
"@jimp/gif": "^0.6.4",
"@jimp/jpeg": "^0.6.4",
"@jimp/png": "^0.6.4",
"@jimp/tiff": "^0.6.4",
"@jimp/bmp": "^0.6.8",
"@jimp/gif": "^0.6.8",
"@jimp/jpeg": "^0.6.8",
"@jimp/png": "^0.6.8",
"@jimp/tiff": "^0.6.8",
"core-js": "^2.5.7",
"timm": "^1.6.1"
}
},
"@jimp/utils": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.6.4.tgz",
"integrity": "sha512-EFQurCyEnZLSM2Q1BYDTUmsOJPSOYEQd18Fvq8bGo8hnBHoGLWLWWyNi2l4cYhtpKmIXyhvQqa6/WaEpKPzvqA==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.6.8.tgz",
"integrity": "sha512-7RDfxQ2C/rarNG9iso5vmnKQbcvlQjBIlF/p7/uYj72WeZgVCB+5t1fFBKJSU4WhniHX4jUMijK+wYGE3Y3bGw==",
"requires": {
"core-js": "^2.5.7"
}
@ -1408,9 +1392,9 @@
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
},
"bowser": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/bowser/-/bowser-2.5.3.tgz",
"integrity": "sha512-aWCA+CKfKNL/WGzNgjmK+Whp57JMzboZMwJ5gy2jDj2bEIjbMCb3ImGX+V++5wsJftyFiDIbOjRXl60ycniVqg=="
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/bowser/-/bowser-2.5.4.tgz",
"integrity": "sha512-74GGwfc2nzYD19JCiA0RwCxdq7IY5jHeEaSrrgm/5kusEuK+7UK0qDG3gyzN47c4ViNyO4osaKtZE+aSV6nlpQ=="
},
"boxen": {
"version": "1.3.0",
@ -3117,9 +3101,9 @@
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"ejs": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.2.tgz",
"integrity": "sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q=="
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.1.tgz",
"integrity": "sha512-kS/gEPzZs3Y1rRsbGX4UOSjtP/CeJP0CxSNZHYxGfVM/VgLcv0ZqM7C45YyTj2DI2g7+P9Dd24C+IMIg6D0nYQ=="
},
"electron": {
"version": "6.0.7",
@ -4155,16 +4139,20 @@
}
},
"es-abstract": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz",
"integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==",
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.1.tgz",
"integrity": "sha512-cp/Tb1oA/rh2X7vqeSOvM+TSo3UkJLX70eNihgVEvnzwAgikjkTFr/QVgRCaxjm0knCNQzNoxxxcw2zO2LJdZA==",
"requires": {
"es-to-primitive": "^1.2.0",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.0",
"is-callable": "^1.1.4",
"is-regex": "^1.0.4",
"object-keys": "^1.0.12"
"object-inspect": "^1.6.0",
"object-keys": "^1.1.1",
"string.prototype.trimleft": "^2.0.0",
"string.prototype.trimright": "^2.0.0"
},
"dependencies": {
"object-keys": {
@ -5501,9 +5489,9 @@
}
},
"file-type": {
"version": "12.2.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-12.2.0.tgz",
"integrity": "sha512-bkDBeH5doAqP69axEO69OviLlWbrZ10Ne2OPHaxBgG+fyT0w/2zfMzJz21SPwq5Iq0aN70q7RN3KRcdUY427Mg=="
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-12.3.0.tgz",
"integrity": "sha512-4E4Esq9KLwjYCY32E7qSmd0h7LefcniZHX+XcdJ4Wfx1uGJX7QCigiqw/U0yT7WOslm28yhxl87DJ0wHYv0RAA=="
},
"filename-regex": {
"version": "2.0.1",
@ -6574,9 +6562,9 @@
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
},
"helmet": {
"version": "3.20.1",
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.20.1.tgz",
"integrity": "sha512-em+X5Wz/f0yqoRsBnpnVy3wJHSiIeskX3FQn30szBh1tILaOeSRRLkShuUVFlk/o4qTYjWxdHg4FrRe45iBWHg==",
"version": "3.21.0",
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.21.0.tgz",
"integrity": "sha512-TS3GryQMPR7n/heNnGC0Cl3Ess30g8C6EtqZyylf+Y2/kF4lM8JinOR90rzIICsw4ymWTvji4OhDmqsqxkLrcg==",
"requires": {
"depd": "2.0.0",
"dns-prefetch-control": "0.2.0",
@ -6585,14 +6573,14 @@
"feature-policy": "0.3.0",
"frameguard": "3.1.0",
"helmet-crossdomain": "0.4.0",
"helmet-csp": "2.9.0",
"helmet-csp": "2.9.1",
"hide-powered-by": "1.1.0",
"hpkp": "2.0.0",
"hsts": "2.2.0",
"ienoopen": "1.1.0",
"nocache": "2.1.0",
"referrer-policy": "1.2.0",
"x-xss-protection": "1.2.0"
"x-xss-protection": "1.3.0"
},
"dependencies": {
"depd": {
@ -6608,11 +6596,11 @@
"integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA=="
},
"helmet-csp": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.9.0.tgz",
"integrity": "sha512-DGGOQtOLM7ZQpjbf/uvUonq1yG/rFgsBuK10ZJt2AtxUJxqfkPvfmP9aLUmgH9IactiRiYoiFY72YYSPl1TLTQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.9.1.tgz",
"integrity": "sha512-HgdXSJ6AVyXiy5ohVGpK6L7DhjI9KVdKVB1xRoixxYKsFXFwoVqtLKgDnfe3u8FGGKf9Ml9k//C9rnncIIAmyA==",
"requires": {
"bowser": "2.5.3",
"bowser": "2.5.4",
"camelize": "1.0.0",
"content-security-policy-builder": "2.1.0",
"dasherize": "2.0.0"
@ -7615,21 +7603,21 @@
}
},
"jimp": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/jimp/-/jimp-0.6.4.tgz",
"integrity": "sha512-WQVMoNhkcq/fgthZOWeMdIguCVPg+t4PDFfSxvbNcrECwl8eq3/Ou2whcFWWjyW45m43yAJEY2UT7acDKl6uSQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/jimp/-/jimp-0.6.8.tgz",
"integrity": "sha512-F7emeG7Hp61IM8VFbNvWENLTuHe0ghizWPuP4JS9ujx2r5mCVYEd/zdaz6M2M42ZdN41blxPajLWl9FXo7Mr2Q==",
"requires": {
"@babel/polyfill": "^7.0.0",
"@jimp/custom": "^0.6.4",
"@jimp/plugins": "^0.6.4",
"@jimp/types": "^0.6.4",
"core-js": "^2.5.7"
"@jimp/custom": "^0.6.8",
"@jimp/plugins": "^0.6.8",
"@jimp/types": "^0.6.8",
"core-js": "^2.5.7",
"regenerator-runtime": "^0.13.3"
}
},
"jpeg-js": {
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.3.5.tgz",
"integrity": "sha512-hvaExqwmQDS8O9qnZAVDXGWU43Tbu1V0wMZmjROjT11jloSgGICZpscG+P6Nyi1BVAvyu2ARRx8qmEW30sxgdQ=="
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.3.6.tgz",
"integrity": "sha512-MUj2XlMB8kpe+8DJUGH/3UJm4XpI8XEgZQ+CiHDeyrGoKPdW/8FJv6ku+3UiYm5Fz3CWaL+iXmD8Q4Ap6aC1Jw=="
},
"js-tokens": {
"version": "4.0.0",
@ -9492,6 +9480,11 @@
}
}
},
"object-inspect": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz",
"integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ=="
},
"object-keys": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz",
@ -9507,6 +9500,15 @@
"isobject": "^3.0.0"
}
},
"object.getownpropertydescriptors": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
"integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.5.1"
}
},
"object.omit": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
@ -9526,9 +9528,9 @@
}
},
"omggif": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.9.tgz",
"integrity": "sha1-3LcCTazVDFK00wPwSALJHAV8dl8="
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz",
"integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw=="
},
"on-finished": {
"version": "2.3.0",
@ -11134,9 +11136,9 @@
"integrity": "sha512-LgQJIuS6nAy1Jd88DCQRemyE3mS+ispwlqMk3b0yjZ257fI1v9c+/p6SD5gP5FGyXUIgrNOAfmyioHwZtYv2VA=="
},
"regenerator-runtime": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz",
"integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA=="
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
"integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw=="
},
"regex-cache": {
"version": "0.4.4",
@ -12236,12 +12238,30 @@
"integrity": "sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8="
},
"string.prototype.trim": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz",
"integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.0.tgz",
"integrity": "sha512-9EIjYD/WdlvLpn987+ctkLf0FfvBefOCuiEr2henD8X+7jfwPnyvTdmW8OJhj5p+M0/96mBdynLWkxUr+rHlpg==",
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.13.0",
"function-bind": "^1.1.1"
}
},
"string.prototype.trimleft": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.0.0.tgz",
"integrity": "sha1-aLaqjhYsaoDnbjqKDC50cYbicf8=",
"requires": {
"define-properties": "^1.1.2",
"function-bind": "^1.0.2"
}
},
"string.prototype.trimright": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.0.0.tgz",
"integrity": "sha1-q0pW2AKgH75yk+EehPJNyBZGYd0=",
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.5.0",
"function-bind": "^1.0.2"
}
},
@ -12643,9 +12663,9 @@
"integrity": "sha1-lYYL/MXHbCd/j4Mm/Q9bLiDrohc="
},
"timm": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/timm/-/timm-1.6.1.tgz",
"integrity": "sha512-hqDTYi/bWuDxL2i6T3v6nrvkAQ/1Bc060GSkVEQZp02zTSTB4CHSKsOkliequCftQaNRcjRqUZmpGWs5FfhrNg=="
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/timm/-/timm-1.6.2.tgz",
"integrity": "sha512-IH3DYDL1wMUwmIlVmMrmesw5lZD6N+ZOAFWEyLrtpoL9Bcrs9u7M/vyOnHzDD2SMs4irLkVjqxZbHrXStS/Nmw=="
},
"tiny-each-async": {
"version": "2.0.3",
@ -13167,6 +13187,15 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"util.promisify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
"integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
"requires": {
"define-properties": "^1.1.2",
"object.getownpropertydescriptors": "^2.0.3"
}
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
@ -13531,9 +13560,9 @@
}
},
"x-xss-protection": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.2.0.tgz",
"integrity": "sha512-xN0kV+8XfOQM2OPPBdEbGtbvJNNP1pvZR7sE6d44cjJFQG4OiGDdienPg5iOUGswBTiGbBvtYDURd30BMJwwqg=="
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz",
"integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg=="
},
"xdg-basedir": {
"version": "3.0.0",
@ -13563,18 +13592,27 @@
"integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig="
},
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"version": "0.4.22",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.22.tgz",
"integrity": "sha512-MWTbxAQqclRSTnehWWe5nMKzI3VmJ8ltiJEco8akcC6j3miOhjjfzKum5sId+CWhfxdOs/1xauYr8/ZDBtQiRw==",
"requires": {
"sax": ">=0.6.0",
"xmlbuilder": "~9.0.1"
"util.promisify": "~1.0.0",
"xmlbuilder": "~11.0.0"
},
"dependencies": {
"xmlbuilder": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
}
}
},
"xmlbuilder": {
"version": "9.0.7",
"resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=",
"dev": true
},
"xmlcreate": {
"version": "2.0.1",

View file

@ -30,7 +30,7 @@
"csurf": "1.10.0",
"dayjs": "1.8.16",
"debug": "4.1.1",
"ejs": "2.6.2",
"ejs": "2.7.1",
"electron-context-menu": "0.15.0",
"electron-debug": "3.0.1",
"electron-dl": "1.14.0",
@ -38,9 +38,9 @@
"electron-window-state": "5.0.3",
"express": "4.17.1",
"express-session": "1.16.2",
"file-type": "12.2.0",
"file-type": "12.3.0",
"fs-extra": "8.1.0",
"helmet": "3.20.1",
"helmet": "3.21.0",
"html": "1.0.0",
"html2plaintext": "2.1.2",
"http-proxy-agent": "^2.1.0",
@ -51,7 +51,7 @@
"imagemin-mozjpeg": "8.0.0",
"imagemin-pngquant": "8.0.0",
"ini": "1.3.5",
"jimp": "0.6.4",
"jimp": "0.6.8",
"mime-types": "2.1.24",
"moment": "2.24.0",
"multer": "1.4.2",
@ -75,7 +75,7 @@
"turndown": "5.0.3",
"unescape": "1.0.1",
"ws": "7.1.2",
"xml2js": "0.4.19"
"xml2js": "0.4.22"
},
"devDependencies": {
"electron": "6.0.7",

View file

@ -33,7 +33,7 @@ class Attributes {
this.reloadAttributes();
}
return await this.attributePromise;
return this.attributePromise;
}
async showAttributes() {

View file

@ -174,14 +174,13 @@ async function showTab(tabId) {
/**
* @param {TabContext} ctx
* @param {NoteFull} note
* @param {string} notePath
*/
async function loadNoteDetailToContext(ctx, note, notePath) {
await ctx.setNote(note, notePath);
openTabsChanged();
treeService.setBranchBackgroundBasedOnProtectedStatus(note.noteId);
fireDetailLoaded();
}

View file

@ -45,11 +45,13 @@ class TabContext {
this.state = state;
}
initTabContent() {
async initTabContent() {
if (this.initialized) {
return;
}
this.initialized = true;
this.$tabContent = $(".note-tab-content-template").clone();
this.$tabContent.removeClass('note-tab-content-template');
this.$tabContent.attr('data-tab-id', this.tabId);
@ -110,7 +112,13 @@ class TabContext {
this.$unprotectButton = this.$tabContent.find(".unprotect-button");
this.$unprotectButton.click(protectedSessionService.unprotectNoteAndSendToServer);
this.initialized = true;
const type = this.getComponentType();
if (!(type in this.components)) {
const clazz = await import(componentClasses[type]);
this.components[type] = new clazz.default(this);
}
}
async setNote(note, notePath) {
@ -124,21 +132,9 @@ class TabContext {
return;
}
await this.initComponent();
// after loading new note make sure editor is scrolled to the top
this.getComponent().scrollToTop();
if (utils.isDesktop()) {
// needs to happen after loading the note itself because it references active noteId
this.attributes.refreshAttributes();
await this.showChildrenOverview();
} else {
// mobile usually doesn't need attributes so we just invalidate
this.attributes.invalidateAttributes();
}
this.setupClasses();
this.setCurrentNotePathToHash();
@ -148,10 +144,6 @@ class TabContext {
try {
this.$noteTitle.val(this.note.title);
if (utils.isDesktop()) {
this.noteType.update();
}
await this.renderComponent();
} finally {
this.noteChangeDisabled = false;
@ -173,18 +165,29 @@ class TabContext {
this.showPaths();
if (utils.isDesktop()) {
this.attributes.refreshAttributes();
this.noteType.update();
this.showChildrenOverview();
} else {
// mobile usually doesn't need attributes so we just invalidate
this.attributes.invalidateAttributes();
}
if (this.sidebar) {
this.sidebar.noteLoaded(); // load async
}
await bundleService.executeRelationBundles(this.note, 'runOnNoteView', this);
bundleService.executeRelationBundles(this.note, 'runOnNoteView', this);
}
async show() {
if (!this.initialized) {
this.initTabContent();
await this.initTabContent();
await this.initComponent();
this.$tabContent.show(); // show immediately so that user can see something
if (this.note) {
await this.setNote(this.note, this.notePath);
@ -192,14 +195,14 @@ class TabContext {
}
this.$tabContent.show();
this.setCurrentNotePathToHash();
this.setTitleBar();
this.getComponent().show();
}
async renderComponent() {
for (const componentType in this.components) {
if (componentType !== this.note.type) {
if (componentType !== this.getComponentType()) {
this.components[componentType].cleanup();
}
}
@ -209,12 +212,10 @@ class TabContext {
this.$noteTitle.show(); // this can be hidden by empty detail
this.$noteTitle.removeAttr("readonly"); // this can be set by protected session service
await this.initComponent();
this.getComponent().show();
await this.getComponent().render();
}
setTitleBar() {
if (!this.$tabContent.is(":visible")) {
return;
@ -269,16 +270,6 @@ class TabContext {
this.$unprotectButton.prop("disabled", !this.note.isProtected || !protectedSessionHolder.isProtectedSessionAvailable());
}
async initComponent() {
const type = this.getComponentType();
if (!(type in this.components)) {
const clazz = await import(componentClasses[type]);
this.components[type] = new clazz.default(this);
}
}
getComponent() {
const type = this.getComponentType();