mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 05:15:59 +01:00
findwidget in read only notes WIP
This commit is contained in:
36
src/public/app/widgets/find_in_html.js
Normal file
36
src/public/app/widgets/find_in_html.js
Normal file
@@ -0,0 +1,36 @@
|
||||
// ck-find-result and ck-find-result_selected are the styles ck-editor
|
||||
// uses for highlighting matches, use the same one on CodeMirror
|
||||
// for consistency
|
||||
import libraryLoader from "../services/library_loader.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
const FIND_RESULT_SELECTED_CSS_CLASSNAME = "ck-find-result_selected";
|
||||
const FIND_RESULT_CSS_CLASSNAME = "ck-find-result";
|
||||
|
||||
export default class FindInHtml {
|
||||
constructor(parent) {
|
||||
/** @property {FindWidget} */
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
async getInitialSearchTerm() {
|
||||
return ""; // FIXME
|
||||
}
|
||||
|
||||
async performFind(searchTerm, matchCase, wholeWord) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.MARKJS);
|
||||
|
||||
const $content = await this.parent.noteContext.getContentElement();
|
||||
|
||||
$content.markRegExp(new RegExp(utils.escapeRegExp(searchTerm), "gi"));
|
||||
}
|
||||
|
||||
async findNext(direction, currentFound, nextFound) {
|
||||
}
|
||||
|
||||
async cleanup(totalFound, currentFound) {
|
||||
}
|
||||
|
||||
async close() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user