search page change

v1.18.x
Baris Soner Usakli 11 years ago
parent d34e68ca25
commit 7dfdab0a2d

@ -5,10 +5,12 @@ define(function() {
var searchQuery = $('#topic-results').attr('data-search-query');
$('.search-result-text').each(function() {
var text = $(this).html();
var result = $(this);
var text = result.html();
var regex = new RegExp(searchQuery, 'gi');
text = text.replace(regex, '<span class="label label-success">' + searchQuery + '</span>');
$(this).html(text);
result.html(text);
result.find('img').addClass('img-responsive');
});
$('#search-form input').val(searchQuery);

@ -31,7 +31,7 @@
<a href="../../topic/{topics.slug}" class="search-result-text">
{topics.title}
<h4>{topics.title}</h4>
</a>
<div>
@ -61,10 +61,13 @@
<!-- BEGIN posts -->
<div class="topic-row panel panel-default clearfix">
<div class="panel-body">
<a href="../../topic/{posts.topic.slug}#{posts.pid}" class="search-result-text">
{posts.content}
<h4>{posts.topic.title}</h4>
</a>
<div class="search-result-text">
{posts.content}
</div>
<div>
<small>
<span class="pull-right">

Loading…
Cancel
Save