You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
557 B
21 lines
557 B
|
|
let lastSearch = {text: "", caseSensitive: false};
|
|
|
|
function findText(selector, text, caseSensitive) {
|
|
lastSearch.text = text;
|
|
lastSearch.caseSensitive = caseSensitive;
|
|
var sel = window.getSelection();
|
|
sel.collapse(document.body, 0);
|
|
|
|
return self.find(text, caseSensitive);
|
|
}
|
|
|
|
function findNext() {
|
|
window.getSelection().collapseToEnd();
|
|
self.find(lastSearch.text, lastSearch.caseSensitive, false, true);
|
|
}
|
|
|
|
function findPrev() {
|
|
window.getSelection().collapseToStart();
|
|
self.find(lastSearch.text, lastSearch.caseSensitive, true, true);
|
|
} |