Skip to content

Commit

Permalink
Replaced GM About modal's Rate Us button w/ Discuss + deleted Rate Us…
Browse files Browse the repository at this point in the history
… button from Donate modal ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-refresh]
  • Loading branch information
kudo-sync-bot committed Jan 18, 2025
1 parent bb33432 commit 4a5c900
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions chatgpt/chatgpt-auto-refresh/chatgpt-auto-refresh.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2025.1.17
// @version 2025.1.18
// @license MIT
// @icon https://assets.chatgptautorefresh.com/images/icons/openai/black/icon48.png?v=f11a0a8
// @icon64 https://assets.chatgptautorefresh.com/images/icons/openai/black/icon64.png?v=f11a0a8
Expand Down Expand Up @@ -287,22 +287,19 @@
urls: {
chatgptJS: 'https://chatgpt.js.org',
contributors: 'https://docs.chatgptautorefresh.com/#-contributors',
discuss: 'https://github.com/adamlui/chatgpt-auto-refresh/discussions',
donate: {
cashApp: 'https://cash.app/$adamlui',
gitHub: 'https://github.com/sponsors/adamlui',
payPal: 'https://paypal.me/adamlui'
},
gitHub: 'https://github.com/adamlui/chatgpt-auto-refresh',
greasyFork: 'https://greasyfork.org/scripts/462422-chatgpt-auto-refresh',
assetHost: 'https://assets.chatgptautorefresh.com',
relatedExtensions: 'https://github.com/adamlui/ai-web-extensions',
review: {
greasyFork: 'https://greasyfork.org/scripts/462422-chatgpt-auto-refresh/feedback#post-discussion'
},
support: 'https://support.chatgptautorefresh.com',
update: 'https://gm.chatgptautorefresh.com'
},
latestResourceCommitHash: '228c25a' // for cached messages.json + navicon in toggles.sidebar.insert()
latestResourceCommitHash: 'e6261c6' // for cached messages.json + navicon in toggles.sidebar.insert()
}
app.urls.resourceHost = app.urls.gitHub.replace('github.com', 'cdn.jsdelivr.net/gh') + `@${app.latestResourceCommitHash}`
app.msgs = {
Expand Down Expand Up @@ -345,6 +342,7 @@
alert_isUpToDate: 'is up-to-date',
btnLabel_moreAIextensions: 'More AI Extensions',
btnLabel_rateUs: 'Rate Us',
btnLabel_discuss: 'Discuss',
btnLabel_getSupport: 'Get Support',
btnLabel_checkForUpdates: 'Check for Updates',
btnLabel_update: 'Update',
Expand Down Expand Up @@ -625,7 +623,7 @@
[ // buttons
function checkForUpdates() { updateCheck() },
function getSupport(){},
function rateUs() {},
function discuss() {},
function moreAIextensions(){}
], '', 714 // set width
)
Expand All @@ -642,23 +640,22 @@
btn.style.cssText = 'height: 58px ; min-width: 136px ; text-align: center'

// Replace link buttons w/ clones that don't dismiss modal
if (/support|rate|extensions/i.test(btn.textContent)) {
if (/support|discuss|extensions/i.test(btn.textContent)) {
const btnClone = btn.cloneNode(true)
btn.parentNode.replaceChild(btnClone, btn) ; btn = btnClone
btn.onclick = () => modals.safeWinOpen(
btn.textContent.includes(app.msgs.btnLabel_getSupport) ? app.urls.support
: btn.textContent.includes(app.msgs.btnLabel_rateUs) ? app.urls.review.greasyFork
: app.urls.relatedExtensions
)
btn.onclick = () => modals.safeWinOpen(app.urls[
btn.textContent.includes(app.msgs.btnLabel_getSupport) ? 'support'
: btn.textContent.includes(app.msgs.btnLabel_discuss) ? 'discuss' : 'relatedExtensions'
])
}

// Prepend emoji + localize labels
if (/updates/i.test(btn.textContent))
btn.textContent = `🚀 ${app.msgs.btnLabel_checkForUpdates}`
else if (/support/i.test(btn.textContent))
btn.textContent = `🧠 ${app.msgs.btnLabel_getSupport}`
else if (/rate/i.test(btn.textContent))
btn.textContent = ` ${app.msgs.btnLabel_rateUs}`
else if (/discuss/i.test(btn.textContent))
btn.textContent = `🗨️ ${app.msgs.btnLabel_discuss}`
else if (/extensions/i.test(btn.textContent))
btn.textContent = `🤖 ${app.msgs.btnLabel_moreAIextensions}`

Expand Down Expand Up @@ -690,8 +687,7 @@
[ // buttons
function paypal(){},
function githubSponsors(){},
function cashApp(){},
function rateUs() { modals.safeWinOpen(app.urls.review.greasyFork) }
function cashApp(){}
], '', 478 // set width
)

Expand All @@ -704,15 +700,13 @@
btns.forEach((btn, idx) => {

// Replace link buttons w/ clones that don't dismiss modal
if (!/dismiss|rate/i.test(btn.textContent)) {
if (!/dismiss/i.test(btn.textContent)) {
const btnClone = btn.cloneNode(true)
btn.parentNode.replaceChild(btnClone, btn) ; btn = btnClone
btn.onclick = () => modals.safeWinOpen(
btn.textContent == 'Cash App' ? app.urls.donate.cashApp
: btn.textContent == 'Github Sponsors' ? app.urls.donate.gitHub
: btn.textContent == 'Paypal' ? app.urls.donate.payPal
: app.urls.review.greasyFork
)
btn.onclick = () => modals.safeWinOpen(app.urls.donate[
btn.textContent == 'Cash App' ? 'cashApp'
: btn.textContent == 'Github Sponsors' ? 'gitHub' : 'payPal'
])
}

// Format buttons
Expand All @@ -722,8 +716,6 @@
+ ' width: 107px ; line-height: 14px'
if (idx == btns.length -1) // de-emphasize right-most button
btn.classList.remove('primary-modal-btn')
else if (/rate/i.test(btn.textContent)) // localize 'Rate Us' label
btn.textContent = app.msgs.btnLabel_rateUs
}
})

Expand Down

0 comments on commit 4a5c900

Please sign in to comment.