mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	sort child notes by ... WIP
This commit is contained in:
		
							parent
							
								
									cb6d35236c
								
							
						
					
					
						commit
						1c59bc4d3c
					
				
							
								
								
									
										8
									
								
								src/public/app/dialogs/sort_child_notes.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/public/app/dialogs/sort_child_notes.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
import server from "../services/server.js";
 | 
			
		||||
import utils from "../services/utils.js";
 | 
			
		||||
 | 
			
		||||
const $dialog = $("#sort-child-notes-dialog");
 | 
			
		||||
 | 
			
		||||
export async function showDialog() {
 | 
			
		||||
    utils.openDialog($dialog);
 | 
			
		||||
}
 | 
			
		||||
@ -75,7 +75,7 @@ class TreeContextMenu {
 | 
			
		||||
                    { title: 'Expand subtree <kbd data-command="expandSubtree"></kbd>', command: "expandSubtree", uiIcon: "expand", enabled: noSelectedNotes },
 | 
			
		||||
                    { title: 'Collapse subtree <kbd data-command="collapseSubtree"></kbd>', command: "collapseSubtree", uiIcon: "collapse", enabled: noSelectedNotes },
 | 
			
		||||
                    { title: "Force note sync", command: "forceNoteSync", uiIcon: "refresh", enabled: noSelectedNotes },
 | 
			
		||||
                    { title: 'Sort alphabetically <kbd data-command="sortChildNotes"></kbd>', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch },
 | 
			
		||||
                    { title: 'Sort by ... <kbd data-command="sortChildNotes"></kbd>', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch },
 | 
			
		||||
                    { title: 'Recent changes in subtree', command: "recentChangesInSubtree", uiIcon: "history", enabled: noSelectedNotes }
 | 
			
		||||
                ] },
 | 
			
		||||
            { title: "----" },
 | 
			
		||||
 | 
			
		||||
@ -1370,7 +1370,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    sortChildNotesCommand({node}) {
 | 
			
		||||
        treeService.sortAlphabetically(node.data.noteId);
 | 
			
		||||
        import("../dialogs/sort_child_notes.js").then(d => d.showDialog(node));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async recentChangesInSubtreeCommand({node}) {
 | 
			
		||||
 | 
			
		||||
@ -39,6 +39,7 @@
 | 
			
		||||
<%- include('dialogs/move_to.ejs') %>
 | 
			
		||||
<%- include('dialogs/backend_log.ejs') %>
 | 
			
		||||
<%- include('dialogs/include_note.ejs') %>
 | 
			
		||||
<%- include('dialogs/sort_child_notes.ejs') %>
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    window.baseApiUrl = 'api/';
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										74
									
								
								src/views/dialogs/sort_child_notes.ejs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								src/views/dialogs/sort_child_notes.ejs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,74 @@
 | 
			
		||||
<div id="sort-child-notes-dialog" class="modal mx-auto" tabindex="-1" role="dialog">
 | 
			
		||||
    <div class="modal-dialog modal-lg" style="max-width: 500px" role="document">
 | 
			
		||||
        <div class="modal-content">
 | 
			
		||||
            <div class="modal-header">
 | 
			
		||||
                <h5 class="modal-title mr-auto">Sort children by ...</h5>
 | 
			
		||||
 | 
			
		||||
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
 | 
			
		||||
                    <span aria-hidden="true">×</span>
 | 
			
		||||
                </button>
 | 
			
		||||
            </div>
 | 
			
		||||
            <form id="move-to-form">
 | 
			
		||||
                <div class="modal-body">
 | 
			
		||||
                    <h5>Sorting criteria</h5>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            title
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            date created
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            date modified
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            note content size
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            note content size including revisions
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    <br/>
 | 
			
		||||
 | 
			
		||||
                    <h5>Sorting direction</h5>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            ascending
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    <div class="form-check">
 | 
			
		||||
                        <input class="form-check-input" type="checkbox" value="" id="defaultCheck2">
 | 
			
		||||
                        <label class="form-check-label" for="defaultCheck2">
 | 
			
		||||
                            descending
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="modal-footer">
 | 
			
		||||
                    <button type="submit" class="btn btn-primary">Sort <kbd>enter</kbd></button>
 | 
			
		||||
                </div>
 | 
			
		||||
            </form>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user