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
  • Loading branch information
kudo-sync-bot committed Jan 18, 2025
1 parent 4a5c900 commit b32beb9
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2025.1.17
// @version 2025.1.18
// @license MIT
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
Expand Down Expand Up @@ -285,7 +285,7 @@
version: GM_info.script.version, configKeyPrefix: 'autoclearChatGPThistory',
chatgptJSver: /chatgpt\.js@([\d.]+)/.exec(GM_info.scriptMetaStr)[1],
urls: { update: 'https://gm.autoclearchatgpt.com' },
latestResourceCommitHash: '06d6690' // for cached app.json + messages.json + navicon in toggles.sidebar.insert()
latestResourceCommitHash: '05a0d8c' // for cached app.json + messages.json + navicon in toggles.sidebar.insert()
}
app.urls.resourceHost = `https://cdn.jsdelivr.net/gh/adamlui/autoclear-chatgpt-history@${app.latestResourceCommitHash}`
const remoteAppData = await new Promise(resolve => xhr({
Expand Down Expand Up @@ -332,6 +332,7 @@
alert_tyForSupport: 'Thank you for your support',
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 @@ -588,7 +589,7 @@
[ // buttons
function checkForUpdates() { updateCheck() },
function getSupport(){},
function rateUs() {},
function discuss() {},
function moreAIextensions(){}
], '', 745 // set width
)
Expand All @@ -605,23 +606,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 @@ -653,8 +653,7 @@
[ // buttons
function paypal(){},
function githubSponsors(){},
function cashApp(){},
function rateUs(){}
function cashApp(){}
], '', 478 // set width
)

Expand All @@ -670,12 +669,10 @@
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 @@ -685,8 +682,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 b32beb9

Please sign in to comment.