mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	launchbar WIP
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/public/app/doc_notes/launchbar_intro.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/public/app/doc_notes/launchbar_intro.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
<p>Welcome to the Launchbar configuration.</p>
 | 
			
		||||
 | 
			
		||||
<p>You can do the following things here:</p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
    <li>Move available shortcuts to the visible list (thus putting them into the launchbar) by dragging them</li>
 | 
			
		||||
    <li>Move visible shortcuts to the available list (thus hiding them from the launchbar) by dragging them</li>
 | 
			
		||||
    <li>You can reorder the items in the lists by dragging</li>
 | 
			
		||||
    <li>You can create new shortcuts by right-clicking on the "Visible shortcuts" folder</li>
 | 
			
		||||
    <li>If you want to get back to the default setup, just delete the "Visible shortcuts" and "Available shortcuts", the default configuration will be re-created.</li>
 | 
			
		||||
</ul>
 | 
			
		||||
@@ -20,14 +20,12 @@ import ImagePropertiesWidget from "../widgets/ribbon_widgets/image_properties.js
 | 
			
		||||
import NotePropertiesWidget from "../widgets/ribbon_widgets/note_properties.js";
 | 
			
		||||
import NoteIconWidget from "../widgets/note_icon.js";
 | 
			
		||||
import SearchResultWidget from "../widgets/search_result.js";
 | 
			
		||||
import SyncStatusWidget from "../widgets/sync_status.js";
 | 
			
		||||
import ScrollingContainer from "../widgets/containers/scrolling_container.js";
 | 
			
		||||
import RootContainer from "../widgets/containers/root_container.js";
 | 
			
		||||
import NoteUpdateStatusWidget from "../widgets/note_update_status.js";
 | 
			
		||||
import SpacerWidget from "../widgets/spacer.js";
 | 
			
		||||
import QuickSearchWidget from "../widgets/quick_search.js";
 | 
			
		||||
import ButtonWidget from "../widgets/buttons/button_widget.js";
 | 
			
		||||
import ProtectedSessionStatusWidget from "../widgets/buttons/protected_session_status.js";
 | 
			
		||||
import SplitNoteContainer from "../widgets/containers/split_note_container.js";
 | 
			
		||||
import LeftPaneToggleWidget from "../widgets/buttons/left_pane_toggle.js";
 | 
			
		||||
import CreatePaneButton from "../widgets/buttons/create_pane_button.js";
 | 
			
		||||
@@ -40,11 +38,8 @@ import NotePathsWidget from "../widgets/ribbon_widgets/note_paths.js";
 | 
			
		||||
import SimilarNotesWidget from "../widgets/ribbon_widgets/similar_notes.js";
 | 
			
		||||
import RightPaneContainer from "../widgets/containers/right_pane_container.js";
 | 
			
		||||
import EditButton from "../widgets/buttons/edit_button.js";
 | 
			
		||||
import CalendarWidget from "../widgets/buttons/calendar.js";
 | 
			
		||||
import EditedNotesWidget from "../widgets/ribbon_widgets/edited_notes.js";
 | 
			
		||||
import OpenNoteButtonWidget from "../widgets/buttons/open_note_button_widget.js";
 | 
			
		||||
import MermaidWidget from "../widgets/mermaid.js";
 | 
			
		||||
import BookmarkButtons from "../widgets/bookmark_buttons.js";
 | 
			
		||||
import NoteWrapperWidget from "../widgets/note_wrapper.js";
 | 
			
		||||
import BacklinksWidget from "../widgets/floating_buttons/zpetne_odkazy.js";
 | 
			
		||||
import SharedInfoWidget from "../widgets/shared_info.js";
 | 
			
		||||
@@ -79,6 +74,7 @@ import FloatingButtons from "../widgets/floating_buttons/floating_buttons.js";
 | 
			
		||||
import RelationMapButtons from "../widgets/floating_buttons/relation_map_buttons.js";
 | 
			
		||||
import MermaidExportButton from "../widgets/floating_buttons/mermaid_export_button.js";
 | 
			
		||||
import ShortcutContainer from "../widgets/containers/shortcut_container.js";
 | 
			
		||||
import NoteRevisionsButton from "../widgets/buttons/note_revisions_button.js";
 | 
			
		||||
 | 
			
		||||
export default class DesktopLayout {
 | 
			
