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'); var searchQuery = $('#topic-results').attr('data-search-query');
$('.search-result-text').each(function() { $('.search-result-text').each(function() {
var text = $(this).html(); var result = $(this);
var text = result.html();
var regex = new RegExp(searchQuery, 'gi'); var regex = new RegExp(searchQuery, 'gi');
text = text.replace(regex, '<span class="label label-success">' + searchQuery + '</span>'); 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); $('#search-form input').val(searchQuery);

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

Loading…
Cancel
Save