mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
Merge branch 'master' into next60
# Conflicts: # package-lock.json # package.json
This commit is contained in:
@@ -94,13 +94,13 @@ function undeleteNote(req) {
|
||||
|
||||
function sortChildNotes(req) {
|
||||
const noteId = req.params.noteId;
|
||||
const {sortBy, sortDirection, foldersFirst} = req.body;
|
||||
const {sortBy, sortDirection, foldersFirst, sortNatural, sortLocale} = req.body;
|
||||
|
||||
log.info(`Sorting '${noteId}' children with ${sortBy} ${sortDirection}, foldersFirst=${foldersFirst}`);
|
||||
log.info(`Sorting '${noteId}' children with ${sortBy} ${sortDirection}, foldersFirst=${foldersFirst}, sortNatural=${sortNatural}, sortLocale=${sortLocale}`);
|
||||
|
||||
const reverse = sortDirection === 'desc';
|
||||
|
||||
treeService.sortNotes(noteId, sortBy, reverse, foldersFirst);
|
||||
treeService.sortNotes(noteId, sortBy, reverse, foldersFirst, sortNatural, sortLocale);
|
||||
}
|
||||
|
||||
function protectNote(req) {
|
||||
|
||||
@@ -74,7 +74,7 @@ function getOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
resultMap['isPasswordSet'] = !!optionMap['passwordVerificationHash'] ? 'true' : 'false';
|
||||
resultMap['isPasswordSet'] = optionMap['passwordVerificationHash'] ? 'true' : 'false';
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
29
src/routes/api/other.js
Normal file
29
src/routes/api/other.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const becca = require("../../becca/becca");
|
||||
|
||||
function getIconUsage() {
|
||||
const iconClassToCountMap = {};
|
||||
|
||||
for (const {value: iconClass, noteId} of becca.findAttributes('label', 'iconClass')) {
|
||||
if (noteId.startsWith("_")) {
|
||||
continue; // ignore icons of "system" notes since they were not set by the user
|
||||
}
|
||||
|
||||
if (!iconClass?.trim()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const clazz of iconClass.trim().split(/\s+/)) {
|
||||
if (clazz === 'bx') {
|
||||
continue;
|
||||
}
|
||||
|
||||
iconClassToCountMap[clazz] = (iconClassToCountMap[clazz] || 0) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return { iconClassToCountMap };
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getIconUsage
|
||||
};
|
||||
Reference in New Issue
Block a user