		||||
    constructor(customWidgets) {
 | 
			
		||||
@@ -95,33 +91,6 @@ export default class DesktopLayout {
 | 
			
		||||
                .css("width", "53px")
 | 
			
		||||
                .child(new GlobalMenuWidget())
 | 
			
		||||
                .child(new ShortcutContainer())
 | 
			
		||||
                // .child(new ButtonWidget()
 | 
			
		||||
                //     .icon("bx-file-blank")
 | 
			
		||||
                //     .title("New note")
 | 
			
		||||
                //     .command("createNoteIntoInbox"))
 | 
			
		||||
                // .child(new ButtonWidget()
 | 
			
		||||
                //     .icon("bx-search")
 | 
			
		||||
                //     .title("Search")
 | 
			
		||||
                //     .command("searchNotes"))
 | 
			
		||||
                // .child(new ButtonWidget()
 | 
			
		||||
                //     .icon("bx-send")
 | 
			
		||||
                //     .title("Jump to note")
 | 
			
		||||
                //     .command("jumpToNote"))
 | 
			
		||||
                // .child(new OpenNoteButtonWidget()
 | 
			
		||||
                //     .targetNote('globalnotemap'))
 | 
			
		||||
                // .child(new ButtonWidget()
 | 
			
		||||
                //     .icon("bx-history")
 | 
			
		||||
                //     .title("Show recent changes")
 | 
			
		||||
                //     .command("showRecentChanges"))
 | 
			
		||||
                // .child(new CalendarWidget())
 | 
			
		||||
                // .child(new SpacerWidget(40, 0))
 | 
			
		||||
                // .child(new FlexContainer("column")
 | 
			
		||||
                //     .id("plugin-buttons")
 | 
			
		||||
                //     .contentSized())
 | 
			
		||||
                // .child(new BookmarkButtons())
 | 
			
		||||
                // .child(new SpacerWidget(0, 1000))
 | 
			
		||||
                // .child(new ProtectedSessionStatusWidget())
 | 
			
		||||
                // .child(new SyncStatusWidget())
 | 
			
		||||
                .child(new LeftPaneToggleWidget())
 | 
			
		||||
            )
 | 
			
		||||
            .child(new LeftPaneContainer()
 | 
			
		||||
@@ -145,63 +114,59 @@ export default class DesktopLayout {
 | 
			
		||||
                        .collapsible()
 | 
			
		||||
                        .id('center-pane')
 | 
			
		||||
                        .child(new SplitNoteContainer(() =>
 | 
			
		||||
                            new NoteWrapperWidget()
 | 
			
		||||
                                .child(new FlexContainer('row').class('title-row')
 | 
			
		||||
                                    .css("height", "50px")
 | 
			
		||||
                                    .css('align-items', "center")
 | 
			
		||||
                                    .cssBlock('.title-row > * { margin: 5px; }')
 | 
			
		||||
                                    .child(new NoteIconWidget())
 | 
			
		||||
                                    .child(new NoteTitleWidget())
 | 
			
		||||
                                    .child(new SpacerWidget(0, 1))
 | 
			
		||||
                                    .child(new ClosePaneButton())
 | 
			
		||||
                                    .child(new CreatePaneButton())
 | 
			
		||||
                                )
 | 
			
		||||
                                .child(
 | 
			
		||||
                                    new RibbonContainer()
 | 
			
		||||
                                        .ribbon(new SearchDefinitionWidget())
 | 
			
		||||
                                        .ribbon(new EditedNotesWidget())
 | 
			
		||||
                                        .ribbon(new BookPropertiesWidget())
 | 
			
		||||
                                        .ribbon(new NotePropertiesWidget())
 | 
			
		||||
                                        .ribbon(new FilePropertiesWidget())
 | 
			
		||||
                                        .ribbon(new ImagePropertiesWidget())
 | 
			
		||||
                                        .ribbon(new PromotedAttributesWidget())
 | 
			
		||||
                                        .ribbon(new BasicPropertiesWidget())
 | 
			
		||||
                                        .ribbon(new OwnedAttributeListWidget())
 | 
			
		||||
                                        .ribbon(new InheritedAttributesWidget())
 | 
			
		||||
                                        .ribbon(new NotePathsWidget())
 | 
			
		||||
                                        .ribbon(new NoteMapRibbonWidget())
 | 
			
		||||
                                        .ribbon(new SimilarNotesWidget())
 | 
			
		||||
                                        .ribbon(new NoteInfoWidget())
 | 
			
		||||
                                        .button(new EditButton())
 | 
			
		||||
                                        .button(new ButtonWidget()
 | 
			
		||||
                                            .icon('bx-history')
 | 
			
		||||
                                            .title("Note Revisions")
 | 
			
		||||
                                            .command("showNoteRevisions")
 | 
			
		||||
                                            .titlePlacement("bottom"))
 | 
			
		||||
                                        .button(new NoteActionsWidget())
 | 
			
		||||
                                )
 | 
			
		||||
                                .child(new SharedInfoWidget())
 | 
			
		||||
                                .child(new NoteUpdateStatusWidget())
 | 
			
		||||
                                .child(new FloatingButtons()
 | 
			
		||||
                                    .child(new RelationMapButtons())
 | 
			
		||||
                                    .child(new MermaidExportButton())
 | 
			
		||||
                                    .child(new BacklinksWidget())
 | 
			
		||||
                                )
 | 
			
		||||
                                .child(new MermaidWidget())
 | 
			
		||||
                                .child(
 | 
			
		||||
                                    new ScrollingContainer()
 | 
			
		||||
                                        .filling()
 | 
			
		||||
                                        .child(new SqlTableSchemasWidget())
 | 
			
		||||
                                        .child(new NoteDetailWidget())
 | 
			
		||||
                                        .child(new NoteListWidget())
 | 
			
		||||
                                        .child(new SearchResultWidget())
 | 
			
		||||
                                        .child(new SqlResultWidget())
 | 
			
		||||
                                )
 | 
			
		||||
                                .child(new FindWidget())
 | 
			
		||||
                                .child(
 | 
			
		||||
                                    ...this.customWidgets.get('node-detail-pane'), // typo, let's keep it for a while as BC
 | 
			
		||||
                                    ...this.customWidgets.get('note-detail-pane')
 | 
			
		||||
                                )
 | 
			
		||||
                                new NoteWrapperWidget()
 | 
			
		||||
                                    .child(new FlexContainer('row').class('title-row')
 | 
			
		||||
                                        .css("height", "50px")
 | 
			
		||||
                                        .css('align-items', "center")
 | 
			
		||||
                                        .cssBlock('.title-row > * { margin: 5px; }')
 | 
			
		||||
                                        .child(new NoteIconWidget())
 | 
			
		||||
                                        .child(new NoteTitleWidget())
 | 
			
		||||
                                        .child(new SpacerWidget(0, 1))
 | 
			
		||||
                                        .child(new ClosePaneButton())
 | 
			
		||||
                                        .child(new CreatePaneButton())
 | 
			
		||||
                                    )
 | 
			
		||||
                                    .child(
 | 
			
		||||
                                        new RibbonContainer()
 | 
			
		||||
                                            .ribbon(new SearchDefinitionWidget())
 | 
			
		||||
                                            .ribbon(new EditedNotesWidget())
 | 
			
		||||
                                            .ribbon(new BookPropertiesWidget())
 | 
			
		||||
                                            .ribbon(new NotePropertiesWidget())
 | 
			
		||||
                                            .ribbon(new FilePropertiesWidget())
 | 
			
		||||
                                            .ribbon(new ImagePropertiesWidget())
 | 
			
		||||
                                            .ribbon(new PromotedAttributesWidget())
 | 
			
		||||
                                            .ribbon(new BasicPropertiesWidget())
 | 
			
		||||
                                            .ribbon(new OwnedAttributeListWidget())
 | 
			
		||||
                                            .ribbon(new InheritedAttributesWidget())
 | 
			
		||||
                                            .ribbon(new NotePathsWidget())
 | 
			
		||||
                                            .ribbon(new NoteMapRibbonWidget())
 | 
			
		||||
                                            .ribbon(new SimilarNotesWidget())
 | 
			
		||||
                                            .ribbon(new NoteInfoWidget())
 | 
			
		||||
                                            .button(new EditButton())
 | 
			
		||||
                                            .button(new NoteRevisionsButton())
 | 
			
		||||
                                            .button(new NoteActionsWidget())
 | 
			
		||||
                                    )
 | 
			
		||||
                                    .child(new SharedInfoWidget())
 | 
			
		||||
                                    .child(new NoteUpdateStatusWidget())
 | 
			
		||||
                                    .child(new FloatingButtons()
 | 
			
		||||
                                        .child(new RelationMapButtons())
 | 
			
		||||
                                        .child(new MermaidExportButton())
 | 
			
		||||
                                        .child(new BacklinksWidget())
 | 
			
		||||
                                    )
 | 
			
		||||
                                    .child(new MermaidWidget())
 | 
			
		||||
                                    .child(
 | 
			
		||||
                                        new ScrollingContainer()
 | 
			
		||||
                                            .filling()
 | 
			
		||||
                                            .child(new SqlTableSchemasWidget())
 | 
			
		||||
                                            .child(new NoteDetailWidget())
 | 
			
		||||
                                            .child(new NoteListWidget())
 | 
			
		||||
                                            .child(new SearchResultWidget())
 | 
			
		||||
                                            .child(new SqlResultWidget())
 | 
			
		||||
                                    )
 | 
			
		||||
                                    .child(new FindWidget())
 | 
			
		||||
                                    .child(
 | 
			
		||||
                                        ...this.customWidgets.get('node-detail-pane'), // typo, let's keep it for a while as BC
 | 
			
		||||
                                        ...this.customWidgets.get('note-detail-pane')
 | 
			
		||||
                                    )
 | 
			
		||||
                            )
 | 
			
		||||
                        )
 | 
			
		||||
                        .child(...this.customWidgets.get('center-pane'))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								src/public/app/widgets/buttons/note_revisions_button.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/public/app/widgets/buttons/note_revisions_button.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
import ButtonWidget from "./button_widget.js";
 | 
			
		||||
 | 
			
		||||
export default class NoteRevisionsButton extends ButtonWidget {
 | 
			
		||||
    constructor() {
 | 
			
		||||
        super();
 | 
			
		||||
 | 
			
		||||
        this.icon('bx-history')
 | 
			
		||||
            .title("Note Revisions")
 | 
			
		||||
            .command("showNoteRevisions")
 | 
			
		||||
            .titlePlacement("bottom");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    isEnabled() {
 | 
			
		||||
        return super.isEnabled() && this.note?.type !== 'shortcut';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,13 +1,32 @@
 | 
			
		||||
import TypeWidget from "./type_widget.js";
 | 
			
		||||
 | 
			
		||||
const TPL = `<div class="note-detail-doc note-detail-printable">Z</div>`;
 | 
			
		||||
const TPL = `<div class="note-detail-doc note-detail-printable">
 | 
			
		||||
    <style>
 | 
			
		||||
        .note-detail-doc-content {
 | 
			
		||||
            padding: 15px;
 | 
			
		||||
        }
 | 
			
		||||
    </style>
 | 
			
		||||
    
 | 
			
		||||
    <div class="note-detail-doc-content"></div>
 | 
			
		||||
</div>`;
 | 
			
		||||
 | 
			
		||||
export default class DocTypeWidget extends TypeWidget {
 | 
			
		||||
    static getType() { return "doc"; }
 | 
			
		||||
 | 
			
		||||
    doRender() {
 | 
			
		||||
        this.$widget = $(TPL);
 | 
			
		||||
        this.$content = this.$widget.find('.note-detail-doc-content');
 | 
			
		||||
 | 
			
		||||
        super.doRender();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async doRefresh(note) {
 | 
			
		||||
        const docName = note.getLabelValue('docName');
 | 
			
		||||
 | 
			
		||||
        if (docName) {
 | 
			
		||||
            this.$content.load(`app/doc_notes/${docName}.html`);
 | 
			
		||||
        } else {
 | 
			
		||||
            this.$content.empty();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -250,6 +250,7 @@ function getLaunchBarRoot() {
 | 
			
		||||
        }).note;
 | 
			
		||||
 | 
			
		||||
        note.addLabel("iconClass", "bx bx-sidebar");
 | 
			
		||||
        note.addLabel("docName", "launchbar_intro");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return note;
 | 
			
		||||
@@ -269,6 +270,7 @@ function getLaunchBarAvailableShortcutsRoot() {
 | 
			
		||||
        }).note;
 | 
			
		||||
 | 
			
		||||
        note.addLabel("iconClass", "bx bx-hide");
 | 
			
		||||
        note.addLabel("docName", "launchbar_intro");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const branch = becca.getBranch('lb_availableshortcuts');
 | 
			
		||||
@@ -294,6 +296,7 @@ function getLaunchBarVisibleShortcutsRoot() {
 | 
			
		||||
        }).note;
 | 
			
		||||
 | 
			
		||||
        note.addLabel("iconClass", "bx bx-show");
 | 
			
		||||
        note.addLabel("docName", "launchbar_intro");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const branch = becca.getBranch('lb_visibleshortcuts');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user