files: added option to use highlight marker to show keywords inside file source.

This commit is contained in:
Daniel Dourvaris 2018-12-19 18:17:25 +01:00
parent 6957757150
commit 47db530369
2 changed files with 23 additions and 2 deletions

View file

@ -314,7 +314,7 @@
$(document).ready(function() {
callbacks();
var search_GET = "${request.GET.get('search','')}";
if (search_GET == "1") {
if (search_GET === "1") {
_NODEFILTER.initFilter();
}
});

View file

@ -106,4 +106,25 @@
%endif
%endif
</div>
</div>
</div>
<script type="text/javascript">
% if request.GET.get('mark'):
$(function(){
$(".codehilite").mark(
"${request.GET.get('mark')}",
{
"className": 'match',
"accuracy": "complementary",
"ignorePunctuation": ":._(){}[]!'+=".split(""),
"each": function(el) {
// and also highlight lines !
$($(el).closest('tr')).find('td.cb-lineno').addClass('cb-line-selected');
}
}
);
});
% endif
</script>