mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
attachments WIP
This commit is contained in:
parent
c2f70031d0
commit
0aa119af2c
@ -5,8 +5,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CKEditor 5 (v35.4.0) content styles.
|
* CKEditor 5 (v38.0.1) content styles.
|
||||||
* Generated on Wed, 14 Dec 2022 12:53:04 GMT.
|
* Generated on Thu, 25 May 2023 13:25:51 GMT.
|
||||||
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
|
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -28,29 +28,7 @@
|
|||||||
--ck-todo-list-checkmark-size: 16px;
|
--ck-todo-list-checkmark-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ckeditor5-basic-styles/theme/code.css */
|
/* @ckeditor/ckeditor5-block-quote/theme/blockquote.css */
|
||||||
.ck-content code {
|
|
||||||
background-color: hsla(0, 0%, 78%, 0.3);
|
|
||||||
padding: .15em;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
/* ckeditor5-font/theme/fontsize.css */
|
|
||||||
.ck-content .text-tiny {
|
|
||||||
font-size: .7em;
|
|
||||||
}
|
|
||||||
/* ckeditor5-font/theme/fontsize.css */
|
|
||||||
.ck-content .text-small {
|
|
||||||
font-size: .85em;
|
|
||||||
}
|
|
||||||
/* ckeditor5-font/theme/fontsize.css */
|
|
||||||
.ck-content .text-big {
|
|
||||||
font-size: 1.4em;
|
|
||||||
}
|
|
||||||
/* ckeditor5-font/theme/fontsize.css */
|
|
||||||
.ck-content .text-huge {
|
|
||||||
font-size: 1.8em;
|
|
||||||
}
|
|
||||||
/* ckeditor5-block-quote/theme/blockquote.css */
|
|
||||||
.ck-content blockquote {
|
.ck-content blockquote {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-right: 1.5em;
|
padding-right: 1.5em;
|
||||||
@ -60,75 +38,60 @@
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
border-left: solid 5px hsl(0, 0%, 80%);
|
border-left: solid 5px hsl(0, 0%, 80%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-block-quote/theme/blockquote.css */
|
/* @ckeditor/ckeditor5-block-quote/theme/blockquote.css */
|
||||||
.ck-content[dir="rtl"] blockquote {
|
.ck-content[dir="rtl"] blockquote {
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
border-right: solid 5px hsl(0, 0%, 80%);
|
border-right: solid 5px hsl(0, 0%, 80%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-highlight/theme/highlight.css */
|
/* @ckeditor/ckeditor5-basic-styles/theme/code.css */
|
||||||
|
.ck-content code {
|
||||||
|
background-color: hsla(0, 0%, 78%, 0.3);
|
||||||
|
padding: .15em;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-font/theme/fontsize.css */
|
||||||
|
.ck-content .text-tiny {
|
||||||
|
font-size: .7em;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-font/theme/fontsize.css */
|
||||||
|
.ck-content .text-small {
|
||||||
|
font-size: .85em;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-font/theme/fontsize.css */
|
||||||
|
.ck-content .text-big {
|
||||||
|
font-size: 1.4em;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-font/theme/fontsize.css */
|
||||||
|
.ck-content .text-huge {
|
||||||
|
font-size: 1.8em;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
.ck-content .marker-yellow {
|
.ck-content .marker-yellow {
|
||||||
background-color: var(--ck-highlight-marker-yellow);
|
background-color: var(--ck-highlight-marker-yellow);
|
||||||
}
|
}
|
||||||
/* ckeditor5-highlight/theme/highlight.css */
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
.ck-content .marker-green {
|
.ck-content .marker-green {
|
||||||
background-color: var(--ck-highlight-marker-green);
|
background-color: var(--ck-highlight-marker-green);
|
||||||
}
|
}
|
||||||
/* ckeditor5-highlight/theme/highlight.css */
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
.ck-content .marker-pink {
|
.ck-content .marker-pink {
|
||||||
background-color: var(--ck-highlight-marker-pink);
|
background-color: var(--ck-highlight-marker-pink);
|
||||||
}
|
}
|
||||||
/* ckeditor5-highlight/theme/highlight.css */
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
.ck-content .marker-blue {
|
.ck-content .marker-blue {
|
||||||
background-color: var(--ck-highlight-marker-blue);
|
background-color: var(--ck-highlight-marker-blue);
|
||||||
}
|
}
|
||||||
/* ckeditor5-highlight/theme/highlight.css */
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
.ck-content .pen-red {
|
.ck-content .pen-red {
|
||||||
color: var(--ck-highlight-pen-red);
|
color: var(--ck-highlight-pen-red);
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
/* ckeditor5-highlight/theme/highlight.css */
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
.ck-content .pen-green {
|
.ck-content .pen-green {
|
||||||
color: var(--ck-highlight-pen-green);
|
color: var(--ck-highlight-pen-green);
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/image.css */
|
/* @ckeditor/ckeditor5-image/theme/imagecaption.css */
|
||||||
.ck-content .image {
|
|
||||||
display: table;
|
|
||||||
clear: both;
|
|
||||||
text-align: center;
|
|
||||||
margin: 0.9em auto;
|
|
||||||
min-width: 50px;
|
|
||||||
}
|
|
||||||
/* ckeditor5-image/theme/image.css */
|
|
||||||
.ck-content .image img {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
max-width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
}
|
|
||||||
/* ckeditor5-image/theme/image.css */
|
|
||||||
.ck-content .image-inline {
|
|
||||||
/*
|
|
||||||
* Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).;
|
|
||||||
* Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.
|
|
||||||
* This strange behavior does not happen with inline-flex.
|
|
||||||
*/
|
|
||||||
display: inline-flex;
|
|
||||||
max-width: 100%;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
/* ckeditor5-image/theme/image.css */
|
|
||||||
.ck-content .image-inline picture {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
/* ckeditor5-image/theme/image.css */
|
|
||||||
.ck-content .image-inline picture,
|
|
||||||
.ck-content .image-inline img {
|
|
||||||
flex-grow: 1;
|
|
||||||
flex-shrink: 1;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
/* ckeditor5-image/theme/imagecaption.css */
|
|
||||||
.ck-content .image > figcaption {
|
.ck-content .image > figcaption {
|
||||||
display: table-caption;
|
display: table-caption;
|
||||||
caption-side: bottom;
|
caption-side: bottom;
|
||||||
@ -139,98 +102,167 @@
|
|||||||
font-size: .75em;
|
font-size: .75em;
|
||||||
outline-offset: -1px;
|
outline-offset: -1px;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imageresize.css */
|
/* @ckeditor/ckeditor5-image/theme/image.css */
|
||||||
|
.ck-content .image {
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0.9em auto;
|
||||||
|
min-width: 50px;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/image.css */
|
||||||
|
.ck-content .image img {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/image.css */
|
||||||
|
.ck-content .image-inline {
|
||||||
|
/*
|
||||||
|
* Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).;
|
||||||
|
* Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.
|
||||||
|
* This strange behavior does not happen with inline-flex.
|
||||||
|
*/
|
||||||
|
display: inline-flex;
|
||||||
|
max-width: 100%;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/image.css */
|
||||||
|
.ck-content .image-inline picture {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/image.css */
|
||||||
|
.ck-content .image-inline picture,
|
||||||
|
.ck-content .image-inline img {
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-shrink: 1;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
||||||
.ck-content .image.image_resized {
|
.ck-content .image.image_resized {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imageresize.css */
|
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
||||||
.ck-content .image.image_resized img {
|
.ck-content .image.image_resized img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imageresize.css */
|
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
||||||
.ck-content .image.image_resized > figcaption {
|
.ck-content .image.image_resized > figcaption {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-block-align-left,
|
.ck-content .image-style-block-align-left,
|
||||||
.ck-content .image-style-block-align-right {
|
.ck-content .image-style-block-align-right {
|
||||||
max-width: calc(100% - var(--ck-image-style-spacing));
|
max-width: calc(100% - var(--ck-image-style-spacing));
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-align-left,
|
.ck-content .image-style-align-left,
|
||||||
.ck-content .image-style-align-right {
|
.ck-content .image-style-align-right {
|
||||||
clear: none;
|
clear: none;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-side {
|
.ck-content .image-style-side {
|
||||||
float: right;
|
float: right;
|
||||||
margin-left: var(--ck-image-style-spacing);
|
margin-left: var(--ck-image-style-spacing);
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-align-left {
|
.ck-content .image-style-align-left {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: var(--ck-image-style-spacing);
|
margin-right: var(--ck-image-style-spacing);
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-align-center {
|
.ck-content .image-style-align-center {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-align-right {
|
.ck-content .image-style-align-right {
|
||||||
float: right;
|
float: right;
|
||||||
margin-left: var(--ck-image-style-spacing);
|
margin-left: var(--ck-image-style-spacing);
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-block-align-right {
|
.ck-content .image-style-block-align-right {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-block-align-left {
|
.ck-content .image-style-block-align-left {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content p + .image-style-align-left,
|
.ck-content p + .image-style-align-left,
|
||||||
.ck-content p + .image-style-align-right,
|
.ck-content p + .image-style-align-right,
|
||||||
.ck-content p + .image-style-side {
|
.ck-content p + .image-style-side {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-inline.image-style-align-left,
|
.ck-content .image-inline.image-style-align-left,
|
||||||
.ck-content .image-inline.image-style-align-right {
|
.ck-content .image-inline.image-style-align-right {
|
||||||
margin-top: var(--ck-inline-image-style-spacing);
|
margin-top: var(--ck-inline-image-style-spacing);
|
||||||
margin-bottom: var(--ck-inline-image-style-spacing);
|
margin-bottom: var(--ck-inline-image-style-spacing);
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-inline.image-style-align-left {
|
.ck-content .image-inline.image-style-align-left {
|
||||||
margin-right: var(--ck-inline-image-style-spacing);
|
margin-right: var(--ck-inline-image-style-spacing);
|
||||||
}
|
}
|
||||||
/* ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-inline.image-style-align-right {
|
.ck-content .image-inline.image-style-align-right {
|
||||||
margin-left: var(--ck-inline-image-style-spacing);
|
margin-left: var(--ck-inline-image-style-spacing);
|
||||||
}
|
}
|
||||||
/* ckeditor5-language/theme/language.css */
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
.ck-content span[lang] {
|
.ck-content ol {
|
||||||
font-style: italic;
|
list-style-type: decimal;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ol ol {
|
||||||
|
list-style-type: lower-latin;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ol ol ol {
|
||||||
|
list-style-type: lower-roman;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ol ol ol ol {
|
||||||
|
list-style-type: upper-latin;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ol ol ol ol ol {
|
||||||
|
list-style-type: upper-roman;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ul {
|
||||||
|
list-style-type: disc;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ul ul {
|
||||||
|
list-style-type: circle;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ul ul ul {
|
||||||
|
list-style-type: square;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
|
.ck-content ul ul ul ul {
|
||||||
|
list-style-type: square;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list {
|
.ck-content .todo-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list li {
|
.ck-content .todo-list li {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list li .todo-list {
|
.ck-content .todo-list li .todo-list {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list .todo-list__label > input {
|
.ck-content .todo-list .todo-list__label > input {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -244,7 +276,7 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list .todo-list__label > input::before {
|
.ck-content .todo-list .todo-list__label > input::before {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -256,7 +288,7 @@
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
transition: 250ms ease-in-out box-shadow, 250ms ease-in-out background, 250ms ease-in-out border;
|
transition: 250ms ease-in-out box-shadow, 250ms ease-in-out background, 250ms ease-in-out border;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list .todo-list__label > input::after {
|
.ck-content .todo-list .todo-list__label > input::after {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -272,27 +304,27 @@
|
|||||||
border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;
|
border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list .todo-list__label > input[checked]::before {
|
.ck-content .todo-list .todo-list__label > input[checked]::before {
|
||||||
background: hsl(126, 64%, 41%);
|
background: hsl(126, 64%, 41%);
|
||||||
border-color: hsl(126, 64%, 41%);
|
border-color: hsl(126, 64%, 41%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list .todo-list__label > input[checked]::after {
|
.ck-content .todo-list .todo-list__label > input[checked]::after {
|
||||||
border-color: hsl(0, 0%, 100%);
|
border-color: hsl(0, 0%, 100%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/todolist.css */
|
/* @ckeditor/ckeditor5-list/theme/todolist.css */
|
||||||
.ck-content .todo-list .todo-list__label .todo-list__label__description {
|
.ck-content .todo-list .todo-list__label .todo-list__label__description {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
/* ckeditor5-media-embed/theme/mediaembed.css */
|
/* @ckeditor/ckeditor5-media-embed/theme/mediaembed.css */
|
||||||
.ck-content .media {
|
.ck-content .media {
|
||||||
clear: both;
|
clear: both;
|
||||||
margin: 0.9em 0;
|
margin: 0.9em 0;
|
||||||
display: block;
|
display: block;
|
||||||
min-width: 15em;
|
min-width: 15em;
|
||||||
}
|
}
|
||||||
/* ckeditor5-page-break/theme/pagebreak.css */
|
/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */
|
||||||
.ck-content .page-break {
|
.ck-content .page-break {
|
||||||
position: relative;
|
position: relative;
|
||||||
clear: both;
|
clear: both;
|
||||||
@ -301,14 +333,14 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
/* ckeditor5-page-break/theme/pagebreak.css */
|
/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */
|
||||||
.ck-content .page-break::after {
|
.ck-content .page-break::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-bottom: 2px dashed hsl(0, 0%, 77%);
|
border-bottom: 2px dashed hsl(0, 0%, 77%);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
/* ckeditor5-page-break/theme/pagebreak.css */
|
/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */
|
||||||
.ck-content .page-break__label {
|
.ck-content .page-break__label {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@ -328,12 +360,25 @@
|
|||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/table.css */
|
/* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */
|
||||||
|
.ck-content .table .ck-table-resized {
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */
|
||||||
|
.ck-content .table table {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */
|
||||||
|
.ck-content .table td,
|
||||||
|
.ck-content .table th {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-table/theme/table.css */
|
||||||
.ck-content .table {
|
.ck-content .table {
|
||||||
margin: 0.9em auto;
|
margin: 0.9em auto;
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/table.css */
|
/* @ckeditor/ckeditor5-table/theme/table.css */
|
||||||
.ck-content .table table {
|
.ck-content .table table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
@ -341,40 +386,27 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border: 1px double hsl(0, 0%, 70%);
|
border: 1px double hsl(0, 0%, 70%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/table.css */
|
/* @ckeditor/ckeditor5-table/theme/table.css */
|
||||||
.ck-content .table table td,
|
.ck-content .table table td,
|
||||||
.ck-content .table table th {
|
.ck-content .table table th {
|
||||||
min-width: 2em;
|
min-width: 2em;
|
||||||
padding: .4em;
|
padding: .4em;
|
||||||
border: 1px solid hsl(0, 0%, 75%);
|
border: 1px solid hsl(0, 0%, 75%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/table.css */
|
/* @ckeditor/ckeditor5-table/theme/table.css */
|
||||||
.ck-content .table table th {
|
.ck-content .table table th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background: hsla(0, 0%, 0%, 5%);
|
background: hsla(0, 0%, 0%, 5%);
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/table.css */
|
/* @ckeditor/ckeditor5-table/theme/table.css */
|
||||||
.ck-content[dir="rtl"] .table th {
|
.ck-content[dir="rtl"] .table th {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/table.css */
|
/* @ckeditor/ckeditor5-table/theme/table.css */
|
||||||
.ck-content[dir="ltr"] .table th {
|
.ck-content[dir="ltr"] .table th {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
/* ckeditor5-table/theme/tablecolumnresize.css */
|
/* @ckeditor/ckeditor5-table/theme/tablecaption.css */
|
||||||
.ck-content .table .ck-table-resized {
|
|
||||||
table-layout: fixed;
|
|
||||||
}
|
|
||||||
/* ckeditor5-table/theme/tablecolumnresize.css */
|
|
||||||
.ck-content .table table {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
/* ckeditor5-table/theme/tablecolumnresize.css */
|
|
||||||
.ck-content .table td,
|
|
||||||
.ck-content .table th {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
/* ckeditor5-table/theme/tablecaption.css */
|
|
||||||
.ck-content .table > figcaption {
|
.ck-content .table > figcaption {
|
||||||
display: table-caption;
|
display: table-caption;
|
||||||
caption-side: top;
|
caption-side: top;
|
||||||
@ -386,7 +418,7 @@
|
|||||||
font-size: .75em;
|
font-size: .75em;
|
||||||
outline-offset: -1px;
|
outline-offset: -1px;
|
||||||
}
|
}
|
||||||
/* ckeditor5-code-block/theme/codeblock.css */
|
/* @ckeditor/ckeditor5-code-block/theme/codeblock.css */
|
||||||
.ck-content pre {
|
.ck-content pre {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
color: hsl(0, 0%, 20.8%);
|
color: hsl(0, 0%, 20.8%);
|
||||||
@ -400,66 +432,30 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
/* ckeditor5-code-block/theme/codeblock.css */
|
/* @ckeditor/ckeditor5-code-block/theme/codeblock.css */
|
||||||
.ck-content pre code {
|
.ck-content pre code {
|
||||||
background: unset;
|
background: unset;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
/* ckeditor5-horizontal-line/theme/horizontalline.css */
|
/* @ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css */
|
||||||
.ck-content hr {
|
.ck-content hr {
|
||||||
margin: 15px 0;
|
margin: 15px 0;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
background: hsl(0, 0%, 87%);
|
background: hsl(0, 0%, 87%);
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
/* @ckeditor/ckeditor5-mention/theme/mention.css */
|
||||||
.ck-content ol {
|
|
||||||
list-style-type: decimal;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ol ol {
|
|
||||||
list-style-type: lower-latin;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ol ol ol {
|
|
||||||
list-style-type: lower-roman;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ol ol ol ol {
|
|
||||||
list-style-type: upper-latin;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ol ol ol ol ol {
|
|
||||||
list-style-type: upper-roman;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ul {
|
|
||||||
list-style-type: circle;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ul ul {
|
|
||||||
list-style-type: disc;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ul ul ul {
|
|
||||||
list-style-type: square;
|
|
||||||
}
|
|
||||||
/* ckeditor5-list/theme/liststyles.css */
|
|
||||||
.ck-content ul ul ul ul {
|
|
||||||
list-style-type: square;
|
|
||||||
}
|
|
||||||
/* ckeditor5-mention/theme/mention.css */
|
|
||||||
.ck-content .mention {
|
.ck-content .mention {
|
||||||
background: var(--ck-color-mention-background);
|
background: var(--ck-color-mention-background);
|
||||||
color: var(--ck-color-mention-text);
|
color: var(--ck-color-mention-text);
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
/* ckeditor5-page-break/theme/pagebreak.css */
|
/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */
|
||||||
.ck-content .page-break {
|
.ck-content .page-break {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
/* ckeditor5-page-break/theme/pagebreak.css */
|
/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */
|
||||||
.ck-content .page-break::after {
|
.ck-content .page-break::after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
4
libraries/ckeditor/ckeditor.js
vendored
4
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
150
package-lock.json
generated
150
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.60.0-beta",
|
"version": "0.60.1-beta",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.60.0-beta",
|
"version": "0.60.1-beta",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -16,7 +16,7 @@
|
|||||||
"archiver": "5.3.1",
|
"archiver": "5.3.1",
|
||||||
"async-mutex": "0.4.0",
|
"async-mutex": "0.4.0",
|
||||||
"axios": "1.4.0",
|
"axios": "1.4.0",
|
||||||
"better-sqlite3": "8.3.0",
|
"better-sqlite3": "8.4.0",
|
||||||
"chokidar": "3.5.3",
|
"chokidar": "3.5.3",
|
||||||
"cls-hooked": "4.2.2",
|
"cls-hooked": "4.2.2",
|
||||||
"commonmark": "0.30.0",
|
"commonmark": "0.30.0",
|
||||||
@ -39,15 +39,15 @@
|
|||||||
"helmet": "7.0.0",
|
"helmet": "7.0.0",
|
||||||
"html": "1.0.0",
|
"html": "1.0.0",
|
||||||
"html2plaintext": "2.1.4",
|
"html2plaintext": "2.1.4",
|
||||||
"http-proxy-agent": "6.1.0",
|
"http-proxy-agent": "7.0.0",
|
||||||
"https-proxy-agent": "6.2.0",
|
"https-proxy-agent": "7.0.0",
|
||||||
"image-type": "4.1.0",
|
"image-type": "4.1.0",
|
||||||
"ini": "3.0.1",
|
"ini": "3.0.1",
|
||||||
"is-animated": "2.0.2",
|
"is-animated": "2.0.2",
|
||||||
"is-svg": "4.3.2",
|
"is-svg": "4.3.2",
|
||||||
"jimp": "0.22.8",
|
"jimp": "0.22.8",
|
||||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||||
"jsdom": "22.0.0",
|
"jsdom": "22.1.0",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-abi": "3.40.0",
|
"node-abi": "3.40.0",
|
||||||
@ -71,7 +71,7 @@
|
|||||||
"turndown": "7.1.2",
|
"turndown": "7.1.2",
|
||||||
"unescape": "1.0.1",
|
"unescape": "1.0.1",
|
||||||
"ws": "8.13.0",
|
"ws": "8.13.0",
|
||||||
"xml2js": "0.5.0",
|
"xml2js": "0.6.0",
|
||||||
"yauzl": "2.10.0"
|
"yauzl": "2.10.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -79,7 +79,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"electron": "25.0.0-beta.7",
|
"electron": "25.0.0-beta.8",
|
||||||
"electron-builder": "23.6.0",
|
"electron-builder": "23.6.0",
|
||||||
"electron-packager": "17.1.1",
|
"electron-packager": "17.1.1",
|
||||||
"electron-rebuild": "3.2.9",
|
"electron-rebuild": "3.2.9",
|
||||||
@ -99,7 +99,7 @@
|
|||||||
"nodemon": "2.0.22",
|
"nodemon": "2.0.22",
|
||||||
"prettier": "2.8.8",
|
"prettier": "2.8.8",
|
||||||
"rcedit": "3.0.1",
|
"rcedit": "3.0.1",
|
||||||
"webpack": "5.83.1",
|
"webpack": "5.84.1",
|
||||||
"webpack-cli": "5.1.1"
|
"webpack-cli": "5.1.1"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
@ -1752,9 +1752,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/acorn-import-assertions": {
|
"node_modules/acorn-import-assertions": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
|
||||||
"integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==",
|
"integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"acorn": "^8"
|
"acorn": "^8"
|
||||||
@ -2443,9 +2443,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/better-sqlite3": {
|
"node_modules/better-sqlite3": {
|
||||||
"version": "8.3.0",
|
"version": "8.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.4.0.tgz",
|
||||||
"integrity": "sha512-JTmvBZL/JLTc+3Msbvq6gK6elbU9/wVMqiudplHrVJpr7sVMR9KJrNhZAbW+RhXKlpMcuEhYkdcHa3TXKNXQ1w==",
|
"integrity": "sha512-NmsNW1CQvqMszu/CFAJ3pLct6NEFlNfuGM6vw72KHkjOD1UDnL96XNN1BMQc1hiHo8vE2GbOWQYIpZ+YM5wrZw==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bindings": "^1.5.0",
|
"bindings": "^1.5.0",
|
||||||
@ -4198,9 +4198,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "25.0.0-beta.7",
|
"version": "25.0.0-beta.8",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-25.0.0-beta.7.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-25.0.0-beta.8.tgz",
|
||||||
"integrity": "sha512-pNlAmEH0v3ADTUeMfDiD5u2ODTQKdhABBSkUzvmq+tMJgCbbb8SlffcmekL2fHENDxwPycaH1ld+fCMG33ce6g==",
|
"integrity": "sha512-o3X0pkg1PyR/yawlSJzTXrh5GG8sH7jjtOzr74f0Zb4PnInzI3MIr8NopyhcGCW0JmOwFu+DLZX4bDlaLmtyGQ==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron/get": "^2.0.0",
|
"@electron/get": "^2.0.0",
|
||||||
@ -4843,9 +4843,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/enhanced-resolve": {
|
"node_modules/enhanced-resolve": {
|
||||||
"version": "5.14.0",
|
"version": "5.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.1.tgz",
|
||||||
"integrity": "sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==",
|
"integrity": "sha512-Vklwq2vDKtl0y/vtwjSesgJ5MYS7Etuk5txS8VdKL4AOS1aUlD96zqIfsOSLQsdv3xgMRbtkWM8eG9XDfKUPow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"graceful-fs": "^4.2.4",
|
"graceful-fs": "^4.2.4",
|
||||||
@ -6964,11 +6964,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/http-proxy-agent": {
|
"node_modules/http-proxy-agent": {
|
||||||
"version": "6.1.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
|
||||||
"integrity": "sha512-75t5ACHLOMnz/KsDAS4BdHx4J0sneT/HW+Sz070NR+n7RZ7SmYXYn2FXq6D0XwQid8hYgRVf6HZJrYuGzaEqtw==",
|
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"agent-base": "^7.0.2",
|
"agent-base": "^7.1.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -6976,9 +6976,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/http-proxy-agent/node_modules/agent-base": {
|
"node_modules/http-proxy-agent/node_modules/agent-base": {
|
||||||
"version": "7.0.2",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
|
||||||
"integrity": "sha512-k2/tQ1+8Zf50dEUJWklUP80LcE/+Ph+OJ6cf2Ff2fD/c/TtCe6ofnCoNMz9UnyxOQYlaAALZtEWETzn+1JjfHg==",
|
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
@ -7013,9 +7013,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/https-proxy-agent": {
|
"node_modules/https-proxy-agent": {
|
||||||
"version": "6.2.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-6.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz",
|
||||||
"integrity": "sha512-4xhCnMpxR9fupa7leh9uJK2P/qjYIeaM9uZ9c1bi1JDSwX2VH9NDk/oKSToNX4gBKa2WT31Mldne7e26ckohLQ==",
|
"integrity": "sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"agent-base": "^7.0.2",
|
"agent-base": "^7.0.2",
|
||||||
"debug": "4"
|
"debug": "4"
|
||||||
@ -7985,9 +7985,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jsdom": {
|
"node_modules/jsdom": {
|
||||||
"version": "22.0.0",
|
"version": "22.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz",
|
||||||
"integrity": "sha512-p5ZTEb5h+O+iU02t0GfEjAnkdYPrQSkfuTSMkMYyIoMvUNEHsbG0bHHbfXIcfTqD2UfvjQX7mmgiFsyRwGscVw==",
|
"integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"abab": "^2.0.6",
|
"abab": "^2.0.6",
|
||||||
"cssstyle": "^3.0.0",
|
"cssstyle": "^3.0.0",
|
||||||
@ -12564,9 +12564,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack": {
|
"node_modules/webpack": {
|
||||||
"version": "5.83.1",
|
"version": "5.84.1",
|
||||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.83.1.tgz",
|
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.84.1.tgz",
|
||||||
"integrity": "sha512-TNsG9jDScbNuB+Lb/3+vYolPplCS3bbEaJf+Bj0Gw4DhP3ioAflBb1flcRt9zsWITyvOhM96wMQNRWlSX52DgA==",
|
"integrity": "sha512-ZP4qaZ7vVn/K8WN/p990SGATmrL1qg4heP/MrVneczYtpDGJWlrgZv55vxaV2ul885Kz+25MP2kSXkPe3LZfmg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/eslint-scope": "^3.7.3",
|
"@types/eslint-scope": "^3.7.3",
|
||||||
@ -12575,10 +12575,10 @@
|
|||||||
"@webassemblyjs/wasm-edit": "^1.11.5",
|
"@webassemblyjs/wasm-edit": "^1.11.5",
|
||||||
"@webassemblyjs/wasm-parser": "^1.11.5",
|
"@webassemblyjs/wasm-parser": "^1.11.5",
|
||||||
"acorn": "^8.7.1",
|
"acorn": "^8.7.1",
|
||||||
"acorn-import-assertions": "^1.7.6",
|
"acorn-import-assertions": "^1.9.0",
|
||||||
"browserslist": "^4.14.5",
|
"browserslist": "^4.14.5",
|
||||||
"chrome-trace-event": "^1.0.2",
|
"chrome-trace-event": "^1.0.2",
|
||||||
"enhanced-resolve": "^5.14.0",
|
"enhanced-resolve": "^5.14.1",
|
||||||
"es-module-lexer": "^1.2.1",
|
"es-module-lexer": "^1.2.1",
|
||||||
"eslint-scope": "5.1.1",
|
"eslint-scope": "5.1.1",
|
||||||
"events": "^3.2.0",
|
"events": "^3.2.0",
|
||||||
@ -12894,9 +12894,9 @@
|
|||||||
"integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g=="
|
"integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g=="
|
||||||
},
|
},
|
||||||
"node_modules/xml2js": {
|
"node_modules/xml2js": {
|
||||||
"version": "0.5.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.0.tgz",
|
||||||
"integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
|
"integrity": "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sax": ">=0.6.0",
|
"sax": ">=0.6.0",
|
||||||
"xmlbuilder": "~11.0.0"
|
"xmlbuilder": "~11.0.0"
|
||||||
@ -14362,9 +14362,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"acorn-import-assertions": {
|
"acorn-import-assertions": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
|
||||||
"integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==",
|
"integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@ -14900,9 +14900,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"better-sqlite3": {
|
"better-sqlite3": {
|
||||||
"version": "8.3.0",
|
"version": "8.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.4.0.tgz",
|
||||||
"integrity": "sha512-JTmvBZL/JLTc+3Msbvq6gK6elbU9/wVMqiudplHrVJpr7sVMR9KJrNhZAbW+RhXKlpMcuEhYkdcHa3TXKNXQ1w==",
|
"integrity": "sha512-NmsNW1CQvqMszu/CFAJ3pLct6NEFlNfuGM6vw72KHkjOD1UDnL96XNN1BMQc1hiHo8vE2GbOWQYIpZ+YM5wrZw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bindings": "^1.5.0",
|
"bindings": "^1.5.0",
|
||||||
"prebuild-install": "^7.1.0"
|
"prebuild-install": "^7.1.0"
|
||||||
@ -16251,9 +16251,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"electron": {
|
"electron": {
|
||||||
"version": "25.0.0-beta.7",
|
"version": "25.0.0-beta.8",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-25.0.0-beta.7.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-25.0.0-beta.8.tgz",
|
||||||
"integrity": "sha512-pNlAmEH0v3ADTUeMfDiD5u2ODTQKdhABBSkUzvmq+tMJgCbbb8SlffcmekL2fHENDxwPycaH1ld+fCMG33ce6g==",
|
"integrity": "sha512-o3X0pkg1PyR/yawlSJzTXrh5GG8sH7jjtOzr74f0Zb4PnInzI3MIr8NopyhcGCW0JmOwFu+DLZX4bDlaLmtyGQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@electron/get": "^2.0.0",
|
"@electron/get": "^2.0.0",
|
||||||
"@types/node": "^18.11.18",
|
"@types/node": "^18.11.18",
|
||||||
@ -16753,9 +16753,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"enhanced-resolve": {
|
"enhanced-resolve": {
|
||||||
"version": "5.14.0",
|
"version": "5.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.1.tgz",
|
||||||
"integrity": "sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==",
|
"integrity": "sha512-Vklwq2vDKtl0y/vtwjSesgJ5MYS7Etuk5txS8VdKL4AOS1aUlD96zqIfsOSLQsdv3xgMRbtkWM8eG9XDfKUPow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"graceful-fs": "^4.2.4",
|
"graceful-fs": "^4.2.4",
|
||||||
@ -18343,18 +18343,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http-proxy-agent": {
|
"http-proxy-agent": {
|
||||||
"version": "6.1.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
|
||||||
"integrity": "sha512-75t5ACHLOMnz/KsDAS4BdHx4J0sneT/HW+Sz070NR+n7RZ7SmYXYn2FXq6D0XwQid8hYgRVf6HZJrYuGzaEqtw==",
|
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"agent-base": "^7.0.2",
|
"agent-base": "^7.1.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"agent-base": {
|
"agent-base": {
|
||||||
"version": "7.0.2",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
|
||||||
"integrity": "sha512-k2/tQ1+8Zf50dEUJWklUP80LcE/+Ph+OJ6cf2Ff2fD/c/TtCe6ofnCoNMz9UnyxOQYlaAALZtEWETzn+1JjfHg==",
|
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
}
|
}
|
||||||
@ -18381,9 +18381,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"https-proxy-agent": {
|
"https-proxy-agent": {
|
||||||
"version": "6.2.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-6.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz",
|
||||||
"integrity": "sha512-4xhCnMpxR9fupa7leh9uJK2P/qjYIeaM9uZ9c1bi1JDSwX2VH9NDk/oKSToNX4gBKa2WT31Mldne7e26ckohLQ==",
|
"integrity": "sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"agent-base": "^7.0.2",
|
"agent-base": "^7.0.2",
|
||||||
"debug": "4"
|
"debug": "4"
|
||||||
@ -19077,9 +19077,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jsdom": {
|
"jsdom": {
|
||||||
"version": "22.0.0",
|
"version": "22.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz",
|
||||||
"integrity": "sha512-p5ZTEb5h+O+iU02t0GfEjAnkdYPrQSkfuTSMkMYyIoMvUNEHsbG0bHHbfXIcfTqD2UfvjQX7mmgiFsyRwGscVw==",
|
"integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"abab": "^2.0.6",
|
"abab": "^2.0.6",
|
||||||
"cssstyle": "^3.0.0",
|
"cssstyle": "^3.0.0",
|
||||||
@ -22556,9 +22556,9 @@
|
|||||||
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="
|
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="
|
||||||
},
|
},
|
||||||
"webpack": {
|
"webpack": {
|
||||||
"version": "5.83.1",
|
"version": "5.84.1",
|
||||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.83.1.tgz",
|
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.84.1.tgz",
|
||||||
"integrity": "sha512-TNsG9jDScbNuB+Lb/3+vYolPplCS3bbEaJf+Bj0Gw4DhP3ioAflBb1flcRt9zsWITyvOhM96wMQNRWlSX52DgA==",
|
"integrity": "sha512-ZP4qaZ7vVn/K8WN/p990SGATmrL1qg4heP/MrVneczYtpDGJWlrgZv55vxaV2ul885Kz+25MP2kSXkPe3LZfmg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/eslint-scope": "^3.7.3",
|
"@types/eslint-scope": "^3.7.3",
|
||||||
@ -22567,10 +22567,10 @@
|
|||||||
"@webassemblyjs/wasm-edit": "^1.11.5",
|
"@webassemblyjs/wasm-edit": "^1.11.5",
|
||||||
"@webassemblyjs/wasm-parser": "^1.11.5",
|
"@webassemblyjs/wasm-parser": "^1.11.5",
|
||||||
"acorn": "^8.7.1",
|
"acorn": "^8.7.1",
|
||||||
"acorn-import-assertions": "^1.7.6",
|
"acorn-import-assertions": "^1.9.0",
|
||||||
"browserslist": "^4.14.5",
|
"browserslist": "^4.14.5",
|
||||||
"chrome-trace-event": "^1.0.2",
|
"chrome-trace-event": "^1.0.2",
|
||||||
"enhanced-resolve": "^5.14.0",
|
"enhanced-resolve": "^5.14.1",
|
||||||
"es-module-lexer": "^1.2.1",
|
"es-module-lexer": "^1.2.1",
|
||||||
"eslint-scope": "5.1.1",
|
"eslint-scope": "5.1.1",
|
||||||
"events": "^3.2.0",
|
"events": "^3.2.0",
|
||||||
@ -22786,9 +22786,9 @@
|
|||||||
"integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g=="
|
"integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g=="
|
||||||
},
|
},
|
||||||
"xml2js": {
|
"xml2js": {
|
||||||
"version": "0.5.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.0.tgz",
|
||||||
"integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
|
"integrity": "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"sax": ">=0.6.0",
|
"sax": ">=0.6.0",
|
||||||
"xmlbuilder": "~11.0.0"
|
"xmlbuilder": "~11.0.0"
|
||||||
|
10
package.json
10
package.json
@ -37,7 +37,7 @@
|
|||||||
"archiver": "5.3.1",
|
"archiver": "5.3.1",
|
||||||
"async-mutex": "0.4.0",
|
"async-mutex": "0.4.0",
|
||||||
"axios": "1.4.0",
|
"axios": "1.4.0",
|
||||||
"better-sqlite3": "8.3.0",
|
"better-sqlite3": "8.4.0",
|
||||||
"chokidar": "3.5.3",
|
"chokidar": "3.5.3",
|
||||||
"cls-hooked": "4.2.2",
|
"cls-hooked": "4.2.2",
|
||||||
"commonmark": "0.30.0",
|
"commonmark": "0.30.0",
|
||||||
@ -60,15 +60,15 @@
|
|||||||
"helmet": "7.0.0",
|
"helmet": "7.0.0",
|
||||||
"html": "1.0.0",
|
"html": "1.0.0",
|
||||||
"html2plaintext": "2.1.4",
|
"html2plaintext": "2.1.4",
|
||||||
"http-proxy-agent": "6.1.0",
|
"http-proxy-agent": "7.0.0",
|
||||||
"https-proxy-agent": "6.2.0",
|
"https-proxy-agent": "7.0.0",
|
||||||
"image-type": "4.1.0",
|
"image-type": "4.1.0",
|
||||||
"ini": "3.0.1",
|
"ini": "3.0.1",
|
||||||
"is-animated": "2.0.2",
|
"is-animated": "2.0.2",
|
||||||
"is-svg": "4.3.2",
|
"is-svg": "4.3.2",
|
||||||
"jimp": "0.22.8",
|
"jimp": "0.22.8",
|
||||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||||
"jsdom": "22.0.0",
|
"jsdom": "22.1.0",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-abi": "3.40.0",
|
"node-abi": "3.40.0",
|
||||||
@ -97,7 +97,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"electron": "25.0.0-beta.7",
|
"electron": "25.0.0-beta.8",
|
||||||
"electron-builder": "23.6.0",
|
"electron-builder": "23.6.0",
|
||||||
"electron-packager": "17.1.1",
|
"electron-packager": "17.1.1",
|
||||||
"electron-rebuild": "3.2.9",
|
"electron-rebuild": "3.2.9",
|
||||||
|
@ -77,6 +77,7 @@ class BAttachment extends AbstractBeccaEntity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @returns {BNote} */
|
||||||
getNote() {
|
getNote() {
|
||||||
return this.becca.notes[this.parentId];
|
return this.becca.notes[this.parentId];
|
||||||
}
|
}
|
||||||
|
@ -1116,6 +1116,8 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
/** @returns {BAttachment[]} */
|
/** @returns {BAttachment[]} */
|
||||||
getAttachments(opts = {}) {
|
getAttachments(opts = {}) {
|
||||||
opts.includeContentLength = !!opts.includeContentLength;
|
opts.includeContentLength = !!opts.includeContentLength;
|
||||||
|
// from testing it looks like calculating length does not make a difference in performance even on large-ish DB
|
||||||
|
// given that we're always fetching attachments only for a specific note, we might just do it always
|
||||||
|
|
||||||
const query = opts.includeContentLength
|
const query = opts.includeContentLength
|
||||||
? `SELECT attachments.*, LENGTH(blobs.content) AS contentLength
|
? `SELECT attachments.*, LENGTH(blobs.content) AS contentLength
|
||||||
|
@ -231,8 +231,7 @@ class FNote {
|
|||||||
/** @returns {Promise<FAttachment[]>} */
|
/** @returns {Promise<FAttachment[]>} */
|
||||||
async getAttachments() {
|
async getAttachments() {
|
||||||
if (!this.attachments) {
|
if (!this.attachments) {
|
||||||
this.attachments = (await server.get(`notes/${this.noteId}/attachments`))
|
this.attachments = await this.froca.getAttachmentsForNote(this.noteId);
|
||||||
.map(row => new FAttachment(froca, row));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.attachments;
|
return this.attachments;
|
||||||
|
@ -20,7 +20,7 @@ async function renderAttribute(attribute, renderIsInheritable) {
|
|||||||
// when the relation has just been created, then it might not have a value
|
// when the relation has just been created, then it might not have a value
|
||||||
if (attribute.value) {
|
if (attribute.value) {
|
||||||
$attr.append(document.createTextNode(`~${attribute.name}${isInheritable}=`));
|
$attr.append(document.createTextNode(`~${attribute.name}${isInheritable}=`));
|
||||||
$attr.append(await createNoteLink(attribute.value));
|
$attr.append(await createLink(attribute.value));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ws.logError(`Unknown attr type: ${attribute.type}`);
|
ws.logError(`Unknown attr type: ${attribute.type}`);
|
||||||
@ -47,7 +47,7 @@ function formatValue(val) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createNoteLink(noteId) {
|
async function createLink(noteId) {
|
||||||
const note = await froca.getNote(noteId);
|
const note = await froca.getNote(noteId);
|
||||||
|
|
||||||
if (!note) {
|
if (!note) {
|
||||||
|
@ -71,7 +71,7 @@ async function copy(branchIds) {
|
|||||||
const links = [];
|
const links = [];
|
||||||
|
|
||||||
for (const branch of froca.getBranches(clipboardBranchIds)) {
|
for (const branch of froca.getBranches(clipboardBranchIds)) {
|
||||||
const $link = await linkService.createNoteLink(`${branch.parentNoteId}/${branch.noteId}`, { referenceLink: true });
|
const $link = await linkService.createLink(`${branch.parentNoteId}/${branch.noteId}`, { referenceLink: true });
|
||||||
links.push($link[0].outerHTML);
|
links.push($link[0].outerHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,9 +100,7 @@ async function renderText(note, options, $renderedContent) {
|
|||||||
await froca.getNotes(noteIdsToPrefetch);
|
await froca.getNotes(noteIdsToPrefetch);
|
||||||
|
|
||||||
for (const el of referenceLinks) {
|
for (const el of referenceLinks) {
|
||||||
const noteId = getNoteIdFromLink(el);
|
await linkService.loadReferenceLinkTitle($(el));
|
||||||
|
|
||||||
await linkService.loadReferenceLinkTitle(noteId, $(el));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await renderChildrenList($renderedContent, note);
|
await renderChildrenList($renderedContent, note);
|
||||||
@ -146,15 +144,6 @@ function renderFile(entity, type, $renderedContent) {
|
|||||||
throw new Error(`Can't recognize entity type of '${entity}'`);
|
throw new Error(`Can't recognize entity type of '${entity}'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const $downloadButton = $('<button class="file-download btn btn-primary" type="button">Download</button>');
|
|
||||||
const $openButton = $('<button class="file-open btn btn-primary" type="button">Open</button>');
|
|
||||||
|
|
||||||
$downloadButton.on('click', () => openService.downloadFileNote(entity.noteId));
|
|
||||||
$openButton.on('click', () => openService.openNoteExternally(entity.noteId, entity.mime));
|
|
||||||
|
|
||||||
// open doesn't work for protected notes since it works through a browser which isn't in protected session
|
|
||||||
$openButton.toggle(!entity.isProtected);
|
|
||||||
|
|
||||||
const $content = $('<div style="display: flex; flex-direction: column; height: 100%;">');
|
const $content = $('<div style="display: flex; flex-direction: column; height: 100%;">');
|
||||||
|
|
||||||
if (type === 'pdf') {
|
if (type === 'pdf') {
|
||||||
@ -178,11 +167,23 @@ function renderFile(entity, type, $renderedContent) {
|
|||||||
$content.append($videoPreview);
|
$content.append($videoPreview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entityType === 'notes') {
|
||||||
|
// TODO: we should make this available also for attachments, but there's a problem with "Open externally" support
|
||||||
|
// in attachment list
|
||||||
|
const $downloadButton = $('<button class="file-download btn btn-primary" type="button">Download</button>');
|
||||||
|
const $openButton = $('<button class="file-open btn btn-primary" type="button">Open</button>');
|
||||||
|
|
||||||
|
$downloadButton.on('click', () => openService.downloadFileNote(entity.noteId));
|
||||||
|
$openButton.on('click', () => openService.openNoteExternally(entity.noteId, entity.mime));
|
||||||
|
// open doesn't work for protected notes since it works through a browser which isn't in protected session
|
||||||
|
$openButton.toggle(!entity.isProtected);
|
||||||
|
|
||||||
$content.append(
|
$content.append(
|
||||||
$('<div style="display: flex; justify-content: space-evenly; margin-top: 5px;">')
|
$('<div style="display: flex; justify-content: space-evenly; margin-top: 5px;">')
|
||||||
.append($downloadButton)
|
.append($downloadButton)
|
||||||
.append($openButton)
|
.append($openButton)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$renderedContent.append($content);
|
$renderedContent.append($content);
|
||||||
}
|
}
|
||||||
@ -253,7 +254,7 @@ async function renderChildrenList($renderedContent, note) {
|
|||||||
const childNotes = await froca.getNotes(childNoteIds);
|
const childNotes = await froca.getNotes(childNoteIds);
|
||||||
|
|
||||||
for (const childNote of childNotes) {
|
for (const childNote of childNotes) {
|
||||||
$renderedContent.append(await linkService.createNoteLink(`${note.noteId}/${childNote.noteId}`, {
|
$renderedContent.append(await linkService.createLink(`${note.noteId}/${childNote.noteId}`, {
|
||||||
showTooltip: false,
|
showTooltip: false,
|
||||||
showNoteIcon: true
|
showNoteIcon: true
|
||||||
}));
|
}));
|
||||||
|
@ -314,10 +314,45 @@ class Froca {
|
|||||||
return child.parentToBranch[parentNoteId];
|
return child.parentToBranch[parentNoteId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @returns {Promise<FAttachment>} */
|
||||||
async getAttachment(attachmentId) {
|
async getAttachment(attachmentId) {
|
||||||
const attachmentRow = await server.get(`attachments/${attachmentId}`);
|
const attachment = this.attachments[attachmentId];
|
||||||
|
if (attachment) {
|
||||||
|
return attachment;
|
||||||
|
}
|
||||||
|
|
||||||
return attachmentRow ? new FAttachment(this, attachmentRow) : null;
|
// load all attachments for the given note even if one is requested, don't load one by one
|
||||||
|
const attachmentRows = await server.get(`attachments/${attachmentId}/all`);
|
||||||
|
const attachments = this.processAttachmentRows(attachmentRows);
|
||||||
|
|
||||||
|
if (attachments.length) {
|
||||||
|
attachments[0].getNote().attachments = attachments;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.attachments[attachmentId];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @returns {Promise<FAttachment[]>} */
|
||||||
|
async getAttachmentsForNote(noteId) {
|
||||||
|
const attachmentRows = await server.get(`notes/${noteId}/attachments`);
|
||||||
|
return this.processAttachmentRows(attachmentRows);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @returns {FAttachment[]} */
|
||||||
|
processAttachmentRows(attachmentRows) {
|
||||||
|
return attachmentRows.map(attachmentRow => {
|
||||||
|
let attachment;
|
||||||
|
|
||||||
|
if (attachmentRow.attachmentId in this.attachments) {
|
||||||
|
attachment = this.attachments[attachmentRow.attachmentId];
|
||||||
|
attachment.update(attachmentRow);
|
||||||
|
} else {
|
||||||
|
attachment = new FAttachment(this, attachmentRow);
|
||||||
|
this.attachments[attachment.attachmentId] = attachment;
|
||||||
|
}
|
||||||
|
|
||||||
|
return attachment;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<FBlob>} */
|
/** @returns {Promise<FBlob>} */
|
||||||
|
@ -269,7 +269,7 @@ function processAttachment(loadResults, ec) {
|
|||||||
} else {
|
} else {
|
||||||
const note = froca.notes[ec.entity.parentId];
|
const note = froca.notes[ec.entity.parentId];
|
||||||
|
|
||||||
if (note && note.attachments) {
|
if (note?.attachments) {
|
||||||
note.attachments.push(new FAttachment(froca, ec.entity));
|
note.attachments.push(new FAttachment(froca, ec.entity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Returns list of notes. If note is missing from the cache, it's loaded.
|
* Returns list of notes. If note is missing from the cache, it's loaded.
|
||||||
*
|
*
|
||||||
* This is often used to bulk-fill the cache with notes which would have to be picked one by one
|
* This is often used to bulk-fill the cache with notes which would have to be picked one by one
|
||||||
* otherwise (by e.g. createNoteLink())
|
* otherwise (by e.g. createLink())
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string[]} noteIds
|
* @param {string[]} noteIds
|
||||||
@ -302,7 +302,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* @param {boolean} [params.showNoteIcon=false] - show also note icon before the title
|
* @param {boolean} [params.showNoteIcon=false] - show also note icon before the title
|
||||||
* @param {string} [params.title=] - custom link tile with note's title as default
|
* @param {string} [params.title=] - custom link tile with note's title as default
|
||||||
*/
|
*/
|
||||||
this.createNoteLink = linkService.createNoteLink;
|
this.createLink = linkService.createLink;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds given text to the editor cursor
|
* Adds given text to the editor cursor
|
||||||
|
@ -10,7 +10,7 @@ function getNotePathFromUrl(url) {
|
|||||||
return notePathMatch === null ? null : notePathMatch[1];
|
return notePathMatch === null ? null : notePathMatch[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createNoteLink(notePath, options = {}) {
|
async function createLink(notePath, options = {}) {
|
||||||
if (!notePath || !notePath.trim()) {
|
if (!notePath || !notePath.trim()) {
|
||||||
logError("Missing note path");
|
logError("Missing note path");
|
||||||
|
|
||||||
@ -29,26 +29,50 @@ async function createNoteLink(notePath, options = {}) {
|
|||||||
const referenceLink = options.referenceLink === undefined ? false : options.referenceLink;
|
const referenceLink = options.referenceLink === undefined ? false : options.referenceLink;
|
||||||
|
|
||||||
const { noteId, parentNoteId } = treeService.getNoteIdAndParentIdFromNotePath(notePath);
|
const { noteId, parentNoteId } = treeService.getNoteIdAndParentIdFromNotePath(notePath);
|
||||||
const noteTitle = options.title || await treeService.getNoteTitle(noteId, parentNoteId);
|
const viewScope = options.viewScope || {};
|
||||||
|
const viewMode = viewScope.viewMode || 'default';
|
||||||
|
let linkTitle = options.title;
|
||||||
|
|
||||||
|
if (!linkTitle) {
|
||||||
|
if (viewMode === 'attachments' && viewScope.attachmentId) {
|
||||||
|
const attachment = await froca.getAttachment(viewScope.attachmentId);
|
||||||
|
|
||||||
|
linkTitle = attachment ? attachment.title : '[missing attachment]';
|
||||||
|
} else {
|
||||||
|
linkTitle = await treeService.getNoteTitle(noteId, parentNoteId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const $container = $("<span>");
|
const $container = $("<span>");
|
||||||
|
|
||||||
if (showNoteIcon) {
|
if (showNoteIcon) {
|
||||||
|
let icon;
|
||||||
|
|
||||||
|
if (viewMode === 'default') {
|
||||||
const note = await froca.getNote(noteId);
|
const note = await froca.getNote(noteId);
|
||||||
|
|
||||||
|
icon = note.getIcon();
|
||||||
|
} else if (viewMode === 'source') {
|
||||||
|
icon = 'bx-code-curly';
|
||||||
|
} else if (viewMode === 'attachments') {
|
||||||
|
icon = 'bx-file';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (icon) {
|
||||||
$container
|
$container
|
||||||
.append($("<span>").addClass(`bx ${note.getIcon()}`))
|
.append($("<span>").addClass(`bx ${icon}`))
|
||||||
.append(" ");
|
.append(" ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const hash = calculateHash({
|
const hash = calculateHash({
|
||||||
notePath,
|
notePath,
|
||||||
viewScope: options.viewScope
|
viewScope: viewScope
|
||||||
});
|
});
|
||||||
|
|
||||||
const $noteLink = $("<a>", {
|
const $noteLink = $("<a>", {
|
||||||
href: hash,
|
href: hash,
|
||||||
text: noteTitle
|
text: linkTitle
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!showTooltip) {
|
if (!showTooltip) {
|
||||||
@ -228,7 +252,14 @@ function linkContextMenu(e) {
|
|||||||
linkContextMenuService.openContextMenu(notePath, e, viewScope, null);
|
linkContextMenuService.openContextMenu(notePath, e, viewScope, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadReferenceLinkTitle(noteId, $el) {
|
async function loadReferenceLinkTitle($el) {
|
||||||
|
const url = $el.attr("href");
|
||||||
|
if (!url) {
|
||||||
|
console.warn("Empty URL for parsing");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {noteId} = parseNavigationStateFromUrl(url);
|
||||||
const note = await froca.getNote(noteId, true);
|
const note = await froca.getNote(noteId, true);
|
||||||
|
|
||||||
let title;
|
let title;
|
||||||
@ -279,7 +310,7 @@ $(document).on('mousedown', 'a', e => {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
getNotePathFromUrl,
|
getNotePathFromUrl,
|
||||||
createNoteLink,
|
createLink,
|
||||||
goToLink,
|
goToLink,
|
||||||
loadReferenceLinkTitle,
|
loadReferenceLinkTitle,
|
||||||
calculateHash,
|
calculateHash,
|
||||||
|
@ -284,7 +284,7 @@ class NoteListRenderer {
|
|||||||
.append($('<span class="note-icon">').addClass(note.getIcon()))
|
.append($('<span class="note-icon">').addClass(note.getIcon()))
|
||||||
.append(this.viewType === 'grid'
|
.append(this.viewType === 'grid'
|
||||||
? $('<span class="note-book-title">').text(note.title)
|
? $('<span class="note-book-title">').text(note.title)
|
||||||
: (await linkService.createNoteLink(notePath, {showTooltip: false, showNotePath: this.showNotePath}))
|
: (await linkService.createLink(notePath, {showTooltip: false, showNotePath: this.showNotePath}))
|
||||||
.addClass("note-book-title")
|
.addClass("note-book-title")
|
||||||
)
|
)
|
||||||
.append($renderedAttributes)
|
.append($renderedAttributes)
|
||||||
|
@ -513,6 +513,15 @@ function areObjectsEqual () {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyHtmlToClipboard(content) {
|
||||||
|
const clipboardItem = new ClipboardItem({
|
||||||
|
'text/html': new Blob([content], {type: 'text/html'}),
|
||||||
|
'text/plain': new Blob([content], {type: 'text/plain'})
|
||||||
|
});
|
||||||
|
|
||||||
|
navigator.clipboard.write([clipboardItem]);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
reloadFrontendApp,
|
reloadFrontendApp,
|
||||||
parseDate,
|
parseDate,
|
||||||
@ -558,5 +567,6 @@ export default {
|
|||||||
isValidAttributeName,
|
isValidAttributeName,
|
||||||
sleep,
|
sleep,
|
||||||
escapeRegExp,
|
escapeRegExp,
|
||||||
areObjectsEqual
|
areObjectsEqual,
|
||||||
|
copyHtmlToClipboard
|
||||||
};
|
};
|
||||||
|
@ -6,6 +6,7 @@ import options from "../services/options.js";
|
|||||||
import imageService from "../services/image.js";
|
import imageService from "../services/image.js";
|
||||||
import linkService from "../services/link.js";
|
import linkService from "../services/link.js";
|
||||||
import contentRenderer from "../services/content_renderer.js";
|
import contentRenderer from "../services/content_renderer.js";
|
||||||
|
import toastService from "../services/toast.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="attachment-detail-widget">
|
<div class="attachment-detail-widget">
|
||||||
@ -126,7 +127,7 @@ export default class AttachmentDetailWidget extends BasicWidget {
|
|||||||
|
|
||||||
if (!this.isFullDetail) {
|
if (!this.isFullDetail) {
|
||||||
this.$wrapper.find('.attachment-title').append(
|
this.$wrapper.find('.attachment-title').append(
|
||||||
await linkService.createNoteLink(this.attachment.parentId, {
|
await linkService.createLink(this.attachment.parentId, {
|
||||||
title: this.attachment.title,
|
title: this.attachment.title,
|
||||||
viewScope: {
|
viewScope: {
|
||||||
viewMode: 'attachments',
|
viewMode: 'attachments',
|
||||||
@ -174,16 +175,20 @@ export default class AttachmentDetailWidget extends BasicWidget {
|
|||||||
if (this.attachment.role === 'image') {
|
if (this.attachment.role === 'image') {
|
||||||
imageService.copyImageReferenceToClipboard(this.$wrapper.find('.attachment-content-wrapper'));
|
imageService.copyImageReferenceToClipboard(this.$wrapper.find('.attachment-content-wrapper'));
|
||||||
} else if (this.attachment.role === 'file') {
|
} else if (this.attachment.role === 'file') {
|
||||||
const $link = await linkService.createNoteLink(this.attachment.parentId, {
|
const $link = await linkService.createLink(this.attachment.parentId, {
|
||||||
referenceLink: true,
|
referenceLink: true,
|
||||||
viewScope: {
|
viewScope: {
|
||||||
viewMode: 'attachments',
|
viewMode: 'attachments',
|
||||||
attachmentId: this.attachment.attachmentId
|
attachmentId: this.attachment.attachmentId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
utils.copyHtmlToClipboard($link[0].outerHTML);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Unrecognized attachment role '${this.attachment.role}'.`);
|
throw new Error(`Unrecognized attachment role '${this.attachment.role}'.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toastService.showMessage("Attachment link copied to clipboard.");
|
||||||
}
|
}
|
||||||
|
|
||||||
async entitiesReloadedEvent({loadResults}) {
|
async entitiesReloadedEvent({loadResults}) {
|
||||||
|
@ -437,7 +437,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
|
|||||||
.empty()
|
.empty()
|
||||||
.append(attribute.type === 'label' ? 'Label' : 'Relation')
|
.append(attribute.type === 'label' ? 'Label' : 'Relation')
|
||||||
.append(' is owned by note ')
|
.append(' is owned by note ')
|
||||||
.append(await linkService.createNoteLink(attribute.noteId))
|
.append(await linkService.createLink(attribute.noteId))
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$inputName
|
this.$inputName
|
||||||
@ -602,7 +602,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
for (const note of displayedNotes) {
|
for (const note of displayedNotes) {
|
||||||
const notePath = note.getBestNotePathString(hoistedNoteId);
|
const notePath = note.getBestNotePathString(hoistedNoteId);
|
||||||
const $noteLink = await linkService.createNoteLink(notePath, {showNotePath: true});
|
const $noteLink = await linkService.createLink(notePath, {showNotePath: true});
|
||||||
|
|
||||||
this.$relatedNotesList.append(
|
this.$relatedNotesList.append(
|
||||||
$("<li>").append($noteLink)
|
$("<li>").append($noteLink)
|
||||||
@ -699,7 +699,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
|
|||||||
this.toggleInt(false);
|
this.toggleInt(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
createNoteLink(noteId) {
|
createLink(noteId) {
|
||||||
return $("<a>", {
|
return $("<a>", {
|
||||||
href: `#root/${noteId}`,
|
href: `#root/${noteId}`,
|
||||||
class: 'reference-link'
|
class: 'reference-link'
|
||||||
|
@ -2,12 +2,13 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
|||||||
import noteAutocompleteService from "../../services/note_autocomplete.js";
|
import noteAutocompleteService from "../../services/note_autocomplete.js";
|
||||||
import server from "../../services/server.js";
|
import server from "../../services/server.js";
|
||||||
import contextMenuService from "../../menus/context_menu.js";
|
import contextMenuService from "../../menus/context_menu.js";
|
||||||
import attributesParser from "../../services/attribute_parser.js";
|
import attributeParser from "../../services/attribute_parser.js";
|
||||||
import libraryLoader from "../../services/library_loader.js";
|
import libraryLoader from "../../services/library_loader.js";
|
||||||
import froca from "../../services/froca.js";
|
import froca from "../../services/froca.js";
|
||||||
import attributeRenderer from "../../services/attribute_renderer.js";
|
import attributeRenderer from "../../services/attribute_renderer.js";
|
||||||
import noteCreateService from "../../services/note_create.js";
|
import noteCreateService from "../../services/note_create.js";
|
||||||
import attributeService from "../../services/attributes.js";
|
import attributeService from "../../services/attributes.js";
|
||||||
|
import linkService from "../../services/link.js";
|
||||||
|
|
||||||
const HELP_TEXT = `
|
const HELP_TEXT = `
|
||||||
<p>To add label, just type e.g. <code>#rock</code> or if you want to add also value then e.g. <code>#year = 2020</code></p>
|
<p>To add label, just type e.g. <code>#rock</code> or if you want to add also value then e.g. <code>#year = 2020</code></p>
|
||||||
@ -321,7 +322,7 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
parseAttributes() {
|
parseAttributes() {
|
||||||
try {
|
try {
|
||||||
return attributesParser.lexAndParse(this.getPreprocessedData());
|
return attributeParser.lexAndParse(this.getPreprocessedData());
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
this.$errors.text(e.message).slideDown();
|
this.$errors.text(e.message).slideDown();
|
||||||
@ -385,7 +386,7 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
|
|||||||
let parsedAttrs;
|
let parsedAttrs;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parsedAttrs = attributesParser.lexAndParse(this.getPreprocessedData(), true);
|
parsedAttrs = attributeParser.lexAndParse(this.getPreprocessedData(), true);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
// the input is incorrect because user messed up with it and now needs to fix it manually
|
// the input is incorrect because user messed up with it and now needs to fix it manually
|
||||||
@ -455,7 +456,8 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
|
|||||||
return clickIndex;
|
return clickIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadReferenceLinkTitle(noteId, $el) {
|
async loadReferenceLinkTitle($el) {
|
||||||
|
const {noteId} = linkService.parseNavigationStateFromUrl($el.attr("href"));
|
||||||
const note = await froca.getNote(noteId, true);
|
const note = await froca.getNote(noteId, true);
|
||||||
|
|
||||||
let title;
|
let title;
|
||||||
|
@ -56,7 +56,6 @@ export default class AttachmentActionsWidget extends BasicWidget {
|
|||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.$widget.on('click', '.dropdown-item', () => this.$widget.find("[data-toggle='dropdown']").dropdown('toggle'));
|
this.$widget.on('click', '.dropdown-item', () => this.$widget.find("[data-toggle='dropdown']").dropdown('toggle'));
|
||||||
this.$widget.find("[data-trigger-command='copyAttachmentLinkToClipboard']").toggle(this.attachment.role === 'image');
|
|
||||||
|
|
||||||
this.$uploadNewRevisionInput = this.$widget.find(".attachment-upload-new-revision-input");
|
this.$uploadNewRevisionInput = this.$widget.find(".attachment-upload-new-revision-input");
|
||||||
this.$uploadNewRevisionInput.on('change', async () => {
|
this.$uploadNewRevisionInput.on('change', async () => {
|
||||||
|
@ -66,7 +66,7 @@ export default class BookmarkFolderWidget extends RightDropdownButtonWidget {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.$parentNote.append(
|
this.$parentNote.append(
|
||||||
(await linkService.createNoteLink(this.note.noteId, linkOptions))
|
(await linkService.createLink(this.note.noteId, linkOptions))
|
||||||
.addClass("note-link")
|
.addClass("note-link")
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ export default class BookmarkFolderWidget extends RightDropdownButtonWidget {
|
|||||||
this.$childrenNotes.append(
|
this.$childrenNotes.append(
|
||||||
$("<li>")
|
$("<li>")
|
||||||
.append(
|
.append(
|
||||||
(await linkService.createNoteLink(childNote.noteId, linkOptions))
|
(await linkService.createLink(childNote.noteId, linkOptions))
|
||||||
.addClass("note-link")
|
.addClass("note-link")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -120,7 +120,7 @@ export default class DeleteNotesDialog extends BasicWidget {
|
|||||||
for (const note of await froca.getNotes(response.noteIdsToBeDeleted)) {
|
for (const note of await froca.getNotes(response.noteIdsToBeDeleted)) {
|
||||||
this.$deleteNotesList.append(
|
this.$deleteNotesList.append(
|
||||||
$("<li>").append(
|
$("<li>").append(
|
||||||
await linkService.createNoteLink(note.noteId, {showNotePath: true})
|
await linkService.createLink(note.noteId, {showNotePath: true})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -136,9 +136,9 @@ export default class DeleteNotesDialog extends BasicWidget {
|
|||||||
this.$brokenRelationsList.append(
|
this.$brokenRelationsList.append(
|
||||||
$("<li>")
|
$("<li>")
|
||||||
.append(`Note `)
|
.append(`Note `)
|
||||||
.append(await linkService.createNoteLink(attr.value))
|
.append(await linkService.createLink(attr.value))
|
||||||
.append(` (to be deleted) is referenced by relation <code>${attr.name}</code> originating from `)
|
.append(` (to be deleted) is referenced by relation <code>${attr.name}</code> originating from `)
|
||||||
.append(await linkService.createNoteLink(attr.noteId))
|
.append(await linkService.createLink(attr.noteId))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ export default class RecentChangesDialog extends BasicWidget {
|
|||||||
const notePath = note.getBestNotePathString();
|
const notePath = note.getBestNotePathString();
|
||||||
|
|
||||||
if (notePath) {
|
if (notePath) {
|
||||||
$noteLink = await linkService.createNoteLink(notePath, {
|
$noteLink = await linkService.createLink(notePath, {
|
||||||
title: change.title,
|
title: change.title,
|
||||||
showNotePath: true
|
showNotePath: true
|
||||||
});
|
});
|
||||||
|
@ -131,7 +131,7 @@ export default class BacklinksWidget extends NoteContextAwareWidget {
|
|||||||
for (const backlink of backlinks) {
|
for (const backlink of backlinks) {
|
||||||
const $item = $("<div>");
|
const $item = $("<div>");
|
||||||
|
|
||||||
$item.append(await linkService.createNoteLink(backlink.noteId, {
|
$item.append(await linkService.createLink(backlink.noteId, {
|
||||||
showNoteIcon: true,
|
showNoteIcon: true,
|
||||||
showNotePath: true,
|
showNotePath: true,
|
||||||
showTooltip: false
|
showTooltip: false
|
||||||
|
@ -396,11 +396,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
if (notes.length === 1) {
|
if (notes.length === 1) {
|
||||||
linkService.createNoteLink(notes[0].noteId, {referenceLink: true})
|
linkService.createLink(notes[0].noteId, {referenceLink: true})
|
||||||
.then($link => data.dataTransfer.setData("text/html", $link[0].outerHTML));
|
.then($link => data.dataTransfer.setData("text/html", $link[0].outerHTML));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Promise.all(notes.map(note => linkService.createNoteLink(note.noteId, {referenceLink: true}))).then(links => {
|
Promise.all(notes.map(note => linkService.createLink(note.noteId, {referenceLink: true}))).then(links => {
|
||||||
const $list = $("<ul>").append(...links.map($link => $("<li>").append($link)));
|
const $list = $("<ul>").append(...links.map($link => $("<li>").append($link)));
|
||||||
|
|
||||||
data.dataTransfer.setData("text/html", $list[0].outerHTML);
|
data.dataTransfer.setData("text/html", $list[0].outerHTML);
|
||||||
|
@ -121,7 +121,7 @@ export default class QuickSearchWidget extends BasicWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const note of await froca.getNotes(displayedNoteIds)) {
|
for (const note of await froca.getNotes(displayedNoteIds)) {
|
||||||
const $link = await linkService.createNoteLink(note.noteId, {showNotePath: true});
|
const $link = await linkService.createLink(note.noteId, {showNotePath: true});
|
||||||
$link.addClass('dropdown-item');
|
$link.addClass('dropdown-item');
|
||||||
$link.attr("tabIndex", "0");
|
$link.attr("tabIndex", "0");
|
||||||
$link.on('click', e => {
|
$link.on('click', e => {
|
||||||
|
@ -78,7 +78,7 @@ export default class EditedNotesWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$item.append(editedNote.notePath
|
$item.append(editedNote.notePath
|
||||||
? await linkService.createNoteLink(editedNote.notePath.join("/"), {showNotePath: true})
|
? await linkService.createLink(editedNote.notePath.join("/"), {showNotePath: true})
|
||||||
: $("<span>").text(editedNote.title));
|
: $("<span>").text(editedNote.title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
|||||||
async getRenderedPath(notePath, notePathRecord = null) {
|
async getRenderedPath(notePath, notePathRecord = null) {
|
||||||
const title = await treeService.getNotePathTitle(notePath);
|
const title = await treeService.getNotePathTitle(notePath);
|
||||||
|
|
||||||
const $noteLink = await linkService.createNoteLink(notePath, {title});
|
const $noteLink = await linkService.createLink(notePath, {title});
|
||||||
|
|
||||||
$noteLink
|
$noteLink
|
||||||
.find('a')
|
.find('a')
|
||||||
|
@ -85,7 +85,7 @@ export default class SimilarNotesWidget extends NoteContextAwareWidget {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const $item = (await linkService.createNoteLink(similarNote.notePath.join("/")))
|
const $item = (await linkService.createLink(similarNote.notePath.join("/")))
|
||||||
.css("font-size", 24 * (1 - 1 / (1 + similarNote.score)));
|
.css("font-size", 24 * (1 - 1 / (1 + similarNote.score)));
|
||||||
|
|
||||||
$list.append($item);
|
$list.append($item);
|
||||||
|
@ -77,7 +77,7 @@ export default class AbstractTextTypeWidget extends TypeWidget {
|
|||||||
if (note) {
|
if (note) {
|
||||||
const $wrapper = $('<div class="include-note-wrapper">');
|
const $wrapper = $('<div class="include-note-wrapper">');
|
||||||
|
|
||||||
const $link = await linkService.createNoteLink(note.noteId, {
|
const $link = await linkService.createLink(note.noteId, {
|
||||||
showTooltip: false
|
showTooltip: false
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -97,8 +97,48 @@ export default class AbstractTextTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadReferenceLinkTitle(noteId, $el) {
|
async loadReferenceLinkTitle($el) {
|
||||||
await linkService.loadReferenceLinkTitle(noteId, $el);
|
await linkService.loadReferenceLinkTitle($el);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getReferenceLinkTitle(href) {
|
||||||
|
const {noteId, viewScope} = linkService.parseNavigationStateFromUrl(href);
|
||||||
|
if (!noteId) {
|
||||||
|
return "[missing note]";
|
||||||
|
}
|
||||||
|
|
||||||
|
const note = await froca.getNote(noteId);
|
||||||
|
if (!note) {
|
||||||
|
return "[missing note]";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewScope?.viewMode === 'attachments' && viewScope?.attachmentId) {
|
||||||
|
const attachment = await note.getAttachmentById(viewScope.attachmentId);
|
||||||
|
|
||||||
|
return attachment ? attachment.title : "[missing attachment]";
|
||||||
|
} else {
|
||||||
|
return note.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getReferenceLinkTitleSync(href) {
|
||||||
|
const {noteId, viewScope} = linkService.parseNavigationStateFromUrl(href);
|
||||||
|
if (!noteId) {
|
||||||
|
return "[missing note]";
|
||||||
|
}
|
||||||
|
|
||||||
|
const note = froca.getNoteFromCache(noteId);
|
||||||
|
if (!note) {
|
||||||
|
return "[missing note]";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewScope?.viewMode === 'attachments' && viewScope?.attachmentId) {
|
||||||
|
const attachment = note.attachments[viewScope.attachmentId];
|
||||||
|
|
||||||
|
return attachment ? attachment.title : "[missing attachment]";
|
||||||
|
} else {
|
||||||
|
return note.title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshIncludedNote($container, noteId) {
|
refreshIncludedNote($container, noteId) {
|
||||||
|
@ -47,9 +47,9 @@ export default class AttachmentDetailTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
this.$linksWrapper.append(
|
this.$linksWrapper.append(
|
||||||
"Owning note: ",
|
"Owning note: ",
|
||||||
await linkService.createNoteLink(this.noteId),
|
await linkService.createLink(this.noteId),
|
||||||
", you can also open the ",
|
", you can also open the ",
|
||||||
await linkService.createNoteLink(this.noteId, {
|
await linkService.createLink(this.noteId, {
|
||||||
title: 'List of all attachments',
|
title: 'List of all attachments',
|
||||||
viewScope: {
|
viewScope: {
|
||||||
viewMode: 'attachments'
|
viewMode: 'attachments'
|
||||||
|
@ -40,7 +40,7 @@ export default class AttachmentListTypeWidget extends TypeWidget {
|
|||||||
this.$linksWrapper.append(
|
this.$linksWrapper.append(
|
||||||
$('<div>').append(
|
$('<div>').append(
|
||||||
"Owning note: ",
|
"Owning note: ",
|
||||||
await linkService.createNoteLink(this.noteId),
|
await linkService.createLink(this.noteId),
|
||||||
),
|
),
|
||||||
$('<button class="btn btn-xs">')
|
$('<button class="btn btn-xs">')
|
||||||
.text("Upload attachments")
|
.text("Upload attachments")
|
||||||
|
@ -97,10 +97,7 @@ export default class ReadOnlyTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
this.$content.html(blob.content);
|
this.$content.html(blob.content);
|
||||||
|
|
||||||
this.$content.find("a.reference-link").each(async (_, el) => {
|
this.$content.find("a.reference-link").each(async (_, el) => {
|
||||||
const notePath = $(el).attr('href');
|
this.loadReferenceLinkTitle($(el));
|
||||||
const noteId = treeService.getNoteIdFromNotePath(notePath);
|
|
||||||
|
|
||||||
this.loadReferenceLinkTitle(noteId, $(el));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$content.find("section").each(async (_, el) => {
|
this.$content.find("section").each(async (_, el) => {
|
||||||
|
@ -469,7 +469,7 @@ export default class RelationMapTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createNoteBox(noteId, title, x, y) {
|
async createNoteBox(noteId, title, x, y) {
|
||||||
const $link = await linkService.createNoteLink(noteId, {title});
|
const $link = await linkService.createLink(noteId, {title});
|
||||||
$link.mousedown(e => linkService.goToLink(e));
|
$link.mousedown(e => linkService.goToLink(e));
|
||||||
|
|
||||||
const note = await froca.getNote(noteId);
|
const note = await froca.getNote(noteId);
|
||||||
|
@ -19,6 +19,14 @@ function getAttachment(req) {
|
|||||||
return becca.getAttachmentOrThrow(attachmentId, {includeContentLength: true});
|
return becca.getAttachmentOrThrow(attachmentId, {includeContentLength: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAllAttachments(req) {
|
||||||
|
const {attachmentId} = req.params;
|
||||||
|
// one particular attachment is requested, but return all note's attachments
|
||||||
|
|
||||||
|
const attachment = becca.getAttachmentOrThrow(attachmentId);
|
||||||
|
return attachment.getNote()?.getAttachments({includeContentLength: true}) || [];
|
||||||
|
}
|
||||||
|
|
||||||
function saveAttachment(req) {
|
function saveAttachment(req) {
|
||||||
const {noteId} = req.params;
|
const {noteId} = req.params;
|
||||||
const {attachmentId, role, mime, title, content} = req.body;
|
const {attachmentId, role, mime, title, content} = req.body;
|
||||||
@ -48,6 +56,7 @@ module.exports = {
|
|||||||
getAttachmentBlob,
|
getAttachmentBlob,
|
||||||
getAttachments,
|
getAttachments,
|
||||||
getAttachment,
|
getAttachment,
|
||||||
|
getAllAttachments,
|
||||||
saveAttachment,
|
saveAttachment,
|
||||||
deleteAttachment,
|
deleteAttachment,
|
||||||
convertAttachmentToNote
|
convertAttachmentToNote
|
||||||
|
@ -153,6 +153,7 @@ function register(app) {
|
|||||||
apiRoute(GET, '/api/notes/:noteId/attachments', attachmentsApiRoute.getAttachments);
|
apiRoute(GET, '/api/notes/:noteId/attachments', attachmentsApiRoute.getAttachments);
|
||||||
apiRoute(PST, '/api/notes/:noteId/attachments', attachmentsApiRoute.saveAttachment);
|
apiRoute(PST, '/api/notes/:noteId/attachments', attachmentsApiRoute.saveAttachment);
|
||||||
apiRoute(GET, '/api/attachments/:attachmentId', attachmentsApiRoute.getAttachment);
|
apiRoute(GET, '/api/attachments/:attachmentId', attachmentsApiRoute.getAttachment);
|
||||||
|
apiRoute(GET, '/api/attachments/:attachmentId/all', attachmentsApiRoute.getAllAttachments);
|
||||||
apiRoute(PST, '/api/attachments/:attachmentId/convert-to-note', attachmentsApiRoute.convertAttachmentToNote);
|
apiRoute(PST, '/api/attachments/:attachmentId/convert-to-note', attachmentsApiRoute.convertAttachmentToNote);
|
||||||
apiRoute(DEL, '/api/attachments/:attachmentId', attachmentsApiRoute.deleteAttachment);
|
apiRoute(DEL, '/api/attachments/:attachmentId', attachmentsApiRoute.deleteAttachment);
|
||||||
apiRoute(GET, '/api/attachments/:attachmentId/blob', attachmentsApiRoute.getAttachmentBlob);
|
apiRoute(GET, '/api/attachments/:attachmentId/blob', attachmentsApiRoute.getAttachmentBlob);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user