HTMLSearch
MMO.core · 1 symbol · generated 5 Oct 2026
HTMLSearch
HTMLSearch.js:197- Namespace
MMO.core
Index
| constructor(nodes, threshold, scoreAttribute, updateCss) | ||
| YieldWords(text, withIndex) static generator | Split a text into searchable words: accents stripped, lower cased, punctuation dropped. | |
| setNodes(nodes) | Replace the searched nodes, clearing whatever was highlighted before. | |
| addNode(node) | Add one node to the search. | |
| removeNode(node) | Remove a node from the search | |
| clear() | Drop every node from the search, clearing their highlights first. | |
| clearHighlight() | Remove every highlight and restore the nodes' order, visibility and score attribute. | |
| highlight(words) | Highlight node using seach words |
Methods8
constructor(nodes, threshold, scoreAttribute, updateCss)
HTMLSearch.js:198| nodes = [] | ||
| threshold = 0.15 | ||
| scoreAttribute = 'data-score' | ||
| updateCss = true |
YieldWords(text, withIndex)
staticgeneratorHTMLSearch.js:215Split a text into searchable words: accents stripped, lower cased, punctuation dropped.
| text | string | |
| withIndex = false | boolean | also yield each word's offset in the text |
setNodes(nodes)
HTMLSearch.js:236Replace the searched nodes, clearing whatever was highlighted before.
| nodes | Array<Element | MMO.core.SearchNode> |
addNode(node)
HTMLSearch.js:247Add one node to the search.
| node | Element | MMO.core.SearchNode | |
| returns | MMO.core.SearchNode | |
| throws | MMO.Error | on anything else |
removeNode(node)
HTMLSearch.js:260Remove a node from the search
| node | ||
| returns | void |
clear()
HTMLSearch.js:273Drop every node from the search, clearing their highlights first.
clearHighlight()
HTMLSearch.js:281Remove every highlight and restore the nodes' order, visibility and score attribute.
highlight(words)
HTMLSearch.js:301Highlight node using seach words
| words | [type] | [description] |
| returns | number | the number of words sarched |