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
  • Loading branch information
adamlui committed Jan 18, 2025
1 parent e9ba104 commit 3a1c2a0
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 107 deletions.
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
31 changes: 14 additions & 17 deletions chatgpt-auto-continue/chromium/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,12 @@ window.modals = {
about() {

// Init buttons
const modalBtns = [
function getSupport(){},
function rateUs(){},
function moreAIextensions(){}
]
if (this.runtime.includes('Greasemonkey')) modalBtns.unshift(
function checkForUpdates(){ modals.imports.updateCheck() })
const modalBtns = [ function getSupport(){}, function moreAIextensions(){} ]
if (this.runtime.includes('Greasemonkey')) { // add Check for Updates + Discuss
modalBtns.unshift(function checkForUpdates(){ modals.imports.updateCheck() })
modalBtns.splice(1, 0, function discuss(){})
} else // add Rate Us
modalBtns.splice(1, 0, function rateUs(){})

// Show modal
const aboutModal = modals.alert(
Expand Down Expand Up @@ -150,15 +149,15 @@ window.modals = {
+ `height: ${ this.runtime.includes('Greasemonkey') ? 58 : 55 }px`

// Replace link buttons w/ clones that don't dismiss modal
if (/support|rate|extensions/i.test(btn.textContent)) {
if (/support|rate|discuss|extensions/i.test(btn.textContent)) {
const btnClone = btn.cloneNode(true)
btn.parentNode.replaceChild(btnClone, btn) ; btn = btnClone
btn.onclick = () => this.safeWinOpen(
btn.textContent.includes(this.getMsg('btnLabel_getSupport')) ? this.imports.app.urls.support
: btn.textContent.includes(this.getMsg('btnLabel_rateUs')) ? this.imports.app.urls.review[
this.runtime.includes('Edge') ? 'edgeAddons'
: this.runtime.includes('Firefox') ? 'firefoxAddons'
: this.runtime.includes('Chromium') ? 'chromeWebStore' : 'greasyFork']
: this.runtime.includes('Firefox') ? 'firefoxAddons' : 'chromeWebStore']
: btn.textContent.includes(this.getMsg('btnLabel_discuss')) ? this.imports.app.urls.discuss
: this.imports.app.urls.relatedExtensions
)
}
Expand All @@ -170,6 +169,8 @@ window.modals = {
btn.textContent = `🧠 ${this.getMsg('btnLabel_getSupport')}`
else if (/rate/i.test(btn.textContent))
btn.textContent = `⭐ ${this.getMsg('btnLabel_rateUs')}`
else if (/discuss/i.test(btn.textContent))
btn.textContent = `🗨️ ${this.getMsg('btnLabel_discuss')}`
else if (/extensions/i.test(btn.textContent))
btn.textContent = `🤖 ${this.getMsg('btnLabel_moreAIextensions')}`

Expand Down Expand Up @@ -201,8 +202,7 @@ window.modals = {
[ // buttons
function paypal(){},
function githubSponsors(){},
function cashApp(){},
function rateUs() { modals.open('feedback') }
function cashApp(){}
], '', 478 // modal width
)

Expand All @@ -215,13 +215,12 @@ window.modals = {
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 = () => this.safeWinOpen(this.imports.app.urls.donate[
btn.textContent == 'Cash App' ? 'cashApp'
: btn.textContent == 'Github Sponsors' ? 'gitHub'
: 'payPal'
: btn.textContent == 'Github Sponsors' ? 'gitHub' : 'payPal'
])
}

Expand All @@ -232,8 +231,6 @@ window.modals = {
+ ' 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 = this.getMsg('btnLabel_rateUs')
}
})

Expand Down
31 changes: 14 additions & 17 deletions chatgpt-auto-continue/firefox/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,12 @@ window.modals = {
about() {

// Init buttons
const modalBtns = [
function getSupport(){},
function rateUs(){},
function moreAIextensions(){}
]
if (this.runtime.includes('Greasemonkey')) modalBtns.unshift(
function checkForUpdates(){ modals.imports.updateCheck() })
const modalBtns = [ function getSupport(){}, function moreAIextensions(){} ]
if (this.runtime.includes('Greasemonkey')) { // add Check for Updates + Discuss
modalBtns.unshift(function checkForUpdates(){ modals.imports.updateCheck() })
modalBtns.splice(1, 0, function discuss(){})
} else // add Rate Us
modalBtns.splice(1, 0, function rateUs(){})

// Show modal
const aboutModal = modals.alert(
Expand Down Expand Up @@ -150,15 +149,15 @@ window.modals = {
+ `height: ${ this.runtime.includes('Greasemonkey') ? 58 : 55 }px`

// Replace link buttons w/ clones that don't dismiss modal
if (/support|rate|extensions/i.test(btn.textContent)) {
if (/support|rate|discuss|extensions/i.test(btn.textContent)) {
const btnClone = btn.cloneNode(true)
btn.parentNode.replaceChild(btnClone, btn) ; btn = btnClone
btn.onclick = () => this.safeWinOpen(
btn.textContent.includes(this.getMsg('btnLabel_getSupport')) ? this.imports.app.urls.support
: btn.textContent.includes(this.getMsg('btnLabel_rateUs')) ? this.imports.app.urls.review[
this.runtime.includes('Edge') ? 'edgeAddons'
: this.runtime.includes('Firefox') ? 'firefoxAddons'
: this.runtime.includes('Chromium') ? 'chromeWebStore' : 'greasyFork']
: this.runtime.includes('Firefox') ? 'firefoxAddons' : 'chromeWebStore']
: btn.textContent.includes(this.getMsg('btnLabel_discuss')) ? this.imports.app.urls.discuss
: this.imports.app.urls.relatedExtensions
)
}
Expand All @@ -170,6 +169,8 @@ window.modals = {
btn.textContent = `🧠 ${this.getMsg('btnLabel_getSupport')}`
else if (/rate/i.test(btn.textContent))
btn.textContent = `⭐ ${this.getMsg('btnLabel_rateUs')}`
else if (/discuss/i.test(btn.textContent))
btn.textContent = `🗨️ ${this.getMsg('btnLabel_discuss')}`
else if (/extensions/i.test(btn.textContent))
btn.textContent = `🤖 ${this.getMsg('btnLabel_moreAIextensions')}`

Expand Down Expand Up @@ -201,8 +202,7 @@ window.modals = {
[ // buttons
function paypal(){},
function githubSponsors(){},
function cashApp(){},
function rateUs() { modals.open('feedback') }
function cashApp(){}
], '', 478 // modal width
)

Expand All @@ -215,13 +215,12 @@ window.modals = {
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 = () => this.safeWinOpen(this.imports.app.urls.donate[
btn.textContent == 'Cash App' ? 'cashApp'
: btn.textContent == 'Github Sponsors' ? 'gitHub'
: 'payPal'
: btn.textContent == 'Github Sponsors' ? 'gitHub' : 'payPal'
])
}

Expand All @@ -232,8 +231,6 @@ window.modals = {
+ ' 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 = this.getMsg('btnLabel_rateUs')
}
})

Expand Down
44 changes: 18 additions & 26 deletions chatgpt-auto-refresh/greasemonkey/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
Loading

0 comments on commit 3a1c2a0

Please sign in to comment.