Skip to content

Commit 0759095

Browse files
thavelickclaude
andcommitted
Add YouTube bang and improve settings panel UX
- Add yt\! bang for YouTube search functionality - Sort bang list alphabetically in settings panel for better usability - Add --yes flag to all npx commands in Makefile to prevent interactive prompts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9c37cf5 commit 0759095

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ dev: # Start development server
1313

1414
format: # Format code with Biome
1515
@echo "Formatting code.."
16-
npx @biomejs/biome format --write .
16+
npx --yes @biomejs/biome format --write .
1717

1818
lint: # Lint code with Biome
1919
@echo "Linting code.."
20-
npx @biomejs/biome lint .
20+
npx --yes @biomejs/biome lint .
2121

2222
check: # Check formatting and linting with Biome
2323
@echo "Checking formatting and linting.."
24-
npx @biomejs/biome check .
24+
npx --yes @biomejs/biome check .
2525

2626
test: # Run unit tests with Jest
2727
@echo "Running tests.."
28-
npx jest -c '{"testMatch":["**/tests/**/*.spec.js"]}'
28+
npx --yes jest -c '{"testMatch":["**/tests/**/*.spec.js"]}'
2929

3030
# -----------------------------------------------------------
3131
# CAUTION: If you have a file with the same name as make

public_html/search.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const bangs = {
2121
pypi: "https://pypi.org/search/?q={{{s}}}",
2222
w: "https://en.wikipedia.org/wiki/Special:Search?search={{{s}}}",
2323
i: "https://duckduckgo.com/?q={{{s}}}&iax=images&ia=images",
24+
yt: "https://www.youtube.com/results?search_query={{{s}}}",
2425
};
2526

2627
function buildSearchUrl(urlTemplate, searchTerm) {
@@ -246,7 +247,11 @@ function buildSettingsPanel(windowObj = window) {
246247
<div class="bang-list">
247248
`;
248249

249-
for (const [bangKey, bangUrl] of Object.entries(bangs)) {
250+
const sortedBangs = Object.entries(bangs).sort(([a], [b]) =>
251+
a.localeCompare(b),
252+
);
253+
254+
for (const [bangKey, bangUrl] of sortedBangs) {
250255
const isChecked = bangKey === currentDefault ? " checked" : "";
251256
html += `
252257
<div class="bang-trigger">${bangKey}!</div>

0 commit comments

Comments
 (0)