Skip to content

Node.js based forum software built for the modern web

better styling for ACP search

psychobunny27a2af89c8fd
diff --git a/public/less/admin/admin.less b/public/less/admin/admin.less
index b52c882844..bdb9753ab7 100644
--- a/public/less/admin/admin.less
+++ b/public/less/admin/admin.less
@@ -357,6 +357,13 @@
border-bottom-right-radius: 5px;
border-top-right-radius: 5px;
}
+
+ #acp-search {
+ .search-match {
+ font-weight: 700;
+ color: black;
+ }
+ }
}
diff --git a/public/src/forum/admin/footer.js b/public/src/forum/admin/footer.js
index 015dcc0327..1b6c204760 100644
--- a/public/src/forum/admin/footer.js
+++ b/public/src/forum/admin/footer.js
@@ -28,9 +28,13 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {
if (value.length > 3) {
for (var file in acpIndex) {
if (acpIndex.hasOwnProperty(file)) {
- if (acpIndex[file].indexOf(value) !== -1) {
+ var position = acpIndex[file].indexOf(value);
+
+ if (position !== -1) {
var href = file.replace('.tpl', ''),
- title = href.replace(/^\/admin\//, '').split('/');
+ title = href.replace(/^\/admin\//, '').split('/'),
+ description = acpIndex[file].substring(Math.max(0, position - 15), Math.min(acpIndex[file].length - 1, position + 15))
+ .replace(value, '<span class="search-match">' + value + '</span>');
for (var t in title) {
if (title.hasOwnProperty(t)) {
@@ -42,7 +46,7 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {
title = title.join(' > ');
- menuItems.append('<li role="presentation"><a role="menuitem" href="' + RELATIVE_PATH + href + '">' + title + '</a></li>');
+ menuItems.append('<li role="presentation"><a role="menuitem" href="' + RELATIVE_PATH + href + '">' + title + '<br /><small><code>...' + description + '...</code></small></a></li>');
}
}
}