|
|
|
@ -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);
|
|
|
|
|