Compare commits

...

18 Commits

Author SHA1 Message Date
SngAbc
271f3c2cfc
Merge a81e8adde78e4d608b40d417fdafd2ca3005bdcc into 732494dfc51286926d86d49a73d3915a4aa22ef9 2025-11-30 02:55:04 +02:00
Adorian Doran
732494dfc5 client/keyboard shortcuts cheatsheet: add an edit button
Some checks are pending
Checks / main (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Dev / Test development (push) Waiting to run
Dev / Build Docker image (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile) (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile.alpine) (push) Blocked by required conditions
/ Check Docker build (Dockerfile) (push) Waiting to run
/ Check Docker build (Dockerfile.alpine) (push) Waiting to run
/ Build Docker images (Dockerfile, ubuntu-24.04-arm, linux/arm64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.alpine, ubuntu-latest, linux/amd64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.legacy, ubuntu-24.04-arm, linux/arm/v7) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.legacy, ubuntu-24.04-arm, linux/arm/v8) (push) Blocked by required conditions
/ Merge manifest lists (push) Blocked by required conditions
playwright / E2E tests on linux-arm64 (push) Waiting to run
playwright / E2E tests on linux-x64 (push) Waiting to run
Deploy website / Build & deploy website (push) Waiting to run
2025-11-30 02:54:51 +02:00
Adorian Doran
b8748b856a client/note menu: use proper style for development-only actions section header 2025-11-30 02:34:09 +02:00
Adorian Doran
cc71f15700 client/quick edit: remove fixed toolbar transparency 2025-11-30 02:17:43 +02:00
Adorian Doran
124ef640b1 client/quick edit: tweak layout 2025-11-30 02:04:40 +02:00
Adorian Doran
f5e3df0cd2 client/quick edit: add placeholder for "open in full editor" custom title bar button 2025-11-30 01:54:28 +02:00
Adorian Doran
c8431181c8 client/dialogs/custom title bar buttons: tweak 2025-11-30 01:52:55 +02:00
Adorian Doran
07fb5ab017 client/dialogs: add support for custom title bar buttons 2025-11-30 01:44:20 +02:00
Adorian Doran
6735b257b4 style/promoted color attributes: fix the layout on narrow width 2025-11-30 01:09:07 +02:00
Adorian Doran
cef242a9ce style/button group: fix the appearance of the active button 2025-11-30 00:55:34 +02:00
Elian Doran
2923d917e5
Translations update from Hosted Weblate (#7891) 2025-11-29 22:58:03 +02:00
Hosted Weblate
9a76a9069c
Update translation files
Updated by "Cleanup translation files" add-on in Weblate.

Translation: Trilium Notes/Client
Translate-URL: https://hosted.weblate.org/projects/trilium/client/
2025-11-29 20:01:42 +01:00
pythaac
8e1d796870
Translated using Weblate (Korean)
Currently translated at 44.7% (68 of 152 strings)

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/ko/
2025-11-29 20:01:38 +01:00
Andreas H.
8b0d4e5c3b
Translated using Weblate (German)
Currently translated at 100.0% (152 of 152 strings)

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/de/
2025-11-29 20:01:37 +01:00
SiriusXT
a81e8adde7 client/pageurl: adjust Info bar order
Some checks failed
Checks / main (push) Has been cancelled
2025-11-14 20:22:51 +08:00
SiriusXT
5aec9229d4 chore: remove unnecessary console.log 2025-11-14 18:16:59 +08:00
SiriusXT
0c954322e4 i18n: remove unused translation note_properties.info 2025-11-14 18:08:20 +08:00
SiriusXT
9580d636cf client/pageurl: migrate note origin to info bar 2025-11-14 17:20:35 +08:00
32 changed files with 130 additions and 78 deletions

View File

@ -30,6 +30,7 @@ import ScrollingContainer from "../widgets/containers/scrolling_container.js";
import ScrollPadding from "../widgets/scroll_padding.js"; import ScrollPadding from "../widgets/scroll_padding.js";
import SearchResult from "../widgets/search_result.jsx"; import SearchResult from "../widgets/search_result.jsx";
import SharedInfo from "../widgets/shared_info.jsx"; import SharedInfo from "../widgets/shared_info.jsx";
import OriginInfo from "../widgets/note_origin.jsx";
import SpacerWidget from "../widgets/spacer.js"; import SpacerWidget from "../widgets/spacer.js";
import SplitNoteContainer from "../widgets/containers/split_note_container.js"; import SplitNoteContainer from "../widgets/containers/split_note_container.js";
import SqlResults from "../widgets/sql_result.js"; import SqlResults from "../widgets/sql_result.js";
@ -139,6 +140,7 @@ export default class DesktopLayout {
.filling() .filling()
.child(new ContentHeader() .child(new ContentHeader()
.child(<ReadOnlyNoteInfoBar />) .child(<ReadOnlyNoteInfoBar />)
.child(<OriginInfo />)
.child(<SharedInfo />) .child(<SharedInfo />)
) )
.child(<PromotedAttributes />) .child(<PromotedAttributes />)

View File

@ -592,11 +592,6 @@ button.btn-sm {
color: var(--left-pane-text-color); color: var(--left-pane-text-color);
} }
.btn.active:not(.btn-primary) {
background-color: var(--button-disabled-background-color) !important;
opacity: 0.4;
}
.ck.ck-block-toolbar-button { .ck.ck-block-toolbar-button {
transform: translateX(7px); transform: translateX(7px);
color: var(--muted-text-color); color: var(--muted-text-color);

View File

@ -41,6 +41,9 @@
--cmd-button-keyboard-shortcut-color: white; --cmd-button-keyboard-shortcut-color: white;
--cmd-button-disabled-opacity: 0.5; --cmd-button-disabled-opacity: 0.5;
--button-group-active-button-background: #ffffff4e;
--button-group-active-button-text-color: white;
--icon-button-color: currentColor; --icon-button-color: currentColor;
--icon-button-hover-background: var(--hover-item-background-color); --icon-button-hover-background: var(--hover-item-background-color);
--icon-button-hover-color: var(--hover-item-text-color); --icon-button-hover-color: var(--hover-item-text-color);

View File

@ -41,6 +41,9 @@
--cmd-button-keyboard-shortcut-color: black; --cmd-button-keyboard-shortcut-color: black;
--cmd-button-disabled-opacity: 0.5; --cmd-button-disabled-opacity: 0.5;
--button-group-active-button-background: #00000026;
--button-group-active-button-text-color: black;
--icon-button-color: currentColor; --icon-button-color: currentColor;
--icon-button-hover-background: var(--hover-item-background-color); --icon-button-hover-background: var(--hover-item-background-color);
--icon-button-hover-color: var(--hover-item-text-color); --icon-button-hover-color: var(--hover-item-text-color);

View File

@ -25,6 +25,7 @@
.modal .modal-header .btn-close, .modal .modal-header .btn-close,
.modal .modal-header .help-button, .modal .modal-header .help-button,
.modal .modal-header .custom-title-bar-button,
#toast-container .toast .toast-header .btn-close { #toast-container .toast .toast-header .btn-close {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -55,15 +56,17 @@
font-family: boxicons; font-family: boxicons;
} }
.modal .modal-header .help-button { .modal .modal-header .help-button,
.modal .modal-header .custom-title-bar-button {
margin-inline-end: 0; margin-inline-end: 0;
font-size: calc(var(--modal-control-button-size) * .75); font-size: calc(var(--modal-control-button-size) * .70);
font-family: unset; font-family: unset;
font-weight: bold; font-weight: bold;
} }
.modal .modal-header .btn-close:hover, .modal .modal-header .btn-close:hover,
.modal .modal-header .help-button:hover, .modal .modal-header .help-button:hover,
.modal .modal-header .custom-title-bar-button:hover,
#toast-container .toast .toast-header .btn-close:hover { #toast-container .toast .toast-header .btn-close:hover {
background: var(--modal-control-button-hover-background); background: var(--modal-control-button-hover-background);
color: var(--modal-control-button-hover-color); color: var(--modal-control-button-hover-color);
@ -71,6 +74,7 @@
.modal .modal-header .btn-close:active, .modal .modal-header .btn-close:active,
.modal .modal-header .help-button:active, .modal .modal-header .help-button:active,
.modal .modal-header .custom-title-bar-button:active,
#toast-container .toast .toast-header .btn-close:active { #toast-container .toast .toast-header .btn-close:active {
transform: scale(.85); transform: scale(.85);
} }

