mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-02-05 13:19:51 -06:00
using jam font icon pack instead of feather, fixes #204
This commit is contained in:
@@ -25,7 +25,7 @@ function initNoteAutocomplete($el) {
|
||||
if (!$el.hasClass("aa-input")) {
|
||||
const $showRecentNotesButton = $("<div>").addClass("input-group-append").append(
|
||||
$("<span>")
|
||||
.addClass("input-group-text show-recent-notes-button")
|
||||
.addClass("input-group-text show-recent-notes-button jam jam-clock")
|
||||
.prop("title", "Show recent notes"));
|
||||
|
||||
$el.after($showRecentNotesButton);
|
||||
|
||||
@@ -393,11 +393,24 @@ function initFancyTree(tree) {
|
||||
if (item.title === '----') {
|
||||
$treeContextMenu.append($("<div>").addClass("dropdown-divider"));
|
||||
} else {
|
||||
const $icon = $("<span>");
|
||||
|
||||
if (item.uiIcon) {
|
||||
$icon.addClass("jam jam-" + item.uiIcon);
|
||||
}
|
||||
else {
|
||||
$icon.append(" ");
|
||||
}
|
||||
|
||||
const $item = $("<a>")
|
||||
.append($icon)
|
||||
.append(" ") // some space between icon and text
|
||||
.addClass("dropdown-item")
|
||||
.prop("data-cmd", item.cmd)
|
||||
.append(item.title);
|
||||
|
||||
|
||||
|
||||
if (item.enabled !== undefined && !item.enabled) {
|
||||
$item.addClass("disabled");
|
||||
}
|
||||
|
||||
@@ -22,6 +22,38 @@ async function prepareBranch(note) {
|
||||
}
|
||||
}
|
||||
|
||||
function getIcon(note) {
|
||||
if (note.noteId === 'root') {
|
||||
return "jam jam-chevrons-right";
|
||||
}
|
||||
else if (note.type === 'text') {
|
||||
if (note.hasChildren()) {
|
||||
return "jam jam-folder";
|
||||
}
|
||||
else {
|
||||
return "jam jam-file";
|
||||
}
|
||||
}
|
||||
else if (note.type === 'file') {
|
||||
return "jam jam-attachment"
|
||||
}
|
||||
else if (note.type === 'image') {
|
||||
return "jam jam-picture"
|
||||
}
|
||||
else if (note.type === 'code') {
|
||||
return "jam jam-terminal"
|
||||
}
|
||||
else if (note.type === 'render') {
|
||||
return "jam jam-play"
|
||||
}
|
||||
else if (note.type === 'search') {
|
||||
return "jam jam-search-folder"
|
||||
}
|
||||
else if (note.type === 'relation-map') {
|
||||
return "jam jam-map"
|
||||
}
|
||||
}
|
||||
|
||||
async function prepareNode(branch) {
|
||||
const note = await branch.getNote();
|
||||
const title = (branch.prefix ? (branch.prefix + " - ") : "") + note.title;
|
||||
@@ -33,6 +65,7 @@ async function prepareNode(branch) {
|
||||
isProtected: note.isProtected,
|
||||
title: utils.escapeHtml(title),
|
||||
extraClasses: await getExtraClasses(note),
|
||||
icon: getIcon(note),
|
||||
refKey: note.noteId,
|
||||
expanded: note.type !== 'search' && branch.isExpanded
|
||||
};
|
||||
|
||||
@@ -78,26 +78,26 @@ function cut(nodes) {
|
||||
}
|
||||
|
||||
const contextMenuItems = [
|
||||
{title: "Insert note here <kbd>Ctrl+O</kbd>", cmd: "insertNoteHere", uiIcon: "ui-icon-plus"},
|
||||
{title: "Insert child note <kbd>Ctrl+P</kbd>", cmd: "insertChildNote", uiIcon: "ui-icon-plus"},
|
||||
{title: "Delete", cmd: "delete", uiIcon: "ui-icon-trash"},
|
||||
{title: "Insert note here <kbd>Ctrl+O</kbd>", cmd: "insertNoteHere", uiIcon: "plus"},
|
||||
{title: "Insert child note <kbd>Ctrl+P</kbd>", cmd: "insertChildNote", uiIcon: "plus"},
|
||||
{title: "Delete", cmd: "delete", uiIcon: "trash"},
|
||||
{title: "----"},
|
||||
{title: "Edit branch prefix <kbd>F2</kbd>", cmd: "editBranchPrefix", uiIcon: "ui-icon-pencil"},
|
||||
{title: "Edit branch prefix <kbd>F2</kbd>", cmd: "editBranchPrefix", uiIcon: "pencil"},
|
||||
{title: "----"},
|
||||
{title: "Protect subtree", cmd: "protectSubtree", uiIcon: "ui-icon-locked"},
|
||||
{title: "Unprotect subtree", cmd: "unprotectSubtree", uiIcon: "ui-icon-unlocked"},
|
||||
{title: "Protect subtree", cmd: "protectSubtree", uiIcon: "shield-check"},
|
||||
{title: "Unprotect subtree", cmd: "unprotectSubtree", uiIcon: "shield-close"},
|
||||
{title: "----"},
|
||||
{title: "Copy / clone <kbd>Ctrl+C</kbd>", cmd: "copy", uiIcon: "ui-icon-copy"},
|
||||
{title: "Cut <kbd>Ctrl+X</kbd>", cmd: "cut", uiIcon: "ui-icon-scissors"},
|
||||
{title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"},
|
||||
{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"},
|
||||
{title: "Copy / clone <kbd>Ctrl+C</kbd>", cmd: "copy", uiIcon: "save"},
|
||||
{title: "Cut <kbd>Ctrl+X</kbd>", cmd: "cut", uiIcon: "scissors"},
|
||||
{title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "clipboard"},
|
||||
{title: "Paste after", cmd: "pasteAfter", uiIcon: "clipboard"},
|
||||
{title: "----"},
|
||||
{title: "Export subtree", cmd: "exportSubtree", uiIcon: " ui-icon-arrowthick-1-ne"},
|
||||
{title: "Import into note (tar, opml, md, enex)", cmd: "importIntoNote", uiIcon: "ui-icon-arrowthick-1-sw"},
|
||||
{title: "Export subtree", cmd: "exportSubtree", uiIcon: "arrow-up-right"},
|
||||
{title: "Import into note (tar, opml, md, enex)", cmd: "importIntoNote", uiIcon: "arrow-down-left"},
|
||||
{title: "----"},
|
||||
{title: "Collapse subtree <kbd>Alt+-</kbd>", cmd: "collapseSubtree", uiIcon: "ui-icon-minus"},
|
||||
{title: "Force note sync", cmd: "forceNoteSync", uiIcon: "ui-icon-refresh"},
|
||||
{title: "Sort alphabetically <kbd>Alt+S</kbd>", cmd: "sortAlphabetically", uiIcon: " ui-icon-arrowthick-2-n-s"}
|
||||
{title: "Collapse subtree <kbd>Alt+-</kbd>", cmd: "collapseSubtree", uiIcon: "align-justify"},
|
||||
{title: "Force note sync", cmd: "forceNoteSync", uiIcon: "refresh"},
|
||||
{title: "Sort alphabetically <kbd>Alt+S</kbd>", cmd: "sortAlphabetically", uiIcon: "arrows-v"}
|
||||
];
|
||||
|
||||
function enableItem(cmd, enabled) {
|
||||
|
||||
Reference in New Issue
Block a user