Skip to content

Commit 97487d3

Browse files
committed
feat(options): add styling and functionality for test webhook button
1 parent 78e5c6d commit 97487d3

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

options/options.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,16 @@ button:hover {
259259
background-color: #dc2626;
260260
}
261261

262+
/* Test webhook button styling */
263+
#test-webhook-btn {
264+
background-color: #f59e0b;
265+
color: white;
266+
}
267+
268+
#test-webhook-btn:hover {
269+
background-color: #d97706;
270+
}
271+
262272
#add-new-webhook-btn {
263273
margin-bottom: 20px;
264274
}

options/options.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ webhookList.addEventListener("click", async (e) => {
895895
headers = Array.isArray(webhook.headers) ? [...webhook.headers] : [];
896896
renderHeaders();
897897
cancelEditBtn.classList.remove("hidden");
898+
testWebhookBtn.classList.remove("hidden");
898899
form.classList.remove('hidden');
899900
showAddWebhookBtn.classList.add('hidden');
900901
// Always set to save button when entering edit mode
@@ -920,6 +921,7 @@ webhookList.addEventListener("click", async (e) => {
920921
headers = Array.isArray(webhook.headers) ? [...webhook.headers] : [];
921922
renderHeaders();
922923
cancelEditBtn.classList.remove("hidden");
924+
testWebhookBtn.classList.remove("hidden");
923925
form.classList.remove('hidden');
924926
showAddWebhookBtn.classList.add('hidden');
925927
form.querySelector('button[type="submit"]').textContent = browser.i18n.getMessage("optionsSaveButton") || "Save Webhook";
@@ -1100,7 +1102,7 @@ testWebhookBtn.addEventListener('click', async () => {
11001102
formStatusMessage.className = 'status-message';
11011103

11021104
try {
1103-
await window.sendWebhook(webhook, true);
1105+
await sendWebhook(webhook, true);
11041106
formStatusMessage.textContent = browser.i18n.getMessage('optionsTestSuccess');
11051107
formStatusMessage.classList.add('success');
11061108
} catch (error) {

0 commit comments

Comments
 (0)