improvements to the search spec

This commit is contained in:
zadam 2021-01-26 15:54:41 +01:00
parent b936a63db3
commit ee78413ecb
10 changed files with 80 additions and 56 deletions

View File

@ -14,7 +14,9 @@ export default class AbstractSearchAction extends Component {
try {
const $rendered = this.doRender();
$rendered.find('.action-conf-del').on('click', () => this.deleteAction())
$rendered.find('.action-conf-del')
.on('click', () => this.deleteAction())
.attr('title', 'Remove this search action');
return $rendered;
}

View File

@ -12,7 +12,20 @@ const TPL = `
placeholder="note.title = note.title + '- suffix';"/>
</td>
<td class="button-column">
<span class="bx bx-x icon-action action-conf-del"></span>
<div style="display: flex">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
You can execute simple scripts on the matched notes.
For example to append a string to a note's title, use this small script:
<pre>note.title = note.title + ' - suffix';</pre>
</div>
</div>
<span class="bx bx-x icon-action action-conf-del"></span>
</div>
</td>
</tr>`;

View File

@ -5,23 +5,21 @@ const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="display: flex; align-items: center">
<div style="margin-right: 15px;">Rename label from:</div>
<input type="text"
class="form-control old-label-name"
placeholder="old name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
<div style="margin-right: 15px; margin-left: 15px;">To:</div>
<input type="text"
class="form-control new-label-name"
placeholder="new name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
</div>
<div style="margin-right: 10px;">Rename label from:</div>
<input type="text"
class="form-control old-label-name"
placeholder="old name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
<div style="margin-right: 10px; margin-left: 10px;">To:</div>
<input type="text"
class="form-control new-label-name"
placeholder="new name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
</div>
</td>
<td class="button-column">

View File

@ -5,23 +5,21 @@ const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="display: flex; align-items: center">
<div style="margin-right: 15px;">Rename relation from:</div>
<input type="text"
class="form-control old-relation-name"
placeholder="old name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
<div style="margin-right: 15px; margin-left: 15px;">To:</div>
<input type="text"
class="form-control new-relation-name"
placeholder="new name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
</div>
<div style="margin-right: 10px;">Rename relation from:</div>
<input type="text"
class="form-control old-relation-name"
placeholder="old name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
<div style="margin-right: 10px; margin-left: 10px;">To:</div>
<input type="text"
class="form-control new-relation-name"
placeholder="new name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
</div>
</td>
<td class="button-column">

View File

@ -5,19 +5,17 @@ const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="display: flex; align-items: center">
<div style="margin-right: 15px;" class="text-nowrap">Set label</div>
<input type="text"
class="form-control label-name"
placeholder="label name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
<div style="margin-right: 15px; margin-left: 15px;" class="text-nowrap">to value</div>
<input type="text" class="form-control label-value" placeholder="new value"/>
</div>
<div style="margin-right: 10px;" class="text-nowrap">Set label</div>
<input type="text"
class="form-control label-name"
placeholder="label name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">to value</div>
<input type="text" class="form-control label-value" placeholder="new value"/>
</div>
</td>
<td class="button-column">

View File

@ -6,18 +6,20 @@ const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="margin-right: 15px;" class="text-nowrap">Set relation</div>
<div style="margin-right: 10px;" class="text-nowrap">Set relation</div>
<input type="text"
class="form-control relation-name"
placeholder="relation name"
pattern="[\\p{L}\\p{N}_:]+"
style="flex-shrink: 3"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
</div>
<div style="display: flex; align-items: center; margin-top: 10px;">
<div style="margin-right: 15px;" class="text-nowrap">target to note</div>
<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">to</div>
<input type="text" class="form-control target-note"/>
<div class="input-group" style="flex-shrink: 2">
<input type="text" class="form-control target-note" placeholder="target note"/>
</div>
</div>
</td>
<td class="button-column">

View File

@ -30,6 +30,10 @@ const TPL = `
border-spacing: 10px;
}
.search-setting-table div {
white-space: nowrap;
}
.search-setting-table .button-column {
/* minimal width so that table remains static sized and most space remains for middle column with settings */
width: 50px;

View File

@ -24,7 +24,9 @@ export default class AbstractSearchOption extends Component {
try {
const $rendered = this.doRender();
$rendered.find('.search-option-del').on('click', () => this.deleteOption())
$rendered.find('.search-option-del')
.on('click', () => this.deleteOption())
.attr('title', 'Remove this search option');
return $rendered;
}

View File

@ -12,7 +12,7 @@ const TPL = `
<td class="button-column">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4" style="width: 500px;">
<div class="dropdown-menu dropdown-menu-right p-4">
<strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="Search">complete help on search syntax</button>
<p>
<ul>

View File

@ -935,4 +935,11 @@ ul.fancytree-container li {
border-width: 2px;
box-shadow: 10px 10px 93px -25px black;
padding: 10px 15px 10px 15px !important;
width: 500px;
}
.help-dropdown .dropdown-menu pre {
background-color: var(--accented-background-color);
padding: 10px;
margin: 10px;
}