Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
query: '',
packages: [],
more_results: false,
case_sensitive: true,
Comment thread
sykloid marked this conversation as resolved.
Outdated

init() {
this.loadPackages();
Expand All @@ -49,7 +50,8 @@
}

try {
const regex = RegExp(this.query);
if (this.case_sensitive) flags = ""; else flags = "i";
const regex = RegExp(this.query, flags);
Comment thread
sykloid marked this conversation as resolved.
Outdated
const results = this.packages.filter(pkg => {
return regex.test(pkg.name);
})
Expand Down Expand Up @@ -112,7 +114,11 @@
<!-- Search Box -->
<div class="bg-primary border-l-4 border-secondary flex flex-col gap-8 p-8 rounded">
<div class="form-control">
<input type="text" id="search-box" placeholder="Search" autofocus class="input input-bordered input-lg w-full" x-model="query">
<input type="text" id="search-box" placeholder="Search" autofocus autocapitalize="off" class="input input-bordered input-lg w-full" x-model="query">
</div>
<div id="search-options" class="text-gray-300">
<input type="checkbox" id="case_sensitive" x-model="case_sensitive">
<label for="case_sensitive">Case Sensitive</label>
</div>
Comment thread
sykloid marked this conversation as resolved.
Outdated
</div>

Expand Down Expand Up @@ -145,4 +151,4 @@
</div>
</body>

</html>
</html>