import utils from "./utils.js"; import appContext from "./app_context.js"; import server from "./server.js"; import libraryLoader from "./library_loader.js"; import ws from "./ws.js"; import protectedSessionHolder from "./protected_session_holder.js"; import froca from "./froca.js"; function setupGlobs() { window.glob.PROFILING_LOG = false; window.glob.isDesktop = utils.isDesktop; window.glob.isMobile = utils.isMobile; window.glob.getComponentByEl = el => appContext.getComponentByEl(el); window.glob.getHeaders = server.getHeaders; // required for ESLint plugin and CKEditor window.glob.getActiveTabNote = () => appContext.tabManager.getActiveTabNote(); window.glob.requireLibrary = libraryLoader.requireLibrary; window.glob.ESLINT = libraryLoader.ESLINT; window.glob.appContext = appContext; // for debugging window.glob.froca = froca; window.glob.treeCache = froca; // compatibility for CKEditor builds for a while // for CKEditor integration (button on block toolbar) window.glob.importMarkdownInline = async () => { const dialog = await import("../dialogs/markdown_import.js"); dialog.importMarkdownInline(); }; window.glob.SEARCH_HELP_TEXT = ` Search tips - also see
#abc
- returns notes with label abc#year = 2019
- matches notes with label year
having value 2019
#rock #pop
- matches notes which have both rock
and pop
labels#rock or #pop
- only one of the labels must be present#year <= 2000
- numerical comparison (also >, >=, <).note.dateCreated >= MONTH-1
- notes created in the last month=handler
- will execute script defined in handler
relation to get results