mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-04 19:41:16 +01:00
search page change
This commit is contained in:
@@ -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}
|
||||
</a>
|
||||
|
||||
<a href="../../topic/{posts.topic.slug}#{posts.pid}" class="search-result-text">
|
||||
<h4>{posts.topic.title}</h4>
|
||||
</a>
|
||||
<div class="search-result-text">
|
||||
{posts.content}
|
||||
</div>
|
||||
<div>
|
||||
<small>
|
||||
<span class="pull-right">
|
||||
|
||||
Reference in New Issue
Block a user