search help dropdown button

This commit is contained in:
zadam 2020-12-30 23:09:29 +01:00
parent 02d9752abf
commit 7aadd57d2f
8 changed files with 25 additions and 21 deletions

6
package-lock.json generated
View file

@ -7918,9 +7918,9 @@
}
},
"ws": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.1.tgz",
"integrity": "sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ=="
"version": "7.4.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz",
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA=="
},
"xdg-basedir": {
"version": "4.0.0",

View file

@ -71,7 +71,7 @@
"turndown": "7.0.0",
"turndown-plugin-gfm": "1.0.2",
"unescape": "1.0.1",
"ws": "7.4.1",
"ws": "7.4.2",
"yauzl": "2.10.0",
"yazl": "2.5.1"
},

View file

@ -1,9 +1,6 @@
import TypeWidget from "./type_widgets/type_widget.js";
import noteAutocompleteService from "../services/note_autocomplete.js";
import SpacedUpdate from "../services/spaced_update.js";
import server from "../services/server.js";
import toastService from "../services/toast.js";
import NoteListRenderer from "../services/note_list_renderer.js";
import TabAwareWidget from "./tab_aware_widget.js";
import treeCache from "../services/tree_cache.js";
@ -42,6 +39,26 @@ const TPL = `
<td colspan="3">
<input type="text" class="form-control search-string">
</td>
<td>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
?
</button>
<div class="dropdown-menu dropdown-menu-right p-4" style="width: 500px;">
<strong>Search tips</strong> - also see <button class="btn btn-sm" type="button" data-help-page="Search">complete help on search</button>
<p>
<ul>
<li>Just enter any text for full text search</li>
<li><code>#abc</code> - returns notes with label abc</li>
<li><code>#year = 2019</code> - matches notes with label <code>year</code> having value <code>2019</code></li>
<li><code>#rock #pop</code> - matches notes which have both <code>rock</code> and <code>pop</code> labels</li>
<li><code>#rock or #pop</code> - only one of the labels must be present</li>
<li><code>#year &lt;= 2000</code> - numerical comparison (also &gt;, &gt;=, &lt;).</li>
<li><code>note.dateCreated >= MONTH-1</code> - notes created in the last month</li>
</ul>
</p>
</div>
</td>
</tr>
<tr>
<td>Limit search to subtree:</td>
@ -76,6 +93,7 @@ export default class SearchDefinitionWidget extends TabAwareWidget {
doRender() {
this.$widget = $(TPL);
this.contentSized();
this.overflowing();
this.$searchString = this.$widget.find(".search-string");
this.$searchString.on('input', () => this.spacedUpdate.scheduleUpdate());

View file

@ -1,4 +1,3 @@
import NoteListRenderer from "../../services/note_list_renderer.js";
import TypeWidget from "./type_widget.js";
const TPL = `

View file

@ -1,9 +1,6 @@
import libraryLoader from "../../services/library_loader.js";
import TypeWidget from "./type_widget.js";
import keyboardActionService from "../../services/keyboard_actions.js";
import server from "../../services/server.js";
import toastService from "../../services/toast.js";
import utils from "../../services/utils.js";
const TPL = `
<div class="note-detail-code note-detail-printable">

View file

@ -4,8 +4,6 @@ const TPL = `
<div class="note-detail-read-only-code note-detail-printable">
<style>
.note-detail-read-only-code {
overflow: auto;
height: 100%;
position: relative;
}

View file

@ -15,8 +15,6 @@ const TPL = `
.note-detail-readonly-text h6 { font-size: 1.1em; }
.note-detail-readonly-text {
overflow: auto;
height: 100%;
padding: 10px;
font-family: var(--detail-text-font-family);
position: relative;

View file

@ -3,12 +3,6 @@ import TypeWidget from "./type_widget.js";
const TPL = `
<div class="note-detail-render note-detail-printable">
<style>
.note-detail-render {
height: 100%;
}
</style>
<div class="note-detail-render-help alert alert-warning" style="margin: 50px; padding: 20px;">
<p><strong>This help note is shown because this note of type Render HTML doesn't have required relation to function properly.</strong></p>