View File

@ -146,6 +146,14 @@ button.btn.btn-success kbd {
outline: 2px solid var(--input-focus-outline-color); outline: 2px solid var(--input-focus-outline-color);
} }
/* Button groups */
/* Active button */
:root .btn-group button.btn.active {
background-color: var(--button-group-active-button-background);
color: var(--button-group-active-button-text-color);
}
/* /*
* Input boxes * Input boxes
*/ */

View File

@ -1448,6 +1448,14 @@ div.promoted-attribute-cell .multiplicity:has(span) span {
justify-content: center; justify-content: center;
} }
div.promoted-attribute-cell.promoted-attribute-label-color {
justify-content: space-between;
}
div.promoted-attribute-cell.promoted-attribute-label-color .input-group {
width: auto;
}
/* /*
* Floating buttons * Floating buttons
*/ */

View File

@ -511,7 +511,7 @@
"title": "الملاحظات المعدلة" "title": "الملاحظات المعدلة"
}, },
"note_properties": { "note_properties": {
"info": "معلومات" "this_note_was_originally_taken_from": ""
}, },
"backend_log": { "backend_log": {
"refresh": "تحديث" "refresh": "تحديث"

View File

@ -840,8 +840,7 @@
"search": "搜索" "search": "搜索"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "笔记来源:", "this_note_was_originally_taken_from": "笔记来源:"
"info": "信息"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "拥有的属性" "owned_attributes": "拥有的属性"
@ -2098,7 +2097,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "当前正在查看一个只读笔记。", "read-only-note": "当前正在查看一个只读笔记。",
"auto-read-only-note": "这条笔记以只读模式显示便于快速加载。", "auto-read-only-note": "这条笔记以只读模式显示便于快速加载。",
"auto-read-only-learn-more": "了解更多",
"edit-note": "编辑笔记" "edit-note": "编辑笔记"
}, },
"note-color": { "note-color": {

View File

@ -837,8 +837,7 @@
"search": "Suchen" "search": "Suchen"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Diese Notiz stammt ursprünglich aus:", "this_note_was_originally_taken_from": "Diese Notiz stammt ursprünglich aus:"
"info": "Info"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Eigene Attribute" "owned_attributes": "Eigene Attribute"
@ -2097,7 +2096,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "Aktuelle Notiz wird im Lese-Modus angezeigt.", "read-only-note": "Aktuelle Notiz wird im Lese-Modus angezeigt.",
"auto-read-only-note": "Diese Notiz wird im Nur-Lesen-Modus angezeigt, um ein schnelleres Laden zu ermöglichen.", "auto-read-only-note": "Diese Notiz wird im Nur-Lesen-Modus angezeigt, um ein schnelleres Laden zu ermöglichen.",
"auto-read-only-learn-more": "Mehr erfahren",
"edit-note": "Notiz bearbeiten" "edit-note": "Notiz bearbeiten"
}, },
"calendar_view": { "calendar_view": {

View File

@ -112,6 +112,7 @@
}, },
"help": { "help": {
"title": "Cheatsheet", "title": "Cheatsheet",
"editShortcuts": "Edit keyboard shortcuts",
"noteNavigation": "Note navigation", "noteNavigation": "Note navigation",
"goUpDown": "go up/down in the list of notes", "goUpDown": "go up/down in the list of notes",
"collapseExpand": "collapse/expand node", "collapseExpand": "collapse/expand node",
@ -840,8 +841,7 @@
"search": "Search" "search": "Search"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "This note was originally taken from:", "this_note_was_originally_taken_from": "This note was originally taken from:"
"info": "Info"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Owned Attributes" "owned_attributes": "Owned Attributes"

View File

@ -840,8 +840,7 @@
"search": "Buscar" "search": "Buscar"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Esta nota fue tomada originalmente de:", "this_note_was_originally_taken_from": "Esta nota fue tomada originalmente de:"
"info": "Información"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Atributos propios" "owned_attributes": "Atributos propios"
@ -2096,7 +2095,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "Actualmente, está viendo una nota de solo lectura.", "read-only-note": "Actualmente, está viendo una nota de solo lectura.",
"auto-read-only-note": "Esta nota se muestra en modo de solo lectura para una carga más rápida.", "auto-read-only-note": "Esta nota se muestra en modo de solo lectura para una carga más rápida.",
"auto-read-only-learn-more": "Para saber más",
"edit-note": "Editar nota" "edit-note": "Editar nota"
}, },
"calendar_view": { "calendar_view": {

View File

@ -834,8 +834,7 @@
"search": "Recherche" "search": "Recherche"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Cette note est initialement extraite de :", "this_note_was_originally_taken_from": "Cette note est initialement extraite de :"
"info": "Infos"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Attributs propres" "owned_attributes": "Attributs propres"

View File

@ -1409,8 +1409,7 @@
"search": "Ricerca" "search": "Ricerca"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Questa nota è stata originariamente tratta da:", "this_note_was_originally_taken_from": "Questa nota è stata originariamente tratta da:"
"info": "Informazioni"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Attributi posseduti" "owned_attributes": "Attributi posseduti"
@ -2092,7 +2091,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "Stai visualizzando una nota di sola lettura.", "read-only-note": "Stai visualizzando una nota di sola lettura.",
"auto-read-only-note": "Questa nota viene visualizzata in modalità di sola lettura per un caricamento più rapido.", "auto-read-only-note": "Questa nota viene visualizzata in modalità di sola lettura per un caricamento più rapido.",
"auto-read-only-learn-more": "Per saperne di più",
"edit-note": "Modifica nota" "edit-note": "Modifica nota"
}, },
"calendar_view": { "calendar_view": {

View File

@ -692,7 +692,6 @@
"outside_hoisted": "このパスはホイストされたノートの外側にあるため、ホイストを解除する必要があります。" "outside_hoisted": "このパスはホイストされたノートの外側にあるため、ホイストを解除する必要があります。"
}, },
"note_properties": { "note_properties": {
"info": "情報",
"this_note_was_originally_taken_from": "このノートは元々以下から引用したものです:" "this_note_was_originally_taken_from": "このノートは元々以下から引用したものです:"
}, },
"similar_notes": { "similar_notes": {
@ -2098,7 +2097,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "現在、読み取り専用のノートを表示しています。", "read-only-note": "現在、読み取り専用のノートを表示しています。",
"auto-read-only-note": "このノートは読み込みを高速化するために読み取り専用モードで表示されています。", "auto-read-only-note": "このノートは読み込みを高速化するために読み取り専用モードで表示されています。",
"auto-read-only-learn-more": "さらに詳しく",
"edit-note": "ノートを編集" "edit-note": "ノートを編集"
}, },
"note-color": { "note-color": {

View File

@ -447,8 +447,7 @@
"search": "Szukaj" "search": "Szukaj"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Ta notatka oryginalnie została wzięta z:", "this_note_was_originally_taken_from": "Ta notatka oryginalnie została wzięta z:"
"info": "Info"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Posiadane atrybuty" "owned_attributes": "Posiadane atrybuty"

View File

@ -809,8 +809,7 @@
"search": "Pesquisar" "search": "Pesquisar"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:", "this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:"
"info": "Informações"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Atributos próprios" "owned_attributes": "Atributos próprios"

View File

@ -1075,8 +1075,7 @@
"outside_hoisted": "Este caminho está fora de uma nota fixada e você teria que desafixar." "outside_hoisted": "Este caminho está fora de uma nota fixada e você teria que desafixar."
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:", "this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:"
"info": "Informações"
}, },
"promoted_attributes": { "promoted_attributes": {
"promoted_attributes": "Atributos Promovidos", "promoted_attributes": "Atributos Promovidos",

View File

@ -910,7 +910,6 @@
"title": "Căile notiței" "title": "Căile notiței"
}, },
"note_properties": { "note_properties": {
"info": "Informații",
"this_note_was_originally_taken_from": "Această notiță a fost preluată original de la:" "this_note_was_originally_taken_from": "Această notiță a fost preluată original de la:"
}, },
"note_type_chooser": { "note_type_chooser": {
@ -2097,7 +2096,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "Vizualizați o notiță în modul doar în citire.", "read-only-note": "Vizualizați o notiță în modul doar în citire.",
"auto-read-only-note": "Această notiță este afișată în modul doar în citire din motive de performanță.", "auto-read-only-note": "Această notiță este afișată în modul doar în citire din motive de performanță.",
"auto-read-only-learn-more": "Mai multe detalii",
"edit-note": "Editează notița" "edit-note": "Editează notița"
}, },
"calendar_view": { "calendar_view": {

View File

@ -1066,7 +1066,6 @@
"archived": "Архивировано" "archived": "Архивировано"
}, },
"note_properties": { "note_properties": {
"info": "Информация",
"this_note_was_originally_taken_from": "Эта заметка была первоначально взята из:" "this_note_was_originally_taken_from": "Эта заметка была первоначально взята из:"
}, },
"promoted_attributes": { "promoted_attributes": {

View File

@ -837,8 +837,7 @@
"search": "搜尋" "search": "搜尋"
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "筆記來源:", "this_note_was_originally_taken_from": "筆記來源:"
"info": "資訊"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "自有屬性" "owned_attributes": "自有屬性"
@ -2098,7 +2097,6 @@
"read-only-info": { "read-only-info": {
"read-only-note": "目前正在檢視唯讀筆記。", "read-only-note": "目前正在檢視唯讀筆記。",
"auto-read-only-note": "此筆記以唯讀模式顯示以加快載入速度。", "auto-read-only-note": "此筆記以唯讀模式顯示以加快載入速度。",
"auto-read-only-learn-more": "了解更多",
"edit-note": "編輯筆記" "edit-note": "編輯筆記"
}, },
"note-color": { "note-color": {

View File

@ -938,8 +938,7 @@
"outside_hoisted": "Цей шлях знаходиться поза межами закріпленої нотатки і вам доведеться відкріпити." "outside_hoisted": "Цей шлях знаходиться поза межами закріпленої нотатки і вам доведеться відкріпити."
}, },
"note_properties": { "note_properties": {
"this_note_was_originally_taken_from": "Цю нотатку було спочатку взято з:", "this_note_was_originally_taken_from": "Цю нотатку було спочатку взято з:"
"info": "Інформація"
}, },
"owned_attribute_list": { "owned_attribute_list": {
"owned_attributes": "Власні Атрибути" "owned_attributes": "Власні Атрибути"

View File

@ -33,8 +33,8 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {
align-items: center; align-items: center;
} }
.modal.popup-editor-dialog .modal-header .title-row > * { .modal.popup-editor-dialog .modal-header .note-title-widget {
margin: 5px; margin-top: 8px;
} }
.modal.popup-editor-dialog .modal-body { .modal.popup-editor-dialog .modal-body {
@ -66,12 +66,17 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {
background-color: transparent; background-color: transparent;
} }
.modal.popup-editor-dialog div.promoted-attributes-container {
margin-block: 0;
}
.modal.popup-editor-dialog .classic-toolbar-widget { .modal.popup-editor-dialog .classic-toolbar-widget {
position: sticky; position: sticky;
margin-inline: 8px;
top: 0; top: 0;
inset-inline-start: 0; inset-inline-start: 0;
inset-inline-end: 0; inset-inline-end: 0;
background: transparent; background: var(--modal-background-color);
z-index: 998; z-index: 998;
align-items: flex-start; align-items: flex-start;
} }

View File

@ -60,6 +60,11 @@ export default function PopupEditor() {
<DialogWrapper> <DialogWrapper>
<Modal <Modal
title={<TitleRow />} title={<TitleRow />}
customTitleBarButtons={[{
iconClassName: "bx-expand-alt",
title: "Switch to full editor",
onClick: () => {/* TO DO */}
}]}
className="popup-editor-dialog" className="popup-editor-dialog"
size="lg" size="lg"
show={shown} show={shown}

View File

@ -1,7 +1,7 @@
import Modal from "../react/Modal.jsx"; import Modal from "../react/Modal.jsx";
import { t } from "../../services/i18n.js"; import { t } from "../../services/i18n.js";
import { ComponentChildren } from "preact"; import { ComponentChildren } from "preact";
import { CommandNames } from "../../components/app_context.js"; import appContext, { CommandNames } from "../../components/app_context.js";
import RawHtml from "../react/RawHtml.jsx"; import RawHtml from "../react/RawHtml.jsx";
import { useEffect, useState } from "preact/hooks"; import { useEffect, useState } from "preact/hooks";
import keyboard_actions from "../../services/keyboard_actions.js"; import keyboard_actions from "../../services/keyboard_actions.js";
@ -14,6 +14,7 @@ export default function HelpDialog() {
return ( return (
<Modal <Modal
title={t("help.title")} className="help-dialog use-tn-links" minWidth="90%" size="lg" scrollable title={t("help.title")} className="help-dialog use-tn-links" minWidth="90%" size="lg" scrollable
customTitleBarButtons={[{title: t("help.editShortcuts"), iconClassName: "bxs-pencil", onClick: editShortcuts}]}
onHidden={() => setShown(false)} onHidden={() => setShown(false)}
show={shown} show={shown}
> >
@ -160,3 +161,7 @@ function Card({ title, children }: { title: string, children: ComponentChildren
</div> </div>
) )
} }
function editShortcuts() {
appContext.tabManager.openContextWithNote("_optionsShortcuts", { activate: true });
}

View File

@ -0,0 +1,43 @@
import { t } from "../services/i18n";
import { useNoteContext, useTriliumEvent, useTriliumOption } from "./react/hooks";
import { useEffect, useState } from "preact/hooks";
import attributes from "../services/attributes";
import InfoBar from "./react/InfoBar";
import RawHtml from "./react/RawHtml";
import FNote from "../entities/fnote";
export default function OriginInfo() {
const { note } = useNoteContext();
const [link, setLink] = useState<string>();
function refresh() {
if (!note) return;
const pageUrl = getPageUrl(note);
if (!pageUrl) {
setLink(undefined);
return;
}
setLink(`<a href="${pageUrl}" class="external tn-link">${pageUrl}</a>`);
}
useEffect(refresh, [note]);
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
if (loadResults.getAttributeRows().find((attr) => attr.type === "label" && attr.name?.toString() === "pageUrl" && attributes.isAffecting(attr, note))) {
refresh();
}
});
return (
<InfoBar className="origin-info-widget" type="subtle" style={{ display: (!link) ? "none" : undefined }}>
{link && (
<RawHtml
html={`${t("note_properties.this_note_was_originally_taken_from")} ${link}`}
/>
)}
</InfoBar>
)
}
function getPageUrl(note: FNote) {
return note.getOwnedLabelValue("pageUrl");
}

View File

@ -1,3 +1,4 @@
import clsx from "clsx";
import { useEffect, useRef, useMemo } from "preact/hooks"; import { useEffect, useRef, useMemo } from "preact/hooks";
import { t } from "../../services/i18n"; import { t } from "../../services/i18n";
import { ComponentChildren } from "preact"; import { ComponentChildren } from "preact";
@ -7,9 +8,16 @@ import { Modal as BootstrapModal } from "bootstrap";
import { memo } from "preact/compat"; import { memo } from "preact/compat";
import { useSyncedRef } from "./hooks"; import { useSyncedRef } from "./hooks";
interface CustomTitleBarButton {
title: string;
iconClassName: string;
onClick: () => void;
}
interface ModalProps { interface ModalProps {
className: string; className: string;
title: string | ComponentChildren; title: string | ComponentChildren;
customTitleBarButtons?: (CustomTitleBarButton | null)[];
size: "xl" | "lg" | "md" | "sm"; size: "xl" | "lg" | "md" | "sm";
children: ComponentChildren; children: ComponentChildren;
/** /**
@ -72,7 +80,7 @@ interface ModalProps {
noFocus?: boolean; noFocus?: boolean;
} }
export default function Modal({ children, className, size, title, header, footer, footerStyle, footerAlignment, onShown, onSubmit, helpPageId, minWidth, maxWidth, zIndex, scrollable, onHidden: onHidden, modalRef: externalModalRef, formRef, bodyStyle, show, stackable, keepInDom, noFocus }: ModalProps) { export default function Modal({ children, className, size, title, customTitleBarButtons: titleBarButtons, header, footer, footerStyle, footerAlignment, onShown, onSubmit, helpPageId, minWidth, maxWidth, zIndex, scrollable, onHidden: onHidden, modalRef: externalModalRef, formRef, bodyStyle, show, stackable, keepInDom, noFocus }: ModalProps) {
const modalRef = useSyncedRef<HTMLDivElement>(externalModalRef); const modalRef = useSyncedRef<HTMLDivElement>(externalModalRef);
const modalInstanceRef = useRef<BootstrapModal>(); const modalInstanceRef = useRef<BootstrapModal>();
const elementToFocus = useRef<Element | null>(); const elementToFocus = useRef<Element | null>();
@ -148,7 +156,17 @@ export default function Modal({ children, className, size, title, header, footer
{helpPageId && ( {helpPageId && (
<button className="help-button" type="button" data-in-app-help={helpPageId} title={t("modal.help_title")}>?</button> <button className="help-button" type="button" data-in-app-help={helpPageId} title={t("modal.help_title")}>?</button>
)} )}
{titleBarButtons?.filter((b) => b !== null).map((titleBarButton) => (
<button type="button"
className={clsx("custom-title-bar-button bx", titleBarButton.iconClassName)}
title={titleBarButton.title}
onClick={titleBarButton.onClick}>
</button>
))}
<button type="button" className="btn-close" data-bs-dismiss="modal" aria-label={t("modal.close")}></button> <button type="button" className="btn-close" data-bs-dismiss="modal" aria-label={t("modal.close")}></button>
</div> </div>
{onSubmit ? ( {onSubmit ? (

View File

@ -1,5 +1,5 @@
import { ConvertToAttachmentResponse } from "@triliumnext/commons"; import { ConvertToAttachmentResponse } from "@triliumnext/commons";
import { FormDropdownDivider, FormListItem } from "../react/FormList"; import { FormDropdownDivider, FormListHeader, FormListItem } from "../react/FormList";
import { isElectron as getIsElectron, isMac as getIsMac } from "../../services/utils"; import { isElectron as getIsElectron, isMac as getIsMac } from "../../services/utils";
import { ParentComponent } from "../react/react_utils"; import { ParentComponent } from "../react/react_utils";
import { t } from "../../services/i18n" import { t } from "../../services/i18n"
@ -113,8 +113,7 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
function DevelopmentActions({ note }: { note: FNote }) { function DevelopmentActions({ note }: { note: FNote }) {
return ( return (
<> <>
<FormDropdownDivider /> <FormListHeader text="Development-only Actions" />
<FormListItem disabled>Development-only Actions</FormListItem>
<FormListItem <FormListItem
icon="bx bx-printer" icon="bx bx-printer"
onClick={() => window.open(`/?print=#root/${note.noteId}`, "_blank")} onClick={() => window.open(`/?print=#root/${note.noteId}`, "_blank")}

View File

@ -1,20 +0,0 @@
import { t } from "../../services/i18n";
import { useNoteLabel } from "../react/hooks";
import { TabContext } from "./ribbon-interface";
/**
* TODO: figure out better name or conceptualize better.
*/
export default function NotePropertiesTab({ note }: TabContext) {
const [ pageUrl ] = useNoteLabel(note, "pageUrl");
return (
<div className="note-properties-widget" style={{ padding: "12px", color: "var(--muted-text-color)" }}>
{ pageUrl && (
<div style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
{t("note_properties.this_note_was_originally_taken_from")} <a href={pageUrl} class="page-url external">{pageUrl}</a>
</div>
)}
</div>
)
}

View File

@ -1,6 +1,5 @@
import ScriptTab from "./ScriptTab"; import ScriptTab from "./ScriptTab";
import EditedNotesTab from "./EditedNotesTab"; import EditedNotesTab from "./EditedNotesTab";
import NotePropertiesTab from "./NotePropertiesTab";
import NoteInfoTab from "./NoteInfoTab"; import NoteInfoTab from "./NoteInfoTab";
import SimilarNotesTab from "./SimilarNotesTab"; import SimilarNotesTab from "./SimilarNotesTab";
import FilePropertiesTab from "./FilePropertiesTab"; import FilePropertiesTab from "./FilePropertiesTab";
@ -59,13 +58,6 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
show: ({ note }) => note?.type === "book" || note?.type === "search", show: ({ note }) => note?.type === "book" || note?.type === "search",
toggleCommand: "toggleRibbonTabBookProperties" toggleCommand: "toggleRibbonTabBookProperties"
}, },
{
title: t("note_properties.info"),
icon: "bx bx-info-square",
content: NotePropertiesTab,
show: ({ note }) => !!note?.getLabelValue("pageUrl"),
activate: true
},
{ {
title: t("file_properties.title"), title: t("file_properties.title"),
icon: "bx bx-file", icon: "bx bx-file",

View File

@ -21,7 +21,7 @@
"note_structure_description": "Notizen lassen sich hierarchisch anordnen. Ordner sind nicht nötig, da jede Notiz Unternotizen enthalten kann. Eine einzelne Notiz kann an mehreren Stellen in der Hierarchie hinzugefügt werden.", "note_structure_description": "Notizen lassen sich hierarchisch anordnen. Ordner sind nicht nötig, da jede Notiz Unternotizen enthalten kann. Eine einzelne Notiz kann an mehreren Stellen in der Hierarchie hinzugefügt werden.",
"hoisting_description": "Trennen Sie Ihre persönlichen und beruflichen Notizen ganz einfach, indem Sie sie in einem Arbeitsbereich gruppieren. Dadurch wird Ihre Notizstruktur so fokussiert, dass nur ein bestimmter Satz von Notizen angezeigt wird.", "hoisting_description": "Trennen Sie Ihre persönlichen und beruflichen Notizen ganz einfach, indem Sie sie in einem Arbeitsbereich gruppieren. Dadurch wird Ihre Notizstruktur so fokussiert, dass nur ein bestimmter Satz von Notizen angezeigt wird.",
"hoisting_title": "Arbeitsbereiche und Fokusansicht", "hoisting_title": "Arbeitsbereiche und Fokusansicht",
"attributes_description": "Nutzen Sie Verbindungen zwischen Notizen oder fügen Sie Labels hinzu, um die Kategorisierung zu erleichtern. Mit hervorgehobenen („promoted“) Attributen können Sie strukturierte Informationen erfassen, die sich direkt in Tabellen und Boards verwenden lassen." "attributes_description": "Verwenden Sie Beziehungen zwischen Notizen oder fügen Sie Beschriftungen hinzu, um die Kategorisierung zu vereinfachen. Verwenden Sie hervorgehobene Attribute, um strukturierte Informationen einzugeben, die in Tabellen und Boards verwendet werden können."
}, },
"productivity_benefits": { "productivity_benefits": {
"revisions_title": "Notizrevisionen", "revisions_title": "Notizrevisionen",

View File

@ -87,6 +87,8 @@
"description_arm64": "ARM 기반 리눅스 배포판에서 aarch64 아키텍처와 호환됩니다." "description_arm64": "ARM 기반 리눅스 배포판에서 aarch64 아키텍처와 호환됩니다."
}, },
"note_types": { "note_types": {
"text_title": "텍스트 노트" "text_title": "텍스트 노트",
"text_description": "노트는 WYSIWYG 편집기를 사용하며 표, 이미지, 수학 표현식, 구문 강조 기능의 코드 블록을 지원합니다. 특수문자를 사용한 마크다운 유사 구문이나 슬래시(/) 명령으로 텍스트 서식을 빠르게 지정할 수 있습니다.",
"code_title": "코드 노트"
} }
} }