hugo-theme-zzo/layouts/partials/sidebar/site-mark.html

38 lines
894 B
HTML
Raw Normal View History

2019-11-04 13:09:44 +00:00
{{ if $.Param "enableMark" }}
2019-11-05 08:51:53 +00:00
{{ $mark := resources.Get "js/jquery.mark.min.js" | resources.Fingerprint }}
2019-11-05 08:11:56 +00:00
<script defer src="{{ $mark.RelPermalink }}"></script>
2019-11-04 13:09:44 +00:00
<script>
2019-11-05 08:11:56 +00:00
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
2019-11-04 13:09:44 +00:00
};
2019-11-05 08:11:56 +00:00
$(".container").unmark({
done: function () {
$(".container").mark(keyword, options);
}
});
};
$("#search").on("input", mark);
2019-11-04 13:09:44 +00:00
</script>
{{ end }}