refactor data-kb-command

This commit is contained in:
zadam 2020-02-27 23:12:22 +01:00
parent cd4b1235a7
commit 4bd298a55b
9 changed files with 70 additions and 712 deletions

View file

@ -10,647 +10,5 @@
<collation id="3" parent="1" name="BINARY"/>
<collation id="4" parent="1" name="NOCASE"/>
<collation id="5" parent="1" name="RTRIM"/>
<table id="6" parent="2" name="api_tokens"/>
<table id="7" parent="2" name="attributes"/>
<table id="8" parent="2" name="branches"/>
<table id="9" parent="2" name="note_contents"/>
<table id="10" parent="2" name="note_revision_contents"/>
<table id="11" parent="2" name="note_revisions"/>
<table id="12" parent="2" name="notes"/>
<table id="13" parent="2" name="options"/>
<table id="14" parent="2" name="recent_notes"/>
<table id="15" parent="2" name="source_ids"/>
<table id="16" parent="2" name="sqlite_master">
<System>1</System>
</table>
<table id="17" parent="2" name="sqlite_sequence">
<System>1</System>
</table>
<table id="18" parent="2" name="sync"/>
<column id="19" parent="6" name="apiTokenId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="20" parent="6" name="token">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="21" parent="6" name="utcDateCreated">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="22" parent="6" name="isDeleted">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="23" parent="6" name="hash">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>apiTokenId</ColNames>
<Unique>1</Unique>
</index>
<key id="25" parent="6">
<ColNames>apiTokenId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_api_tokens_1</UnderlyingIndexName>
</key>
<column id="26" parent="7" name="attributeId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="27" parent="7" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="28" parent="7" name="type">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="29" parent="7" name="name">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="30" parent="7" name="value">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="31" parent="7" name="position">
<Position>6</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="32" parent="7" name="utcDateCreated">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="33" parent="7" name="utcDateModified">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="34" parent="7" name="isDeleted">
<Position>9</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="35" parent="7" name="deleteId">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="36" parent="7" name="hash">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="37" parent="7" name="isInheritable">
<Position>12</Position>
<DataType>int|0s</DataType>
<DefaultExpression>0</DefaultExpression>
</column>
<index id="38" parent="7" name="sqlite_autoindex_attributes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>attributeId</ColNames>
<Unique>1</Unique>
</index>
<index id="39" parent="7" name="IDX_attributes_noteId_index">
<ColNames>noteId</ColNames>
</index>
<index id="40" parent="7" name="IDX_attributes_name_value">
<ColNames>name
value</ColNames>
</index>
<index id="41" parent="7" name="IDX_attributes_value_index">
<ColNames>value</ColNames>
</index>
<key id="42" parent="7">
<ColNames>attributeId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
</key>
<column id="43" parent="8" name="branchId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="44" parent="8" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="45" parent="8" name="parentNoteId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="46" parent="8" name="notePosition">
<Position>4</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="47" parent="8" name="prefix">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="48" parent="8" name="isExpanded">
<Position>6</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="49" parent="8" name="isDeleted">
<Position>7</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="50" parent="8" name="deleteId">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="51" parent="8" name="utcDateModified">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="52" parent="8" name="utcDateCreated">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="53" parent="8" name="hash">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="54" parent="8" name="sqlite_autoindex_branches_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>branchId</ColNames>
<Unique>1</Unique>
</index>
<index id="55" parent="8" name="IDX_branches_noteId_parentNoteId">
<ColNames>noteId
parentNoteId</ColNames>
</index>
<index id="56" parent="8" name="IDX_branches_parentNoteId">
<ColNames>parentNoteId</ColNames>
</index>
<key id="57" parent="8">
<ColNames>branchId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
</key>
<column id="58" parent="9" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="59" parent="9" name="content">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="60" parent="9" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="61" parent="9" name="utcDateModified">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="62" parent="9" name="sqlite_autoindex_note_contents_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteId</ColNames>
<Unique>1</Unique>
</index>
<key id="63" parent="9">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
</key>
<column id="64" parent="10" name="noteRevisionId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="65" parent="10" name="content">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="66" parent="10" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="67" parent="10" name="utcDateModified">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="68" parent="10" name="sqlite_autoindex_note_revision_contents_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteRevisionId</ColNames>
<Unique>1</Unique>
</index>
<key id="69" parent="10">
<ColNames>noteRevisionId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_revision_contents_1</UnderlyingIndexName>
</key>
<column id="70" parent="11" name="noteRevisionId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="71" parent="11" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="72" parent="11" name="title">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="73" parent="11" name="contentLength">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="74" parent="11" name="isErased">
<Position>5</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="75" parent="11" name="isProtected">
<Position>6</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="76" parent="11" name="utcDateLastEdited">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="77" parent="11" name="utcDateCreated">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="78" parent="11" name="utcDateModified">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="79" parent="11" name="dateLastEdited">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="80" parent="11" name="dateCreated">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="81" parent="11" name="type">
<Position>12</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="82" parent="11" name="mime">
<Position>13</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="83" parent="11" name="hash">
<Position>14</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<index id="84" parent="11" name="sqlite_autoindex_note_revisions_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteRevisionId</ColNames>
<Unique>1</Unique>
</index>
<index id="85" parent="11" name="IDX_note_revisions_noteId">
<ColNames>noteId</ColNames>
</index>
<index id="86" parent="11" name="IDX_note_revisions_utcDateLastEdited">
<ColNames>utcDateLastEdited</ColNames>
</index>
<index id="87" parent="11" name="IDX_note_revisions_utcDateCreated">
<ColNames>utcDateCreated</ColNames>
</index>
<index id="88" parent="11" name="IDX_note_revisions_dateLastEdited">
<ColNames>dateLastEdited</ColNames>
</index>
<index id="89" parent="11" name="IDX_note_revisions_dateCreated">
<ColNames>dateCreated</ColNames>
</index>
<key id="90" parent="11">
<ColNames>noteRevisionId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
</key>
<column id="91" parent="12" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="92" parent="12" name="title">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;note&quot;</DefaultExpression>
</column>
<column id="93" parent="12" name="contentLength">
<Position>3</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="94" parent="12" name="isProtected">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="95" parent="12" name="type">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;text&apos;</DefaultExpression>
</column>
<column id="96" parent="12" name="mime">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;text/html&apos;</DefaultExpression>
</column>
<column id="97" parent="12" name="hash">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="98" parent="12" name="isDeleted">
<Position>8</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="99" parent="12" name="deleteId">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="100" parent="12" name="isErased">
<Position>10</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="101" parent="12" name="dateCreated">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="102" parent="12" name="dateModified">
<Position>12</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="103" parent="12" name="utcDateCreated">
<Position>13</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="104" parent="12" name="utcDateModified">
<Position>14</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="105" parent="12" name="sqlite_autoindex_notes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteId</ColNames>
<Unique>1</Unique>
</index>
<index id="106" parent="12" name="IDX_notes_title">
<ColNames>title</ColNames>
</index>
<index id="107" parent="12" name="IDX_notes_type">
<ColNames>type</ColNames>
</index>
<index id="108" parent="12" name="IDX_notes_isDeleted">
<ColNames>isDeleted</ColNames>
</index>
<index id="109" parent="12" name="IDX_notes_dateCreated">
<ColNames>dateCreated</ColNames>
</index>
<index id="110" parent="12" name="IDX_notes_dateModified">
<ColNames>dateModified</ColNames>
</index>
<index id="111" parent="12" name="IDX_notes_utcDateCreated">
<ColNames>utcDateCreated</ColNames>
</index>
<index id="112" parent="12" name="IDX_notes_utcDateModified">
<ColNames>utcDateModified</ColNames>
</index>
<key id="113" parent="12">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
</key>
<column id="114" parent="13" name="name">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="115" parent="13" name="value">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="116" parent="13" name="isSynced">
<Position>3</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="117" parent="13" name="hash">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="118" parent="13" name="utcDateCreated">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="119" parent="13" name="utcDateModified">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="120" parent="13" name="sqlite_autoindex_options_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>name</ColNames>
<Unique>1</Unique>
</index>
<key id="121" parent="13">
<ColNames>name</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
</key>
<column id="122" parent="14" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="123" parent="14" name="notePath">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="124" parent="14" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="125" parent="14" name="utcDateCreated">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="126" parent="14" name="isDeleted">
<Position>5</Position>
<DataType>INT|0s</DataType>
</column>
<index id="127" parent="14" name="sqlite_autoindex_recent_notes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteId</ColNames>
<Unique>1</Unique>
</index>
<key id="128" parent="14">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
</key>
<column id="129" parent="15" name="sourceId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="130" parent="15" name="utcDateCreated">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="131" parent="15" name="sqlite_autoindex_source_ids_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>sourceId</ColNames>
<Unique>1</Unique>
</index>
<index id="132" parent="15" name="IDX_source_ids_utcDateCreated">
<ColNames>utcDateCreated</ColNames>
</index>
<key id="133" parent="15">
<ColNames>sourceId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
</key>
<column id="134" parent="16" name="type">
<Position>1</Position>
<DataType>text|0s</DataType>
</column>
<column id="135" parent="16" name="name">
<Position>2</Position>
<DataType>text|0s</DataType>
</column>
<column id="136" parent="16" name="tbl_name">
<Position>3</Position>
<DataType>text|0s</DataType>
</column>
<column id="137" parent="16" name="rootpage">
<Position>4</Position>
<DataType>int|0s</DataType>
</column>
<column id="138" parent="16" name="sql">
<Position>5</Position>
<DataType>text|0s</DataType>
</column>
<column id="139" parent="17" name="name">
<Position>1</Position>
</column>
<column id="140" parent="17" name="seq">
<Position>2</Position>
</column>
<column id="141" parent="18" name="id">
<Position>1</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="142" parent="18" name="entityName">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="143" parent="18" name="entityId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="144" parent="18" name="sourceId">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="145" parent="18" name="utcSyncDate">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="146" parent="18" name="IDX_sync_entityName_entityId">
<ColNames>entityName
entityId</ColNames>
<Unique>1</Unique>
</index>
<index id="147" parent="18" name="IDX_sync_utcSyncDate">
<ColNames>utcSyncDate</ColNames>
</index>
<key id="148" parent="18">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
</database-model>
</dataSource>

