Skip to content

Commit 3eaabc4

Browse files
committed
search
1 parent 4c6a590 commit 3eaabc4

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

scripts/ufs_statistic.css

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ li:hover .show-on-hover {
104104
max-height: 90vh;
105105
overflow-y: auto;
106106
overflow-x: hidden;
107-
min-width: 50vw;
107+
min-width: 500px;
108108
display: flex;
109109
flex-direction: column;
110110
align-items: center;
@@ -119,6 +119,7 @@ li:hover .show-on-hover {
119119

120120
.modal-body {
121121
margin-bottom: 10px;
122+
width: 100%;
122123
}
123124

124125
.modal .close {
@@ -140,3 +141,17 @@ li:hover .show-on-hover {
140141
color: white;
141142
text-decoration: none;
142143
}
144+
145+
.modal li {
146+
width: 100%;
147+
clear: right;
148+
}
149+
150+
[data-search] {
151+
cursor: pointer;
152+
float: right;
153+
}
154+
155+
[data-search]:hover {
156+
text-decoration: underline;
157+
}

scripts/ufs_statistic.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ async function onDocumentEnd() {
445445
<span data-profile-name="${uid}">${uid}</span>
446446
(${count})
447447
</a>
448+
<span data-search="${uid}">${uid}🔎</span>
448449
</li>`;
449450
})
450451
.join("")}
@@ -463,7 +464,10 @@ async function onDocumentEnd() {
463464
<ol class="list-group">
464465
${Array.from(eventNameCountSorted.entries())
465466
.map(([eventName, count], index) => {
466-
return `<li> ${index + 1}. ${eventName} (${count})</li>`;
467+
return `<li>
468+
${index + 1}. ${eventName} (${count})
469+
<span data-search="${eventName}">🔎</span>
470+
</li>`;
467471
})
468472
.join("")}
469473
</ol>
@@ -486,6 +490,11 @@ async function onDocumentEnd() {
486490
if (event.target.classList.contains("modal")) {
487491
event.target.style.display = "none";
488492
}
493+
const dataSearch = event.target.getAttribute("data-search");
494+
if (dataSearch) {
495+
searchBox.value = dataSearch;
496+
searchBox.dispatchEvent(new Event("input", { bubbles: true }));
497+
}
489498
});
490499

491500
document.body.append(modalByUid, modalByScript);

0 commit comments

Comments
 (0)