mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
cleaned up experimental attribute pane
This commit is contained in:
parent
0ebc947fbd
commit
ea7257a5b2
@ -16,40 +16,6 @@ import noteAutocompleteService from "./note_autocomplete.js";
|
|||||||
|
|
||||||
const $tabContentsContainer = $("#note-tab-container");
|
const $tabContentsContainer = $("#note-tab-container");
|
||||||
|
|
||||||
const mentionSetup = {
|
|
||||||
feeds: [
|
|
||||||
{
|
|
||||||
marker: '@',
|
|
||||||
feed: queryText => {
|
|
||||||
return new Promise((res, rej) => {
|
|
||||||
noteAutocompleteService.autocompleteSource(queryText, rows => {
|
|
||||||
if (rows.length === 1 && rows[0].title === 'No results') {
|
|
||||||
rows = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const row of rows) {
|
|
||||||
row.text = row.name = row.noteTitle;
|
|
||||||
row.id = '@' + row.text;
|
|
||||||
row.link = '#' + row.path;
|
|
||||||
}
|
|
||||||
|
|
||||||
res(rows);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
itemRenderer: item => {
|
|
||||||
const itemElement = document.createElement('span');
|
|
||||||
|
|
||||||
itemElement.classList.add('mentions-item');
|
|
||||||
itemElement.innerHTML = `${item.highlightedTitle} `;
|
|
||||||
|
|
||||||
return itemElement;
|
|
||||||
},
|
|
||||||
minimumCharacters: 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
const componentClasses = {
|
const componentClasses = {
|
||||||
'empty': "./note_detail_empty.js",
|
'empty': "./note_detail_empty.js",
|
||||||
'text': "./note_detail_text.js",
|
'text': "./note_detail_text.js",
|
||||||
@ -103,7 +69,6 @@ class TabContext {
|
|||||||
this.$noteDetailComponents = this.$tabContent.find(".note-detail-component");
|
this.$noteDetailComponents = this.$tabContent.find(".note-detail-component");
|
||||||
this.$scriptArea = this.$tabContent.find(".note-detail-script-area");
|
this.$scriptArea = this.$tabContent.find(".note-detail-script-area");
|
||||||
this.$savedIndicator = this.$tabContent.find(".saved-indicator");
|
this.$savedIndicator = this.$tabContent.find(".saved-indicator");
|
||||||
this.$attributesEditor = this.$tabContent.find(".note-title-attributes");
|
|
||||||
this.noteChangeDisabled = false;
|
this.noteChangeDisabled = false;
|
||||||
this.isNoteChanged = false;
|
this.isNoteChanged = false;
|
||||||
this.attributes = new Attributes(this);
|
this.attributes = new Attributes(this);
|
||||||
@ -150,16 +115,6 @@ class TabContext {
|
|||||||
this.$unprotectButton.on('click', protectedSessionService.unprotectNoteAndSendToServer);
|
this.$unprotectButton.on('click', protectedSessionService.unprotectNoteAndSendToServer);
|
||||||
|
|
||||||
await this.initComponent();
|
await this.initComponent();
|
||||||
|
|
||||||
await libraryLoader.requireLibrary(libraryLoader.CKEDITOR);
|
|
||||||
|
|
||||||
await BalloonEditor.create(this.$attributesEditor[0], {
|
|
||||||
placeholder: "type attributes here, e.g. @rock @year=2019",
|
|
||||||
mention: mentionSetup,
|
|
||||||
removePlugins: ['Autoformat'],
|
|
||||||
blockToolbar: [],
|
|
||||||
toolbar: []
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async initComponent(disableAutoBook = false) {
|
async initComponent(disableAutoBook = false) {
|
||||||
@ -195,6 +150,10 @@ class TabContext {
|
|||||||
|
|
||||||
this.setCurrentNotePathToHash();
|
this.setCurrentNotePathToHash();
|
||||||
|
|
||||||
|
if (this.sidebar) {
|
||||||
|
this.sidebar.noteLoaded(); // load async
|
||||||
|
}
|
||||||
|
|
||||||
this.noteChangeDisabled = true;
|
this.noteChangeDisabled = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -228,10 +187,6 @@ class TabContext {
|
|||||||
this.noteType.update();
|
this.noteType.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.sidebar) {
|
|
||||||
this.sidebar.noteLoaded(); // load async
|
|
||||||
}
|
|
||||||
|
|
||||||
bundleService.executeRelationBundles(this.note, 'runOnNoteView', this);
|
bundleService.executeRelationBundles(this.note, 'runOnNoteView', this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,6 +410,7 @@ body {
|
|||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
padding-left: 7px;
|
padding-left: 7px;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#right-pane .card {
|
#right-pane .card {
|
||||||
|
@ -68,6 +68,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="note-title-attributes" tabindex="9999"></div>
|
|
||||||
</div>
|
</div>
|
Loading…
x
Reference in New Issue
Block a user