View file

@ -94,8 +94,8 @@ async function getAction(actionName, silent = false) {
}
function updateDisplayedShortcuts($container) {
$container.find('kbd[data-kb-command]').each(async (i, el) => {
const actionName = $(el).attr('data-kb-command');
$container.find('kbd[data-command]').each(async (i, el) => {
const actionName = $(el).attr('data-command');
const action = await getAction(actionName, true);
if (action) {
@ -103,8 +103,8 @@ function updateDisplayedShortcuts($container) {
}
});
$container.find('button[data-kb-command],a.icon-action[data-kb-command],.kb-in-title').each(async (i, el) => {
const actionName = $(el).attr('data-kb-command');
$container.find('button[data-command],a.icon-action[data-command],.kb-in-title').each(async (i, el) => {
const actionName = $(el).attr('data-command');
const action = await getAction(actionName, true);
if (action) {

View file

@ -47,39 +47,39 @@ class TreeContextMenu {
return [
{ title: 'Open in new tab', cmd: "openInTab", uiIcon: "empty", enabled: noSelectedNotes },
{ title: 'Insert note after <kbd data-kb-command="createNoteAfter"></kbd>', cmd: "insertNoteAfter", uiIcon: "plus",
{ title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', cmd: "insertNoteAfter", uiIcon: "plus",
items: insertNoteAfterEnabled ? this.getNoteTypeItems("insertNoteAfter") : null,
enabled: insertNoteAfterEnabled && noSelectedNotes },
{ title: 'Insert child note <kbd data-kb-command="createNoteInto"></kbd>', cmd: "insertChildNote", uiIcon: "plus",
{ title: 'Insert child note <kbd data-command="createNoteInto"></kbd>', cmd: "insertChildNote", uiIcon: "plus",
items: notSearch ? this.getNoteTypeItems("insertChildNote") : null,
enabled: notSearch && noSelectedNotes },
{ title: 'Delete <kbd data-kb-command="deleteNotes"></kbd>', cmd: "deleteNotes", uiIcon: "trash",
{ title: 'Delete <kbd data-command="deleteNotes"></kbd>', cmd: "deleteNotes", uiIcon: "trash",
enabled: isNotRoot && !isHoisted && parentNotSearch },
{ title: "----" },
{ title: 'Search in subtree <kbd data-kb-command="searchInSubtree"></kbd>', cmd: "searchInSubtree", uiIcon: "search",
{ title: 'Search in subtree <kbd data-command="searchInSubtree"></kbd>', cmd: "searchInSubtree", uiIcon: "search",
enabled: notSearch && noSelectedNotes },
isHoisted ? null : { title: 'Hoist note <kbd data-kb-command="toggleNoteHoisting"></kbd>', cmd: "toggleNoteHoisting", uiIcon: "empty", enabled: noSelectedNotes && notSearch },
!isHoisted || !isNotRoot ? null : { title: 'Unhoist note <kbd data-kb-command="ToggleNoteHoisting"></kbd>', cmd: "toggleNoteHoisting", uiIcon: "arrow-up" },
{ title: 'Edit branch prefix <kbd data-kb-command="editBranchPrefix"></kbd>', cmd: "editBranchPrefix", uiIcon: "empty",
isHoisted ? null : { title: 'Hoist note <kbd data-command="toggleNoteHoisting"></kbd>', cmd: "toggleNoteHoisting", uiIcon: "empty", enabled: noSelectedNotes && notSearch },
!isHoisted || !isNotRoot ? null : { title: 'Unhoist note <kbd data-command="ToggleNoteHoisting"></kbd>', cmd: "toggleNoteHoisting", uiIcon: "arrow-up" },
{ title: 'Edit branch prefix <kbd data-command="editBranchPrefix"></kbd>', cmd: "editBranchPrefix", uiIcon: "empty",
enabled: isNotRoot && parentNotSearch && noSelectedNotes},
{ title: "Advanced", uiIcon: "empty", enabled: true, items: [
{ title: 'Collapse subtree <kbd data-kb-command="collapseSubtree"></kbd>', cmd: "collapseSubtree", uiIcon: "align-justify", enabled: noSelectedNotes },
{ title: 'Collapse subtree <kbd data-command="collapseSubtree"></kbd>', cmd: "collapseSubtree", uiIcon: "align-justify", enabled: noSelectedNotes },
{ title: "Force note sync", cmd: "forceNoteSync", uiIcon: "refresh", enabled: noSelectedNotes },
{ title: 'Sort alphabetically <kbd data-kb-command="sortChildNotes"></kbd>', cmd: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch }
{ title: 'Sort alphabetically <kbd data-command="sortChildNotes"></kbd>', cmd: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch }
] },
{ title: "----" },
{ title: "Protect subtree", cmd: "protectSubtree", uiIcon: "check-shield", enabled: noSelectedNotes },
{ title: "Unprotect subtree", cmd: "unprotectSubtree", uiIcon: "shield", enabled: noSelectedNotes },
{ title: "----" },
{ title: 'Copy / clone <kbd data-kb-command="copyNotesToClipboard"></kbd>', cmd: "copyNotesToClipboard", uiIcon: "copy",
{ title: 'Copy / clone <kbd data-command="copyNotesToClipboard"></kbd>', cmd: "copyNotesToClipboard", uiIcon: "copy",
enabled: isNotRoot && !isHoisted },
{ title: 'Clone to ... <kbd data-kb-command="cloneNotesTo"></kbd>', cmd: "cloneNotesTo", uiIcon: "empty",
{ title: 'Clone to ... <kbd data-command="cloneNotesTo"></kbd>', cmd: "cloneNotesTo", uiIcon: "empty",
enabled: isNotRoot && !isHoisted },
{ title: 'Cut <kbd data-kb-command="cutNotesToClipboard"></kbd>', cmd: "cutNotesToClipboard", uiIcon: "cut",
{ title: 'Cut <kbd data-command="cutNotesToClipboard"></kbd>', cmd: "cutNotesToClipboard", uiIcon: "cut",
enabled: isNotRoot && !isHoisted && parentNotSearch },
{ title: 'Move to ... <kbd data-kb-command="moveNotesTo"></kbd>', cmd: "moveNotesTo", uiIcon: "empty",
{ title: 'Move to ... <kbd data-command="moveNotesTo"></kbd>', cmd: "moveNotesTo", uiIcon: "empty",
enabled: isNotRoot && !isHoisted && parentNotSearch },
{ title: 'Paste into <kbd data-kb-command="pasteNotesFromClipboard"></kbd>', cmd: "pasteNotesFromClipboard", uiIcon: "paste",
{ title: 'Paste into <kbd data-command="pasteNotesFromClipboard"></kbd>', cmd: "pasteNotesFromClipboard", uiIcon: "paste",
enabled: !clipboard.isClipboardEmpty() && notSearch && noSelectedNotes },
{ title: 'Paste after', cmd: "pasteNotesAfterFromClipboard", uiIcon: "paste",
enabled: !clipboard.isClipboardEmpty() && isNotRoot && !isHoisted && parentNotSearch && noSelectedNotes },

View file

@ -19,17 +19,17 @@ const WIDGET_TPL = `
<a data-trigger-event="collapseTree"
title="Collapse note tree"
data-kb-command="collapseTree"
data-command="collapseTree"
class="icon-action bx bx-layer-minus"></a>
<a data-trigger-event="scrollToActiveNote"
title="Scroll to active note"
data-kb-command="scrollToActiveNote"
data-command="scrollToActiveNote"
class="icon-action bx bx-crosshair"></a>
<a data-trigger-event="searchNotes"
title="Search in notes"
data-kb-command="searchNotes"
data-command="searchNotes"
class="icon-action bx bx-search"></a>
</div>
`;

View file

@ -42,44 +42,44 @@ const TPL = `
<a class="dropdown-item open-dev-tools-button" data-trigger-event="openDevTools">
<span class="bx bx-terminal"></span>
Open Dev Tools
<kbd data-kb-command="openDevTools"></kbd>
<kbd data-command="openDevTools"></kbd>
</a>
<a class="dropdown-item" data-trigger-event="showSQLConsole">
<span class="bx bx-data"></span>
Open SQL Console
<kbd data-kb-command="showSQLConsole"></kbd>
<kbd data-command="showSQLConsole"></kbd>
</a>
<a class="dropdown-item" data-trigger-event="showBackendLog">
<span class="bx bx-empty"></span>
Show backend log
<kbd data-kb-command="showBackendLog"></kbd>
<kbd data-command="showBackendLog"></kbd>
</a>
<a class="dropdown-item" data-trigger-event="reloadFrontendApp"
title="Reload can help with some visual glitches without restarting the whole app.">
<span class="bx bx-empty"></span>
Reload frontend
<kbd data-kb-command="reloadFrontendApp"></kbd>
<kbd data-command="reloadFrontendApp"></kbd>
</a>
<a class="dropdown-item" data-trigger-event="toggleZenMode">
<span class="bx bx-empty"></span>
Toggle Zen mode
<kbd data-kb-command="toggleZenMode"></kbd>
<kbd data-command="toggleZenMode"></kbd>
</a>
<a class="dropdown-item" data-trigger-event="toggleFullscreen">
<span class="bx bx-empty"></span>
Toggle fullscreen
<kbd data-kb-command="toggleFullscreen"></kbd>
<kbd data-command="toggleFullscreen"></kbd>
</a>
<a class="dropdown-item" data-trigger-event="showHelp">
<span class="bx bx-info-circle"></span>
Show Help
<kbd data-kb-command="showHelp"></kbd>
<kbd data-command="showHelp"></kbd>
</a>
<a class="dropdown-item show-about-dialog-button">

View file

@ -14,13 +14,13 @@ const TPL = `
</button>
<div class="dropdown-menu dropdown-menu-right">
<a data-trigger-event="showNoteRevisions" class="dropdown-item show-note-revisions-button">Revisions</a>
<a data-trigger-event="showAttributes" class="dropdown-item show-attributes-button"><kbd data-kb-command="showAttributes"></kbd> Attributes</a>
<a data-trigger-event="showLinkMap" class="dropdown-item show-link-map-button"><kbd data-kb-command="showLinkMap"></kbd> Link map</a>
<a data-trigger-event="showNoteSource" class="dropdown-item show-source-button"><kbd data-kb-command="showNoteSource"></kbd> Note source</a>
<a data-trigger-event="showAttributes" class="dropdown-item show-attributes-button"><kbd data-command="showAttributes"></kbd> Attributes</a>
<a data-trigger-event="showLinkMap" class="dropdown-item show-link-map-button"><kbd data-command="showLinkMap"></kbd> Link map</a>
<a data-trigger-event="showNoteSource" class="dropdown-item show-source-button"><kbd data-command="showNoteSource"></kbd> Note source</a>
<a class="dropdown-item import-files-button">Import files</a>
<a class="dropdown-item export-note-button">Export note</a>
<a data-trigger-event="printActiveNote" class="dropdown-item print-note-button"><kbd data-kb-command="printActiveNote"></kbd> Print note</a>
<a data-trigger-event="showNoteInfo" class="dropdown-item show-note-info-button"><kbd data-kb-command="showNoteInfo"></kbd> Note info</a>
<a data-trigger-event="printActiveNote" class="dropdown-item print-note-button"><kbd data-command="printActiveNote"></kbd> Print note</a>
<a data-trigger-event="showNoteInfo" class="dropdown-item show-note-info-button"><kbd data-command="showNoteInfo"></kbd> Note info</a>
</div>
</div>`;

View file

@ -32,12 +32,12 @@ const TPL = `
</style>
<div style="flex-grow: 100; display: flex;">
<button class="btn btn-sm jump-to-note-dialog-button" data-kb-command="jumpToNote">
<button class="btn btn-sm jump-to-note-dialog-button" data-command="jumpToNote">
<span class="bx bx-crosshair"></span>
Jump to note
</button>
<button class="btn btn-sm recent-changes-button" data-kb-command="showRecentChanges">
<button class="btn btn-sm recent-changes-button" data-command="showRecentChanges">
<span class="bx bx-history"></span>
Recent changes

View file

@ -29,11 +29,11 @@ const TAB_TPL = `
<div class="note-tab-wrapper">
<div class="note-tab-title"></div>
<div class="note-tab-drag-handle"></div>
<div class="note-tab-close kb-in-title" title="Close tab" data-kb-command="closeActiveTab"><span>×</span></div>
<div class="note-tab-close kb-in-title" title="Close tab" data-command="closeActiveTab"><span>×</span></div>
</div>
</div>`;
const NEW_TAB_BUTTON_TPL = `<div class="note-new-tab kb-in-title" data-kb-command="openNewTab" title="Add new tab">+</div>`;
const NEW_TAB_BUTTON_TPL = `<div class="note-new-tab kb-in-title" data-command="openNewTab" title="Add new tab">+</div>`;
const FILLER_TPL = `<div class="tab-row-filler">
<div class="tab-row-border"></div>
</div>`;

View file

@ -18,12 +18,12 @@
<ul>
<li><kbd>UP</kbd>, <kbd>DOWN</kbd> - go up/down in the list of notes</li>
<li><kbd>LEFT</kbd>, <kbd>RIGHT</kbd> - collapse/expand node</li>
<li><kbd data-kb-command="backInNoteHistory"></kbd>, <kbd data-kb-command="BackInNoteHistory"></kbd> - go back / forwards in the history</li>
<li><kbd data-kb-command="jumpToNote"></kbd> - show <a class="external" href="https://github.com/zadam/trilium/wiki/Note-navigation#jump-to-note">"Jump to" dialog</a></li>
<li><kbd data-kb-command="scrollToActiveNote"></kbd> - scroll to active note</li>
<li><kbd data-kb-command="activateParentNote"></kbd> - jumps to parent note</li>
<li><kbd data-kb-command="collapseTree"></kbd> - collapse whole note tree</li>
<li><kbd data-kb-command="collapseSubtree"></kbd> - collapse sub-tree</li>
<li><kbd data-command="backInNoteHistory"></kbd>, <kbd data-command="BackInNoteHistory"></kbd> - go back / forwards in the history</li>
<li><kbd data-command="jumpToNote"></kbd> - show <a class="external" href="https://github.com/zadam/trilium/wiki/Note-navigation#jump-to-note">"Jump to" dialog</a></li>
<li><kbd data-command="scrollToActiveNote"></kbd> - scroll to active note</li>
<li><kbd data-command="activateParentNote"></kbd> - jumps to parent note</li>
<li><kbd data-command="collapseTree"></kbd> - collapse whole note tree</li>
<li><kbd data-command="collapseSubtree"></kbd> - collapse sub-tree</li>
</ul>
</p>
</div>
@ -40,10 +40,10 @@
Only in desktop (electron build):
<ul>
<li><kbd data-kb-command="openNewTab"></kbd> opens empty tab</li>
<li><kbd data-kb-command="closeActiveTab"></kbd> closes active tab</li>
<li><kbd data-kb-command="activateNextTab"></kbd> activates next tab</li>
<li><kbd data-kb-command="activatePreviousTab"></kbd> activates previous tab</li>
<li><kbd data-command="openNewTab"></kbd> opens empty tab</li>
<li><kbd data-command="closeActiveTab"></kbd> closes active tab</li>
<li><kbd data-command="activateNextTab"></kbd> activates next tab</li>
<li><kbd data-command="activatePreviousTab"></kbd> activates previous tab</li>
</ul>
</p>
</div>
@ -55,9 +55,9 @@
<p class="card-text">
<ul>
<li><kbd data-kb-command="createNoteAfter"></kbd> - creates new note after the active note</li>
<li><kbd data-kb-command="createNoteInto"></kbd> - creates new sub-note into active note</li>
<li><kbd data-kb-command="editBranchPrefix"></kbd> - edit <a class="external" href="https://github.com/zadam/trilium/wiki/Tree concepts#prefix">prefix</a> of active note clone</li>
<li><kbd data-command="createNoteAfter"></kbd> - creates new note after the active note</li>
<li><kbd data-command="createNoteInto"></kbd> - creates new sub-note into active note</li>
<li><kbd data-command="editBranchPrefix"></kbd> - edit <a class="external" href="https://github.com/zadam/trilium/wiki/Tree concepts#prefix">prefix</a> of active note clone</li>
</ul>
</p>
</div>
@ -69,15 +69,15 @@
<p class="card-text">
<ul>
<li><kbd data-kb-command="moveNoteUp"></kbd>, <kbd data-kb-command="MoveNoteDown"></kbd> - move note up/down in the note list</li>
<li><kbd data-kb-command="moveNoteUpInHierarchy"></kbd>, <kbd data-kb-command="MoveNoteDownInHierarchy"></kbd> - move note up in the hierarchy</li>
<li><kbd data-kb-command="addNoteAboveToSelection"></kbd>, <kbd data-kb-command="AddNoteBelowToSelection"></kbd> - multi-select note above/below</li>
<li><kbd data-kb-command="selectAllNotesInParent"></kbd> - select all notes in the current level</li>
<li><kbd data-command="moveNoteUp"></kbd>, <kbd data-command="MoveNoteDown"></kbd> - move note up/down in the note list</li>
<li><kbd data-command="moveNoteUpInHierarchy"></kbd>, <kbd data-command="MoveNoteDownInHierarchy"></kbd> - move note up in the hierarchy</li>
<li><kbd data-command="addNoteAboveToSelection"></kbd>, <kbd data-command="AddNoteBelowToSelection"></kbd> - multi-select note above/below</li>
<li><kbd data-command="selectAllNotesInParent"></kbd> - select all notes in the current level</li>
<li><kbd>Shift+click</kbd> - select note</li>
<li><kbd data-kb-command="copyNotesToClipboard"></kbd> - copies active note (or current selection) into clipboard (used for <a class="external" href="https://github.com/zadam/trilium/wiki/Cloning notes">cloning</a>)</li>
<li><kbd data-kb-command="cutNotesToClipboard"></kbd> - cuts current (or current selection) note into clipboard (used for moving notes)</li>
<li><kbd data-kb-command="pasteNotesFromClipboard"></kbd> - pastes note(s) as sub-note into active note (which is either move or clone depending on whether it was copied or cut into clipboard)</li>
<li><kbd data-kb-command="deleteNotes"></kbd> - delete note / sub-tree</li>
<li><kbd data-command="copyNotesToClipboard"></kbd> - copies active note (or current selection) into clipboard (used for <a class="external" href="https://github.com/zadam/trilium/wiki/Cloning notes">cloning</a>)</li>
<li><kbd data-command="cutNotesToClipboard"></kbd> - cuts current (or current selection) note into clipboard (used for moving notes)</li>
<li><kbd data-command="pasteNotesFromClipboard"></kbd> - pastes note(s) as sub-note into active note (which is either move or clone depending on whether it was copied or cut into clipboard)</li>
<li><kbd data-command="deleteNotes"></kbd> - delete note / sub-tree</li>
</ul>
</p>
</div>
@ -89,12 +89,12 @@
<p class="card-text">
<ul>
<li><kbd data-kb-command="editNoteTitle"></kbd> in tree pane switches from tree pane into note title. Enter from note title switches focus to text editor.
<kbd data-kb-command="scrollToActiveNote"></kbd> switches back from editor to tree pane.</li>
<li><kbd data-command="editNoteTitle"></kbd> in tree pane switches from tree pane into note title. Enter from note title switches focus to text editor.
<kbd data-command="scrollToActiveNote"></kbd> switches back from editor to tree pane.</li>
<li><kbd>Ctrl+K</kbd> - create / edit external link</li>
<li><kbd data-kb-command="addLinkToText"></kbd> - create internal link</li>
<li><kbd data-kb-command="insertDateTimeToText"></kbd> - inserts current date and time at caret position</li>
<li><kbd data-kb-command="scrollToActiveNote"></kbd> - jump away to the tree pane and scroll to active note</li>
<li><kbd data-command="addLinkToText"></kbd> - create internal link</li>
<li><kbd data-command="insertDateTimeToText"></kbd> - inserts current date and time at caret position</li>
<li><kbd data-command="scrollToActiveNote"></kbd> - jump away to the tree pane and scroll to active note</li>
</ul>
</p>
</div>
@ -121,9 +121,9 @@
<p class="card-text">
<ul>
<li><kbd data-kb-command="reloadFrontendApp"></kbd> - reloads Trilium frontend</li>
<li><kbd data-kb-command="openDevTools"></kbd> - show developer tools</li>
<li><kbd data-kb-command="showSQLConsole"></kbd> - show SQL console</li>
<li><kbd data-command="reloadFrontendApp"></kbd> - reloads Trilium frontend</li>
<li><kbd data-command="openDevTools"></kbd> - show developer tools</li>
<li><kbd data-command="showSQLConsole"></kbd> - show SQL console</li>
</ul>
</p>
</div>
@ -135,10 +135,10 @@
<p class="card-text">
<ul>
<li><kbd data-kb-command="toggleZenMode"></kbd> - Zen mode - display only note editor, everything else is hidden</li>
<li><kbd data-kb-command="searchNotes"></kbd> - toggle search form in tree pane</li>
<li><kbd data-kb-command="findInText"></kbd> - in page search</li>
<li><kbd data-kb-command="showAttributes"></kbd> - show note attributes dialog</li>
<li><kbd data-command="toggleZenMode"></kbd> - Zen mode - display only note editor, everything else is hidden</li>
<li><kbd data-command="searchNotes"></kbd> - toggle search form in tree pane</li>
<li><kbd data-command="findInText"></kbd> - in page search</li>
<li><kbd data-command="showAttributes"></kbd> - show note attributes dialog</li>
</ul>
</p>
</div>