mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
improvements to the search spec help button
This commit is contained in:
parent
80354d09fb
commit
b936a63db3
@ -73,11 +73,7 @@ function setupGlobs() {
|
|||||||
libraryLoader.requireCss(`api/notes/download/${appCssNoteId}`);
|
libraryLoader.requireCss(`api/notes/download/${appCssNoteId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/";
|
utils.initHelpButtons($(window));
|
||||||
|
|
||||||
$(document).on("click", "*[data-help-page]", e => {
|
|
||||||
window.open(wikiBaseUrl + $(e.target).attr("data-help-page"), '_blank');
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on("click", "a.external", function () {
|
$("body").on("click", "a.external", function () {
|
||||||
window.open($(this).attr("href"), '_blank');
|
window.open($(this).attr("href"), '_blank');
|
||||||
|
@ -317,6 +317,23 @@ function timeLimit(promise, limitMs) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initHelpDropdown($el) {
|
||||||
|
// stop inside clicks from closing the menu
|
||||||
|
const $dropdownMenu = $el.find('.help-dropdown .dropdown-menu');
|
||||||
|
$dropdownMenu.on('click', e => e.stopPropagation());
|
||||||
|
|
||||||
|
// previous propagation stop will also block help buttons from being opened so we need to re-init for this element
|
||||||
|
initHelpButtons($dropdownMenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/"
|
||||||
|
|
||||||
|
function initHelpButtons($el) {
|
||||||
|
$el.on("click", "*[data-help-page]", e => {
|
||||||
|
window.open(wikiBaseUrl + $(e.target).attr("data-help-page"), '_blank');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
reloadApp,
|
reloadApp,
|
||||||
parseDate,
|
parseDate,
|
||||||
@ -355,5 +372,7 @@ export default {
|
|||||||
copySelectionToClipboard,
|
copySelectionToClipboard,
|
||||||
isCKEditorInitialized,
|
isCKEditorInitialized,
|
||||||
dynamicRequire,
|
dynamicRequire,
|
||||||
timeLimit
|
timeLimit,
|
||||||
|
initHelpDropdown,
|
||||||
|
initHelpButtons
|
||||||
};
|
};
|
||||||
|
@ -10,10 +10,10 @@ const TPL = `
|
|||||||
<input type="text" class="form-control search-string">
|
<input type="text" class="form-control search-string">
|
||||||
</td>
|
</td>
|
||||||
<td class="button-column">
|
<td class="button-column">
|
||||||
<div class="dropdown">
|
<div class="dropdown help-dropdown">
|
||||||
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
|
<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" 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>
|
<strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="Search">complete help on search syntax</button>
|
||||||
<p>
|
<p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Just enter any text for full text search</li>
|
<li>Just enter any text for full text search</li>
|
||||||
@ -64,6 +64,8 @@ export default class SearchString extends AbstractSearchOption {
|
|||||||
|
|
||||||
this.$searchString.val(this.note.getLabelValue('searchString'));
|
this.$searchString.val(this.note.getLabelValue('searchString'));
|
||||||
|
|
||||||
|
utils.initHelpDropdown($option);
|
||||||
|
|
||||||
return $option;
|
return $option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -929,3 +929,10 @@ ul.fancytree-container li {
|
|||||||
.area-expander:hover .area-expander-text {
|
.area-expander:hover .area-expander-text {
|
||||||
color: var(--main-text-color);
|
color: var(--main-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.help-dropdown .dropdown-menu {
|
||||||
|
border-radius: 10px;
|
||||||
|
border-width: 2px;
|
||||||
|
box-shadow: 10px 10px 93px -25px black;
|
||||||
|
padding: 10px 15px 10px 15px !important;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user