mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-11 14:40:46 +00:00
Update searchform.js
This commit is contained in:
parent
e0760ff74a
commit
6d4482882c
1 changed files with 23 additions and 7 deletions
28
resources/assets/js/components/searchform.js
vendored
28
resources/assets/js/components/searchform.js
vendored
|
@ -13,21 +13,21 @@ $(document).ready(function() {
|
||||||
name: 'search',
|
name: 'search',
|
||||||
display: 'value',
|
display: 'value',
|
||||||
source: queryEngine,
|
source: queryEngine,
|
||||||
limit: 20,
|
limit: 40,
|
||||||
templates: {
|
templates: {
|
||||||
empty: [
|
empty: [
|
||||||
'<div class="alert alert-danger mb-0">',
|
'<div class="alert alert-info mb-0 font-weight-bold">',
|
||||||
'unable to find any matches',
|
'No Results Found',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
suggestion: function(data) {
|
suggestion: function(data) {
|
||||||
let type = data.type;
|
let type = data.type;
|
||||||
let res = null;
|
let res = false;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 'hashtag':
|
case 'hashtag':
|
||||||
res = '<a href="'+data.url+'">' +
|
res = '<a href="'+data.url+'">' +
|
||||||
'<div class="media d-flex align-items-center">' +
|
'<div class="media d-flex align-items-center">' +
|
||||||
'<div class="mr-3 h4 text-muted">#</div>' +
|
'<div class="mr-3 h4 text-muted"><span class="fas fa-hashtag"></span></div>' +
|
||||||
'<div class="media-body text-truncate">' +
|
'<div class="media-body text-truncate">' +
|
||||||
'<p class="mt-0 mb-0 font-weight-bold">'+data.value+'</p>' +
|
'<p class="mt-0 mb-0 font-weight-bold">'+data.value+'</p>' +
|
||||||
'<p class="text-muted mb-0">'+data.count+' posts</p>' +
|
'<p class="text-muted mb-0">'+data.count+' posts</p>' +
|
||||||
|
@ -38,7 +38,7 @@ $(document).ready(function() {
|
||||||
case 'profile':
|
case 'profile':
|
||||||
res = '<a href="'+data.url+'">' +
|
res = '<a href="'+data.url+'">' +
|
||||||
'<div class="media d-flex align-items-center">' +
|
'<div class="media d-flex align-items-center">' +
|
||||||
'<div class="mr-3 h4 text-muted"><span class="icon-user"></span></div>' +
|
'<div class="mr-3 h4 text-muted"><span class="far fa-user"></span></div>' +
|
||||||
'<div class="media-body text-truncate">' +
|
'<div class="media-body text-truncate">' +
|
||||||
'<p class="mt-0 mb-0 font-weight-bold">'+data.name+'</p>' +
|
'<p class="mt-0 mb-0 font-weight-bold">'+data.name+'</p>' +
|
||||||
'<p class="text-muted mb-0">'+data.value+'</p>' +
|
'<p class="text-muted mb-0">'+data.value+'</p>' +
|
||||||
|
@ -46,10 +46,26 @@ $(document).ready(function() {
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</a>';
|
'</a>';
|
||||||
break;
|
break;
|
||||||
|
case 'status':
|
||||||
|
res = '<a href="'+data.url+'">' +
|
||||||
|
'<div class="media d-flex align-items-center">' +
|
||||||
|
'<div class="mr-3 h4 text-muted"><img src="'+data.thumb+'" width="32px"></div>' +
|
||||||
|
'<div class="media-body text-truncate">' +
|
||||||
|
'<p class="mt-0 mb-0 font-weight-bold">'+data.name+'</p>' +
|
||||||
|
'<p class="text-muted mb-0">'+data.value+'</p>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</a>';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
res = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
if(res !== false) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in a new issue