41 lines
969 B
HTML
41 lines
969 B
HTML
|
{{ if $.Param "enableMark" }}
|
||
|
{{ $mark := resources.Get "js/jquery.mark.min.js" | fingerprint }}
|
||
|
|
||
|
<script>
|
||
|
fetchInject([
|
||
|
"{{ $mark.RelPermalink }}",
|
||
|
]).then(() => {
|
||
|
var mark = function () {
|
||
|
var keyword = $("#search").val();
|
||
|
var options = {
|
||
|
"element": "mark",
|
||
|
"className": "",
|
||
|
"exclude": [],
|
||
|
"iframes": false,
|
||
|
"iframesTimeout": 5000,
|
||
|
"acrossElements": false,
|
||
|
"ignoreGroups": 0,
|
||
|
"each": function (node) {
|
||
|
},
|
||
|
"filter": function (textNode, foundTerm, totalCounter) {
|
||
|
return true;
|
||
|
},
|
||
|
"noMatch": function (term) {
|
||
|
},
|
||
|
"done": function (counter) {
|
||
|
},
|
||
|
"debug": false,
|
||
|
"log": window.console
|
||
|
};
|
||
|
|
||
|
$(".container").unmark({
|
||
|
done: function () {
|
||
|
$(".container").mark(keyword, options);
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
|
||
|
$("#search").on("input", mark);
|
||
|
});
|
||
|
</script>
|
||
|
{{ end }}
|