chore(client/ts): port doc

This commit is contained in:
Elian Doran 2025-02-02 12:59:00 +02:00
parent 2fdac9b438
commit 00bb7af5bd
No known key found for this signature in database
2 changed files with 8 additions and 3 deletions

View File

@ -39,6 +39,7 @@ interface CustomGlobals {
maxEntityChangeIdAtLoad: number; maxEntityChangeIdAtLoad: number;
maxEntityChangeSyncIdAtLoad: number; maxEntityChangeSyncIdAtLoad: number;
assetPath: string; assetPath: string;
appPath: string;
instanceName: string; instanceName: string;
appCssNoteIds: string[]; appCssNoteIds: string[];
triliumVersion: string; triliumVersion: string;

View File

@ -1,3 +1,4 @@
import type FNote from "../../entities/fnote.js";
import TypeWidget from "./type_widget.js"; import TypeWidget from "./type_widget.js";
const TPL = `<div class="note-detail-doc note-detail-printable"> const TPL = `<div class="note-detail-doc note-detail-printable">
@ -5,7 +6,7 @@ const TPL = `<div class="note-detail-doc note-detail-printable">
.note-detail-doc-content { .note-detail-doc-content {
padding: 15px; padding: 15px;
} }
.note-detail-doc-content pre { .note-detail-doc-content pre {
background-color: var(--accented-background-color); background-color: var(--accented-background-color);
border: 1px solid var(--main-border-color); border: 1px solid var(--main-border-color);
@ -13,11 +14,14 @@ const TPL = `<div class="note-detail-doc note-detail-printable">
border-radius: 5px; border-radius: 5px;
} }
</style> </style>
<div class="note-detail-doc-content"></div> <div class="note-detail-doc-content"></div>
</div>`; </div>`;
export default class DocTypeWidget extends TypeWidget { export default class DocTypeWidget extends TypeWidget {
private $content!: JQuery<HTMLElement>;
static getType() { static getType() {
return "doc"; return "doc";
} }
@ -29,7 +33,7 @@ export default class DocTypeWidget extends TypeWidget {
super.doRender(); super.doRender();
} }
async doRefresh(note) { async doRefresh(note: FNote) {
const docName = note.getLabelValue("docName"); const docName = note.getLabelValue("docName");
if (docName) { if (docName) {