import server from "../../services/server.js"; import NoteContextAwareWidget from "../note_context_aware_widget.js"; import froca from "../../services/froca.js"; import ws from "../../services/ws.js"; import toastService from "../../services/toast.js"; import treeService from "../../services/tree.js"; import SearchString from "../search_options/search_string.js"; import FastSearch from "../search_options/fast_search.js"; import Ancestor from "../search_options/ancestor.js"; import IncludeArchivedNotes from "../search_options/include_archived_notes.js"; import OrderBy from "../search_options/order_by.js"; import SearchScript from "../search_options/search_script.js"; import Limit from "../search_options/limit.js"; import Debug from "../search_options/debug.js"; import appContext from "../../services/app_context.js"; import bulkActionService from "../../services/bulk_action.js"; const TPL = `
Add search option:
`; const OPTION_CLASSES = [ SearchString, SearchScript, Ancestor, FastSearch, IncludeArchivedNotes, OrderBy, Limit, Debug ]; export default class SearchDefinitionWidget extends NoteContextAwareWidget { get name() { return "searchDefinition"; } isEnabled() { return this.note && this.note.type === 'search'; } getTitle() { return { show: this.isEnabled(), activate: true, title: 'Search parameters', icon: 'bx bx-search' }; } doRender() { this.$widget = $(TPL); this.contentSized(); this.$component = this.$widget.find('.search-definition-widget'); this.$actionList = this.$widget.find('.action-list'); for (const actionGroup of bulkActionService.ACTION_GROUPS) { this.$actionList.append($('