Skip to content

Commit

Permalink
Simplified AlternativeTo button init/processing for Feedback modal ↞ …
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Dec 2, 2024
1 parent 5d3aeb4 commit a2b8fa2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions greasemonkey/duckduckgpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.12.1.8
// @version 2024.12.2
// @license MIT
// @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302
// @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302
Expand Down Expand Up @@ -1010,7 +1010,7 @@
log.debug('Showing Feedback modal...')

// Init buttons
let btns = [ function greasyFork(){}, function productHunt(){}, function alternativeTo() {} ]
let btns = [ function greasyFork(){}, function productHunt(){}, function alternativeto() {} ]
if (options?.sites != 'review') btns.splice(1, 0, function github(){})

// Create/init modal
Expand All @@ -1027,7 +1027,6 @@
btns = btnsDiv.querySelectorAll('button')
btns.forEach((btn, idx) => {
if (idx == 0) btn.style.display = 'none' // hide Dismiss button
else if (btn.textContent == 'Alternative To') btn.textContent = 'AlternativeTo'
if (idx == btns.length -1) btn.classList.remove('primary-modal-btn') // de-emphasize last link
btn.style.marginTop = btn.style.marginBottom = '5px' // v-pad btns

Expand All @@ -1037,7 +1036,7 @@
btn.onclick = () => modals.safeWinOpen(
btn.textContent == 'Greasy Fork' ? app.urls.review.greasyFork
: btn.textContent == 'Product Hunt' ? app.urls.review.productHunt
: btn.textContent == 'AlternativeTo' ? app.urls.review.alternativeTo
: btn.textContent == 'Alternativeto' ? app.urls.review.alternativeTo
: `${app.urls.gitHub}/discussions/new/choose`
)
})
Expand Down

0 comments on commit a2b8fa2

Please sign in to comment.